Commit Graph
1684 Commits
Author SHA1 Message Date
Dean ef1f41c4c9 Merge pull request #8061 from Dragost/fix/libkernel-pthread-yield-busy-spin
fix(libkernel): prevent 100% CPU busy-spinning on pthread yield on Windows
2026-10-21 20:57:20 +13:00
Dean 8425543705 Merge pull request #8655 from cadenasynyster/fix/win-open-loop-inside
fix(libkernel): report ELOOP for a path below a Windows symlink loop
2026-10-21 20:57:12 +13:00
Dragost 2716dee730 fix(libkernel): prevent 100% CPU busy-spinning on pthread yield on Windows 2026-10-21 09:30:27 +02:00
Dean 9be6ccf60c Merge pull request #8255 from Nixitov/feat/process-abi-type
feat(libkernel): declare sceKernelGetProcessAbiType
2026-10-21 20:20:37 +13:00
Nixitov 4d83fece6d feat(libkernel): declare sceKernelGetProcessAbiType
AI-assisted: yes
2026-10-21 09:01:22 +02:00
Dean 5b5d2a8636 Merge pull request #8626 from xXPBSXx/carry/6226-relinker-stem
fix(libc): find a relinked module by stem when the exact name misses (carries #6226)
2026-10-21 19:52:46 +13:00
Dean 65c393a684 Merge pull request #8714 from mehmetbayoglu/fix/libkernel-process-time-tsc
fix(libkernel): tick the process time counter at the TSC frequency
2026-10-21 19:36:01 +13:00
Dean cd700fe9ec Merge pull request #8793 from xXPBSXx/fix/pthread-kill-ended-thread-esrch
fix(libkernel): let pthread_kill with signal 0 report ESRCH for a thread that has ended
2026-10-21 15:27:29 +13:00
Dean GalvinandxXPBSXx 8cb7251b2e Merge origin/main into PR 8626
Co-authored-by: xXPBSXx <20614131+xXPBSXx@users.noreply.github.com>
2026-10-21 14:56:22 +13:00
Dean 557682ca44 Merge pull request #8798 from JJenkx/windows/open-keep-native-error
fix(libkernel): keep the native open error when the Windows directory probe finds no directory
2026-10-21 14:38:41 +13:00
Dean a806c69bfe Merge pull request #8758 from p3n1cillin/codex/pthread-getprio-20261021
feat(libkernel): implement pthread_getprio
2026-10-21 14:27:54 +13:00
Dean c5d841ed94 Merge pull request #8732 from DoubleAAGuy/feat/libkernel-osreldate-sysctl
feat(libkernel): expose kern.osreldate sysctl
2026-10-21 14:27:39 +13:00
Dean 8a803d3e6d Merge pull request #8743 from valenciana-nc/fix/kernel-iovec-table-copy
fix(libkernel): return EFAULT for unreadable iovec tables
2026-10-21 14:24:39 +13:00
Dean 7697443281 Merge pull request #8653 from Ondra97/codex/fix-net-dontwait
fix(net): keep MSG_DONTWAIT transfers nonblocking on Windows
2026-10-21 14:19:19 +13:00
Dean e7ce7102ab Merge pull request #7468 from Dripl1x/codex/direct-memory-alias-index
perf(libkernel): find direct-memory aliases through the physical index
2026-10-21 13:57:13 +13:00
JJenkxandClaude Opus 5.5 af086114c7 fix(libkernel): keep the native open error when the Windows directory probe finds no directory
When the native open failed with an error other than ENOENT, OpenNative
probed whether the path is a directory with std::filesystem::is_directory.
With the MinGW runtime that probe can set errno to ENOENT, and OpenNative
then reported the probe's ENOENT instead of the open error. On Windows 11
22621 a symbolic link loop failed with ELOOP from the native open and
sceKernelOpen returned 0x80020002, so guest_filesystem aborted at the
ELOOP check added by #8640.

Keep the open error and restore it when the path is not a directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 20:54:15 -04:00
xXPBSXxandClaude Sonnet 5.5 79569a7a3d fix(libkernel): let pthread_kill with signal 0 report ESRCH for a thread that has ended
pthread_kill(thread, 0) returned 0 for every handle other than the caller's before it asked whether the thread was still alive. FreeBSD's _pthread_kill looks the thread up with _thr_find_thread before it checks for signal 0, so the call answers ESRCH for a thread that has ended or was never a thread. The liveness check now runs before the signal 0 shortcut; the calling thread still answers 0.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 02:29:54 +02:00
Dean 70c497739e Merge pull request #8636 from cadenasynyster/fix/libc-thrd-detach
feat(libc): implement _Thrd_detach
2026-10-21 13:11:55 +13:00
Dean da5ea87cd6 Merge pull request #8455 from hypermoist/feat/libkernel-create-uuid-v4
feat(libkernel): implement sceKernelCreateUuidV4
2026-10-21 13:11:28 +13:00
Dean f41c5bef2b Merge pull request #8637 from billythemenace2/fix/kernel-raise-system-call-wait
fix(libkernel): keep waiting while a raise target is inside a system call
2026-10-21 13:11:08 +13:00
Dean 261497b450 Merge pull request #8676 from MarcZX10/codex/module-info-elf-phdr-match
fix(libkernel): match module info segment records
2026-10-21 13:10:46 +13:00
Ondra97 c415375041 fix(net): finish blocking stream sends after short writes 2026-10-21 01:53:43 +02:00
Dean b753508271 Merge pull request #8454 from hypermoist/feat/libkernel-byte-order
feat(libkernel): export htonl, ntohl, htons and ntohs
2026-10-21 12:40:32 +13:00
Dean 6c30d8d804 Merge pull request #8394 from Sam-mon7/fix/apr-staging-off-stack
fix(libkernel): keep the Windows APR read staging buffer off the stack
2026-10-21 12:14:31 +13:00
p3nicillin 5a79dda21d feat(libkernel): implement pthread_getprio 2026-10-21 00:08:30 +01:00
Dean eea640a5bf Merge pull request #8386 from xXPBSXx/fix/lseek-descriptor-first-fb
fix(libkernel): look up the descriptor of lseek before the whence value
2026-10-21 12:06:53 +13:00
valenciana-nc 23c43725f6 fix(libkernel): copy guest iovec tables before vector transfers 2026-10-20 17:04:30 -06:00
Dean 61d0fa5b3c Merge pull request #8304 from Aryansh1520/feat/libkernel-umtx-ops-sync
feat(libkernel): implement _umtx_op UMTX_OP_SEM_WAIT and UMTX_OP_SEM_WAKE
2026-10-21 11:50:34 +13:00
Hermes Agent 0273c1479f feat(libkernel): expose kern.osreldate sysctl 2026-10-20 18:29:40 -04:00
memob 95050dda24 fix(libkernel): tick the process time counter at the TSC frequency
sceKernelGetProcessTimeCounter counted nanoseconds and
sceKernelGetProcessTimeCounterFrequency returned 1 GHz, while
sceKernelGetTscFrequency reports the host TSC rate. On the console the
process time counter runs at the TSC frequency, so a title may scale
the counter by sceKernelGetTscFrequency. PPSA34501 does, and its clock
ran 3.4 times slow on a 3.4 GHz host: it paced its 60 Hz frames to
17.6 fps and its game time and audio drifted apart.

The counter now ticks at sceKernelGetTscFrequency, over the same
monotonic clock and APS5_TIME_SCALE, and its frequency is that rate.
2026-10-20 17:43:18 -04:00
MarcZX10 05cc68cd95 style(libkernel): keep regression comments out of code 2026-10-20 20:52:44 +00:00
MarcZX10 e1e20f0f2e fix(libkernel): match module info segment records 2026-10-20 20:50:05 +00:00
Dean a6a4101e19 Merge pull request #8595 from MarcZX10/codex/socket-fdset-limit-followup
fix(libkernel): keep socket descriptors within FD_SETSIZE
2026-10-21 09:22:06 +13:00
cadenasynysterandClaude Sonnet 5.5 97a2dcb27f fix(libkernel): report ELOOP when opening below a Windows symbolic link loop
A path below a self-referencing symbolic link returned ENOTDIR on Windows; FreeBSD returns ELOOP. A failed native open now uses the loop check that sceKernelStat uses.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-20 22:06:36 +02:00
Dean 9a97ac784d Merge pull request #8591 from xXPBSXx/fix/getdirentries-basep-windows
fix(libkernel): report the starting entry index in getdirentries basep on Windows
2026-10-21 09:04:26 +13:00
Dean 5e113d91f9 Merge pull request #8414 from xXPBSXx/fix/raise-signal-zero
fix(libkernel): let raise(0) check the calling thread and return 0
2026-10-21 09:03:51 +13:00
xXPBSXxandClaude Sonnet 5.5 c98377710f test(libkernel): rename the variant-name decoys so they still compete for the stem
With the stem cut at the last extension, the decoy guest_module_fixture.sprx.elf.GUEST.PRX
and the dangling link guest_module_fixture.zprx.elf.GUEST.PRX had the stems
guest_module_fixture.sprx and guest_module_fixture.zprx, so they no longer
matched the request and the shortest-name rule was not exercised. They are now
guest_module_fixture.sprx.GUEST.PRX and guest_module_fixture.zprx.GUEST.PRX,
which have the request's stem and are longer than the real module copy.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 21:53:32 +02:00
Ondra97 1b182e7fb2 fix(net): keep MSG_DONTWAIT transfers nonblocking on Windows 2026-10-20 21:47:08 +02:00
billythemenace2andClaude Opus 5.5 681926e085 fix(libkernel): keep waiting while a raise target is inside a system call
Since #8512 a raise redirects a target running host code once 50 ms have
passed since the raise began. A target inside a system call that is not a
wait, such as the NtWriteFile of an fwrite that holds its stream lock, can
stay there longer; the redirect then ran the handler with the lock held.
SONIC SUPERSTARS froze at frame 67 again on main this way, with its GC
raise delivered at ntdll!ZwWriteFile+20.

A target stopped right after a syscall instruction in ntdll now restarts
the 50 ms host-code window, so the raise keeps sampling until the call
returns and the target leaves host code, bounded by the 1 s retry limit.
guest_raise_in_system_call holds a writer in NtWriteFile on a slowly
drained pipe; it times out on main and passes with this change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-20 20:35:36 +01:00
cadenasynysterandClaude Sonnet 5.5 a8b6d1c411 feat(libc): implement _Thrd_detach
Animal Well (PPSA22520) imports _Thrd_detach (L7f7zYwBvZA) from libc.prx and nothing exports it, so the Windows loader stops at startup. Register libkernel's pthread_detach with libc like pthread_create and pthread_join, and return _Thrd_error (4) when it fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Claude-Session: https://claude.ai/code/session_01GtXavMkgCTCdmRpweviHcQ
2026-10-20 21:31:16 +02:00
Dean c70524a3db Merge pull request #8596 from ebarr24/ws/libkernel-kevent-note-lowat-above-1-on-e
fix(libkernel): fire EVFILT_WRITE on a socket once free send space reaches NOTE_LOWAT
2026-10-21 08:27:05 +13:00
Dean a9cfea22f7 Merge pull request #8594 from mantavisual/fix/libkernel-utimes-rejected-keeps-atime
fix(libkernel): leave a file's times untouched when Windows utimes refuses them
2026-10-21 07:56:52 +13:00
Dean b7596be595 Merge pull request #6658 from nicolasabosch/perf/gpu-wake-sleeps
perf(libkernel): end short sleeps when the GPU or a flip completes
2026-10-21 07:55:28 +13:00
Adrià FranchandClaude Sonnet 5.5 c420b8d53d fix(main): skip the parent watch of a vnode already deleted at registration
Culprit: none in 892a4f1328..b85d972f42; race in the Windows vnode watch (50b06110b guarded only the loop). Run 39473930499, guest_kqueue: a watched file deleted before registration is snapshotted under $Extend\$Deleted, WatchParent got ERROR_ACCESS_DENIED and threw.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 20:49:45 +02:00
lendinglibrary a3c4cdcdbb fix(libc): find a relinked module by stem when the exact name misses
A title asks for a module by its console name and the relinker names the
converted module after the ELF it was built from: Unity IL2CPP titles load
Media/Modules/<name>.prx and Media/Plugins/<name>.prx while the dump holds
<name>.elf.guest.prx, so sceKernelLoadStartModule failed with 0x80020002
and the title stopped 3 s after start. After the exact and the
case-insensitive <name>.guest.prx lookups miss, take the sibling whose stem
matches the request and ends with .guest.prx, shortest name first.
2026-10-20 20:42:59 +02:00
Dean 78e398d6d0 Merge pull request #8467 from xXPBSXx/fix/raise-default-ignored-signals
fix(libkernel): let raise and kill return 0 for ignored signals
2026-10-21 07:18:46 +13:00
Dean 352dbe751a Merge pull request #8583 from Ondra97/codex/fix-pthread-attr-policy
fix(libkernel): report current thread scheduling policy in attributes
2026-10-21 07:14:27 +13:00
Dean eae6e0162f Merge pull request #8512 from oneandonlydean/fix/7652-host-raise-patience
fix(libkernel): bound the raise wait on host code to 50 ms
2026-10-21 07:00:13 +13:00
MarcZX10 2299284a69 fix(libkernel): keep socket descriptors within FD_SETSIZE 2026-10-20 17:41:40 +00:00
xXPBSXxandClaude Sonnet 5.5 eaadb2924b fix(libkernel): report the starting entry index in getdirentries basep on Windows
The Windows sceKernelGetdirentries stored 0 in *basep on every read, so a
guest looping on the cookie saw it stall (FreeBSD stores the directory
offset the read started at, kern_getdirentries: *basep = loff). Report the
index of the first entry of the read, the same unit lseek takes on these
descriptors, and run guest_directory_entries on Windows, where it was never
built.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 19:33:03 +02:00