[ros-diffs] [sir_richard] 48172: [NDK]: Add all the definitions regarding VADs.
sir_richard at svn.reactos.org
sir_richard at svn.reactos.org
Thu Jul 22 01:41:21 UTC 2010
- Previous message: [ros-diffs] [sir_richard] 48171: [NDK]: Add missing RTL AVL Tree definitions, when used by user-mode applications.
- Next message: [ros-diffs] [sir_richard] 48173: This patch introduces a highly-shareable version of AVL trees both for RTL usage and for ARM3's MM_AVL_TABLE/MMADDRESS_NODE structures used by VADs on Windows (and soon, ReactOS): [RTL]: Uncouple generic table from AVL table implementation into its own avltable.c [RTL]: Get rid of "Austin" and fix prototypes of AVL table functions. [RTL]: Re-implement AVL table functions, sharing as much code as possible with the SPLAY tree implementation which is pretty decent. Lookup, insert, enumeration are implemented, but not delete. [RTL]: Make large part of the RTL AVL package into its own "support" file that can work both with MMADDRESS_NODE and RTL_BALANCED_LINKS structures. The former is used by ARM3 for VADs. [NTOS]: Implement basic VAD AVL tree routines (Insert, LookupEmpty, GetPrevious, CheckForConflict, Locate). This is enough to insert VADs, find a free address range, and locate a VAD by address. No delete yet Thanks to Timo Kreuzer for some clever definitions, Knuth for his genius, several online C implementations for ideas, the HPI kernel blog for insight on how Windows does it, and others.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: sir_richard
Date: Thu Jul 22 01:41:20 2010
New Revision: 48172
URL: http://svn.reactos.org/svn/reactos?rev=48172&view=rev
Log:
[NDK]: Add all the definitions regarding VADs.
Modified:
trunk/reactos/include/ndk/mmtypes.h
Modified: trunk/reactos/include/ndk/mmtypes.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/mmtypes.h?rev=48172&r1=48171&r2=48172&view=diff
==============================================================================
--- trunk/reactos/include/ndk/mmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/mmtypes.h [iso-8859-1] Thu Jul 22 01:41:20 2010
@@ -170,6 +170,21 @@
SectionBasicInformation,
SectionImageInformation,
} SECTION_INFORMATION_CLASS;
+
+//
+// Kinds of VADs
+//
+typedef enum _MI_VAD_TYPE
+{
+ VadNone,
+ VadDevicePhysicalMemory,
+ VadImageMap,
+ VadAwe,
+ VadWriteWatch,
+ VadLargePages,
+ VadRotatePhysical,
+ VadLargePageSection
+} MI_VAD_TYPE, *PMI_VAD_TYPE;
#ifdef NTOS_MODE_USER
@@ -613,6 +628,113 @@
PVOID NodeHint;
PVOID NodeFreeHint;
} MM_AVL_TABLE, *PMM_AVL_TABLE;
+
+//
+// Virtual Adress List used in VADs
+//
+typedef struct _MMADDRESS_LIST
+{
+ ULONG StartVpn;
+ ULONG EndVpn;
+} MMADDRESS_LIST, *PMMADDRESS_LIST;
+
+//
+// Flags used in the VAD
+//
+typedef struct _MMVAD_FLAGS
+{
+ ULONG CommitCharge:19;
+ ULONG NoChange:1;
+ ULONG VadType:3;
+ ULONG MemCommit:1;
+ ULONG Protection:5;
+ ULONG Spare:2;
+ ULONG PrivateMemory:1;
+} MMVAD_FLAGS, *PMMVAD_FLAGS;
+
+//
+// Extended flags used in the VAD
+//
+typedef struct _MMVAD_FLAGS2
+{
+ ULONG FileOffset:24;
+ ULONG SecNoChange:1;
+ ULONG OneSecured:1;
+ ULONG MultipleSecured:1;
+ ULONG ReadOnly:1;
+ ULONG LongVad:1;
+ ULONG ExtendableFile:1;
+ ULONG Inherit:1;
+ ULONG CopyOnWrite:1;
+} MMVAD_FLAGS2, *PMMVAD_FLAGS2;
+
+//
+// Virtual Address Descriptor (VAD) Structure
+//
+typedef struct _MMVAD
+{
+ union
+ {
+ LONG_PTR Balance:2;
+ struct _MMVAD *Parent;
+ } u1;
+ struct _MMVAD *LeftChild;
+ struct _MMVAD *RightChild;
+ ULONG StartingVpn;
+ ULONG EndingVpn;
+ union
+ {
+ ULONG LongFlags;
+ MMVAD_FLAGS VadFlags;
+ } u;
+ PCONTROL_AREA ControlArea;
+ PMMPTE FirstPrototypePte;
+ PMMPTE LastContiguousPte;
+ union
+ {
+ ULONG LongFlags2;
+ MMVAD_FLAGS2 VadFlags2;
+ } u2;
+} MMVAD, *PMMVAD;
+
+//
+// Long VAD used in section and private allocations
+//
+typedef struct _MMVAD_LONG
+{
+ union
+ {
+ LONG_PTR Balance:2;
+ PMMVAD Parent;
+ } u1;
+ PMMVAD LeftChild;
+ PMMVAD RightChild;
+ ULONG StartingVpn;
+ ULONG EndingVpn;
+ union
+ {
+ ULONG LongFlags;
+ MMVAD_FLAGS VadFlags;
+ } u;
+ PCONTROL_AREA ControlArea;
+ PMMPTE FirstPrototypePte;
+ PMMPTE LastContiguousPte;
+ union
+ {
+ ULONG LongFlags2;
+ MMVAD_FLAGS2 VadFlags2;
+ } u2;
+ union
+ {
+ LIST_ENTRY List;
+ MMADDRESS_LIST Secured;
+ } u3;
+ union
+ {
+ PVOID Banked;
+ PMMEXTEND_INFO ExtendedInfo;
+ } u4;
+} MMVAD_LONG, *PMMVAD_LONG;
//
// Actual Section Object
- Previous message: [ros-diffs] [sir_richard] 48171: [NDK]: Add missing RTL AVL Tree definitions, when used by user-mode applications.
- Next message: [ros-diffs] [sir_richard] 48173: This patch introduces a highly-shareable version of AVL trees both for RTL usage and for ARM3's MM_AVL_TABLE/MMADDRESS_NODE structures used by VADs on Windows (and soon, ReactOS): [RTL]: Uncouple generic table from AVL table implementation into its own avltable.c [RTL]: Get rid of "Austin" and fix prototypes of AVL table functions. [RTL]: Re-implement AVL table functions, sharing as much code as possible with the SPLAY tree implementation which is pretty decent. Lookup, insert, enumeration are implemented, but not delete. [RTL]: Make large part of the RTL AVL package into its own "support" file that can work both with MMADDRESS_NODE and RTL_BALANCED_LINKS structures. The former is used by ARM3 for VADs. [NTOS]: Implement basic VAD AVL tree routines (Insert, LookupEmpty, GetPrevious, CheckForConflict, Locate). This is enough to insert VADs, find a free address range, and locate a VAD by address. No delete yet Thanks to Timo Kreuzer for some clever definitions, Knuth for his genius, several online C implementations for ideas, the HPI kernel blog for insight on how Windows does it, and others.
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Ros-diffs
mailing list