summaryrefslogtreecommitdiff
path: root/kernel/include
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-04-15 22:49:12 -0400
committerFreya Murphy <freya@freyacat.org>2025-04-15 22:49:12 -0400
commit14538777ff7645d51d27a239739c5335180ae947 (patch)
treec17ebbe980aef026118afcbf9ed328e1b099b8fe /kernel/include
parentexpand memory manager work with userspace (more then one ctx) (diff)
downloadcomus-14538777ff7645d51d27a239739c5335180ae947.tar.gz
comus-14538777ff7645d51d27a239739c5335180ae947.tar.bz2
comus-14538777ff7645d51d27a239739c5335180ae947.zip
public cpu_print_regs fn
Diffstat (limited to 'kernel/include')
-rw-r--r--kernel/include/comus/cpu.h15
1 files changed, 10 insertions, 5 deletions
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 <stdint.h>
-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 */