Author: tkreuzer Date: Mon Oct 19 18:19:29 2009 New Revision: 43605
URL: http://svn.reactos.org/svn/reactos?rev=43605&view=rev Log: [FREELDR] - include the intrinsics from the kernel - set segement selectors
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/arch/amd64/amd64.h [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -58,13 +58,6 @@ HARDWARE_PTE Pde[512]; } PAGE_DIRECTORY_AMD64, *PPAGE_DIRECTORY_AMD64;
-VOID -FORCEINLINE -__lgdt(void *gdt) -{ - asm volatile ("lgdt %0\n" : : "m"(*(short*)gdt)); -} - PKGDTENTRY64 FORCEINLINE KiGetGdtEntry(PVOID pGdt, USHORT Index)
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/include/freeldr.h [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -86,6 +86,7 @@ #elif defined(_M_AMD64) #include <arch/amd64/hardware.h> #include <arch/amd64/machpc.h> +#include <internal/amd64/intrin_i.h> #endif /* misc files */ #include <keycodes.h>
Modified: branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/boot/f... ============================================================================== --- branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] (original) +++ branches/ros-amd64-bringup/reactos/boot/freeldr/freeldr/windows/amd64/wlmemory.c [iso-8859-1] Mon Oct 19 18:19:29 2009 @@ -341,8 +341,20 @@
WinLdrSetupIdt((PVOID)((ULONG64)GdtIdt + 2048)); // HACK!
+ /* LDT is unused */ + __lldt(0); + + /* Load selectors for DS/ES/FS/GS/SS */ + Ke386SetDs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetEs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetFs(KGDT_32_R3_TEB | RPL_MASK); // 0x53 + Ke386SetGs(KGDT_64_DATA | RPL_MASK); // 0x2b + Ke386SetSs(KGDT_64_R0_SS); // 0x18 + + // Load TSR + Ke386SetTr(KGDT_TSS); + DPRINTM(DPRINT_WINDOWS, "leave WinLdrSetProcessorContext\n"); - }
VOID