FreeBSD 11.4's libusb10_handle_events_sub ends every pass, a timed-out
one included, with pthread_cond_broadcast on the context's condition
variable, so a thread in libusb_wait_for_event wakes after each pass of
the handler. Here waiters woke only when the handler unlocked, so a
waiter could sleep through the handler's whole loop. Notify them when
the handler takes the event lock back after a pass.
The follower test that expected a timeout while the handler ran 20 ms
passes now races that wake-up, so guest_usbd checks three cases
instead: a follower with a long timeout returns 0 after a pass, a
follower times out during a longer pass, and a follower returns after
the handler held the event lock past its timeout.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
sceUsbdLockEvents, sceUsbdTryLockEvents, sceUsbdUnlockEvents,
sceUsbdLockEventWaiters, sceUsbdUnlockEventWaiters, sceUsbdWaitForEvent,
sceUsbdEventHandlerActive, sceUsbdHandleEvents and
sceUsbdHandleEventsLocked follow FreeBSD 11.4 libusb10_io.c: one lock
for events and their waiters, one handler thread that releases the lock
while the host libusb handles events, and waiters that are woken when
the handler unlocks and take over handling when there is none.
sceUsbdEventHandlingOk now reports whether the calling thread is the
handler, and sceUsbdHandleEventsTimeout takes the same path.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The device test raced sceUsbdCancelTransfer on the first interrupt IN endpoint of the device. On Windows the first one can belong to a mouse or keyboard collection, which the system opens exclusively, so libusb's HID backend cannot read it and the submission failed, reported as a failed cancel race. The test now tries each interrupt IN endpoint, requires a refusal to be the host's I/O error with nothing in flight, and races on the first one the host accepts, with a buffer sized from that endpoint.
sceUsbdGetDevice, sceUsbdGetDeviceSpeed, sceUsbdGetMaxPacketSize,
sceUsbdGetMaxIsoPacketSize, sceUsbdOpenDeviceWithVidPid,
sceUsbdSetInterfaceAltSetting, sceUsbdClearHalt and
sceUsbdDetachKernelDriver follow FreeBSD 11.4 libusb10.c over the host
libusb. The packet sizes and the alternate setting checks are done as
FreeBSD does them, so the library records which interfaces are claimed,
and a device stays known while a handle to it is open.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
AnyPS5 resolves a title's imports by NID, so a title that imports a system
function that no AnyPS5 library provides fails to load with an unresolved
import. This declares 222 such exports across 11 PS5 system libraries that
AnyPS5 implements but does not provide.
Each declaration calls NotImplemented_nid_no_patch and returns 0; none of
them implements the function. A declaration with a credible prototype uses
it and cites the source with a pinned commit; the rest are declared without
parameters, which resolves the import without making an ABI claim. The
technical-debt files record the limitation per library.
The list is the intersection of the export table of the console's library
(function symbols only), the pinned aerolib names and the functions not yet
defined anywhere in the repo. Every name recomputes to its NID with
tools/nid_names.py.
libSceAudio3d and libSceVoice are left out because #8331 declares them.