···15151616#include <uapi/asm/ptrace.h>17171818+/* This struct defines the way the registers are stored on the1919+ stack during a system call. */2020+1821#ifndef __ASSEMBLY__2222+struct pt_regs {2323+ unsigned long r8; /* r8-r15 Caller-saved GP registers */2424+ unsigned long r9;2525+ unsigned long r10;2626+ unsigned long r11;2727+ unsigned long r12;2828+ unsigned long r13;2929+ unsigned long r14;3030+ unsigned long r15;3131+ unsigned long r1; /* Assembler temporary */3232+ unsigned long r2; /* Retval LS 32bits */3333+ unsigned long r3; /* Retval MS 32bits */3434+ unsigned long r4; /* r4-r7 Register arguments */3535+ unsigned long r5;3636+ unsigned long r6;3737+ unsigned long r7;3838+ unsigned long orig_r2; /* Copy of r2 ?? */3939+ unsigned long ra; /* Return address */4040+ unsigned long fp; /* Frame pointer */4141+ unsigned long sp; /* Stack pointer */4242+ unsigned long gp; /* Global pointer */4343+ unsigned long estatus;4444+ unsigned long ea; /* Exception return address (pc) */4545+ unsigned long orig_r7;4646+};4747+4848+/*4949+ * This is the extended stack used by signal handlers and the context5050+ * switcher: it's pushed after the normal "struct pt_regs".5151+ */5252+struct switch_stack {5353+ unsigned long r16; /* r16-r23 Callee-saved GP registers */5454+ unsigned long r17;5555+ unsigned long r18;5656+ unsigned long r19;5757+ unsigned long r20;5858+ unsigned long r21;5959+ unsigned long r22;6060+ unsigned long r23;6161+ unsigned long fp;6262+ unsigned long gp;6363+ unsigned long ra;6464+};6565+1966#define user_mode(regs) (((regs)->estatus & ESTATUS_EU))20672168#define instruction_pointer(regs) ((regs)->ra)
-32
arch/nios2/include/asm/ucontext.h
···11-/*22- * Copyright (C) 2010 Tobias Klauser <tklauser@distanz.ch>33- * Copyright (C) 2004 Microtronix Datacom Ltd44- *55- * This file is subject to the terms and conditions of the GNU General Public66- * License. See the file "COPYING" in the main directory of this archive77- * for more details.88- */99-1010-#ifndef _ASM_NIOS2_UCONTEXT_H1111-#define _ASM_NIOS2_UCONTEXT_H1212-1313-typedef int greg_t;1414-#define NGREG 321515-typedef greg_t gregset_t[NGREG];1616-1717-struct mcontext {1818- int version;1919- gregset_t gregs;2020-};2121-2222-#define MCONTEXT_VERSION 22323-2424-struct ucontext {2525- unsigned long uc_flags;2626- struct ucontext *uc_link;2727- stack_t uc_stack;2828- struct mcontext uc_mcontext;2929- sigset_t uc_sigmask; /* mask last for extensibility */3030-};3131-3232-#endif
···67676868#define NUM_PTRACE_REG (PTR_TLBMISC + 1)69697070-/* this struct defines the way the registers are stored on the7171- stack during a system call.7272-7373- There is a fake_regs in setup.c that has to match pt_regs.*/7474-7575-struct pt_regs {7676- unsigned long r8; /* r8-r15 Caller-saved GP registers */7777- unsigned long r9;7878- unsigned long r10;7979- unsigned long r11;8080- unsigned long r12;8181- unsigned long r13;8282- unsigned long r14;8383- unsigned long r15;8484- unsigned long r1; /* Assembler temporary */8585- unsigned long r2; /* Retval LS 32bits */8686- unsigned long r3; /* Retval MS 32bits */8787- unsigned long r4; /* r4-r7 Register arguments */8888- unsigned long r5;8989- unsigned long r6;9090- unsigned long r7;9191- unsigned long orig_r2; /* Copy of r2 ?? */9292- unsigned long ra; /* Return address */9393- unsigned long fp; /* Frame pointer */9494- unsigned long sp; /* Stack pointer */9595- unsigned long gp; /* Global pointer */9696- unsigned long estatus;9797- unsigned long ea; /* Exception return address (pc) */9898- unsigned long orig_r7;9999-};100100-101101-/*102102- * This is the extended stack used by signal handlers and the context103103- * switcher: it's pushed after the normal "struct pt_regs".104104- */105105-struct switch_stack {106106- unsigned long r16; /* r16-r23 Callee-saved GP registers */107107- unsigned long r17;108108- unsigned long r18;109109- unsigned long r19;110110- unsigned long r20;111111- unsigned long r21;112112- unsigned long r22;113113- unsigned long r23;114114- unsigned long fp;115115- unsigned long gp;116116- unsigned long ra;7070+/* User structures for general purpose registers. */7171+struct user_pt_regs {7272+ __u32 regs[49];11773};1187411975#endif /* __ASSEMBLY__ */
+7-5
arch/nios2/include/uapi/asm/sigcontext.h
···1515 * details.1616 */17171818-#ifndef _ASM_NIOS2_SIGCONTEXT_H1919-#define _ASM_NIOS2_SIGCONTEXT_H1818+#ifndef _UAPI__ASM_SIGCONTEXT_H1919+#define _UAPI__ASM_SIGCONTEXT_H20202121-#include <asm/ptrace.h>2121+#include <linux/types.h>2222+2323+#define MCONTEXT_VERSION 222242325struct sigcontext {2424- struct pt_regs regs;2525- unsigned long sc_mask; /* old sigmask */2626+ int version;2727+ unsigned long gregs[32];2628};27292830#endif
+2-2
arch/nios2/kernel/signal.c
···3939 struct ucontext *uc, int *pr2)4040{4141 int temp;4242- greg_t *gregs = uc->uc_mcontext.gregs;4242+ unsigned long *gregs = uc->uc_mcontext.gregs;4343 int err;44444545 /* Always make any pending restarted system calls return -EINTR */···127127static inline int rt_setup_ucontext(struct ucontext *uc, struct pt_regs *regs)128128{129129 struct switch_stack *sw = (struct switch_stack *)regs - 1;130130- greg_t *gregs = uc->uc_mcontext.gregs;130130+ unsigned long *gregs = uc->uc_mcontext.gregs;131131 int err = 0;132132133133 err |= __put_user(MCONTEXT_VERSION, &uc->uc_mcontext.version);