Skip to content

Commit 2663147

Browse files
committed
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>
1 parent 2201f31 commit 2663147

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

arch/xtensa/include/asm/processor.h

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -187,15 +187,18 @@ struct thread_struct {
187187

188188
/* Clearing a0 terminates the backtrace. */
189189
#define start_thread(regs, new_pc, new_sp) \
190-
memset(regs, 0, sizeof(*regs)); \
191-
regs->pc = new_pc; \
192-
regs->ps = USER_PS_VALUE; \
193-
regs->areg[1] = new_sp; \
194-
regs->areg[0] = 0; \
195-
regs->wmask = 1; \
196-
regs->depc = 0; \
197-
regs->windowbase = 0; \
198-
regs->windowstart = 1;
190+
do { \
191+
memset((regs), 0, sizeof(*(regs))); \
192+
(regs)->pc = (new_pc); \
193+
(regs)->ps = USER_PS_VALUE; \
194+
(regs)->areg[1] = (new_sp); \
195+
(regs)->areg[0] = 0; \
196+
(regs)->wmask = 1; \
197+
(regs)->depc = 0; \
198+
(regs)->windowbase = 0; \
199+
(regs)->windowstart = 1; \
200+
(regs)->syscall = NO_SYSCALL; \
201+
} while (0)
199202

200203
/* Forward declaration */
201204
struct task_struct;

0 commit comments

Comments
 (0)