sceNpCalloutStartOnCtx64 cleared and filled the entry before looking for
it in the queue, so restarting a queued callout cut off every callout
queued after it and changed its deadline while the callout thread could
read it. The entry is now written only after the duplicate check under
the context mutex. sceNpArchInit and sceNpArchTerm now hold a lock, so a
second caller no longer returns before the global heap exists. Both
differences from the firmware are recorded in the debt document.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013XFS3FUfBtqCVfwmBrRQ6q
Builds on #9037. Adds threads, event flags, semaphores, atomics, heaps
and kernel memory, callout contexts, time and SDK version queries,
base64 and hex codecs, integer and string helpers, JSON escaping, URL
encoding, online id strings, language codes, title ids and debug output.
The behaviour follows libSceNpCommon.sprx from firmware 12.00, read
from disassembly.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK