[SMP] Boot Application Processors

This commit is contained in:
2016-11-23 16:16:33 +01:00
parent f356cc8f95
commit 6a2bef5517
4 changed files with 193 additions and 0 deletions

View File

@@ -2,7 +2,17 @@
#define MAX_NUMCPU 64
#define CPU_STOPPED 0
#define CPU_SIPI_SENT 1
#define CPU_SIPI_REC 2
#define CPU_STARTED 3
#define CPU_FAILED 4
#define TRAMPOLINE_ADDR 0x1000
#define GS_OFFSET_CPU 0
#define GS_OFFSET_STATE 40
#define GS_OFFSET_STACK 48
#ifndef __ASSEMBLER__
#include <stdint.h>
@@ -17,6 +27,8 @@ typedef struct cpu_t
uint64_t apic_id;
uint64_t apic_ticks_per_us;
uint64_t is_bsp;
uint64_t current_state; // 40
void *kernel_stack; // 48
thread_t *current_thread;
thread_t *last_thread;
process_t *current_process;
@@ -31,7 +43,11 @@ extern unsigned int num_cpu;
void acpi_init();
void cpu_add(uint64_t id, uint64_t apic);
void cpu_init();
void init_cpu();
cpu_t *get_cpu();
void ap_init(cpu_t *cpu);
void trampoline();
#endif