Commit Graph
2598 Commits
Author SHA1 Message Date
Adrià 96ff704249 Merge pull request #12667 from xdCloudy/feat/libkernel-sys-pthread-attr-helpers
feat(libkernel_sys): implement mutex attribute generation helpers
2026-10-30 14:02:33 +01:00
Dean 5c0ee1bbf4 Merge pull request #11827 from oneandonlydean/carry/7268-cert-paths
feat(libkernel): provide system and common certificate list paths
2026-10-31 01:18:08 +13:00
Adrià 8304ccaedb Merge pull request #11341 from SteelCrab/review/emscripten-libraries
build(libs): support Emscripten memory64 compilation
2026-10-30 12:49:20 +01:00
Adrià 45d0ed5f35 Merge pull request #11725 from camezaro-intc/fix/libkernel-timedwait-busy-spin
fix(libkernel): prevent sub-millisecond timed wait busy-spinning on Windows
2026-10-30 12:44:23 +01:00
Dean Galvin 462c4ec0aa Merge main into PR #11827 2026-10-30 23:07:47 +13:00
DeveshB-1 9e5683dd8b fix(libkernel): return EFAULT from sched_getparam and sched_setparam for invalid memory 2026-10-30 15:05:54 +05:30
Adrià bcee950a9c Merge pull request #12467 from Buraddomoon/fix/udp-disconnect-local-address
fix(libkernel): clear reported local address after UDP disconnect
2026-10-30 10:18:49 +01:00
Cloudy d833429467 feat(libkernel_sys): implement pthread attribute helpers 2026-10-30 08:12:52 +01:00
Adrià e4f5516fd6 Merge pull request #12974 from MarcZX10/feat/host-game-mode
feat(libkernel): opt-in host game mode request (APS5_GAME_MODE)
2026-10-30 06:36:04 +01:00
Adrià 0a2cda921d Merge pull request #12933 from heditrigui/feat/libc-dprintf
feat(libc): implement dprintf and vdprintf
2026-10-30 06:33:00 +01:00
Adrià 5ba6b2b917 Merge pull request #12963 from JJenkx/windows/libkernel-raise-pending-until-resume
fix(libkernel): keep sceKernelRaiseException pending on a suspended thread on Windows
2026-10-30 06:32:05 +01:00
Adrià 8f21dd5a6a Merge pull request #12897 from AdnanKhan-ak47/fix/libkernel-thread-exit-signal-mask
fix(libkernel): leave other threads' signal masks alone when a thread exits through scePthreadExit
2026-10-30 06:30:49 +01:00
Adrià ad9001f9d2 Merge pull request #12865 from heditrigui/feat/libkernel-posix-madvise
feat(libkernel): implement posix_madvise
2026-10-30 05:52:23 +01:00
Adrià 0c9c5db748 Merge pull request #12690 from MarcZX10/feat/host-system-report
feat(agc): host system report and an actionable missing-Vulkan-feature message
2026-10-30 02:52:18 +01:00
pista 2c22b68133 fix(libs): reject unsupported WebAssembly module unwind queries 2026-10-30 10:50:57 +09:00
pista 2f49b2568d build(libs): validate current native and WebAssembly adapter sources 2026-10-30 10:50:57 +09:00
pista d64e85164b build(libs): let the system libraries compile with Emscripten
Emscripten targets wasm64 without x86 assembly, Linux-only headers or the
x87 long double. These changes add __EMSCRIPTEN__ paths beside the host
ones; native builds compile the same code as before.

- libc: long doubles in guest varargs and scanf go through
  GuestLongDouble, a plain copy where long double is the x87 format;
  APS5_EXPORT emits no assembler alias; the guest arena is one aligned
  allocation that zeroes pages when they are committed again; getifaddrs
  keeps its link-level entries on Linux; /proc lookups and the host
  stderr duplicate are left out.
- libkernel: file-backed mmap, EVFILT_VNODE watches, getcontext and
  setcontext throw; getdents replaces the raw getdents64 syscall;
  getdtablesize takes the resource limit alone.
- VideoOut leaves SDL, the display window and the HDR probe out,
  Sysmodule asks libkernel for unwind information and Net includes
  sys/time.h.
2026-10-30 10:50:57 +09:00
Adrià 87d938c650 Merge pull request #12556 from babyhuey/fix/sched-efault
fix(libkernel): return EFAULT from rtprio_thread and sched_rr_get_interval for a bad pointer
2026-10-30 02:32:23 +01:00
Adrià 2485cdefa3 Merge pull request #12538 from babyhuey/fix/utimes-efault
fix(libkernel): return EFAULT from the utimes family for an unreadable times array
2026-10-30 02:31:43 +01:00
Adrià ec709cede3 Merge pull request #12436 from milescoviello/fix/vm-loadavg
fix(libkernel): answer vm.loadavg with the host's load averages
2026-10-30 02:31:30 +01:00
Adrià 365f857609 Merge pull request #12427 from simnJS/feat/kernel-is-neo-mode
feat(libkernel_sys): answer sceKernelIsNeoMode from the param.sfo Neo-mode attribute
2026-10-30 02:30:27 +01:00
Adrià 28b490ea5c Merge pull request #12296 from JJenkx/windows/kernel-shm-mmap-checks
fix(libkernel): map Windows shared memory with the regular file checks
2026-10-30 02:04:04 +01:00
Adrià f9a8813b11 Merge pull request #12179 from p3n1cillin/claude/kernel-executable-module-handle
feat(libkernel): add sceKernelGetExecutableModuleHandle
2026-10-30 02:01:01 +01:00
Adrià 4725feb152 Merge pull request #11431 from p3n1cillin/claude/pthread-getaffinity-set-size
fix(libkernel): answer pthread_getaffinity_np for the console's 8- and 16-byte sets
2026-10-30 01:20:44 +01:00
Adrià 96613bba67 Merge pull request #12060 from Ragbie/fix/windows-directory-flock
fix(libkernel): lock directories with flock on Windows as FreeBSD does
2026-10-30 01:04:03 +01:00
Adrià 438cebf361 Merge pull request #10544 from maximilianfv/fix/libkernel-macos-datagram-disconnect
fix(libkernel): count a dissolved datagram association as disconnected on macOS
2026-10-30 01:03:08 +01:00
Adrià 5a3c1a2f81 Merge pull request #10627 from maximilianfv/fix/libkernel-dlerror-long-messages
fix(libkernel): keep dlerror messages whole
2026-10-30 01:02:55 +01:00
Adrià 83861d9909 Merge pull request #12068 from dantdmdarealguy/fix/relinker-cli-off-test-registrations
fix(build): skip the core/libs relinker CLI tests when ANYPS5_RELINKER_CLI is OFF
2026-10-30 00:28:20 +01:00
Adrià 788e5531a1 Merge pull request #12163 from slopgobblercobbler/fix/libkernel-windows-descriptor-socket-classification
fix(libkernel): classify guest sockets on Windows and align errno parity
2026-10-29 23:46:12 +01:00
Adrià d820fef182 Merge pull request #12503 from babyhuey/fix/kevent-efault
fix(libkernel): return EFAULT from kevent for an unreadable changelist or timeout or an unwritable eventlist
2026-10-29 22:49:08 +01:00
Adrià cfbca30026 Merge pull request #12206 from XairRrR/fix/libkernel-tsc-time-scale
fix(libkernel): scale the reported TSC frequency under APS5_TIME_SCALE
2026-10-29 21:20:59 +01:00
Adrià 1aff97d3c8 Merge pull request #12093 from dantdmdarealguy/fix/kqueue-windows-snapshot-times
fix(libkernel): read a watched file's times again after its size on Windows
2026-10-29 21:20:39 +01:00
Adrià 184afa49ad Merge pull request #12563 from babyhuey/fix/setrlimit-efault
fix(libkernel): return EFAULT from setrlimit for an unreadable limit
2026-10-29 20:35:45 +01:00
Adrià 43332e5f3b Merge pull request #11865 from ionut27001/fix/libkernel-sched-own-pid
fix(libkernel): sched_getparam reads out-of-range priorities, sched_setparam EPERM outside 256-767, own pid on the main thread
2026-10-29 20:34:52 +01:00
MarcZX10 79fb3bae75 fix(libkernel): link the host performance session test with the host test helper on MinGW
host_performance_session_tests uses no guest library, so the guest unwind helper leaves the C++ runtime unlinked on MinGW and the link fails with an undefined __gxx_personality_v0. The host test helper links the runtime statically, as the other host-only tests do.
2026-10-29 18:49:17 +00:00
JJenkxandClaude Opus 5.5 db14f7a49d fix(libkernel): keep sceKernelRaiseException pending on a suspended thread on Windows
On Windows, sceKernelRaiseException threw for a thread created suspended
and not resumed yet. FreeBSD libthr starts such a thread with signals
blocked and restores its mask on resume, so the signal stays pending and
is delivered on that thread once it runs.

The raise is now recorded in the thread's pendingException with a
compare-exchange, and the thread exchanges it for -1 when it leaves the
creation wait and delivers it to itself before its start routine. Both
sides use one atomic, so a raise racing a resume is either taken by the
thread or, after it started, delivered as for a running thread. Raises
while pending are merged, as for a standard signal.

guest_pthread_create_suspended now runs the deferred-delivery case on
every host, with a second raise while the thread is suspended.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 13:39:50 -04:00
MarcZX10 05fe8ad592 feat(libkernel): start the host performance session when libkernel loads
Read APS5_GAME_MODE once at load, the same point where the Windows build
raises the scheduler tick, so an invalid value stops the title at start
with an error that names the variable and an unset one changes nothing.
2026-10-29 17:14:43 +00:00
MarcZX10 ad28df623d test(libkernel): check that exits release the process session and the environment is validated
Run the process session in a test executable linked with libc and leave
through LibcExit and LibcExitWithoutHandlers: the backend is released once
in both. Check that a refused request is never released, that off never
reaches the backend, that a second session is refused, that an unset
APS5_GAME_MODE is accepted and that APS5_GAME_MODE=bogus is rejected with
an error naming the variable.
2026-10-29 17:14:38 +00:00
MarcZX10 63cb5fbd00 feat(libkernel): start the host performance session for the process
Add CreateHostBackend (the GameMode client on Linux, the activity backend
on macOS, a backend that reports itself unavailable elsewhere),
StartProcessSession, which owns the one session of the process and
releases it from the libc shutdown callbacks that every exit path runs,
and StartFromEnvironment, which reads APS5_GAME_MODE and does nothing at
all when it is unset, empty or off. Build the files into libkernel; the
session is not started yet.
2026-10-29 17:14:12 +00:00
MarcZX10 65fb3b5a0c test(libkernel): run the macOS activity backend against a fake Objective-C runtime
Build four fixture libraries that export objc_getClass, sel_registerName,
objc_msgSend and the autorelease pool functions (complete, without
NSProcessInfo, returning no activity, without pool functions) and drive
the backend through them on any POSIX host. Check the exact message
sequence (begin with the user-initiated and latency-critical options,
retain, end, release), balanced pools on every path, a held activity ended
by the destructor, and unavailable and refused results.
2026-10-29 17:13:04 +00:00
MarcZX10 07c3fec103 feat(libkernel): add a macOS activity backend over the Objective-C runtime
macOS throttles timers and background work of a process unless it holds an
NSProcessInfo activity (Apple, Foundation, NSProcessInfo
beginActivityWithOptions:reason:, with NSActivityUserInitiated and
NSActivityLatencyCritical, which asks for the highest timer and I/O
precision available). The tree has no Objective-C sources, so call the
runtime from C++: load libobjc and Foundation with dlopen, look up
objc_getClass, sel_registerName, objc_msgSend and the autorelease pool
functions, begin one activity, retain its token, and end and release it on
End. Both library paths are injectable, and any missing piece is reported
as unavailable. Nothing uses the backend yet.
2026-10-29 17:12:09 +00:00
MarcZX10 72bec771a0 test(libkernel): run the GameMode client against fixture libraries
Build three tiny shared libraries that export the real_gamemode_* symbols
(complete, without real_gamemode_request_end, without
real_gamemode_error_string) and drive the client through them, so no
daemon is needed. Check a missing library, a fall back to the second
library name, request and release once each, a refusal with the library's
reason, a failing release, a missing symbol and a session over the client.
2026-10-29 17:11:33 +00:00
MarcZX10 1a4e30f7fb feat(libkernel): add a GameMode client backend that loads libgamemode at run time
Linux hosts running Feral's gamemoded switch the CPU governor and scheduler
for a registered game. The client the project ships is a header that loads
libgamemode.so.0 (then libgamemode.so) with dlopen and binds the library's
real_gamemode_request_start, real_gamemode_request_end and
real_gamemode_error_string symbols (FeralInteractive/gamemode at
a74b8106a2236d1f2696aa44c93bc4c8ef13b42e, lib/gamemode_client.h).

Do the same here with the library name list injectable: a missing library
or symbol is reported as unavailable, a failing request as refused, nothing
is linked, and the request is ended only when it was made. Nothing uses the
backend yet.
2026-10-29 17:10:52 +00:00
MarcZX10 140f7bb3ba feat(libkernel): parse the APS5_GAME_MODE setting
Accept off, on and auto, treat an unset or empty value as off so the
default stays as it is today, and reject anything else with an error that
names the variable and the accepted values.
2026-10-29 17:10:24 +00:00
MarcZX10 65fb8d72b5 test(libkernel): cover the host performance session with a fake backend
Check that off never reaches the backend, that start and stop reach it
once each and cannot restart a stopped session, that an unavailable
backend is silent in auto and logged once in on, that a refusal is logged
once in both modes, that throwing backends are contained, and that
concurrent starts reach the backend once.
2026-10-29 17:10:12 +00:00
MarcZX10 55587fef6c feat(libkernel): add a host performance session behind an injectable backend
A title that runs for hours would like the host to treat it as a game
(Feral GameMode on Linux, a latency-critical activity on macOS), but no
code owns that request. Add IBackend, the interface a host mechanism
implements, and Session, the state machine that requests once, releases
once, contains every backend failure and logs it once. Nothing uses it
yet.
2026-10-29 17:10:12 +00:00
Hedi Trigui 3dfc973fb8 fix(libc): address review feedback on vdprintf guest write path, short writes, ABI and test coverage 2026-10-29 17:30:21 +01:00
MarcZX10 3a74ce471c feat(libkernel): export the host CPU probe to other libraries through extern C helpers
The patched libkernel does not hand its plain C++ functions to the other patched libraries: every cross-library call in the tree goes through an extern C helper with a _nid suffix. The host CPU probe had none, so a library that wants the CPU model or the missing feature list cannot reach it. These helpers return plain structs, as the application metadata helpers do.
2026-10-29 14:20:35 +00:00
Adrià 01f4e342d5 Merge pull request #12525 from babyhuey/fix/pselect-efault
fix(libkernel): return EFAULT from pselect for an unreadable timeout or signal mask
2026-10-29 14:59:14 +01:00
Adrià 9036e3c9e4 Merge pull request #12126 from morten-holm/fix/macos-host-stack-above-arena
fix(libkernel): move the macOS main stack out of the guest arena
2026-10-29 14:51:57 +01:00