summaryrefslogtreecommitdiff
path: root/src/libk
diff options
context:
space:
mode:
authordzwdz2024-08-02 01:20:40 +0200
committerdzwdz2024-08-02 01:20:40 +0200
commite818cab3f1fc4a3d4d0b8e2c9424fb2e7b1dff70 (patch)
tree5d59d2e0ea74253f5b265cdd542b74daca6dce5a /src/libk
parent1890868af4b8cf2593a4b0831e2fc69a44ec680b (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.h11
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 */
};