Skip to content

1.1.0: memory mappings for JIT compilers, scheduling attributes, CPU feature bits - #1

Merged
fpoussin merged 3 commits into
mainfrom
exec-memory
Nov 20, 2026
Merged

fpoussin merged 3 commits into
mainfrom
exec-memory

Conversation

@fpoussin

Copy link
Copy Markdown
Contributor

No description provided.

Emulators with a dynamic recompiler (PCSX ReARMed's ARM dynarec) need
anonymous mmap, mprotect with PROT_EXEC and __clear_cache. The host ABI
already has the page calls and the instruction cache flush; the SDK's
module runtime now implements the C functions over them.

- libc/include/sys/mman.h: PROT_*, MAP_SHARED/PRIVATE/FIXED/ANONYMOUS,
  MAP_FAILED, mmap, munmap, mprotect.
- compiler-rt's bare-metal __clear_cache aborts at its first use: it is
  removed from the builtins, so the SDK runtime's one is the only one and
  code linked without it fails at link time.
Declarations portable code needs to compile against the NBT C library: pthread_attr_set/get of schedpolicy, schedparam and inheritsched (PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED), and Linux's ARM HWCAP/HWCAP2 bits for getauxval, which picolibc declares. The SDK's module runtime implements them: attributes unused, no optional CPU feature reported.
The SDK's module runtime implements 1.1.0's new declarations (mmap, mprotect, __clear_cache, scheduling attributes, getauxval) and its probe checks them. Move to the SDK's main once the branch merges.
@fpoussin
fpoussin merged commit 6cd2ee8 into main Nov 20, 2026
10 checks passed
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