Files
Sergi・セルジ 908e3c162d Run the latest VitaAutotests, and implement the atomic calls (#4243)
* ci: let an autotest be skipped

Some VitaAutotests tests check timing, like how long a short delay takes,
and on Vita3K their outcome depends on how busy the CI runner is, so they
can pass on one run and fail on the next. The expectations file can now
mark such a test skip, which leaves it out of the run.

* ci: run the latest VitaAutotests

Move AUTOTESTS_REF to the latest VitaAutotests commit, which adds 28
scheduler and sync tests:
- stagnant_mask passes.
- delay_precision, timeout_threshold and timer_period check timing, so
  they're skipped.
- standby_handover_order is skipped too. Vita3K runs its threads at once,
  so the order it checks comes down to a race of about 1 ms.
- The other 24 fail, mostly because threads ignore their core and
  priority, and atomics because no sceKernelAtomic call is implemented.

* kernel: implement the atomic calls

Every sceKernelAtomic call was a stub that returned 0 and left memory
alone. They now work on the guest value with host atomics, the way the
atomics test shows a Vita does: the AndGet calls return the new value,
the GetAnd calls, CompareAndSet and DecIfPositive the old one. AddUnless
stores its last argument instead once the sum reaches it, comparing as
signed and wrapping only at 32 and 64 bits, and DecIfPositive takes 0
down to -1 at 8 and 16 bits.

* kernel: report an unlock of a deleted lightweight mutex as not owned

A delete clears the owner in a lightweight mutex's work area, so a Vita
fails a later unlock with LW_MUTEX_NOT_OWNED, while Vita3K said the
mutex was unknown. That's what cond_mutex_delete sees when a condition
wait ends because its mutex was deleted.
2026-10-15 12:56:53 +02:00
..
2023-04-24 14:39:03 +02:00