arch/x86_64/intel64/intel64_schedulesigaction.c: properly align signal handler stack for vector operations
signal handler stack must be properly aligned, otherwise vector instructions doesn't work in signal handler Signed-off-by: p-szafonimateusz <p-szafonimateusz@xiaomi.com>
This commit is contained in:
parent
ed4acb20cc
commit
ce61347ddf
1 changed files with 8 additions and 1 deletions
|
|
@ -130,6 +130,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
*/
|
||||
|
||||
up_current_regs()[REG_RIP] = (uint64_t)x86_64_sigdeliver;
|
||||
up_current_regs()[REG_RSP] = up_current_regs()[REG_RSP] - 8;
|
||||
up_current_regs()[REG_RFLAGS] = 0;
|
||||
|
||||
/* And make sure that the saved context in the TCB
|
||||
|
|
@ -162,6 +163,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
*/
|
||||
|
||||
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
|
||||
tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
|
||||
tcb->xcp.regs[REG_RFLAGS] = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -242,6 +244,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
*/
|
||||
|
||||
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
|
||||
tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
|
||||
tcb->xcp.regs[REG_RFLAGS] = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -261,7 +264,10 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
* disabled
|
||||
*/
|
||||
|
||||
up_current_regs()[REG_RIP] = (uint64_t)x86_64_sigdeliver;
|
||||
up_current_regs()[REG_RIP] =
|
||||
(uint64_t)x86_64_sigdeliver;
|
||||
up_current_regs()[REG_RSP] =
|
||||
up_current_regs()[REG_RSP] - 8;
|
||||
up_current_regs()[REG_RFLAGS] = 0;
|
||||
|
||||
/* And make sure that the saved context in the TCB
|
||||
|
|
@ -308,6 +314,7 @@ void up_schedule_sigaction(struct tcb_s *tcb, sig_deliver_t sigdeliver)
|
|||
*/
|
||||
|
||||
tcb->xcp.regs[REG_RIP] = (uint64_t)x86_64_sigdeliver;
|
||||
tcb->xcp.regs[REG_RSP] = tcb->xcp.regs[REG_RSP] - 8;
|
||||
tcb->xcp.regs[REG_RFLAGS] = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue