forked from eden-emu/eden
[nce] add syscall number for nearest thing to a tkill
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
ec96d066ab
commit
ff72ba4fc2
2 changed files with 13 additions and 14 deletions
|
@ -59,21 +59,20 @@ _ZN4Core6ArmNce27ReturnToRunCodeByTrampolineEPvPNS_12GuestContextEm:
|
||||||
.global _ZN4Core6ArmNce37ReturnToRunCodeByExceptionLevelChangeEiPv
|
.global _ZN4Core6ArmNce37ReturnToRunCodeByExceptionLevelChangeEiPv
|
||||||
_ZN4Core6ArmNce37ReturnToRunCodeByExceptionLevelChangeEiPv:
|
_ZN4Core6ArmNce37ReturnToRunCodeByExceptionLevelChangeEiPv:
|
||||||
/* This jumps to the signal handler, which will restore the entire context. */
|
/* This jumps to the signal handler, which will restore the entire context. */
|
||||||
/* On entry, x0 = thread id, which is already in the right place. */
|
/* On entry, x0 = thread id, which is already in the right place. Even on macOS. */
|
||||||
|
|
||||||
/* Move tpidr to x9 so it is not trampled. */
|
/* Move tpidr to x9 so it is not trampled. */
|
||||||
mov x9, x1
|
mov x9, x1
|
||||||
|
|
||||||
/* Set up arguments. */
|
|
||||||
mov x8, #(__NR_tkill)
|
|
||||||
mov x1, #(ReturnToRunCodeByExceptionLevelChangeSignal)
|
mov x1, #(ReturnToRunCodeByExceptionLevelChangeSignal)
|
||||||
|
#ifdef __APPLE__
|
||||||
/* Tail call the signal handler. */
|
/* I can never be happy, why no tkill in mach kernel? Ugh ... */
|
||||||
svc #0
|
/* Signature: 328 AUE_PTHREADKILL ALL { int __pthread_kill(int thread_port, int sig); } */
|
||||||
|
mov x16, #328
|
||||||
/* Block execution from flowing here. */
|
#else
|
||||||
brk #1000
|
/* Signature: int tgkill(pid_t tgid, pid_t tid, int sig); */
|
||||||
|
mov x8, #(__NR_tkill)
|
||||||
|
#endif
|
||||||
|
svc #0 /* Tail call the signal handler. */
|
||||||
|
brk #1000 /* Block execution from flowing here. */
|
||||||
|
|
||||||
/* static void Core::ArmNce::ReturnToRunCodeByExceptionLevelChangeSignalHandler(int sig, void* info, void* raw_context) */
|
/* static void Core::ArmNce::ReturnToRunCodeByExceptionLevelChangeSignalHandler(int sig, void* info, void* raw_context) */
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# else
|
# else
|
||||||
# define CTX_DECLARE(raw_context) \
|
# define CTX_DECLARE(raw_context) \
|
||||||
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(raw_context); \
|
||||||
[[maybe_unused]] auto& mctx = reinterpret_cast<ucontext_t*>(raw_context)->uc_mcontext; \
|
[[maybe_unused]] auto& mctx = ucontext->uc_mcontext; \
|
||||||
[[maybe_unused]] const auto fpctx = GetFloatingPointState(mctx);
|
[[maybe_unused]] const auto fpctx = GetFloatingPointState(mctx);
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
# define CTX_PC (mctx->__ss.__pc)
|
# define CTX_PC (mctx->__ss.__pc)
|
||||||
# define CTX_SP (mctx->__ss.__sp)
|
# define CTX_SP (mctx->__ss.__sp)
|
||||||
# define CTX_LR (mctx->__ss.__lr)
|
# define CTX_LR (mctx->__ss.__lr)
|
||||||
# define CTX_PSTATE (mctx->__ss.__pstate)
|
# define CTX_PSTATE (mctx->__ss.__cpsr)
|
||||||
# define CTX_X(i) (mctx->__ss.__x[i])
|
# define CTX_X(i) (mctx->__ss.__x[i])
|
||||||
# define CTX_Q(i) (mctx->__ns.__v[i])
|
# define CTX_Q(i) (mctx->__ns.__v[i])
|
||||||
# define CTX_FPSR(i) (mctx->__ns.__fpsr)
|
# define CTX_FPSR(i) (mctx->__ns.__fpsr)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue