Commit Graph
177 Commits
Author SHA1 Message Date
Dean 2707b3a3c8 Merge pull request #736 from adriadam10/feat/libc-wcsrtombs-s
feat(libc): implement wcsrtombs_s
2026-10-06 09:31:24 +13:00
Dean 2811e0106f Merge pull request #731 from adriadam10/feat/libc-xtime-get-ticks
feat(libc): implement _Xtime_get_ticks
2026-10-06 09:30:42 +13:00
Dean 974c3fa1b5 Merge pull request #652 from Celegans12/fix/guest-arena-app-map-area
fix(libc): reach the application map area end with the guest arena
2026-10-06 08:04:36 +13:00
Dean 66db1930c7 Merge pull request #729 from adriadam10/feat/libc-fdtest-finf-fnan
feat(libc): implement _FDtest, _FInf and _FNan
2026-10-06 08:02:17 +13:00
Dean 7c0528a8f3 Merge pull request #718 from adriadam10/feat/libc-div
feat(libc): implement div
2026-10-06 08:00:09 +13:00
Dean 4520e2b664 Merge pull request #715 from adriadam10/feat/libc-cyber-unknown-names
feat(libc): implement std::_Xrange_error and the range_error type
2026-10-06 07:59:26 +13:00
Dean 823e01e3c1 Merge pull request #706 from adriadam10/feat/libc-strtoimax-logbf
feat(libc): strtoimax and logbf
2026-10-06 07:58:43 +13:00
Adrià FranchandClaude 55f548d6bc feat(libc): implement wcsrtombs_s
Co-Authored-By: Claude <[email protected]>
2026-10-05 20:29:18 +02:00
Adrià FranchandClaude 3f2e5150c2 feat(libc): implement _Xtime_get_ticks
Co-Authored-By: Claude <[email protected]>
2026-10-05 20:16:11 +02:00
Adrià FranchandClaude 68b71c971a feat(libc): implement _FDtest, _FInf and _FNan
Co-Authored-By: Claude <[email protected]>
2026-10-05 20:10:34 +02:00
Adrià FranchandClaude afe2b14a84 feat(libc): implement div
Co-Authored-By: Claude <[email protected]>
2026-10-05 19:53:39 +02:00
Adrià FranchandClaude fbf0099790 feat(libc): implement std::_Xrange_error and the range_error type
Co-Authored-By: Claude <[email protected]>
2026-10-05 19:49:33 +02:00
Adrià FranchandClaude ce4bdbf2eb feat(libc): strtoimax and logbf
Co-Authored-By: Claude <[email protected]>
2026-10-05 19:22:12 +02:00
Celegans12andClaude Opus 5.5 5085746fce fix(libc): reach the application map area end with the guest arena
On Windows the guest arena ended at 0x72_0000_0000: #231 kept its
448 GiB size after #153 had moved its start down to 0x2_0000_0000.
Titles map fixed addresses up to the application map area end,
0xFC_0000_0000 (SCE_KERNEL_APP_MAP_AREA_END_ADDR on the PS4), and a
direct memory mapping above the old end threw "shared mapping outside
the guest arena".

