mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-10 01:28:44 +02:00
feat(libkernel): report no write throttling in sceKernelWriteThrottlingStatus
The host has no SSD write budget, so the status reports the largest budget in its first qword and zeroes the rest.
This commit is contained in:
@@ -405,6 +405,15 @@ int APS5_VABI sceKernelFsync(int fd) {
|
||||
#endif
|
||||
}
|
||||
|
||||
int APS5_VABI sceKernelWriteThrottlingStatus(std::uint64_t* status) {
|
||||
if (status == nullptr) throw std::invalid_argument("sceKernelWriteThrottlingStatus: status is null");
|
||||
status[0] = std::numeric_limits<std::uint32_t>::max();
|
||||
status[1] = 0;
|
||||
status[2] = 0;
|
||||
status[3] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
int APS5_VABI sceKernelGetdirentries(int fd, char* buf, int nbytes, int64_t* basep) {
|
||||
|
||||
@@ -20,6 +20,7 @@ int APS5_VABI fchmod_nid_postfix(int, int);
|
||||
int APS5_VABI futimes_nid_postfix(int, const KernelTimeval*);
|
||||
int APS5_VABI socket_nid_postfix(int, int, int);
|
||||
int APS5_VABI sceKernelFsync(int);
|
||||
int APS5_VABI sceKernelWriteThrottlingStatus(std::uint64_t*);
|
||||
int APS5_VABI sceKernelFtruncate(int, long long);
|
||||
int APS5_VABI sceKernelTruncate_nid_postfix(const char*, long long);
|
||||
int APS5_VABI sceKernelUtimes_nid_postfix(const char*, const void*);
|
||||
@@ -49,6 +50,9 @@ static void Check(bool value, int line) {
|
||||
#define Require(value) Check((value), __LINE__)
|
||||
int main() {
|
||||
Require(sceKernelDebugOutText(-1, "text") == static_cast<int>(0x80020016u));
|
||||
std::uint64_t throttling[4] = {1, 2, 3, 4};
|
||||
Require(sceKernelWriteThrottlingStatus(throttling) == 0);
|
||||
Require(throttling[0] == 0xffffffffu && throttling[1] == 0 && throttling[2] == 0 && throttling[3] == 0);
|
||||
Require(sceKernelDebugOutText(0, nullptr) == static_cast<int>(0x8002000eu));
|
||||
auto* captured = std::tmpfile();
|
||||
Require(captured != nullptr);
|
||||
|
||||
@@ -228,6 +228,7 @@ Throughout the project, every function at every stage either **does exactly what
|
||||
### Functional
|
||||
|
||||
- [libSceHttp2 asynchronous requests](../../core/libs/prx/libSceHttp2/Export.cpp) (libSceHttp2) never reach the network: `sceHttp2SendRequestAsync` accepts the request, queues a completion whose result is the library's network error and triggers the user event named by the kqueue option (equeue at offset 0, event id at 8, user data at 16, layout inferred from PPSA17221); `sceHttp2WaitAsync` returns that completion. The completion's `event_type` value is unknown and left 0. PPSA17221 completes its request object only after `sceHttp2SendRequestAsync` returns, and its handler for a synchronous failure calls `shared_from_this` before that, so a send must not fail synchronously. A kqueue option or user event that is missing, an extra option, and a wait with no completed operation throw
|
||||
- [sceKernelWriteThrottlingStatus](../../core/libs/prx/libkernel/File/src/Stdio.cpp) (libkernel) reports no write throttling: the host SSD has no write budget, so the first qword of the 32-byte status (the remaining write budget in 64 KiB units, inferred from PPSA17221) is set to `UINT32_MAX` and the rest is zeroed. The meaning of the other three qwords is unknown
|
||||
- [sceNetSendmsg and sceNetRecvmsg](../../core/libs/prx/libSceNet/Export.cpp) (libSceNet) copy the scatter/gather list through one host buffer and accept only the flags `sceNetSend`/`sceNetRecv` accept. Sending control data throws; a receive never returns control data (`msg_controllen` 0), since no socket option that queues it is supported
|
||||
- [Additional content](../../core/libs/prx/libSceAppContent/Export.cpp) (libSceAppContent) is not installed or mounted: `sceAppContentAddcontMount` answers `NOT_FOUND` for every entitlement label and `sceAppContentAddcontUnmount` for every mount point, as no add-content mount is ever handed out; `sceAppContentGetAddcontInfo` answers `DRM_NO_ENTITLEMENT` for every label and `sceAppContentGetAddcontInfoList` reports 0 entries
|
||||
- [sceKernelInstallExceptionHandler](../../core/libs/prx/libkernel/System/src/Exception.cpp) records the handler, but a host fault still ends the process: only signals raised with `sceKernelRaiseException` are delivered. Unity's PS5Util module installs a SIGUSR1 handler that reads `uc_mcontext.mc_rsp` (offset 0xf8 of the context) and raises SIGUSR1 on other threads to stop them for garbage collection
|
||||
|
||||
Reference in New Issue
Block a user