x86_64: rename struct cpu_context; move to machine/cpu.h

This commit is contained in:
2026-02-08 11:32:09 +00:00
parent c04b33647c
commit 564d4f9ba0
5 changed files with 23 additions and 21 deletions

View File

@@ -11,6 +11,8 @@ extern "C" {
#define NR_IDT_ENTRIES 256
struct ml_cpu_context;
enum irq_vector {
IRQ0 = 32,
IRQ1,
@@ -35,13 +37,6 @@ struct irq_hook {
int (*irq_callback)(void);
};
struct cpu_context {
uint64_t r15, r14, r13, r12, r11, r10, r9, r8;
uint64_t rdi, rsi, rbp, unused_rsp, rbx, rdx, rcx, rax;
uint64_t int_no, err_no;
uint64_t rip, cs, rflags, rsp, ss;
} __packed;
struct idt_entry {
uint16_t base_low;
uint16_t selector;
@@ -64,7 +59,7 @@ struct idt_ptr {
uintptr_t i_base;
} __packed;
typedef void (*int_hook)(struct cpu_context *);
typedef void (*int_hook)(struct ml_cpu_context *);
extern int idt_init(struct idt_ptr *idtp);
extern int idt_load(struct idt_ptr *idtp);