提交 058eddbb 编写于 作者: H He Sheng 提交者: guzitao

sw64: remove trap_a* and hae from pt_regs

Sunway inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I56OLG

--------------------------------

At present, glibc dumps `trap_a*` when a segmentation fault is caught,
but no user knows what they mean. That is, nobody care about them, so
remove them to reduce overhead of SAVE_COMMON_REGS.

Besides, `hae` is legacy code which should be deprecated too.
Signed-off-by: NHe Sheng <hesheng@wxiat.com>
Signed-off-by: NGu Zitao <guzitao@wxiat.com>
上级 4e691223
...@@ -40,12 +40,7 @@ struct pt_regs { ...@@ -40,12 +40,7 @@ struct pt_regs {
unsigned long r26; unsigned long r26;
unsigned long r27; unsigned long r27;
unsigned long r28; unsigned long r28;
unsigned long hae; /* These are saved by HMcode: */
/* JRP - These are the values provided to a0-a2 by HMcode */
unsigned long trap_a0;
unsigned long trap_a1;
unsigned long trap_a2;
/* These are saved by HMcode: */
unsigned long ps; unsigned long ps;
unsigned long pc; unsigned long pc;
unsigned long gp; unsigned long gp;
......
...@@ -2,15 +2,13 @@ ...@@ -2,15 +2,13 @@
#ifndef _UAPI_ASM_SW64_SIGCONTEXT_H #ifndef _UAPI_ASM_SW64_SIGCONTEXT_H
#define _UAPI_ASM_SW64_SIGCONTEXT_H #define _UAPI_ASM_SW64_SIGCONTEXT_H
/*
* Signal context structure
*
* The context is saved before a signal handler is invoked, and it is
* restored by sys_sigreturn / sys_rt_sigreturn.
*/
struct sigcontext { struct sigcontext {
/*
* What should we have here? I'd probably better use the same
* stack layout as DEC Unix, just in case we ever want to try
* running their binaries..
*
* This is the basic layout, but I don't know if we'll ever
* actually fill in all the values..
*/
long sc_onstack; long sc_onstack;
long sc_mask; long sc_mask;
long sc_pc; long sc_pc;
...@@ -19,6 +17,7 @@ struct sigcontext { ...@@ -19,6 +17,7 @@ struct sigcontext {
long sc_ownedfp; long sc_ownedfp;
long sc_fpregs[128]; /* SIMD-FP */ long sc_fpregs[128]; /* SIMD-FP */
unsigned long sc_fpcr; unsigned long sc_fpcr;
/* TODO: Following are unused, to be removed and synced with libc */
unsigned long sc_fp_control; unsigned long sc_fp_control;
unsigned long sc_reserved1, sc_reserved2; unsigned long sc_reserved1, sc_reserved2;
unsigned long sc_ssize; unsigned long sc_ssize;
......
...@@ -88,9 +88,6 @@ void foo(void) ...@@ -88,9 +88,6 @@ void foo(void)
DEFINE(PT_REGS_R26, offsetof(struct pt_regs, r26)); DEFINE(PT_REGS_R26, offsetof(struct pt_regs, r26));
DEFINE(PT_REGS_R27, offsetof(struct pt_regs, r27)); DEFINE(PT_REGS_R27, offsetof(struct pt_regs, r27));
DEFINE(PT_REGS_R28, offsetof(struct pt_regs, r28)); DEFINE(PT_REGS_R28, offsetof(struct pt_regs, r28));
DEFINE(PT_REGS_TRAP_A0, offsetof(struct pt_regs, trap_a0));
DEFINE(PT_REGS_TRAP_A1, offsetof(struct pt_regs, trap_a1));
DEFINE(PT_REGS_TRAP_A2, offsetof(struct pt_regs, trap_a2));
DEFINE(PT_REGS_PS, offsetof(struct pt_regs, ps)); DEFINE(PT_REGS_PS, offsetof(struct pt_regs, ps));
DEFINE(PT_REGS_PC, offsetof(struct pt_regs, pc)); DEFINE(PT_REGS_PC, offsetof(struct pt_regs, pc));
DEFINE(PT_REGS_GP, offsetof(struct pt_regs, gp)); DEFINE(PT_REGS_GP, offsetof(struct pt_regs, gp));
......
...@@ -14,11 +14,10 @@ ...@@ -14,11 +14,10 @@
/* /*
* This defines the normal kernel pt-regs layout. * This defines the normal kernel pt-regs layout.
* *
* regs 9-15 preserved by C code * regs 9-15 preserved by C code, saving to pt_regs will make
* them easier to be accessed in an unified way.
* regs 16-18 saved by HMcode * regs 16-18 saved by HMcode
* regs 29-30 saved and set up by HMcode * regs 29-30 saved and set up by HMcode
* JRP - Save regs 16-18 in a special area of the stack, so that
* the hmcode-provided values are available to the signal handler.
*/ */
.macro SAVE_COMMON_REGS .macro SAVE_COMMON_REGS
...@@ -42,9 +41,6 @@ ...@@ -42,9 +41,6 @@
stl $25, PT_REGS_R25($sp) stl $25, PT_REGS_R25($sp)
stl $26, PT_REGS_R26($sp) stl $26, PT_REGS_R26($sp)
stl $27, PT_REGS_R27($sp) stl $27, PT_REGS_R27($sp)
stl $16, PT_REGS_TRAP_A0($sp)
stl $17, PT_REGS_TRAP_A1($sp)
stl $18, PT_REGS_TRAP_A2($sp)
.endm .endm
.macro RESTORE_COMMON_REGS .macro RESTORE_COMMON_REGS
......
...@@ -504,10 +504,6 @@ static const struct pt_regs_offset regoffset_table[] = { ...@@ -504,10 +504,6 @@ static const struct pt_regs_offset regoffset_table[] = {
REG_OFFSET_NAME(r26), REG_OFFSET_NAME(r26),
REG_OFFSET_NAME(r27), REG_OFFSET_NAME(r27),
REG_OFFSET_NAME(r28), REG_OFFSET_NAME(r28),
REG_OFFSET_NAME(hae),
REG_OFFSET_NAME(trap_a0),
REG_OFFSET_NAME(trap_a1),
REG_OFFSET_NAME(trap_a2),
REG_OFFSET_NAME(ps), REG_OFFSET_NAME(ps),
REG_OFFSET_NAME(pc), REG_OFFSET_NAME(pc),
REG_OFFSET_NAME(gp), REG_OFFSET_NAME(gp),
......
...@@ -255,10 +255,6 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs, ...@@ -255,10 +255,6 @@ setup_sigcontext(struct sigcontext __user *sc, struct pt_regs *regs,
offsetof(struct user_fpsimd_state, fpcr)); offsetof(struct user_fpsimd_state, fpcr));
err |= __put_user(current->thread.fpstate.fpcr, &sc->sc_fpcr); err |= __put_user(current->thread.fpstate.fpcr, &sc->sc_fpcr);
err |= __put_user(regs->trap_a0, &sc->sc_traparg_a0);
err |= __put_user(regs->trap_a1, &sc->sc_traparg_a1);
err |= __put_user(regs->trap_a2, &sc->sc_traparg_a2);
return err; return err;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册