2010-02-09 18:14:58 +00:00
|
|
|
/*
|
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Kernel
|
|
|
|
* FILE: ntoskrnl/include/ntoskrnl.h
|
|
|
|
* PURPOSE: Main Kernel Header
|
|
|
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
|
|
|
*/
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
#ifndef _NTOSKRNL_PCH
|
|
|
|
#define _NTOSKRNL_PCH
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
|
|
|
/* ARM Bringup Hack */
|
|
|
|
#ifdef _M_ARM
|
|
|
|
#define DbgPrint DbgPrintEarly
|
|
|
|
#endif
|
|
|
|
|
2010-07-15 00:24:38 +00:00
|
|
|
/* WDK hacks */
|
|
|
|
#ifdef _M_AMD64
|
|
|
|
#define IoAllocateAdapterChannel _IoAllocateAdapterChannel
|
|
|
|
#define KeGetCurrentThread _KeGetCurrentThread
|
2011-06-06 19:08:39 +00:00
|
|
|
#define RtlFillMemoryUlong _RtlFillMemoryUlong
|
2010-07-15 00:24:38 +00:00
|
|
|
#endif
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
/* Version Data */
|
|
|
|
#undef __MSVCRT__
|
|
|
|
#include <psdk/ntverp.h>
|
|
|
|
|
|
|
|
/* DDK/IFS/NDK Headers */
|
|
|
|
#define _REALLY_GET_CALLERS_CALLER
|
|
|
|
#include <excpt.h>
|
|
|
|
#include <ntdef.h>
|
|
|
|
#include <ntifs.h>
|
|
|
|
#include <wdmguid.h>
|
|
|
|
#include <arc/arc.h>
|
2012-01-31 18:18:46 +00:00
|
|
|
#include <mountmgr.h>
|
2010-02-09 18:14:58 +00:00
|
|
|
#undef NTHALAPI
|
|
|
|
#define NTHALAPI __declspec(dllimport)
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ndk/asm.h>
|
|
|
|
#include <ndk/cctypes.h>
|
|
|
|
#include <ndk/cmfuncs.h>
|
|
|
|
#include <ndk/dbgkfuncs.h>
|
|
|
|
#include <ndk/exfuncs.h>
|
|
|
|
#include <ndk/halfuncs.h>
|
|
|
|
#include <ndk/inbvfuncs.h>
|
|
|
|
#include <ndk/iofuncs.h>
|
|
|
|
#include <ndk/kdfuncs.h>
|
|
|
|
#include <ndk/kefuncs.h>
|
|
|
|
#include <ndk/ldrfuncs.h>
|
|
|
|
#include <ndk/lpcfuncs.h>
|
|
|
|
#include <ndk/mmfuncs.h>
|
2015-08-18 20:40:17 +00:00
|
|
|
#include <ndk/muptypes.h>
|
2011-08-17 14:04:33 +00:00
|
|
|
#include <ndk/obfuncs.h>
|
|
|
|
#include <ndk/pofuncs.h>
|
|
|
|
#include <ndk/psfuncs.h>
|
|
|
|
#include <ndk/rtlfuncs.h>
|
|
|
|
#include <ndk/sefuncs.h>
|
|
|
|
#include <ndk/vftypes.h>
|
2010-02-09 18:14:58 +00:00
|
|
|
#undef TEXT
|
|
|
|
#define TEXT(s) L##s
|
|
|
|
#include <regstr.h>
|
2011-03-25 21:49:03 +00:00
|
|
|
#include <ntstrsafe.h>
|
2011-07-24 17:14:58 +00:00
|
|
|
#include <ntpoapi.h>
|
2018-09-15 10:27:08 +00:00
|
|
|
#include <ntintsafe.h>
|
2010-02-09 18:14:58 +00:00
|
|
|
|
|
|
|
/* C Headers */
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
#include <wchar.h>
|
|
|
|
|
|
|
|
/* SEH support with PSEH */
|
|
|
|
#include <pseh/pseh2.h>
|
|
|
|
|
|
|
|
/* SetupLDR Support */
|
|
|
|
#include <arc/setupblk.h>
|
|
|
|
|
|
|
|
/* KD Support */
|
|
|
|
#define NOEXTAPI
|
|
|
|
#include <windbgkd.h>
|
|
|
|
#include <wdbgexts.h>
|
|
|
|
#include <kddll.h>
|
|
|
|
#ifndef _WINKD_
|
|
|
|
#include <reactos/rossym.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* PNP GUIDs */
|
|
|
|
#include <umpnpmgr/sysguid.h>
|
|
|
|
|
2015-10-26 21:03:40 +00:00
|
|
|
/* SRM header */
|
|
|
|
#include <srmp.h>
|
|
|
|
|
2010-02-09 18:14:58 +00:00
|
|
|
#define ExRaiseStatus RtlRaiseStatus
|
2011-09-07 13:58:34 +00:00
|
|
|
|
2019-01-18 21:11:43 +00:00
|
|
|
/* Also defined in fltkernel.h, but we don't want the entire header */
|
|
|
|
#ifndef Add2Ptr
|
|
|
|
#define Add2Ptr(P,I) ((PVOID)((PUCHAR)(P) + (I)))
|
|
|
|
#endif
|
|
|
|
#ifndef PtrOffset
|
|
|
|
#define PtrOffset(B,O) ((ULONG)((ULONG_PTR)(O) - (ULONG_PTR)(B)))
|
|
|
|
#endif
|
|
|
|
|
[NTOS]
Add super-complicated handling of global pages to KeFlushCurrentTb (pretty much the same code which has been in HalpFlushTLB for the past ~6 years). This should be all that is required to make this feature work (everything else being in place already), and *seems* to work fine but is disabled under a switch until tested thoroughly.
Global pages, an important optimization that allows for not flushing the whole x86 TLB every time CR3 is changed (typically on context switch to a new process, or during process attach/detach), relies on us doing extra work whenever we do alter a global page. This is likely where any bugs will have to be flushed out!
Fixup Ki386EnableGlobalPage while we are at it -- disable/restore interrupts properly, and verify PGE-bit isn't set (nothing should have touched it before this routine, which is responsible for initializing it, so we shouldn't have to disable it). Fix, but disable, the CPU-sync spin as well as there should be no particular reason to do this for PGE-enabling during initialization (no other processor will be messing with PTEs at this stage, as compared to a call to KeFlushEntireTb).
Everyone, repeat after me: Global pages are awesome!
svn path=/trunk/; revision=69528
2015-10-14 19:33:35 +00:00
|
|
|
//
|
|
|
|
// Switch for enabling global page support
|
|
|
|
//
|
|
|
|
|
|
|
|
//#define _GLOBAL_PAGES_ARE_AWESOME_
|
|
|
|
|
|
|
|
|
2011-09-07 13:58:34 +00:00
|
|
|
/* Internal Headers */
|
|
|
|
#include "internal/ntoskrnl.h"
|
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <reactos/probe.h>
|
|
|
|
#include "internal/probe.h"
|
|
|
|
#include "resource.h"
|
|
|
|
|
2014-02-10 17:12:41 +00:00
|
|
|
#endif /* _NTOSKRNL_PCH */
|