BarryServer : Git

All the code for all my projects
// BarryServer : Git / Nucleus / blob / 232d0f9e7dd31316a9b91cbdfec0174afce40c7e / include / nucleus / cpu.h

// Related

Nucleus

Barry ACPI + APIC 232d0f9 (3 years, 3 months ago)
#ifndef _NUCLEUS_CPU_H
#define _NUCLEUS_CPU_H

/* Structure for an Interrupt Frame */
struct InterruptFrame {
	uint32_t eip, cs, eflags;
};

extern uintptr_t lapicPtr, ioapicPtr;
#define LAPIC(off)  (*((uint32_t *) ((uint32_t)  lapicPtr + (off))))
#define IOAPIC(off) (*((uint32_t *) ((uint32_t) ioapicPtr + (off))))

extern uint8_t lapicNums[];
#define CPUID lapicNums[(uint8_t) (LAPIC(0x20) >> 24)]
#define MAX_CPUS 2

#endif