aboutsummaryrefslogtreecommitdiffstats
path: root/arch/xtensa/include/asm/processor.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2019-04-03 20:22:42 -0700
committerMax Filippov <jcmvbkbc@gmail.com>2019-04-03 23:18:39 -0700
commit2663147dc7465cb29040a05cc4286fdd839978b5 (patch)
tree7c1d90d0abadb5a57817fad42cde06de5d8101f1 /arch/xtensa/include/asm/processor.h
parentxtensa: use actual syscall number in do_syscall_trace_leave (diff)
downloadlinux-dev-2663147dc7465cb29040a05cc4286fdd839978b5.tar.xz
linux-dev-2663147dc7465cb29040a05cc4286fdd839978b5.zip
xtensa: fix initialization of pt_regs::syscall in start_thread
New pt_regs should indicate that there's no syscall, not that there's syscall #0. While at it wrap macro body in do/while and parenthesize macro arguments. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/processor.h')
-rw-r--r--arch/xtensa/include/asm/processor.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/xtensa/include/asm/processor.h b/arch/xtensa/include/asm/processor.h
index f7dd895b2353..0c14018d1c26 100644
--- a/arch/xtensa/include/asm/processor.h
+++ b/arch/xtensa/include/asm/processor.h
@@ -187,15 +187,18 @@ struct thread_struct {
/* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \
- memset(regs, 0, sizeof(*regs)); \
- regs->pc = new_pc; \
- regs->ps = USER_PS_VALUE; \
- regs->areg[1] = new_sp; \
- regs->areg[0] = 0; \
- regs->wmask = 1; \
- regs->depc = 0; \
- regs->windowbase = 0; \
- regs->windowstart = 1;
+ do { \
+ memset((regs), 0, sizeof(*(regs))); \
+ (regs)->pc = (new_pc); \
+ (regs)->ps = USER_PS_VALUE; \
+ (regs)->areg[1] = (new_sp); \
+ (regs)->areg[0] = 0; \
+ (regs)->wmask = 1; \
+ (regs)->depc = 0; \
+ (regs)->windowbase = 0; \
+ (regs)->windowstart = 1; \
+ (regs)->syscall = NO_SYSCALL; \
+ } while (0)
/* Forward declaration */
struct task_struct;