Author: tkreuzer Date: Sun Sep 21 14:05:48 2008 New Revision: 36388
URL: http://svn.reactos.org/svn/reactos?rev=36388&view=rev Log: implement SetInterruptGate for amd64 and fix APIC_DEFAULT_BASE
Modified: branches/ros-amd64-bringup/reactos/hal/halx86/include/apic.h branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c
Modified: branches/ros-amd64-bringup/reactos/hal/halx86/include/apic.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/ha... ============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/include/apic.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/include/apic.h [iso-8859-1] Sun Sep 21 14:05:48 2008 @@ -5,7 +5,11 @@ #ifndef __INTERNAL_HAL_APIC_H #define __INTERNAL_HAL_APIC_H
+#ifdef _M_AMD64 +#define APIC_DEFAULT_BASE 0xfffffffffee00000ULL; +#else #define APIC_DEFAULT_BASE 0xFEE00000 /* Default Local APIC Base Register Address */ +#endif
/* APIC Register Address Map */ #define APIC_ID 0x0020 /* Local APIC ID Register (R/W) */
Modified: branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/hal/ha... ============================================================================== --- branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/hal/halx86/mp/apic.c [iso-8859-1] Sun Sep 21 14:05:48 2008 @@ -916,7 +916,21 @@ SetInterruptGate(ULONG index, ULONG_PTR address) { #ifdef _M_AMD64 -UNIMPLEMENTED; + KIDTENTRY64 *idt; + + idt = &KeGetPcr()->IdtBase[index]; + + idt->OffsetLow = address & 0xffff; + idt->Selector = KGDT_64_R0_CODE; + idt->IstIndex = 0; + idt->Reserved0 = 0; + idt->Type = 0x0e; + idt->Dpl = 0; + idt->Present = 1; + idt->OffsetMiddle = (address >> 16) & 0xffff; + idt->OffsetHigh = address >> 32; + idt->Reserved1 = 0; + idt->Alignment = 0; #else KIDTENTRY *idt; KIDT_ACCESS Access; @@ -960,7 +974,7 @@ #ifdef CONFIG_SMP SetInterruptGate(IPI_VECTOR, (ULONG_PTR)MpsIpiInterrupt); #endif - DPRINT("APIC is mapped at 0x%X\n", APICBase); + DPRINT1("APIC is mapped at 0x%p\n", (PVOID)APICBase);
if (VerifyLocalAPIC()) { @@ -968,7 +982,7 @@ } else { - DPRINT("No APIC found\n"); + DPRINT1("No APIC found\n"); ASSERT(FALSE); }