Commit 2663147d authored by Max Filippov's avatar Max Filippov

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: default avatarMax Filippov <jcmvbkbc@gmail.com>
parent 2201f31f
...@@ -187,15 +187,18 @@ struct thread_struct { ...@@ -187,15 +187,18 @@ struct thread_struct {
/* Clearing a0 terminates the backtrace. */ /* Clearing a0 terminates the backtrace. */
#define start_thread(regs, new_pc, new_sp) \ #define start_thread(regs, new_pc, new_sp) \
memset(regs, 0, sizeof(*regs)); \ do { \
regs->pc = new_pc; \ memset((regs), 0, sizeof(*(regs))); \
regs->ps = USER_PS_VALUE; \ (regs)->pc = (new_pc); \
regs->areg[1] = new_sp; \ (regs)->ps = USER_PS_VALUE; \
regs->areg[0] = 0; \ (regs)->areg[1] = (new_sp); \
regs->wmask = 1; \ (regs)->areg[0] = 0; \
regs->depc = 0; \ (regs)->wmask = 1; \
regs->windowbase = 0; \ (regs)->depc = 0; \
regs->windowstart = 1; (regs)->windowbase = 0; \
(regs)->windowstart = 1; \
(regs)->syscall = NO_SYSCALL; \
} while (0)
/* Forward declaration */ /* Forward declaration */
struct task_struct; struct task_struct;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment