Skip to content

Set IO_MEM_EXECUTABLE_IO for all non-IMapped peripherals#186

Open
neilberkman wants to merge 1 commit intorenode:masterfrom
neilberkman:fix/non-imapped-executable
Open

Set IO_MEM_EXECUTABLE_IO for all non-IMapped peripherals#186
neilberkman wants to merge 1 commit intorenode:masterfrom
neilberkman:fix/non-imapped-executable

Conversation

@neilberkman
Copy link
Copy Markdown

Summary

  • Generalizes the IO_MEM_EXECUTABLE_IO flag from ArrayMemory-only to all non-IMapped peripherals
  • Fixes cpu_abort when executing code from dynamically compiled C# peripherals that don't implement IMapped
  • Three changes: RegisterInner, MoveRegistrationWithinContext, and PostCreationActions

Fixes #877

Previously, only ArrayMemory peripherals had the IO_MEM_EXECUTABLE_IO
flag set, allowing instruction fetch via I/O callbacks. Any other
non-IMapped peripheral (e.g. dynamically compiled C# peripherals)
would trigger cpu_abort when the CPU tried to execute code from their
address range.

Generalize the check from `peripheral is ArrayMemory` to
`!(peripheral is IMapped)` in three places:
- SystemBus.RegisterInner: set flag when peripheral is first registered
- SystemBus.MoveRegistrationWithinContext: preserve flag on re-registration
- Machine.PostCreationActions: set flag for peripherals registered before CPU
@neilberkman neilberkman force-pushed the fix/non-imapped-executable branch from aadcbce to 3efe6a5 Compare March 13, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant