Commit Graph
2512 Commits
Author SHA1 Message Date
Adrià cba260828e Merge pull request #11864 from ionut27001/fix/libkernel-get-app-info-layout
fix(libkernel): fill 0x58-byte sceKernelGetAppInfo record, throw for other pids
2026-10-29 14:33:12 +01:00
Adrià efc24518bc Merge pull request #11862 from ionut27001/fix/libkernel-setrlimit-store-limits
fix(libkernel): store setrlimit RLIMIT_CORE soft limit, ignore raised DATA/STACK hard limits
2026-10-29 13:47:57 +01:00
Adrià 5454cd2e45 Merge pull request #11130 from imellag/perf/macos-mimalloc
feat(libs): let relinked macOS games opt into mimalloc
2026-10-29 12:58:23 +01:00
Adrià 578b8311ac Merge pull request #11267 from kallmek3nny/feat/libkernel-sem-setname
feat(libkernel): implement sem_setname
2026-10-29 11:31:34 +01:00
Adrià 0e5dad41c2 Merge pull request #9575 from DavidSamir/feat/libkernel-kqueue-evclear
feat(libkernel): support EV_CLEAR on a kqueue watched by another kqueue
2026-10-29 11:23:08 +01:00
Adrià 2257ffde7b Merge pull request #9473 from cadenasynyster/fix/windows-directory-link-rmdir-unlink
fix(libkernel): rmdir and unlink on a Windows directory link
2026-10-29 09:31:36 +01:00
Adrià c70c75ad13 Merge pull request #9284 from DavidSamir/feat/libkernel-sys-ksem-unnamed
feat(libkernel): implement the unnamed ksem semaphores
2026-10-29 08:48:19 +01:00
Dean 2960e9a6e7 Merge pull request #12705 from DeveshB-1/fix/fionread-efault
fix(libkernel): return EFAULT from ioctl FIONREAD for an unwritable argument
2026-10-29 18:50:49 +13:00
Dean e0a11b3fba Merge pull request #9515 from EagleBearerYS/fix/libkernel-getsockopt-net-sockets
fix(libkernel): getsockopt reads options of libSceNet sockets
2026-10-29 18:49:11 +13:00
DeveshB-1 1a47f9f0ee fix(libkernel): return EFAULT from ioctl FIONREAD for an unwritable argument 2026-10-29 09:15:45 +05:30
Dean 3a2b919816 Merge pull request #11863 from ionut27001/fix/libkernel-soc-sensor-channels
fix(libkernel): return -49 from sceKernelGetSocSensorTemperature channel 64 as a PS5 payload process does
2026-10-29 12:17:03 +13:00
Dean 711c4eca09 Merge pull request #11785 from ionut27001/fix/libc-hardware-concurrency
fix(libc): return the CPU count of the default thread mask from std::thread::hardware_concurrency
2026-10-29 12:16:46 +13:00
Dean 9412e47af6 Merge pull request #12579 from babyhuey/fix/fionbio-efault
fix(libkernel): return EFAULT from ioctl FIONBIO for an unreadable argument
2026-10-29 12:15:13 +13:00
Dean d775fc5958 Merge pull request #11403 from MarcZX10/marc/fix-libkernel-shm-anon-windows
fix(libkernel): recognize Windows anonymous shared memory descriptors
2026-10-29 11:49:22 +13:00
Dean 319621ba2e Merge pull request #12339 from medazizktata/fix/windows-exec-shared-mapping
fix(libkernel): map shared memory and files executable on Windows
2026-10-29 07:28:16 +13:00
Dean 1235db19dc Merge pull request #11500 from xXPBSXx/test/pthread-mutex-trylock-behavior
test(libkernel): cover the return values of pthread_mutex_trylock
2026-10-29 07:20:19 +13:00
babyhuey b4ae3afc61 fix(libkernel): return EFAULT from ioctl FIONBIO for an unreadable argument
ioctl(FIONBIO) read its int argument directly after the existing null
check, so a non-null pointer into unmapped memory crashed the host.
FIONBIO is an _IOW request, which FreeBSD copies in and fails with
EFAULT; the argument is now copied in with GuestCopyIn_nid_no_patch
before the status change.
2026-10-28 14:19:31 -04:00
ionut27001 7dc80f7f37 fix(libkernel): fill 0x58-byte sceKernelGetAppInfo record, throw for other pids 2026-10-28 20:16:32 +02:00
Adrià 027989a44a Merge pull request #11858 from jotitadev/fix/macos-poll-hangup-both-directions
fix(libkernel): report POLLHUP on macOS only once both directions of a stream have ended
2026-10-28 18:20:12 +01:00
Adrià 6eae433fad Merge pull request #11801 from jotitadev/fix/macos-waitpid-child-signals
fix(libkernel): report a child's stop and kill signals correctly on macOS hosts
2026-10-28 17:35:55 +01:00
kenny soloandClaude Opus 5.5 20c9a93999 feat(libkernel): implement sem_setname
Keep a copy of the name with the semaphore and move the export from the libkernel_sys stub into libkernel next to the other sem_* exports.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-28 14:51:17 +01:00
Emanuele 4c75091972 feat(libs): let relinked macOS games opt into mimalloc 2026-10-28 14:50:31 +01:00
MarcZX10 436769c634 fix(libkernel): recognize Windows anonymous shared memory descriptors 2026-10-28 13:04:38 +00:00
AdriàandClaude Sonnet 5.5 7cdb7a8780 test(libkernel): shrink the cleared kqueue race, match watched notes by ident, correct the kqueue debt entry
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 13:45:37 +01:00
David ec708dbde2 fix(libkernel): take the watched kqueue's count and activations in one snapshot
A cleared kqueue watch read the watched queue's triggered count and its
activation counter under two separate locks, so an activation between the
reads was marked seen without making the watch active, and the wakeup was
lost. SnapshotTriggered now returns both under one lock. Every poll of an
active watch also rechecks the count, as kqueue_scan reruns filt_kqueue:
it drops when the watched queue empties and reports the current count.
EV_ADD and EV_ENABLE of an existing watch re-arm it. A separate
guest_kqueue_cleared_race test triggers the watched queue from another
thread while the watching queue waits.
2026-10-28 13:45:03 +01:00
David 4c77b6ab65 feat(libkernel): support EV_CLEAR on a kqueue watched by another kqueue
FreeBSD re-evaluates a kqueue's EVFILT_READ note from kqueue_wakeup,
which runs whenever the watched kqueue queues a note, so an EV_CLEAR
note fires again only after such an activation. The equeue now counts
activations, and the EV_CLEAR note fires when the count moves while
notes are queued.
2026-10-28 13:44:50 +01:00
cadenasynysterandClaude Sonnet 5.5 b28edaf954 fix(libkernel): rmdir and unlink on a Windows directory symbolic link
On Windows, std::filesystem::symlink_status and is_symlink report a directory symbolic link as a plain directory, so rmdir removed the link instead of failing with ENOTDIR (20) and unlink failed with EPERM (1) instead of removing it, unlike FreeBSD. Detect the symlink reparse tag with FindFirstFileW: rmdir returns ENOTDIR, unlink removes the link with RemoveDirectoryW. Junctions and volume mounts keep their previous behaviour. Enable the directory-link and dangling-link blocks of guest_filesystem on Windows (created with CreateSymbolicLinkW).

AI-assisted: yes

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-28 13:41:23 +01:00
AdriàandClaude Sonnet 5.5 735dd0bdd7 fix(libkernel): declare the unnamed ksem exports once in the public header
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 12:58:01 +01:00
David fd6513d6ff refactor(libkernel): move the unnamed ksem calls into libkernel
The PS5 3.20 export lists have ksem_* in libkernel as well as
libkernel_sys, and on Windows a libkernel import never reaches
libkernel_sys, so titles importing them from libkernel did not find
them. Following pipe1os's review on #9284, also: ENOSPC from
ksem_init when no descriptor is left, the SEM_MAX limit of 30 with
ENOSPC, and dup/dup2 from a ksem id throwing as for a kqueue.
2026-10-28 12:57:04 +01:00
David 0742c4f6b4 feat(libkernel): let other libraries observe closed guest descriptors 2026-10-28 12:56:30 +01:00
Dean d937efc9ca Merge pull request #12283 from B-Howell/claude/fix-issue-12079-rmdir-link-classify
fix(libkernel): classify the rmdir path with lstat so links give ENOTDIR on Windows
2026-10-29 00:30:56 +13:00
Dean 785f7b35d9 Merge pull request #12260 from tkcm01/fix/libkernel-cancellable-sleep-errno
fix(libkernel): keep errno across cancellable sleeps
2026-10-29 00:29:17 +13:00
Mohamed Aziz Ktata dbd826bc88 fix(libkernel): map shared memory and files executable on Windows
A guest mmap with PROT_EXEC and MAP_SHARED of a shared-memory object or a regular file threw on Windows. The section is now created from a handle reopened with GENERIC_EXECUTE, as PAGE_EXECUTE_READ or PAGE_EXECUTE_READWRITE, the owner ACE of named objects grants execute with read, and a writable shared mapping of a read-only descriptor fails with EACCES, as FreeBSD 11.4 shm_mmap and vn_mmap do.

Fixes #12337
2026-10-28 11:14:08 +01:00
Dean 846ae118f9 Merge pull request #11861 from ionut27001/fix/libkernel-sysconf-measured-names
fix(libkernel): sysconf answers the names a PS5 payload process answers
2026-10-28 22:52:41 +13:00
Dean bc7cc27e55 Merge pull request #10856 from Felipebmaitan/feat/guest-signal-cancellation
fix(libkernel): avoid cancellation wakeups during thread exit
2026-10-28 22:52:08 +13:00
Dean 4a6693acf8 Merge pull request #12083 from KernelPanicNT/fix/libkernel-mutexattr-setkind-any-kind
fix(libkernel): store any scePthreadMutexattrSetkind kind as firmware 13.42 does
2026-10-28 22:46:46 +13:00
Dean 7eac0fe4cb Merge pull request #12075 from JJenkx/windows/kernel-truncate-loop
fix(libkernel): report ELOOP from truncate on a looping Windows link
2026-10-28 22:46:08 +13:00
Dean e4a00a5ddb Merge pull request #12069 from dantdmdarealguy/fix/raise-terminating-target-windows
fix(libkernel): treat a raise target that is already terminating as exited on Windows
2026-10-28 22:45:45 +13:00
Dean f05f82a005 Merge pull request #11926 from al3ss4ndrolb/fix/param-json-incomplete-member
fix(libkernel): build the param.json parser with Clang and libstdc++
2026-10-28 22:31:21 +13:00
AdriàandClaude Sonnet 5.5 149ec09adf fix(libkernel): give the descriptor checks C linkage so libkernel_sys can import them
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
AdriàandClaude Sonnet 5.5 f87b6289ac fix(libkernel): export the kqueue descriptor check to libkernel_sys
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-28 08:43:15 +01:00
Dean 210462e2a7 Merge pull request #11838 from oneandonlydean/wolverine/amm-fragmented-pool
fix(libkernel): map AMM pages from a fragmented pool
2026-10-28 20:11:32 +13:00
B-HowellandClaude Opus 5.5 fe7a71c1ea fix(libkernel): classify the rmdir path with lstat so links give ENOTDIR on Windows
sceKernelRmdir decided whether the last component was a symbolic link with
std::filesystem::is_symlink, which follows the link with WinLibs libstdc++ on
Windows. A dangling or self-referencing file link then looked missing on
Windows 10 (ENOENT instead of ENOTDIR), and a directory link to an empty
directory looked like that directory, so rmdir removed the link and
returned 0. The last component is now classified with FillLinkStat, the
same lstat path lstat_nid_postfix uses, matching FreeBSD 11 kern_rmdirat,
which returns ENOTDIR for any non-directory vnode found without following
the last link.

Fixes #12079

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 03:10:08 -04:00
tkcm01andClaude Opus 5.5 1127dacf68 fix(libkernel): keep errno across cancellable sleeps
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 01:49:47 -04:00
harisibrar1 6413eacf9d Merge remote-tracking branch 'origin/main' into fix/map-undefined-protection-einval
# Conflicts:
#	docs/dev/debt/libkernel.md
2026-10-28 01:28:03 -04:00
Yunus Shaikh 4432e8aa57 Merge main into fix/libkernel-getsockopt-net-sockets 2026-10-27 21:03:12 -07:00
Felipebmaitan 4ba0a6f9c4 chore: integrate current main for guest-signal-cancellation 2026-10-28 00:48:38 -03:00
Dean Galvin 97f1d41a2c Revert "Merge pull request #10809 from frankea/fix/direct-memory-12gib"
This reverts commit 780b33aea3, restoring the 13824 MiB direct memory pool.

With the pool at 12288 MiB, Astro Bot (PPSA21564) can no longer load its
level: DirectMemoryAllocator asserts "Can't allocate direct memory" for a
64 MB VideoPlayerTexture with 12228 of 12288 MB in use, then the process
faults about 26 s in (2 of 2 runs, RTX 4090, Linux, main cccdaa2734).
The same tree with only this merge reverted runs the full 150 s with no
direct memory assert (2 of 2 runs).
2026-10-28 15:45:26 +13:00
Adrià b5873b4ce4 Merge pull request #11594 from milescoviello/test/read-tsc
test(libkernel): cover sceKernelReadTsc's rate against sceKernelGetTscFrequency
2026-10-28 03:35:23 +01:00
Dean 780b33aea3 Merge pull request #10809 from frankea/fix/direct-memory-12gib
fix(libkernel): report 12 GiB of direct memory, as a PS5 does
2026-10-28 13:49:57 +13:00