diff options
author | dzwdz | 2024-08-02 01:20:40 +0200 |
---|---|---|
committer | dzwdz | 2024-08-02 01:20:40 +0200 |
commit | e818cab3f1fc4a3d4d0b8e2c9424fb2e7b1dff70 (patch) | |
tree | 5d59d2e0ea74253f5b265cdd542b74daca6dce5a /src/libk | |
parent | 1890868af4b8cf2593a4b0831e2fc69a44ec680b (diff) |
*: use a generic UserRegs type everywhere I'm storing registers
mostly inspired by Plan 9's Ureg, probably obvious from the name
Diffstat (limited to 'src/libk')
-rw-r--r-- | src/libk/include/camellia/types.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/libk/include/camellia/types.h b/src/libk/include/camellia/types.h index 6fee578..0790db3 100644 --- a/src/libk/include/camellia/types.h +++ b/src/libk/include/camellia/types.h @@ -32,15 +32,16 @@ struct ufs_request { int flags; }; -struct intr_data { - /* same order as CpuRegs. - * notable omissions: - * - SSE registers (usually there's no need to save them, userland can do - * that itself if it wants) */ +typedef struct UserRegs UserRegs; +struct UserRegs { uint64_t r15, r14, r13, r12, r11, r10, r9, r8; uint64_t rdi, rsi, rbp, rsp, rbx, rdx, rcx, rax; uint64_t rip, flags; +}; +_Static_assert(sizeof(UserRegs) == 8 * 18); /* for asm */ +struct intr_data { + UserRegs reg; char msg[]; /* variable size, NUL terminated */ }; |