From 14538777ff7645d51d27a239739c5335180ae947 Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Tue, 15 Apr 2025 22:49:12 -0400 Subject: public cpu_print_regs fn --- kernel/include/comus/cpu.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'kernel/include') diff --git a/kernel/include/comus/cpu.h b/kernel/include/comus/cpu.h index c49fb45..9909a57 100644 --- a/kernel/include/comus/cpu.h +++ b/kernel/include/comus/cpu.h @@ -11,7 +11,7 @@ #include -typedef union { +union cpu_rflags { uint64_t raw; struct { uint64_t cf : 1; @@ -37,9 +37,9 @@ typedef union { uint64_t id : 1; uint64_t : 42; }; -} rflags_t; +}; -typedef struct { +struct cpu_regs { // registers uint64_t r15; uint64_t r14; @@ -61,16 +61,21 @@ typedef struct { // code segment uint64_t cs; // rflags - rflags_t rflags; + union cpu_rflags rflags; // stack pointer uint64_t rsp; // stack segment uint64_t ss; -} regs_t; +}; /** * Initalize current cpu */ void cpu_init(void); +/** + * Dump registers to output + */ +void cpu_print_regs(struct cpu_regs *regs); + #endif /* cpu.h */ -- cgit v1.2.3-freya