The trap was released when FlushPending took the image out of the pending
registry, before it waited for GpuMutex, so a read in between saw the old
bytes; cache eviction and explicit write-backs did not release it at all.
Every store now releases it in writeBackLayers: after recording the GPU copy
into the import, or before the first CPU access on the CPU path, which also
releases the traps of other images on the same pages. A trapped image is
stored whole, and direct memory mapped at a second address is not trapped.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceKernelHasTrinityMode returns 0, the answer of a base PS5, as
sceKernelIsTrinityMode already does. Two public readings of firmware
libkernel (OpenAGC for 11.60, Backport for 11.00 to 12.70) say it
compares hw.sce_main_socid with its low five bits cleared against
0x840fc0; the base PS5 SoC id recorded for sceKernelGetMainSocId,
0x840f80, fails that test. The prototype int (void) comes from the 23
calls in a UE5 title, each storing setne of the result in a guarded
static with no argument set up.
Titles import it from libkernel, but only the libkernel_sys placeholder
inventory exported it, as a throwing stub. The export moves to libkernel
next to sceKernelIsTrinityMode, and the inventory and its counts drop
the entry. guest_operation_mode checks the result.
Return the main program's handle, the first one sceKernelGetModuleList
lists and one sceKernelGetModuleInfo accepts. reSOT (PPSA99023) imports
it from libkernel and passes the handle to sceKernelGetModuleInfo to find
its own code segment; before this its eboot failed to load on the
unresolved import.
The PS5 3.20 export lists have it in libkernel as well as libkernel_sys,
and on Windows a libkernel import never reaches libkernel_sys, so the
throwing libkernel_sys stub moves to libkernel as pselect did.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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]>
Move the declaration out of the test's local extern block so GuestPthreadCondSetname uses the shared libkernel API header, like the other pthread_cond exports.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Main's #9573 implements scePthreadResume right after the
scePthreadMutexattrSetkind stub this branch removes from libkernel_sys;
the merge takes main's scePthreadResume and leaves the stub out.
Main's public-header audit wants one header declaration per export, so
the merge declares this branch's scePthreadMutexattrSetkind,
scePthreadMutexattrGetkind and pthread_rwlockattr_settype_np in
libkernel's Api.hpp, drops their stub declarations from libkernel_sys's
Api.hpp, has Mutex.cpp take sceKernelError from libkernel's Api.hpp,
and has the test include the libkernel headers instead of its own
declarations.
sched_getparam, sched_getscheduler and sched_setparam are defined under libkernel/Pthread/Posix, so their typed declarations replace the no-argument placeholders in the libkernel header (public_headers requires the declaration in the implementing library's header), and GuestSchedParams.cpp includes the canonical headers instead of declaring these exports and the pthread, getpid and error calls locally.
The public header declared the unimplemented placeholder int __tls_get_addr(void). It now declares void* __tls_get_addr(const KernelTlsIndex*), the tls_index pointer the ABI passes, and the implementation and the test use that declaration and type instead of their own.