Commit Graph
25 Commits
Author SHA1 Message Date
Adrià 0caa95b5cd Merge pull request #13683 from 00xDisaster/test/libSceAmpr-command-buffer-size
feat(libSceAmpr): null-check command buffer size lookup
2026-10-31 20:21:45 +01:00
Disaster 0f4ca0e8ec feat(libSceAmpr): null-check command buffer size lookup 2026-10-31 02:05:50 +02:00
MarcZX10 b6a7ea0b34 docs(libSceAmpr): silent-stub command buffer calls release emulator expansions
Old claim: sceAmprCommandBufferDestructor, sceAmprAprCommandBufferDestructor,
sceAmprAmmCommandBufferConstructor and sceAmprAmmCommandBufferDestructor return 0
without reading or changing the buffer, and the AMM constructor leaves every field
of the buffer as the caller left it.

What the code does: each of the four calls ReleaseExpandedCommandBuffer on a
non-null buffer. When the emulator has expanded that buffer's commands, the helper
frees the expansion, restores the original base and size, and resets offset and the
command count to 0. The APR destructor does not touch its gather and scatter states.

Permalinks at b1b5353cfc:
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceAmpr/Export.cpp#L91-L102
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceAmpr/Export.cpp#L395-L400
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceAmpr/Export.cpp#L503-L506
- https://github.com/boykopovar/AnyPS5/blob/b1b5353cfcee098ed17e3ba8a6e616bee97c9215/core/libs/prx/libSceAmpr/Export.cpp#L734-L743
2026-10-30 18:49:34 +00:00
ThomasandClaude Opus 5.5 4d61e68f74 fix(libSceAmpr): keep the occupancy threshold throwing until a title needs it
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 23:59:20 +01:00
ThomasandClaude Opus 5.5 89b061ba9a fix(libSceAmpr): list the occupancy threshold as a silent stub and drop the invalid threshold from its test
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 22:57:44 +01:00
ThomasandClaude Opus 5.5 2e03c203e2 feat(libSceAmpr): accept the page-table pool occupancy notification threshold
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 22:05:19 +01:00
Adrià 3443fd2ec8 Merge pull request #11727 from camezaro-intc/fix/ampr-command-buffer-expansion
fix(libSceAmpr): dynamically expand command buffer capacity on append
2026-10-29 20:35:27 +01:00
camezaro-intc f50ab20a5a fix(libSceAmpr): dynamically expand command buffer capacity on append 2026-10-28 13:05:10 -06:00
milescovielloandClaude Opus 5.5 819cf2eb0a docs(libSceAmpr): list the command buffer destructors and the AMM constructor as silent stubs
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 12:56:23 +00:00
Adnan Khan 0d14468ccc fix(libSceAmpr): zero the padding of a constructed Nop payload 2026-10-25 22:56:04 +05:30
Adnan Khan ada5ad0990 fix(libSceAmpr): write the console's Nop header word and report a null base first 2026-10-25 22:46:51 +05:30
Adnan Khan dc510a5279 fix(libSceAmpr): record Nop as n dwords with a one-dword header 2026-10-25 16:32:53 +05:30
boykopovar d9c2facdb9 fix(ampr): preserve nop payload when data is absent 2026-10-21 21:52:56 +03:00
Dean 0b1d678fe5 Merge pull request #8148 from hamb3r/feat/libc-dinkumware-threads
feat(libc): export Dinkumware thread primitives from libc.prx
2026-10-21 06:21:49 +13:00
hamb3r 387be86004 docs(debt): move Dinkumware thread debt entries from libSceAmpr to libc 2026-10-20 03:22:13 +03:00
voidlakhan 0d24f581f4 docs(ampr): preserve existing debt entries 2026-10-19 19:47:08 +00:00
Adrià Franch c84149b0c1 docs: record unverified null-argument results of libSceAmpr command buffer exports 2026-10-19 18:39:25 +02:00
hugodearaujo 12813101d2 fix(ampr): return EBUSY when a command does not fit and EPERM before a buffer is bound 2026-10-17 19:23:26 -03:00
KernelPanicNTandClaude Opus 5.5 5b7e3aea8b feat(libSceAmpr): implement __cxa_call_unexpected
__cxa_call_unexpected takes the in-flight exception's unwind header and
never returns, as in libcxxabi. No std::set_unexpected is exported and
the exception header's unexpected handler is never set, so the handler
is always the default one, which calls std::terminate. It therefore
forwards to libc's __cxa_call_terminate, which begins the catch and runs
the current terminate handler; a null header terminates in libc's
__cxa_begin_catch. libcxxabi's std::terminate would instead run the
terminate handler saved in the exception header at throw time; the two
differ only if std::set_terminate was called in between, which the debt
entry records.

