Skip to main content
Print

PSP 32-bit Results, Errors, and Signedness at ABI Boundaries

Type: REFERENCE   Status: MAINTAINED   Scope: 32-bit PSP return values, named errors, signed host interpretation, register/output separation, and bounded normalization evidence.   Last reviewed: 2026-08-11

At a PSP ABI boundary, a result is first a 32-bit bit pattern. Whether a host language prints it as signed decimal, unsigned hexadecimal, or a larger integer is a presentation choice that must not change guest behavior. Return registers, output pointers, and latched object status are separate channels.

Public types and named errors

PSPSDK’s exact pspiofilemgr.h source defines SceInt64, SceSize, and SceUID widths used by file APIs. The pspthreadman.h reference lists named thread statuses and error-bearing APIs. These declarations are the right citation for ABI width and operation shape; they do not license a generic error conversion layer.

guest operation -> raw 32-bit result register<br>             -> API-specific output pointers (separate spans)<br>             -> named PSP interpretation at the boundary<br>host log: 0x800200D2 and signed -2147352366 are the same bits<br>policy: preserve bits first; classify only with the API contract
Source-owned ABI presentation model. Hex and signed decimal are two views of one guest-width value.

Do not overgeneralize one measured seam

The existing WaitThreadEnd signed-negative intermediate status page records a bounded hardware observation in which a particular outer join path normalized signed-negative intermediate statuses to a PSP illegal-argument result while positive statuses propagated. That is valuable evidence, but it is not proof that every thread exit API, every negative value, or every kernel object uses the same rule.

Keep at least these fields distinct: syscall return, target thread’s latched exit status, an intermediate wait result, a status-query field, and a termination/deletion status. The ThreadMan reference above shows why collapsing them into one “thread result” field is dangerous.

Safe conversion pattern

Use explicit guest-width helpers: read/write 32-bit values with checked spans, preserve the raw bit pattern, and apply signed interpretation only where the API defines it. Never map all negative results to host errno, exceptions, or one generic PSP error. A failed pointer write is also a distinct guest-visible failure and must be rejected before partial side effects.

Nakagawa’s runtime boundary is anchored in the current hle.c and shared recomp.h ABI definitions. These citations identify the code that must preserve guest-width state; they are not a claim that every NID has identical semantics.

Regression matrix

For each API under test, cover zero, positive, ordinary negative, named PSP error, high-bit error, and output-pointer failure controls. Assert raw guest bits, signed interpretation, output bytes, object state, and wake behavior independently. Report model, firmware/CFW, controls, repetition, and the exact tested path; do not publish private PRX/traces or infer a universal rule from a single result.

Sources

Table of Contents