Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygenpatpge.c
Go to the documentation of this file.
00001 /* 00002 * PROJECT: ReactOS Kernel 00003 * LICENSE: GPL - See COPYING in the top level directory 00004 * FILE: ntoskrnl/ke/i386/patpge.c 00005 * PURPOSE: Support for PAT and PGE (Large Pages) 00006 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) 00007 */ 00008 00009 /* INCLUDES ******************************************************************/ 00010 00011 #include <ntoskrnl.h> 00012 #define NDEBUG 00013 #include <debug.h> 00014 00015 /* FUNCTIONS *****************************************************************/ 00016 00017 ULONG_PTR 00018 NTAPI 00019 INIT_FUNCTION 00020 Ki386EnableGlobalPage(IN volatile ULONG_PTR Context) 00021 { 00022 volatile PLONG Count = (PLONG)Context; 00023 ULONG Cr4, Cr3; 00024 00025 /* Disable interrupts */ 00026 _disable(); 00027 00028 /* Decrease CPU Count and loop until it's reached 0 */ 00029 do {InterlockedDecrement(Count);} while (!*Count); 00030 00031 /* Now check if this is the Boot CPU */ 00032 if (!KeGetPcr()->Number) 00033 { 00034 /* It is.FIXME: Patch KeFlushCurrentTb */ 00035 } 00036 00037 /* Now get CR4 and make sure PGE is masked out */ 00038 Cr4 = __readcr4(); 00039 __writecr4(Cr4 & ~CR4_PGE); 00040 00041 /* Flush the TLB */ 00042 Cr3 = __readcr3(); 00043 __writecr3(Cr3); 00044 00045 /* Now enable PGE */ 00046 DPRINT("Global page support detected but not yet taken advantage of\n"); 00047 //__writecr4(Cr4 | CR4_PGE); 00048 00049 /* Restore interrupts */ 00050 _enable(); 00051 return 0; 00052 } 00053 00054 VOID 00055 NTAPI 00056 INIT_FUNCTION 00057 KiInitializePAT(VOID) 00058 { 00059 /* FIXME: Support this */ 00060 DPRINT("PAT support detected but not yet taken advantage of\n"); 00061 } Generated on Sun May 27 2012 04:37:32 for ReactOS by
1.7.6.1
|