The test shares the forked-child helper of the std::_Pad test, which now
takes the terminate handler to install.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 11:31:15 +00:00
Yossi Yadgar dd1deb6965 fix(ampr): raise std::_Pad failures as the guest std::system_error
A failing _Pad primitive threw a host std::runtime_error, which no guest
catch can see. threadcall.cpp calls the checked wrappers of xthread
(_Mtx_lockX, _Cnd_waitX, _Thrd_startX), which pass a non-success code to
_Throw_C_error: _Thrd_nomem and _Thrd_timedout become
resource_unavailable_try_again, _Thrd_busy device_or_resource_busy and
_Thrd_error invalid_argument, raised through _Throw_Cpp_error, which main
now implements. A failing thread start is _Thrd_startX's
resource_unavailable_try_again.

_Release now wakes the launching thread with _Cnd_signal, as
threadcall.cpp does; libc has it since the pad was written.

guest_ampr_threads checks, in a forked child whose guest terminate
handler reports the thrown object, that _Release on the thread still
holding the pad's mutex throws std::system_error with EBUSY. It fails
with the previous host exception and with busy mapped to
invalid_argument.
2026-10-13 15:59:28 +03:00
DavidandClaude Fable 5.1 d991cdccf9 feat(libSceAmpr): implement the std::_Pad thread launch helpers
Implement _ZNSt4_PadC2Ev, _ZNSt4_PadD2Ev, _ZNSt4_Pad7_LaunchEPP7pthread
and _ZNSt4_Pad8_ReleaseEv, which Deathloop (PPSA01670) and Minecraft
Legends (PPSA05510) import from libSceAmpr for the std::thread launch path.

The algorithm and object layout follow Dinkumware V6.00 thr/xthread and
thr/threadcall.cpp of Visual C++ 2013 (ganboing/crt.vc12 f1d47126): a
vtable pointer whose first slot is the pure virtual _Go(), then the
condition and mutex handles and bool _Started (0x8, 0x10, 0x18), with the
console's pointer-to-slot handles of libc Threads.cpp (#3079). The pad
uses libc's _Cnd_*/_Mtx_* exports, starts the guest thread with
pthread_create and an entry that calls _Go() and returns its result as
the exit code, as _Call_func does. The unverified layout, thread
attributes and error reporting are recorded in TechnicalDebt.md.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-13 15:51:00 +03:00
Adrià 955f4fbffe Merge pull request #4207 from xXPBSXx/fix/ampr-amm-usage-stats
feat(libSceAmpr): answer sceAmprAmmGetUsageStatsData
2026-10-12 22:57:04 +02:00
xXPBSXxandClaude Sonnet 5.5 4b6f463751 feat(libSceAmpr): answer sceAmprAmmGetUsageStatsData
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-12 21:14:14 +02:00
Blazing Cook c20583bd34 fix(ampr): reject command buffer offsets beyond bound memory
(cherry picked from commit b92287dc68d538d44369d2a09500b4404ca53fca)
2026-10-12 18:45:58 +00:00
Adrià FranchandClaude 342a8c4590 docs(debt): move library entries to one file per library
Co-Authored-By: Claude <[email protected]>
2026-10-12 20:38:29 +02:00