sched_getparam, sched_getscheduler and sched_setparam with the own pid
from a thread other than the main thread act on the main thread once it
has registered through scePthreadSelf, as FreeBSD's p1003_1b.c selects
the first thread. Before registration, after the main thread exits and
on macOS they still throw.
MihawkOS (PPSA99170) reads sysctl {1, 14, 8, 0} while it starts and the
runtime throws on the unsupported MIB, which aborts the title.
KERN_PROC_PROC takes no pid, so the node lists the one guest process the
runtime hosts, as the same kinfo_proc kern.proc.pid already builds.
AI-assisted: yes
Lock and timed lock now try the mutex up to the spin count with a pause
between tries, then up to the yield count with a yield before each try,
before they block, as FreeBSD 11.4's mutex_lock_sleep does. Trylock and
a lock the thread already holds do not spin. A uniprocessor host skips
the spins and keeps the yields.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The PRT remap's last argument is checked but not recorded by firmware
13.42, and the comparison covered the recorded fields, not the bytes.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mapping a direct memory range that includes an unallocated physical
page threw std::invalid_argument and ended the process. It now returns
ENOMEM before anything is mapped, as shadPS4's MemoryManager::MapMemory
does.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
KytyPS5 and shadPS4 return EFAULT for a null name. The test keeps that
and the rename and clear checks, and drops the null address, zero length
and past-the-end cases that no reference covers; the debt entry records
them as unknown, with the 32-byte name limit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceKernelWriteMapCommand2, sceKernelWriteUnmapToPrtCommand,
sceKernelWriteWriteAddressCommand, sceKernelWriteWriteCounterCommand,
sceKernelWriteWaitOnAddressCommand, sceKernelWriteWaitOnCounterCommand
and sceKernelWriteEventQueueOnCompletionCommand follow the checks of
firmware 13.42's libkernel and record this project's command layout.
Without the PRT flag, sceKernelWriteMapCommand2 is
sceKernelWriteMapCommand, as on the console. The debt files record where
the existing writers' checks differ from the firmware.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
On Windows a sleep shorter than TimedWait's 0.5 ms lead, and the last 0.5 ms of a longer one, is a YieldProcessor spin in host code with no wait counted. A raise that found the target there could only be delivered through the return-address breakpoint or sampling, so sceKernelRaiseException at a thread looping on such sleeps was lost: a thread looping on sceKernelUsleep(200) lost the first raise in 5 of 5 runs.
The spins in SleepUntil and SleepNanosUnlessChanged now run under a DeliveryDeferral and drain APCs afterwards, as BeginPark and Unpark already do. A raise that finds the target spinning is queued as an APC and runs when the sleep ends.
GuestRaiseShortSleep raises 100 times each at a thread sleeping 100, 200 and 400 us in a loop, with sleep wakes on (SleepNanosUnlessChanged) and with APS5_NO_SLEEP_WAKE (SleepUntil). Both fail on main at the first or second raise.
AI-assisted (Claude Code).
Co-Authored-By: Claude Opus 5.5 <[email protected]>