First Hello world syscall
All checks were successful
Build documentation / build-and-deploy (push) Successful in 26s
All checks were successful
Build documentation / build-and-deploy (push) Successful in 26s
This commit is contained in:
@@ -10,6 +10,15 @@
|
||||
#define CPUS_MAX 32
|
||||
|
||||
struct cpu {
|
||||
/* for syscall instruction */
|
||||
uintptr_t syscall_user_stack;
|
||||
uintptr_t syscall_kernel_stack;
|
||||
volatile uint8_t kernel_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t except_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t irq_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile struct gdt_extended gdt ALIGNED (16);
|
||||
volatile struct tss tss;
|
||||
|
||||
uint64_t lapic_ticks;
|
||||
uint32_t id;
|
||||
|
||||
@@ -18,25 +27,16 @@ struct cpu {
|
||||
atomic_int nesting;
|
||||
} irq_ctx;
|
||||
|
||||
uint8_t user_stack[USTACK_SIZE] ALIGNED (16);
|
||||
|
||||
volatile uint8_t kernel_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t except_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile uint8_t irq_stack[KSTACK_SIZE] ALIGNED (16);
|
||||
volatile struct gdt_extended gdt ALIGNED (16);
|
||||
volatile struct tss tss;
|
||||
|
||||
spin_lock_t lock;
|
||||
|
||||
struct proc* proc_run_q;
|
||||
struct proc* proc_current;
|
||||
};
|
||||
} PACKED;
|
||||
|
||||
struct cpu* cpu_make (void);
|
||||
struct cpu* cpu_get (uint32_t id);
|
||||
void cpu_assign (uint32_t id);
|
||||
uint32_t cpu_id (void);
|
||||
struct cpu* cpu_get (void);
|
||||
void amd64_thiscpu_set_init (void);
|
||||
|
||||
#define thiscpu (cpu_get (cpu_id ()))
|
||||
#define thiscpu (cpu_get ())
|
||||
|
||||
#endif // _KERNEL_AMD64_SMP_H
|
||||
|
||||
Reference in New Issue
Block a user