[PR #4064] [MERGED] Implement guest signal handlers #3911

Closed
opened 2026-02-27 22:05:25 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/4064
Author: @kalaposfos13
Created: 2/21/2026
Status: Merged
Merged: 2/22/2026
Merged by: @georgemoralis

Base: mainHead: guest-signals


📝 Commits (9)

  • 847d6e2 Change thread pausing to use SIGTRMIN on UNIX
  • 5c1da58 Allow handling of the rest of the signals
  • 1165339 Add orbis-native signal number conversion and fix a few bugs
  • 9588a8c ifdefing away the issues
  • 4c9f223 add check for mac for the signal that's used for thread pausing there
  • aa20aa7 Add a few more registers
  • 48ddb46 Don't break HLE memory tracking
  • 82e413a copyright 2026
  • ec8bbf3 +

📊 Changes

5 files changed (+283 additions, -44 deletions)

View changed files

📝 src/core/debug_state.cpp (+3 -2)
📝 src/core/libraries/kernel/threads/exception.cpp (+204 -30)
📝 src/core/libraries/kernel/threads/exception.h (+34 -3)
📝 src/core/signals.cpp (+29 -8)
📝 src/core/signals.h (+13 -1)

📄 Description

This PR adds the ability for games to set and use custom signal handlers for all 32 signals possible (except for the uncatchable ones, and SIGVTALRM on macOS) on UNIX systems. For Windows, nothing actually changed, as while there's some scaffolding in place for that OS as well, it's currently doing a whole lot of nothing, as the fact that there's no equivalent feature for sigaction there is still true.
I've tested the PR with Eden's WIP PS4 port, and I got it to crash on a stub unrelated to this PR, so I'd say it is working well enough to make basic readonly usage of it function roughly as intended.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/4064 **Author:** [@kalaposfos13](https://github.com/kalaposfos13) **Created:** 2/21/2026 **Status:** ✅ Merged **Merged:** 2/22/2026 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `guest-signals` --- ### 📝 Commits (9) - [`847d6e2`](https://github.com/shadps4-emu/shadPS4/commit/847d6e2fa7b28f59e1333c44a1c08cdf30bdf5e7) Change thread pausing to use SIGTRMIN on UNIX - [`5c1da58`](https://github.com/shadps4-emu/shadPS4/commit/5c1da581f978cbc0517e42ca527626361ced58da) Allow handling of the rest of the signals - [`1165339`](https://github.com/shadps4-emu/shadPS4/commit/1165339b2f6cdf6a2c298124d6571185c3a41413) Add orbis-native signal number conversion and fix a few bugs - [`9588a8c`](https://github.com/shadps4-emu/shadPS4/commit/9588a8c97debed13fb1db9e34590566d4c508829) ifdefing away the issues - [`4c9f223`](https://github.com/shadps4-emu/shadPS4/commit/4c9f22379980c90e813a4449d76e0b86b62cbb2c) add check for mac for the signal that's used for thread pausing there - [`aa20aa7`](https://github.com/shadps4-emu/shadPS4/commit/aa20aa77f7c3a92ce5d0814c58093e86387e0c36) Add a few more registers - [`48ddb46`](https://github.com/shadps4-emu/shadPS4/commit/48ddb46abf738eb21196aeff59a0c436ff1fd682) Don't break HLE memory tracking - [`82e413a`](https://github.com/shadps4-emu/shadPS4/commit/82e413a0ade8c7ec68c260e207949e079476f785) copyright 2026 - [`ec8bbf3`](https://github.com/shadps4-emu/shadPS4/commit/ec8bbf3d5381d01ebd134c81fd7d41f825372b46) + ### 📊 Changes **5 files changed** (+283 additions, -44 deletions) <details> <summary>View changed files</summary> 📝 `src/core/debug_state.cpp` (+3 -2) 📝 `src/core/libraries/kernel/threads/exception.cpp` (+204 -30) 📝 `src/core/libraries/kernel/threads/exception.h` (+34 -3) 📝 `src/core/signals.cpp` (+29 -8) 📝 `src/core/signals.h` (+13 -1) </details> ### 📄 Description This PR adds the ability for games to set and use custom signal handlers for all 32 signals possible (except for the uncatchable ones, and SIGVTALRM on macOS) on UNIX systems. For Windows, nothing actually changed, as while there's some scaffolding in place for that OS as well, it's currently doing a whole lot of nothing, as the fact that there's no equivalent feature for sigaction there is still true. I've tested the PR with Eden's WIP PS4 port, and I got it to crash on a stub unrelated to this PR, so I'd say it is working well enough to make basic readonly usage of it function roughly as intended. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:05:25 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3911
No description provided.