summaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-09-19 19:15:08 +0000
commit03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch)
tree88db8dba75ae06ba3bad08e42c5e52efc162535c /fs/proc/array.c
parent257730f99381dd26e10b832fce4c94cae7ac1176 (diff)
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'fs/proc/array.c')
-rw-r--r--fs/proc/array.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index cde538846..eeb933628 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -485,16 +485,18 @@ static unsigned long get_wchan(struct task_struct *p)
return 0;
#if defined(__i386__)
{
- unsigned long ebp, eip;
+ unsigned long ebp, esp, eip;
unsigned long stack_page;
int count = 0;
- stack_page = 4096 + (unsigned long)p;
- if (!stack_page)
+ stack_page = (unsigned long)p;
+ esp = p->tss.esp;
+ if (!stack_page || esp < stack_page || esp >= 8188+stack_page)
return 0;
- ebp = p->tss.ebp;
+ /* include/asm-i386/system.h:switch_to() pushes ebp last. */
+ ebp = *(unsigned long *) esp;
do {
- if (ebp < stack_page || ebp >= 4092+stack_page)
+ if (ebp < stack_page || ebp >= 8188+stack_page)
return 0;
eip = *(unsigned long *) (ebp+4);
if (eip < first_sched || eip >= last_sched)
@@ -543,14 +545,12 @@ static unsigned long get_wchan(struct task_struct *p)
unsigned long fp, pc;
unsigned long stack_page;
int count = 0;
- extern int sys_pause (void);
- stack_page = p->kernel_stack_page;
- if (!stack_page)
- return 0;
+ stack_page = (unsigned long)p;
fp = ((struct switch_stack *)p->tss.ksp)->a6;
do {
- if (fp < stack_page || fp >= 4088+stack_page)
+ if (fp < stack_page+sizeof(struct task_struct) ||
+ fp >= 8184+stack_page)
return 0;
pc = ((unsigned long *)fp)[1];
/* FIXME: This depends on the order of these functions. */
@@ -1414,6 +1414,7 @@ static struct file_operations proc_array_operations = {
NULL, /* array_ioctl */
NULL, /* mmap */
NULL, /* no special open code */
+ NULL, /* flush */
NULL, /* no special release code */
NULL /* can't fsync */
};
@@ -1461,6 +1462,7 @@ static struct file_operations proc_arraylong_operations = {
NULL, /* array_ioctl */
NULL, /* mmap */
NULL, /* no special open code */
+ NULL, /* flush */
NULL, /* no special release code */
NULL /* can't fsync */
};