mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 16:54:20 +08:00
75e29b18d9
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>
22 lines
673 B
C
22 lines
673 B
C
/*
|
|
* Copyright (C) 2004 PathScale, Inc
|
|
* Licensed under the GPL
|
|
*/
|
|
|
|
#ifndef __REGISTERS_H
|
|
#define __REGISTERS_H
|
|
|
|
#include "sysdep/ptrace.h"
|
|
#include "sysdep/archsetjmp.h"
|
|
|
|
extern void init_thread_registers(union uml_pt_regs *to);
|
|
extern int save_fp_registers(int pid, unsigned long *fp_regs);
|
|
extern int restore_fp_registers(int pid, unsigned long *fp_regs);
|
|
extern void save_registers(int pid, union uml_pt_regs *regs);
|
|
extern void restore_registers(int pid, union uml_pt_regs *regs);
|
|
extern void init_registers(int pid);
|
|
extern void get_safe_registers(unsigned long * regs, unsigned long * fp_regs);
|
|
extern unsigned long get_thread_reg(int reg, jmp_buf *buf);
|
|
|
|
#endif
|