28 lines
618 B
C
28 lines
618 B
C
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <scheduler/sched.h>
|
|
|
|
#pragma once
|
|
|
|
#define GSBASE 0xC0000101
|
|
#define KERNELGSBASE 0xC0000102
|
|
|
|
typedef struct cpu_state {
|
|
uint32_t id;
|
|
uint64_t lapic_timer_ticks;
|
|
struct thread *head;
|
|
struct thread *base;
|
|
struct thread *current_process;
|
|
uint16_t process_count;
|
|
struct context *scheduler_context;
|
|
uint64_t *scheduler_stack;
|
|
bool scheduler_initialized;
|
|
}cpu_state;
|
|
|
|
void smp_init();
|
|
cpu_state *get_current_cpu_state();
|
|
cpu_state *get_cpu_state(int);
|
|
uint64_t get_cpu_count();
|
|
void bsp_early_init();
|
|
bool get_cpu_struct_initialized();
|
|
|