mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-23 20:00:18 +02:00
Implements rt_sigpending
Any time a guest signal is blocked, add it to the guest signal mask. This doesn't use a signal queue so repeat signals can end up being lost. This is expected behaviour This doesn't help with implementing the problem of unblocking signals causing the masked signal to be resent
This commit is contained in:
1 parent
955bdf2964
commit
758de4deaa
4 files changed
+17
-4
No files matched your search
@@ -22,6 +22,7 @@ namespace FEXCore {
|
||||
SignalDelegator::GuestSAMask Guest_sa_mask[SignalDelegator::MAX_SIGNALS]{};
|
||||
uint32_t CurrentSignal{};
|
||||
uint64_t GuestProcMask{};
|
||||
uint64_t PendingSignals{};
|
||||
};
|
||||
|
||||
thread_local ThreadState ThreadData{};
|
||||
@@ -104,6 +105,8 @@ namespace FEXCore {
|
||||
// Thread specific mask check
|
||||
if (ThreadData.GuestProcMask & (Signal - 1)) {
|
||||
// If the thread specific mask masks the signal then it is hidden from the guest
|
||||
// It gets put in to the pending signals mask
|
||||
ThreadData.PendingSignals |= 1ULL << (Signal - 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -427,4 +430,13 @@ namespace FEXCore {
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t SignalDelegator::GuestSigPending(uint64_t *set, size_t sigsetsize) {
|
||||
if (sigsetsize > sizeof(uint64_t)) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
*set = ThreadData.PendingSignals;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,7 @@ namespace Core {
|
||||
uint64_t RegisterGuestSigAltStack(const stack_t *ss, stack_t *old_ss);
|
||||
|
||||
uint64_t GuestSigProcMask(int how, const uint64_t *set, uint64_t *oldset);
|
||||
uint64_t GuestSigPending(uint64_t *set, size_t sigsetsize);
|
||||
|
||||
// Called from the thunk handler to handle the signal
|
||||
void HandleSignal(int Signal, void *Info, void *UContext);
|
||||
|
||||
@@ -21,5 +21,9 @@ namespace FEXCore::HLE {
|
||||
REGISTER_SYSCALL_IMPL(sigaltstack, [](FEXCore::Core::InternalThreadState *Thread, const stack_t *ss, stack_t *old_ss) -> uint64_t {
|
||||
return Thread->CTX->SignalDelegation.RegisterGuestSigAltStack(ss, old_ss);
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(rt_sigpending, [](FEXCore::Core::InternalThreadState *Thread, uint64_t *set, size_t sigsetsize) -> uint64_t {
|
||||
return Thread->CTX->SignalDelegation.GuestSigPending(set, sigsetsize);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -92,10 +92,6 @@ namespace FEXCore::HLE {
|
||||
SYSCALL_STUB(capset);
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(rt_sigpending, [](FEXCore::Core::InternalThreadState *Thread, sigset_t *set, size_t sigsetsize) -> uint64_t {
|
||||
SYSCALL_STUB(rt_sigpending);
|
||||
});
|
||||
|
||||
REGISTER_SYSCALL_IMPL(rt_sigtimedwait, [](FEXCore::Core::InternalThreadState *Thread, sigset_t *set, const struct timespec*, size_t sigsetsize) -> uint64_t {
|
||||
SYSCALL_STUB(rt_sigtimedwait);
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user