Commit 497a9151 authored by Greg Ungerer's avatar Greg Ungerer Committed by Linus Torvalds

[PATCH] fix text and data sizing in MMUless task_nommu.c

This patch does a couple of things to the MMUless proc support:

1. change current->sig to current->sighand
2. initialize vsize var in task_vsize() function
3. correctly set *text and *data values in task_vsize() function
parent 26f0c3c9
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/file.h>
/* /*
* Logic: we've got two memory sums for each process, "shared", and * Logic: we've got two memory sums for each process, "shared", and
...@@ -44,10 +45,10 @@ char *task_mem(struct mm_struct *mm, char *buffer) ...@@ -44,10 +45,10 @@ char *task_mem(struct mm_struct *mm, char *buffer)
else else
bytes += kobjsize(current->files); bytes += kobjsize(current->files);
if (current->sig && atomic_read(&current->sig->count) > 1) if (current->sighand && atomic_read(&current->sighand->count) > 1)
sbytes += kobjsize(current->sig); sbytes += kobjsize(current->sighand);
else else
bytes += kobjsize(current->sig); bytes += kobjsize(current->sighand);
bytes += kobjsize(current); /* includes kernel stack */ bytes += kobjsize(current); /* includes kernel stack */
...@@ -64,7 +65,7 @@ char *task_mem(struct mm_struct *mm, char *buffer) ...@@ -64,7 +65,7 @@ char *task_mem(struct mm_struct *mm, char *buffer)
unsigned long task_vsize(struct mm_struct *mm) unsigned long task_vsize(struct mm_struct *mm)
{ {
struct mm_tblock_struct *tbp; struct mm_tblock_struct *tbp;
unsigned long vsize; unsigned long vsize = 0;
for (tbp = &mm->context.tblock; tbp; tbp = tbp->next) { for (tbp = &mm->context.tblock; tbp; tbp = tbp->next) {
if (tbp->rblock) if (tbp->rblock)
...@@ -89,8 +90,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text, ...@@ -89,8 +90,8 @@ int task_statm(struct mm_struct *mm, int *shared, int *text,
} }
} }
size += (text = mm->end_code - mm->start_code); size += (*text = mm->end_code - mm->start_code);
size += (data = mm->start_stack - mm->start_data); size += (*data = mm->start_stack - mm->start_data);
*resident = size; *resident = size;
return size; return size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment