Commit Graph
383 Commits
Author SHA1 Message Date
Dean 7704178631 Merge pull request #11182 from orezraey/fix/libkernel-soc-sensor-order-measured-ps5
fix(libkernel): check the SoC sensor channel before the pointer and set errno as measured on a PS5
2026-10-27 01:02:19 +13:00
Dean 0a1496c148 Merge pull request #11170 from orezraey/fix/libkernel-sysctl-toplevel-measured-ps5
fix(libkernel): resolve sysctl top-level names and fail absent top-level MIBs with ENOENT as measured on a PS5
2026-10-27 01:01:03 +13:00
GruzzberryandClaude Opus 5.5 d49b9b6f25 feat(libkernel_sys): implement setlogin
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 09:26:45 +00:00
Dean 690c9c29c2 Merge pull request #10921 from MarcZX10/marc/fix-sysctl-copyout-null-source
fix(libkernel): skip the sysctl copy-out when no bytes are copied
2026-10-26 22:05:30 +13:00
Dean a0c85ea99b Merge pull request #10501 from harisibrar1/fix/pselect-pending-signal-eintr
fix(libkernel): return EINTR from pselect when its mask unblocks a pending signal
2026-10-26 18:26:20 +13:00
Dean 0ce4b82c2d Merge pull request #10243 from orezraey/fix/libkernel-rtld-thread-atexit-measured-ps5
fix(libkernel): answer the thread atexit references as measured on a PS5
2026-10-26 16:23:13 +13:00
harisibrar1 7784604b0b Merge remote-tracking branch 'origin/main' into fix/pselect-pending-signal-eintr
# Conflicts:
#	core/libs/prx/libkernel/System/src/Signals.cpp
2026-10-25 19:35:03 -04:00
orezraeyandClaude Opus 5.5 625dbb4cd9 fix(libkernel): throw for SoC sensor channels 3 to 64 instead of reporting them invalid
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:45:23 -03:00
Adrià 26ba9b6b71 Merge pull request #9499 from EagleBearerYS/fix/libkernel-signal-handler-mask
fix(libkernel): block a signal while its handler runs and honour SA_RESETHAND
2026-10-25 22:05:12 +01:00
orezraeyandClaude Opus 5.5 32e1371697 fix(libkernel): check the SoC sensor channel before the pointer and set errno as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 17:42:22 -03:00
orezraeyandClaude Opus 5.5 65d87b4ecb fix(libkernel): resolve sysctl top-level names and fail absent top-level MIBs with ENOENT as measured on a PS5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 17:22:26 -03:00
Adrià aeff26bd97 Merge pull request #9573 from zaryabzip/feat/pthread-create-suspended
feat(libkernel_sys): create threads suspended and resume them
2026-10-25 20:21:07 +01:00
Adrià 08f2d02a56 Merge pull request #9171 from DavidSamir/feat/libkernel-sys-getlogin-futimesat
feat(libkernel): implement getlogin
2026-10-25 17:54:15 +01:00
zaryabzip 0b60e97834 feat(libkernel_sys): create threads suspended and resume them
Implement pthread_attr_setcreatesuspend_np, pthread_resume_np,
pthread_resume_all_np and pthread_multi_np with the sce forms
scePthreadAttrSetcreatesuspend, scePthreadResume, scePthreadResumeAll
and scePthreadMulti, following FreeBSD 11.4 libthr and the firmware
13.42 libkernel_sys module. A thread created suspended waits before its
start routine, outside any cancellation point, until it is resumed.
sceKernelRaiseException throws on Windows for a thread still suspended
at creation.
2026-10-25 21:51:02 +05:00
Yunus Shaikh f5757aab98 fix(libkernel): restore a handler's signal bit when the handler replaces the mask
A handler that read the mask and put it back with SIG_SETMASK stored its
own signal, which sigprocmask reports from the hold, in the process mask
and cleared the hold, so the signal stayed blocked after the handler
returned. pselect, setcontext and a siglongjmp inside the handler replace
the mask the same way. When the handler's own thread releases a hold, the
signal now gets back its bit from before the handler when the handler
returns, as FreeBSD's sigreturn puts back the mask from before it. A mask
another thread sets meanwhile is kept.
2026-10-25 09:49:35 -07:00
Adrià c661d9fae2 Merge pull request #9133 from fogydes/feat/libSceLibcInternal-posix-spawn
feat(libSceLibcInternal): implement posix_spawn process creation and reaping
2026-10-25 17:38:41 +01:00
Adrià FranchandClaude Sonnet 5.5 f63b27bdaa feat(libkernel): implement getlogin
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-25 15:07:38 +01:00
Yunus Shaikh 8be8dc83af Merge main into fix/libkernel-signal-handler-mask
Main's #10706 moves the declarations of exported functions and their types
into the libraries' public headers, and gives WaitForPendingInSet a
KernelTimespec timeout. The merge keeps this branch's DeliverUnblockedPending
and ChangeBlockedMask with main's KernelTimespec. It takes main's side of
the declarations in GuestSignalSets.cpp, whose setjmp and longjmp this
branch had added and libc's Api.hpp now declares. GuestSignalHandlerMask.cpp
includes the libkernel and libc public headers in place of its own
declarations and GuestSignalSet and GuestSigaction types, as the
public_headers audit requires.
2026-10-25 07:05:46 -07:00
fogydes 0514307ab8 fix(libkernel): translate waitpid child statuses to the guest numbering 2026-10-25 13:57:18 +01:00
fogydes 723d932f73 feat(libSceLibcInternal): implement posix_spawn process creation and reaping 2026-10-25 13:57:17 +01:00
David 5881575782 refactor(libkernel): export swapcontext from libkernel directly
The PS5 3.20 export lists have swapcontext in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys. The assembly entry in UserContext.cpp now is
swapcontext_nid_postfix, and the libkernel_sys jump stub is gone.
2026-10-25 13:04:08 +01:00
David ad0d4f5995 feat(libkernel_sys): implement swapcontext 2026-10-25 13:04:08 +01:00
orezraeyandClaude Opus 5.5 b3b0760369 Merge main into fix/libkernel-rtld-thread-atexit-measured-ps5
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 08:05:05 -03:00
MarcZX10 a8cf7dd75f fix(libkernel): skip the sysctl copy-out when no bytes are copied
CopyOut passed a null source to memcpy for the kern.proc.env query, which reports no data. The copy length is 0 there, but a null source is undefined behavior for memcpy whatever the length, and UBSan reports it in guest_system_configuration. Copy only when there is something to copy.
2026-10-25 10:17:24 +00:00
harisibrar1 b8b42143b1 Merge main e7e3e9c198 into fix/pselect-pending-signal-eintr 2026-10-25 01:24:28 -04:00
MarcZX10 561ea1d4e9 fix(libkernel): check getrusage output pointers 2026-10-25 01:16:14 +00:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Yunus Shaikh 9e7b2ade4c Merge main into fix/libkernel-signal-handler-mask 2026-10-24 10:47:50 -07:00
Dean ebdfb92528 Merge pull request #8872 from ycbuzi/feat/libc-siginterrupt
feat(libc): implement siginterrupt through the sigaction libkernel registers
2026-10-25 06:39:00 +13:00
Yunus Shaikh b72ea79cf9 Merge main into fix/libkernel-signal-handler-mask 2026-10-24 09:56:48 -07:00
review ac2591a193 Merge commit 'refs/review/8742/head' into HEAD 2026-10-24 17:23:45 +02:00
Retr0 8083ae7209 Merge remote-tracking branch 'origin/main' into fix/sigaction-ignore-discards-pending
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-24 16:44:21 +03:00
Adrià 6cd36e6517 Merge pull request #9794 from Retr0G28/feat/sysctl-kern-boottime
feat(libkernel): answer kern.boottime in sysctl and sysctlbyname
2026-10-24 14:58:01 +02:00
Dean 9a1ea5de1b Merge pull request #10110 from BunnyFl/feat/libkernel-version-trace-queries
feat(libkernel): implement the system-ex version, lower-limit and trace memory queries
2026-10-25 01:53:38 +13:00
bluandClaude Opus 5.5 e040d1191b Merge branch 'boykopovar:main' into feat/libc-siginterrupt
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:49:01 -07:00
Emanuele d93cdf402d fix(libkernel): defer raises while a thread holds the address-wait lock on Linux and macOS
On Linux and macOS, sceKernelRaiseException runs the guest handler in
the target's SIGUSR1 handler wherever the thread was interrupted. A
thread interrupted while it held the address-wait lock of
sceKernelSyncOnAddressWait, sceKernelSyncOnAddressWake or _umtx_op ran
the handler with the lock held, so a handler that waits, as a
stop-the-world collector's does, blocked every other thread that waits
on or wakes an address. #5756 fixed this on Windows.

The address-wait lock is now taken under DeliveryDeferral on every
host. On POSIX the deferral is a count per thread: while it is raised
the SIGUSR1 handler only records the signal, and DeliverDeferred sends
it to the thread again once the lock is released. An address waiter
waits on its own semaphore (sem_t, a dispatch semaphore on macOS) with
the lock released and the deferral lifted, so a raise reaches a thread
that waits for an address without a timeout.

The address-lock phases of guest_raise_exception now run on every
host, with a new phase that raises at a thread in an unbounded address
wait.
2026-10-24 08:40:37 +02:00
orezraeyandClaude Opus 5.5 698697cbc7 fix(libkernel): throw for an unmeasured unbalanced thread atexit decrement on a module
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:53:35 -03:00
harisibrar1andClaude Opus 5.5 c7cd45c0da fix(libkernel): return EINTR from pselect when its mask unblocks a pending signal
FreeBSD's kern_pselect installs the mask and kern_select sleeps with
PCATCH, so a pending signal that the new mask unblocks makes the call
return EINTR once the descriptors have been scanned. Here the handler ran
inside the mask swap and select then waited the full timeout, or forever
with no timeout. The swap now reports whether a handler ran, and pselect
then scans the descriptors once without waiting: a ready descriptor, a
zero timeout or an invalid argument keep select's answer, and otherwise
the call fails with EINTR and leaves the descriptor sets unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 00:39:02 -04:00
slopggobblercobbler81 2f1cfdfa1a fix(libkernel): enforce SESS_LEADER EPERM and negative pid ESRCH ordering in setpgid/setpgrp 2026-10-23 23:52:23 +02:00
slopggobblercobbler81 782637fce4 feat(libkernel): implement setpgid and setpgrp 2026-10-23 23:52:21 +02:00
Hermes Agent 950a21aec8 fix(libkernel): return ENOENT for unknown sysctl names 2026-10-23 12:27:30 -04:00
orezraeyandClaude Opus 5.5 4acca6020c fix(libkernel): log a thread atexit Decrement without a reference
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 12:14:27 -03:00
orezraeyandClaude Opus 5.5 e437f33787 fix(libkernel): answer the thread atexit references as measured on a PS5
Increment returns -1 for an address outside every module and Decrement never fails, instead of throwing.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 12:13:07 -03:00
Dean 06fd07ab4a Merge pull request #8700 from nikowolf123/feat/libkernel-underscore-socket-signal-entries
feat(libkernel): export the underscore entry points of the socket, directory and signal calls
2026-10-24 00:53:04 +13:00
Dean 74f6fa8e31 Merge pull request #10076 from JJenkx/windows/raise-host-backoff
fix(libkernel): give a raise target time to run between host-code samples
2026-10-24 00:45:09 +13:00
BunnyFlandClaude Opus 5.5 9aa0f22dc7 feat(libkernel): implement the system-ex version, lower-limit and trace memory queries
sceKernelGetSystemExVersion, sysKernelGetLowerLimitSysexVersion,
sysKernelGetLowerLimitUpdVersion and sceKernelGetTraceMemoryStats were
NotImplemented stubs in libkernel_sys. libkernel, libkernel_sys and
libkernel_web of firmware 13.42 answer them without asking the kernel:
empty strings, a zero version and zero statistics, with the null checks
and return codes the firmware uses, including the plain 22 of
sceKernelGetSystemExVersion.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 12:29:49 +02:00
Dean Galvin 2f741e737f Merge main into feat/libkernel-underscore-socket-signal-entries 2026-10-23 22:00:32 +13:00
Dean dd5b2a3869 Merge pull request #9736 from LeandroLP23/feat/libkernel-kern-proc-env
feat(libkernel): answer kern.proc.env for the calling process
2026-10-23 21:47:33 +13:00
JJenkxandClaude Opus 5.5 fcc01c57a6 fix(libkernel): give a raise target time to run between host-code samples
RaiseOn suspends the target, reads its context and, while it is in host
code, resumes it and samples again after SwitchToThread. On a 16-core
Ryzen 9 5950X (Windows 11 22H2) that resampled the writer of
guest_raise_in_host_code about every 10 us before it could run: in the
raise that hung, 4,989 samples over 50 ms all found it in ucrtbase, so
the 50 ms host-code limit ran out and the handler was redirected into
fwrite, where it deadlocked on the stream lock (the test timed out at
30 s on every run). In a passing raise the samples sat at one RIP for
14,695 of 14,703 samples and the raise took 145 ms.

Spin for 20 us before each new host-code sample, so the target gets to
leave host code. With that, guest_raise_in_host_code passes 5 of 5 runs,
no raise is redirected in host code, and the longest raise is 0.46 to
0.53 ms. Other samples keep SwitchToThread.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 04:32:33 -04:00
Dean Galvin 2f45a312d0 Merge main into fix/setrlimit-nproc 2026-10-23 15:50:49 +13:00