The arena is now reserved up to 0xFC_0000_0000. The out-of-arena
errors name the address and length, and a fixed mapping over a used
arena range says whether it hit a host region. guest_memory maps
direct memory at the last two pages below the end, reads it through
an alias and checks that a mapping at the end is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 17:51:26 +02:00
Tomás Ortellado e1bfd03f23 fix(libc): return null when strdup allocation fails 2026-10-05 08:57:56 -03:00
DotDebianandClaude Opus 5.5 992933b95c feat(libc): implement snwprintf_s
Format through the shared wide formatter, truncate to the buffer and
return the full length, as C11 K.3.9.1.3 specifies. A null buffer or
format, a zero or oversized n, %n and a null %s argument are
runtime-constraint violations that return a negative value.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 09:59:30 +02:00
Nicolas Abosch aa08977a59 fix(libc): preserve 64-bit long integer conversions 2026-10-04 23:27:17 -03:00
Dean 4ae4f53ffb Merge pull request #338 from Pouare514/feat/prx-loader-tripwires
feat(prx): unknown loader tripwires for TLOU
2026-10-05 14:22:18 +13:00
Pouare514 15a4b73e6c fix(crashreport): single-dump timed watchdog with positive-only timeout 2026-10-05 02:31:17 +02:00
Pouare514 ac7bc704c3 fix(prx): export tripwire NIDs under recomputed real names, restore main's hunks 2026-10-05 02:13:22 +02:00
Pouare514 66a95ada20 feat(prx): unknown loader tripwires for TLOU 2026-10-05 02:12:32 +02:00
Dean e682ed35a1 Merge pull request #406 from Pouare514/feat/crashreport-thread-dump
feat(crashreport): dump all threads on fatal crash plus hang watchdog
2026-10-05 12:45:32 +13:00
Pouare514 dbe6b62922 fix(crashreport): capture thread stacks while suspended, report skipped threads 2026-10-05 00:57:04 +02:00
Pouare514 f4301a1347 feat(crashreport): dump all threads on fatal crash plus hang watchdog 2026-10-04 16:36:16 +02:00
Pouare514 1cbf3fa8e4 feat(libc): implement at_quick_exit and quick_exit 2026-10-04 15:20:51 +02:00
RomainROCH 5211ba115b fix(libc): count wide string precision in output characters 2026-10-04 04:31:26 +02:00
Dean e84b558bf1 Merge pull request #462 from oneandonlydean/fix/agc-own-store-write-watch
fix(agc): consume the write-watch faults of the driver's own CPU stores
2026-10-04 15:01:48 +13:00
Dean e656baf20b Merge pull request #398 from Pouare514/fix/libc-fopen-enoent
fix(libc): return NULL with ENOENT for missing files in fopen
2026-10-04 14:02:14 +13:00
Dean e50c18a42d Merge pull request #314 from RomainROCH/codex/fix-fgetpos-error
fix(libc): propagate file position errors
2026-10-04 14:01:01 +13:00
Dean 1dd1be67e3 Merge pull request #262 from RomainROCH/codex/fix-aligned-delete
fix(libc): release aligned allocations through the application heap
2026-10-04 14:00:42 +13:00
Dean Galvin bb1531fc34 fix(agc): consume the write-watch faults of the driver's own CPU stores
A store the driver makes with the CPU into watched guest memory (a
GuestMemory::Write, a changed-bytes write-back, a completion action's label
store, the copy HLE's CPU path) faults its pages dirty in the write watch and
stamps the range with MarkWritten. The faults stayed behind: collects are
memoized per packet, so the next walk over those pages came later and stamped
them again, as a CPU write made after every check in between.

PPSA21564 fast-clears its normal G-buffer every frame with a register DCC key
fill on the GPU. While that fill is still pending, the first draw into the
target materializes the clear with a CPU store of the clear texels and a
refresh of the resident image. A dozen draws later a walk found the store's
faults, the target read as changed, and the image was uploaded again from
guest memory, dropping the draws recorded in between. Lighting then sampled
cleared normals and the level's moon and rocks went unlit in about half the
frames.

The driver's stores now consume those faults themselves: a walk before the
store stamps earlier CPU writes as such, a walk after it takes the store's
own faults as a driver store, and the range is stamped as before.

On Windows the arena's range also holds host regions that were already in
use when it was reserved (heaps, thread stacks). They are not write-watched,
so a store into one is stamped as before, without a walk.
2026-10-04 11:36:05 +13:00
Dean Galvin 6670c52571 fix(libc): run the cleanups of frames that use the C personality
GCC gives C code built with -fexceptions, and cleanup-only functions
after link-time optimization, the C personality __gcc_personality_v0.
The unwinder accepted only its own C++ personality, so an exception
thrown through such a frame was never caught.

libc now provides the C personality, which never catches and installs
the frame's cleanup landing pad in the cleanup phase, and the unwinder
calls it for those frames.
2026-10-04 05:32:55 +13:00
Pouare514 92f3cb3916 fix(libc): return NULL with ENOENT for missing files in fopen 2026-10-02 22:41:57 +02:00
Pouare514 1c724c0228 feat(libs): Cyberpunk 2077 loading support (REDGalaxy + stubs)
# Conflicts:
#	core/libs/prx/libSceContentExport/Export.cpp
#	core/libs/prx/libScePlayGoDialog/Export.cpp
2026-10-02 23:14:04 +03:00
boykopovar 74bdce6f04 Merge pull request #232 from MichonGoddijn231849/fix/guest-read-destination
fix(libkernel): read, pread, AIO and APR write into guest memory as host writes
2026-10-02 22:19:46 +03:00
boykopovar 7db340de2b Merge pull request #231 from MichonGoddijn231849/fix/guest-arena-reserve
fix(libc): reserve the guest arena at its fixed range around what Windows already placed in it
2026-10-02 22:15:26 +03:00
boykopovar 313de1c5a3 Merge pull request #289 from SP4C3B4R-8/feat/missing-exports
feat(libs): declare missing AudioPropagation, AudioIn, NpSessionSignaling and dialog exports
2026-10-02 16:51:14 +03:00
RomainROCH 99fbcf0377 fix(libc): propagate file position errors 2026-10-02 06:15:14 +02:00
SP4C3B4R-8andClaude Opus 5.5 f2deb00fa4 feat(libs): declare missing AudioPropagation, AudioIn, NpSessionSignaling and dialog exports
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bn7CrhG7pTPR6DT13tN6Me
2026-10-01 23:44:31 +02:00
SP4C3B4R-8andClaude Opus 5.5 3fc3b993da feat(libkernel): honour non-fixed mapping address hints on Windows
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Bn7CrhG7pTPR6DT13tN6Me
2026-10-01 23:44:30 +02:00
RomainROCH 8f76c0a57f fix(libc): release aligned allocations through the application heap 2026-10-01 22:43:44 +02:00
MichonandClaude Opus 5.5 676bbea348 fix(libkernel): read, pread, AIO and APR write into guest memory as host writes
A file read into guest memory is a host write: before the I/O it pins the shared pages it
covers, which reopens any page armed for write tracking and keeps write tracking from arming
it again until the read ends, when the pages count as written. A destination the guest cannot
write fails with EFAULT before any I/O; read and pread throw as for any failed read, AIO
reports SCE_KERNEL_ERROR_EFAULT, and APR throws. APR also throws when a read ends before the
requested size.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 18:56:36 +02:00
MichonandClaude Opus 5.5 17eefbbbd9 fix(libc): reserve the guest arena at its fixed range around what Windows already placed in it
The arena is always [0x200000000, 0x7200000000). Every free, allocation-granularity-aligned
piece of the range is reserved as a placeholder; what lies between the pieces (thread stacks
and other reservations Windows made before libc starts, unaligned slivers) and the
system-reserved range are holes, used ranges a release never frees. A failed query or
reservation of the range throws.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-01 18:50:15 +02:00
SamG-Coder 4e2b200a91 fix(libc): invoke guest exit callbacks with the SysV ABI 2026-10-01 12:00:49 +03:00
SamG-Coder d9d34a47ac fix(libc): translate guest scanning and wide formatting arguments 2026-10-01 12:00:41 +03:00
SamG-Coder 3a651055bb feat(libc): support C locale wide stream input 2026-10-01 11:59:11 +03:00
SamG-Coder 7f834fc415 feat(libc): add C locale conversion and sample runtime exports 2026-10-01 11:58:51 +03:00
asimplestray b42db4b6f3 feat(libc): implement RaiseEv, catchReturnFromMain and reallocalign 2026-09-30 23:55:00 +00:00
boykopovar 7b767489f3 Merge pull request #172 from STL1te/fix/savedata-params
fix(savedata): the native module keeps save directory params and moun…
2026-09-30 21:46:55 +03:00
boykopovar 6756edb91f Merge pull request #164 from MichonGoddijn231849/fix/munmap-across-mappings
fix(libkernel): unmap ranges that span several mappings
2026-09-30 20:55:43 +03:00