x86_64 cpu: find topology

This commit is contained in:
Matheus
2024-09-24 23:08:58 -03:00
parent ff6635487e
commit 0585eff9a2
2 changed files with 189 additions and 12 deletions
+27 -11
View File
@@ -16,28 +16,44 @@
#define ARCH_EOI arch_apic_eoi
typedef struct cpu_t {
thread_t *thread;
struct cpu_t *self;
vmmcontext_t *vmmctx;
// expected to be exposed to the rest of the kernel
thread_t *thread; // expected to be here by other code
struct cpu_t *self; // expected to be here by other code
vmmcontext_t *vmmctx; // expected to be here by other code
long id;
uint64_t gdt[7];
ist_t ist;
isr_t isr[MAX_ISR_COUNT];
int acpiid;
timer_t *timer;
bool intstatus;
long ipl;
thread_t *idlethread;
timerentry_t schedtimerentry;
void *schedulerstack;
isr_t *isrqueue;
timer_t *timer;
isr_t *dpcisr;
dpc_t *dpcqueue;
thread_t *idlethread;
timerentry_t schedtimerentry;
void *schedulerstack;
dpc_t reschedule_dpc;
isr_t *reschedule_isr;
// architecture specific, does not need to be exposed
uint64_t gdt[7];
char vendor[13];
ist_t ist;
int acpiid;
uint32_t cpuid_max;
int topology_thread;
int topology_core;
int topology_package;
} cpu_t;
#define CPU_HALT() asm volatile("hlt")