Move SMP and other arch specific stuff into arch specific folders
This commit is contained in:
parent
7706e629c6
commit
2213707c6a
5 changed files with 180 additions and 1 deletions
|
|
@ -1,26 +0,0 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <scheduler/sched.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#define GSBASE 0xC0000101
|
||||
#define KERNELGSBASE 0xC0000102
|
||||
|
||||
typedef struct cpu_state {
|
||||
uint32_t lapic_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_cpu_struct();
|
||||
uint64_t get_cpu_count();
|
||||
bool get_cpu_struct_initialized();
|
||||
|
||||
12
include/arch/amd64/io.h
Normal file
12
include/arch/amd64/io.h
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <stdint.h>
|
||||
|
||||
void outb(uint16_t port, uint8_t val);
|
||||
void outw(uint16_t port, uint16_t val);
|
||||
void outl(uint16_t port, uint32_t val);
|
||||
|
||||
uint8_t inb(uint16_t port);
|
||||
uint16_t inw(uint16_t port);
|
||||
uint32_t inl(uint16_t port);
|
||||
|
||||
void wrmsr(uint64_t msr, uint64_t value);
|
||||
uint64_t rdmsr(uint64_t msr);
|
||||
Loading…
Add table
Add a link
Reference in a new issue