aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/include/registers.h
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-26 02:33:08 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:49:09 -0400
commit75e29b18d9a46bf3193278e92dc95609a8cca2ab (patch)
tree413935160ac2f65c13ec5260a60cdd1d9259fd83 /arch/um/include/registers.h
parentbf61f50d63b4d9e30d7a86a2d44bb300ae7c1dd4 (diff)
[PATCH] uml: stack usage reduction
The KSTK_* macros used an inordinate amount of stack. In order to overcome an impedance mismatch between their interface, which just returns a single register value, and the interface of get_thread_regs, which took a full pt_regs, the implementation created an on-stack pt_regs, filled it in, and returned one field. do_task_stat calls KSTK_* twice, resulting in two local pt_regs, blowing out the stack. This patch changes the interface (and name) of get_thread_regs to just return a single register from a jmp_buf. The include of archsetjmp.h" in registers.h to get the definition of jmp_buf exposed a bogus include of <setjmp.h> in start_up.c. <setjmp.h> shouldn't be used anywhere any more since UML uses the klibc setjmp/longjmp. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/include/registers.h')
-rw-r--r--arch/um/include/registers.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/um/include/registers.h b/arch/um/include/registers.h
index 83b688ca198f..f845b3629a6d 100644
--- a/arch/um/include/registers.h
+++ b/arch/um/include/registers.h
@@ -7,6 +7,7 @@
7#define __REGISTERS_H 7#define __REGISTERS_H
8 8
9#include "sysdep/ptrace.h" 9#include "sysdep/ptrace.h"
10#include "sysdep/archsetjmp.h"
10 11
11extern void init_thread_registers(union uml_pt_regs *to); 12extern void init_thread_registers(union uml_pt_regs *to);
12extern int save_fp_registers(int pid, unsigned long *fp_regs); 13extern int save_fp_registers(int pid, unsigned long *fp_regs);
@@ -15,6 +16,6 @@ extern void save_registers(int pid, union uml_pt_regs *regs);
15extern void restore_registers(int pid, union uml_pt_regs *regs); 16extern void restore_registers(int pid, union uml_pt_regs *regs);
16extern void init_registers(int pid); 17extern void init_registers(int pid);
17extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs); 18extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs);
18extern void get_thread_regs(union uml_pt_regs *uml_regs, void *buffer); 19extern unsigned long get_thread_reg(int reg, jmp_buf *buf);
19 20
20#endif 21#endif