feat(libc): add GuestPtr guest-pointer copies with fault tests #19266
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19266"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Ethan-Hainline on 2026-11-13T00:52:32Z.
What
GuestPtr<T>andGuestBytesfor guest pointer parameters, using the internal-use shape accepted in #19123.GuestPtr<T>copies a value or an array throughGuestCopyIn_nid_no_patch/GuestCopyOut_nid_no_patch, returnsfalseon a fault, and lets the export decide the answer. Theconstform cannotCopyOut.falseto an EFAULT-style error therefore accepts a valid empty array.GuestBytesdoes the same for a raw byte range (the event and status buffers in the conversion).No production code uses it in this PR. The
libSceVideoOutconversion and its test follow separately.Tested
Windows 11 Pro, Ryzen 5 7530U, AMD Radeon Vega 8, MinGW-w64 GCC 16.2, CMake/Ninja, Release,
BUILD_TESTING=ON.guest_ptr_testsbuilds andctest -R '^guest_ptr$'passes.1,~0xfffand null; the const form cannot write; and the array-size overflow guard.python tools/check_conventions.py --base upstream/main --head HEADpasses.Not tested: Linux and macOS; the CI jobs will run them.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)