kernel: don't use typedef for enums or non-opaque structs
This commit is contained in:
@@ -10,7 +10,7 @@ namespace arch::acpi {
|
||||
uint32_t *io_base = nullptr;
|
||||
unsigned int io_first_irq = 0;
|
||||
unsigned int io_nr_irq = 0;
|
||||
queue_entry_t io_entry;
|
||||
struct queue_entry io_entry;
|
||||
|
||||
struct irq_entry {
|
||||
uint64_t irq_vec : 8;
|
||||
|
||||
@@ -11,7 +11,7 @@ extern "C" {
|
||||
|
||||
#define NR_IDT_ENTRIES 48
|
||||
|
||||
typedef enum irq_vector {
|
||||
enum irq_vector {
|
||||
IRQ0 = 32,
|
||||
IRQ1,
|
||||
IRQ2,
|
||||
@@ -28,12 +28,12 @@ typedef enum irq_vector {
|
||||
IRQ13,
|
||||
IRQ14,
|
||||
IRQ15,
|
||||
} irq_vector_t;
|
||||
};
|
||||
|
||||
typedef struct irq_hook {
|
||||
queue_entry_t irq_entry;
|
||||
struct irq_hook {
|
||||
struct queue_entry irq_entry;
|
||||
int (*irq_callback)(void);
|
||||
} irq_hook_t;
|
||||
};
|
||||
|
||||
struct cpu_context {
|
||||
uint64_t r15, r14, r13, r12, r11, r10, r9, r8;
|
||||
@@ -69,8 +69,8 @@ typedef void (*int_hook)(struct cpu_context *);
|
||||
extern int idt_init(struct idt_ptr *idtp);
|
||||
extern int idt_load(struct idt_ptr *idtp);
|
||||
|
||||
extern void hook_irq(irq_vector_t vec, irq_hook_t *hook);
|
||||
extern void unhook_irq(irq_vector_t vec, irq_hook_t *hook);
|
||||
extern void hook_irq(enum irq_vector vec, struct irq_hook *hook);
|
||||
extern void unhook_irq(enum irq_vector vec, struct irq_hook *hook);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -19,37 +19,37 @@ extern "C" {
|
||||
typedef phys_addr_t pml4t_ptr_t;
|
||||
typedef uint64_t pte_t;
|
||||
|
||||
typedef struct pml4t {
|
||||
struct pml4t {
|
||||
phys_addr_t p_entries[512];
|
||||
} __packed pml4t_t;
|
||||
} __packed;
|
||||
|
||||
typedef struct pdpt {
|
||||
struct pdpt {
|
||||
union {
|
||||
/* 4KiB and 2MiB pages */
|
||||
phys_addr_t p_entries[512];
|
||||
/* 1GiB pages */
|
||||
pte_t p_pages[512];
|
||||
};
|
||||
} __packed pdpt_t;
|
||||
} __packed;
|
||||
|
||||
typedef struct pdir {
|
||||
struct pdir {
|
||||
union {
|
||||
/* 4KiB pages */
|
||||
phys_addr_t p_entries[512];
|
||||
/* 2MiB pages */
|
||||
pte_t p_pages[512];
|
||||
};
|
||||
} __packed pdir_t;
|
||||
} __packed;
|
||||
|
||||
typedef struct ptab {
|
||||
struct ptab {
|
||||
pte_t p_pages[512];
|
||||
} __packed ptab_t;
|
||||
} __packed;
|
||||
|
||||
typedef enum page_size {
|
||||
enum page_size {
|
||||
PS_4K,
|
||||
PS_2M,
|
||||
PS_1G,
|
||||
} page_size_t;
|
||||
};
|
||||
|
||||
/* returns 1 if gigabyte pages are supported by the CPU, 0 otherwise.
|
||||
defined in pmap_ctrl.S */
|
||||
|
||||
Reference in New Issue
Block a user