Repository navigation
Save SYS03 outgoing context for a closed current thread - #758
Merged
Merged
Conversation
CloseTh(current); ChangeTh(other) still stores the outgoing registers, as the BIOS exception handler does. Fixes both the HLE scheduler and the LLE fiber bridge. Reported by michaelm-afk. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
mstan
force-pushed
the
fix/hle-sys03-closed-thread-context-20261024
branch
from
October 24, 2026 19:31
89bfffe to
541a9b0
Compare
mstan
changed the base branch from
integrate/tombi-eu-to-master-20261024
to
master
October 24, 2026 19:32
mstan
marked this pull request as ready for review
October 24, 2026 19:32
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CloseTh(current); ChangeTh(other): the BIOS exception handler stores the outgoing registers even though CloseTh marked the TCB free (0x1000). OpenTh later reuses the TCB and only initializes PC/SP/FP/GP, so dropping the save left stale registers (seen as a stale s6 in Tombi EU's CD-loader thread on New Game). Reported by michaelm-afk.541a9b0: saves for 0x4000 and 0x1000 in both the HLE scheduler and the LLE fiber bridge (the handoff fixed only HLE). Never reopens the closed TCB. Independent of the EU stack; based on master.
Test:
syscall_closed_thread_context(production traps.c, O0/O2) fails before, passes after;syscall_change_thread_selfstill passes.🤖 Generated with Claude Code