Skip to content

Commit

Permalink
xtensa: fix initialization of pt_regs::syscall in start_thread
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Max Filippov committed Apr 4, 2019
1 parent 2201f31 commit 2663147
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions arch/xtensa/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2663147

Please sign in to comment.