diff options
| author | Davee | 2018-10-28 16:33:11 +0000 |
|---|---|---|
| committer | Davee | 2018-10-28 16:39:30 +0000 |
| commit | a1c5ac3005c9d083b00826b7e8129fcd98e862d8 (patch) | |
| tree | 93e4c69c36a726597aae6d7c8666f5ba873166b4 /include/kernel | |
| parent | correct spelling error in documentation (diff) | |
| download | vds-libraries-a1c5ac3005c9d083b00826b7e8129fcd98e862d8.tar.gz | |
add ksceKernelGetThreadCpuRegisters
This function is used to get the state of the registers for a SUSPENDED thread. It returns the registers in a two part structure. It's uncertian what the difference is between the two parts. It seems like its a user/kernel separation, but it's uncertain. It could also be a current/exception difference, but it is unconvincing. In normal usage on a suspended thread it seems to be the user aspect that contains valid values. When you query a suspended thread that has no had the opportunity to start yet, the kernel side is filled.
Diffstat (limited to '')
| -rw-r--r-- | include/kernel/kernel/threadmgr.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/include/kernel/kernel/threadmgr.h b/include/kernel/kernel/threadmgr.h index f0e45fc..f5ab960 100644 --- a/include/kernel/kernel/threadmgr.h +++ b/include/kernel/kernel/threadmgr.h @@ -855,6 +855,52 @@ int sceKernelEnqueueWorkQueue(SceUID uid, const char *name, SceKernelWorkQueueWo */ int sceKernelGetThreadIdList(SceUID pid, SceUID *ids, int n, int *copy_count); +/** Structure representing all ARM registers */ +typedef struct ArmCpuRegisters +{ + uint32_t r0; + uint32_t r1; + uint32_t r2; + uint32_t r3; + uint32_t r4; + uint32_t r5; + uint32_t r6; + uint32_t r7; + uint32_t r8; + uint32_t r9; + uint32_t r10; + uint32_t r11; + uint32_t r12; + uint32_t sp; + uint32_t lr; + uint32_t pc; + uint32_t cpsr; + uint32_t unk; +} ArmCpuRegisters; + +/** Structure containing a threads register states. */ +typedef struct ThreadCpuRegisters +{ + /** Set of registers used for user mode. */ + ArmCpuRegisters user; + + /** Set of registers used for kernel mode. */ + ArmCpuRegisters kernel; +} ThreadCpuRegisters; + +/** + * @brief Query the state of the registers for a suspended thread. + * + * The registers returned are the user/kernel set for the requested thread. + * It's not certain that user/kernel is correct representation, instead it could be current/exception. + * The thread provided must be suspended for this function to succeed. + * + * @param[in] thid The thread to query. + * @param[out] registers The set of registers belonging to the thread. + * @return Zero on success, else < 0 on error. + */ +int sceKernelGetThreadCpuRegisters(SceUID thid, ThreadCpuRegisters *registers); + #ifdef __cplusplus } #endif |
