Expand description
Capsule for testing syscall return variants from userspace.
Each command returns a specific [CommandReturn] variant with distinct,
known values so userspace tests can verify correct encoding and decoding
of every return type.
The capsule also supports subscribe, allow read-only, allow read-write, and allow userspace-readable syscalls with subscribe_num/allow_num 0. This lets userspace tests verify that success and failure returns carry back the expected pointer and length values.
For allow calls, pass a valid buffer (within app memory) for a success return and an invalid pointer (e.g. 0x90) for a failure return. For subscribe, pass a valid function pointer for success and an invalid one (e.g. 0x90) for failure.
§Command numbers
- 0: Success (driver presence check)
- 1: Failure(ErrorCode::FAIL)
- 2: FailureU32(ErrorCode::BUSY, 0x20000001)
- 3: FailureU32U32(ErrorCode::NOMEM, 0x30000001, 0x30000002)
- 4: FailureU64(ErrorCode::INVAL, 0x4000000000000001)
- 5: Success
- 6: SuccessU32(0x60000001)
- 7: SuccessU32U32(0x70000001, 0x70000002)
- 8: SuccessU64(0x8000000000000001)
- 9: SuccessU32U32U32(0x90000001, 0x90000002, 0x90000003)
- 10: SuccessU32U64(0xA0000001, 0xA000000000000002)
Structs§
- App
- Per-process grant data. Holds the userspace-readable buffer swapped in via
allow_userspace_readable. - Syscall
Return Test