File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515
1616#include <uapi/asm/ptrace.h>
1717
18+ /* This struct defines the way the registers are stored on the
19+ stack during a system call. */
20+
1821#ifndef __ASSEMBLY__
22+ struct pt_regs {
23+ unsigned long r8 ; /* r8-r15 Caller-saved GP registers */
24+ unsigned long r9 ;
25+ unsigned long r10 ;
26+ unsigned long r11 ;
27+ unsigned long r12 ;
28+ unsigned long r13 ;
29+ unsigned long r14 ;
30+ unsigned long r15 ;
31+ unsigned long r1 ; /* Assembler temporary */
32+ unsigned long r2 ; /* Retval LS 32bits */
33+ unsigned long r3 ; /* Retval MS 32bits */
34+ unsigned long r4 ; /* r4-r7 Register arguments */
35+ unsigned long r5 ;
36+ unsigned long r6 ;
37+ unsigned long r7 ;
38+ unsigned long orig_r2 ; /* Copy of r2 ?? */
39+ unsigned long ra ; /* Return address */
40+ unsigned long fp ; /* Frame pointer */
41+ unsigned long sp ; /* Stack pointer */
42+ unsigned long gp ; /* Global pointer */
43+ unsigned long estatus ;
44+ unsigned long ea ; /* Exception return address (pc) */
45+ unsigned long orig_r7 ;
46+ };
47+
48+ /*
49+ * This is the extended stack used by signal handlers and the context
50+ * switcher: it's pushed after the normal "struct pt_regs".
51+ */
52+ struct switch_stack {
53+ unsigned long r16 ; /* r16-r23 Callee-saved GP registers */
54+ unsigned long r17 ;
55+ unsigned long r18 ;
56+ unsigned long r19 ;
57+ unsigned long r20 ;
58+ unsigned long r21 ;
59+ unsigned long r22 ;
60+ unsigned long r23 ;
61+ unsigned long fp ;
62+ unsigned long gp ;
63+ unsigned long ra ;
64+ };
65+
1966#define user_mode (regs ) (((regs)->estatus & ESTATUS_EU))
2067
2168#define instruction_pointer (regs ) ((regs)->ra)
Load diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,3 +2,5 @@ include include/uapi/asm-generic/Kbuild.asm
22
33header-y += elf.h
44header-y += ucontext.h
5+
6+ generic-y += ucontext.h
Original file line number Diff line number Diff line change 5050
5151typedef unsigned long elf_greg_t ;
5252
53- #define ELF_NGREG \
54- ((sizeof(struct pt_regs) + sizeof(struct switch_stack)) / \
55- sizeof(elf_greg_t))
53+ #define ELF_NGREG 49
5654typedef elf_greg_t elf_gregset_t [ELF_NGREG ];
5755
5856typedef unsigned long elf_fpregset_t ;
Original file line number Diff line number Diff line change 6767
6868#define NUM_PTRACE_REG (PTR_TLBMISC + 1)
6969
70- /* this struct defines the way the registers are stored on the
71- stack during a system call.
72-
73- There is a fake_regs in setup.c that has to match pt_regs.*/
74-
75- struct pt_regs {
76- unsigned long r8 ; /* r8-r15 Caller-saved GP registers */
77- unsigned long r9 ;
78- unsigned long r10 ;
79- unsigned long r11 ;
80- unsigned long r12 ;
81- unsigned long r13 ;
82- unsigned long r14 ;
83- unsigned long r15 ;
84- unsigned long r1 ; /* Assembler temporary */
85- unsigned long r2 ; /* Retval LS 32bits */
86- unsigned long r3 ; /* Retval MS 32bits */
87- unsigned long r4 ; /* r4-r7 Register arguments */
88- unsigned long r5 ;
89- unsigned long r6 ;
90- unsigned long r7 ;
91- unsigned long orig_r2 ; /* Copy of r2 ?? */
92- unsigned long ra ; /* Return address */
93- unsigned long fp ; /* Frame pointer */
94- unsigned long sp ; /* Stack pointer */
95- unsigned long gp ; /* Global pointer */
96- unsigned long estatus ;
97- unsigned long ea ; /* Exception return address (pc) */
98- unsigned long orig_r7 ;
99- };
100-
101- /*
102- * This is the extended stack used by signal handlers and the context
103- * switcher: it's pushed after the normal "struct pt_regs".
104- */
105- struct switch_stack {
106- unsigned long r16 ; /* r16-r23 Callee-saved GP registers */
107- unsigned long r17 ;
108- unsigned long r18 ;
109- unsigned long r19 ;
110- unsigned long r20 ;
111- unsigned long r21 ;
112- unsigned long r22 ;
113- unsigned long r23 ;
114- unsigned long fp ;
115- unsigned long gp ;
116- unsigned long ra ;
70+ /* User structures for general purpose registers. */
71+ struct user_pt_regs {
72+ __u32 regs [49 ];
11773};
11874
11975#endif /* __ASSEMBLY__ */
Original file line number Diff line number Diff line change 1515 * details.
1616 */
1717
18- #ifndef _ASM_NIOS2_SIGCONTEXT_H
19- #define _ASM_NIOS2_SIGCONTEXT_H
18+ #ifndef _UAPI__ASM_SIGCONTEXT_H
19+ #define _UAPI__ASM_SIGCONTEXT_H
2020
21- #include <asm/ptrace.h>
21+ #include <linux/types.h>
22+
23+ #define MCONTEXT_VERSION 2
2224
2325struct sigcontext {
24- struct pt_regs regs ;
25- unsigned long sc_mask ; /* old sigmask */
26+ int version ;
27+ unsigned long gregs [ 32 ];
2628};
2729
2830#endif
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ static inline int rt_restore_ucontext(struct pt_regs *regs,
3939 struct ucontext * uc , int * pr2 )
4040{
4141 int temp ;
42- greg_t * gregs = uc -> uc_mcontext .gregs ;
42+ unsigned long * gregs = uc -> uc_mcontext .gregs ;
4343 int err ;
4444
4545 /* Always make any pending restarted system calls return -EINTR */
@@ -127,7 +127,7 @@ asmlinkage int do_rt_sigreturn(struct switch_stack *sw)
127127static inline int rt_setup_ucontext (struct ucontext * uc , struct pt_regs * regs )
128128{
129129 struct switch_stack * sw = (struct switch_stack * )regs - 1 ;
130- greg_t * gregs = uc -> uc_mcontext .gregs ;
130+ unsigned long * gregs = uc -> uc_mcontext .gregs ;
131131 int err = 0 ;
132132
133133 err |= __put_user (MCONTEXT_VERSION , & uc -> uc_mcontext .version );
You can’t perform that action at this time.
0 commit comments