kernel: implement cpu IDs and per-cpu variables
This commit is contained in:
@@ -4,11 +4,16 @@
|
||||
#include <arch/gdt.h>
|
||||
#include <arch/irq.h>
|
||||
|
||||
#define ml_cpu_block_get_id(p) ((p)->c_cpu_id)
|
||||
|
||||
typedef struct ml_cpu_block {
|
||||
struct ml_cpu_block *c_this;
|
||||
|
||||
struct gdt c_gdt;
|
||||
struct gdt_ptr c_gdt_ptr;
|
||||
|
||||
struct idt_ptr c_idt_ptr;
|
||||
unsigned int c_cpu_id;
|
||||
} ml_cpu_block;
|
||||
|
||||
extern int ml_init_bootcpu(void);
|
||||
@@ -18,5 +23,6 @@ extern int ml_cpu_block_use(ml_cpu_block *p);
|
||||
|
||||
/* defined in cpu_ctrl.S */
|
||||
extern void ml_halt_cpu(void);
|
||||
extern ml_cpu_block *ml_this_cpu(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user