diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-11-10 00:43:14 +0100 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-12-17 22:48:21 +0100 |
commit | 6a986984b63990c80252b2208036fe731a6ae113 (patch) | |
tree | 93928de818b2f3dd98d22bcb68da781d95c6d44b /arch/xtensa | |
parent | xtensa: define syscall_get_arch() (diff) | |
download | linux-6a986984b63990c80252b2208036fe731a6ae113.tar.xz linux-6a986984b63990c80252b2208036fe731a6ae113.zip |
xtensa: use NO_SYSCALL instead of -1
For the sake of clarity define macro NO_SYSCALL and use it for
setting/checking struct pt_regs::syscall field.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/include/asm/ptrace.h | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/entry.S | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/ptrace.c | 2 | ||||
-rw-r--r-- | arch/xtensa/kernel/signal.c | 8 |
4 files changed, 8 insertions, 6 deletions
diff --git a/arch/xtensa/include/asm/ptrace.h b/arch/xtensa/include/asm/ptrace.h index 3a5c5918aea3..f1b1de526d1d 100644 --- a/arch/xtensa/include/asm/ptrace.h +++ b/arch/xtensa/include/asm/ptrace.h @@ -39,6 +39,8 @@ * +-----------------------+ -------- */ +#define NO_SYSCALL (-1) + #ifndef __ASSEMBLY__ #include <asm/coprocessor.h> diff --git a/arch/xtensa/kernel/entry.S b/arch/xtensa/kernel/entry.S index 48d36b4d27b8..e41c1e1ccecb 100644 --- a/arch/xtensa/kernel/entry.S +++ b/arch/xtensa/kernel/entry.S @@ -364,7 +364,7 @@ common_exception: s32i a2, a1, PT_DEBUGCAUSE s32i a3, a1, PT_PC - movi a2, -1 + movi a2, NO_SYSCALL rsr a3, excvaddr s32i a2, a1, PT_SYSCALL movi a2, 0 diff --git a/arch/xtensa/kernel/ptrace.c b/arch/xtensa/kernel/ptrace.c index 8fec063964ae..86622d4db328 100644 --- a/arch/xtensa/kernel/ptrace.c +++ b/arch/xtensa/kernel/ptrace.c @@ -491,7 +491,7 @@ unsigned long do_syscall_trace_enter(struct pt_regs *regs) { if (test_thread_flag(TIF_SYSCALL_TRACE) && tracehook_report_syscall_entry(regs)) - return -1; + return NO_SYSCALL; return regs->areg[2]; } diff --git a/arch/xtensa/kernel/signal.c b/arch/xtensa/kernel/signal.c index f88e7a0b232c..74e1682876ac 100644 --- a/arch/xtensa/kernel/signal.c +++ b/arch/xtensa/kernel/signal.c @@ -185,13 +185,13 @@ restore_sigcontext(struct pt_regs *regs, struct rt_sigframe __user *frame) COPY(sar); #undef COPY - /* All registers were flushed to stack. Start with a prestine frame. */ + /* All registers were flushed to stack. Start with a pristine frame. */ regs->wmask = 1; regs->windowbase = 0; regs->windowstart = 1; - regs->syscall = -1; /* disable syscall checks */ + regs->syscall = NO_SYSCALL; /* disable syscall checks */ /* For PS, restore only PS.CALLINC. * Assume that all other bits are either the same as for the signal @@ -423,7 +423,7 @@ static void do_signal(struct pt_regs *regs) /* Are we from a system call? */ - if ((signed)regs->syscall >= 0) { + if (regs->syscall != NO_SYSCALL) { /* If so, check system call restarting.. */ @@ -462,7 +462,7 @@ static void do_signal(struct pt_regs *regs) } /* Did we come from a system call? */ - if ((signed) regs->syscall >= 0) { + if (regs->syscall != NO_SYSCALL) { /* Restart the system call - no handlers present */ switch (regs->areg[2]) { case -ERESTARTNOHAND: |