From e818cab3f1fc4a3d4d0b8e2c9424fb2e7b1dff70 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Fri, 2 Aug 2024 01:20:40 +0200 Subject: *: use a generic UserRegs type everywhere I'm storing registers mostly inspired by Plan 9's Ureg, probably obvious from the name --- src/libk/include/camellia/types.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/libk') 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 */ }; -- cgit v1.2.3