Author: tkreuzer
Date: Sun Jun 9 08:54:33 2013
New Revision: 59194
URL:
http://svn.reactos.org/svn/reactos?rev=59194&view=rev
Log:
[NDK]
- Add NUMBER_POOL_LOOKASIDE_LISTS constant
- Add PAT MSR constants for amd64
- Add missing extern "C"
[NTOSKRNL]
- Fix pool lookaside list usage for 64 bit
Modified:
trunk/reactos/include/ndk/amd64/ketypes.h
trunk/reactos/include/ndk/amd64/mmtypes.h
trunk/reactos/include/ndk/arm/ketypes.h
trunk/reactos/include/ndk/arm/mmtypes.h
trunk/reactos/include/ndk/extypes.h
trunk/reactos/include/ndk/i386/ketypes.h
trunk/reactos/include/ndk/i386/mmtypes.h
trunk/reactos/include/ndk/pstypes.h
trunk/reactos/include/ndk/rtltypes.h
trunk/reactos/ntoskrnl/mm/ARM3/expool.c
Modified: trunk/reactos/include/ndk/amd64/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/ketypes.…
==============================================================================
--- trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/amd64/ketypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -125,6 +125,16 @@
#define MSR_GS_SWAP 0xC0000102
//
+// Caching values for the PAT MSR
+//
+#define PAT_UC 0ULL
+#define PAT_WC 1ULL
+#define PAT_WT 4ULL
+#define PAT_WP 5ULL
+#define PAT_WB 6ULL
+#define PAT_UCM 7ULL
+
+//
// Flags in MSR_EFER
//
#define MSR_LMA 0x0400
@@ -187,6 +197,11 @@
#define SYNCH_LEVEL 12
#define NMI_STACK_SIZE 0x2000
+
+//
+// Number of pool lookaside lists per pool in the PRCB
+//
+#define NUMBER_POOL_LOOKASIDE_LISTS 32
//
// Trap Frame Definition
@@ -527,8 +542,8 @@
#endif
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; // 2003: 33, vista:49
PP_LOOKASIDE_LIST PPLookasideList[16];
- GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[32];
- GENERAL_LOOKASIDE_POOL PPPagedLookasideList[32];
+ GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
+ GENERAL_LOOKASIDE_POOL PPPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
UINT64 PacketBarrier;
SINGLE_LIST_ENTRY DeferredReadyListHead;
LONG MmPageFaultCount;
Modified: trunk/reactos/include/ndk/amd64/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/amd64/mmtypes.…
==============================================================================
--- trunk/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/amd64/mmtypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -19,6 +19,10 @@
#ifndef _AMD64_MMTYPES_H
#define _AMD64_MMTYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Dependencies
@@ -198,5 +202,8 @@
#endif
} MMPTE_HARDWARE_LARGEPAGE, *PMMPTE_HARDWARE_LARGEPAGE;
+#ifdef __cplusplus
+}; // extern "C"
+#endif
#endif // !AMD64_MMTYPES_H
Modified: trunk/reactos/include/ndk/arm/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/ketypes.h?…
==============================================================================
--- trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/arm/ketypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -18,6 +18,10 @@
#ifndef _ARM_KETYPES_H
#define _ARM_KETYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Dependencies
@@ -105,7 +109,7 @@
// ULONG R0;
// ULONG R1;
// ULONG R2;
-// ULONG R3;
+// ULONG R3;
ULONG R4;
ULONG R5;
ULONG R6;
@@ -134,7 +138,7 @@
typedef union _ARM_STATUS_REGISTER
{
-
+
struct
{
ULONG Mode:5;
@@ -239,7 +243,7 @@
ULONG DMultipler:1;
ULONG DAssociativty:3;
ULONG DSize:4;
- ULONG DReserved:2;
+ ULONG DReserved:2;
ULONG Separate:1;
ULONG CType:4;
ULONG Reserved:3;
@@ -478,7 +482,7 @@
ULONG VdmAlert;
ULONG KernelReserved[14];
ULONG SecondLevelCacheSize;
- ULONG HalReserved[16];
+ ULONG HalReserved[16];
// arm part
UCHAR IrqlMask[32];
ULONG IrqlTable[32];
@@ -525,5 +529,10 @@
#define KeGetPreviousMode() _KeGetPreviousMode()
#define KeGetDcacheFillSize() PCR->DcacheFillSize
+#endif // !NTOS_MODE_USER
+
+#ifdef __cplusplus
+}; // extern "C"
#endif
-#endif
+
+#endif // !_ARM_KETYPES_H
Modified: trunk/reactos/include/ndk/arm/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/arm/mmtypes.h?…
==============================================================================
--- trunk/reactos/include/ndk/arm/mmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/arm/mmtypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -18,6 +18,10 @@
#ifndef _ARM_MMTYPES_H
#define _ARM_MMTYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Dependencies
@@ -178,7 +182,7 @@
typedef struct _MMPDE
{
- union
+ union
{
MMPDE_HARDWARE Hard;
ULONG Long;
@@ -191,4 +195,8 @@
#define HARDWARE_PTE HARDWARE_PTE_ARMV6
#define PHARDWARE_PTE PHARDWARE_PTE_ARMV6
-#endif
+#ifdef __cplusplus
+}; // extern "C"
+#endif
+
+#endif
Modified: trunk/reactos/include/ndk/extypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/extypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/extypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/extypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -33,6 +33,10 @@
#include <lpctypes.h>
#ifdef NTOS_MODE_USER
#include <obtypes.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
#endif
//
@@ -1462,5 +1466,10 @@
SIZE_T ModifiedPageCountPageFile;
} SYSTEM_MEMORY_LIST_INFORMATION, *PSYSTEM_MEMORY_LIST_INFORMATION;
+#endif // !NTOS_MODE_USER
+
+#ifdef __cplusplus
+}; // extern "C"
#endif
-#endif
+
+#endif // !_EXTYPES_H
Modified: trunk/reactos/include/ndk/i386/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/ketypes.h…
==============================================================================
--- trunk/reactos/include/ndk/i386/ketypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/i386/ketypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -185,6 +185,11 @@
#define SYNCH_LEVEL (IPI_LEVEL - 2)
#endif
#endif
+
+//
+// Number of pool lookaside lists per pool in the PRCB
+//
+#define NUMBER_POOL_LOOKASIDE_LISTS 32
//
// Trap Frame Definition
@@ -558,8 +563,8 @@
ULONG SpareCounter1[8];
#endif
PP_LOOKASIDE_LIST PPLookasideList[16];
- PP_LOOKASIDE_LIST PPNPagedLookasideList[32];
- PP_LOOKASIDE_LIST PPPagedLookasideList[32];
+ PP_LOOKASIDE_LIST PPNPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
+ PP_LOOKASIDE_LIST PPPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
volatile ULONG PacketBarrier;
volatile ULONG ReverseStall;
PVOID IpiFrame;
Modified: trunk/reactos/include/ndk/i386/mmtypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/mmtypes.h…
==============================================================================
--- trunk/reactos/include/ndk/i386/mmtypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/i386/mmtypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -18,6 +18,10 @@
#ifndef _I386_MMTYPES_H
#define _I386_MMTYPES_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Dependencies
@@ -171,4 +175,8 @@
#define HARDWARE_PTE HARDWARE_PTE_X86
#define PHARDWARE_PTE PHARDWARE_PTE_X86
+#ifdef __cplusplus
+}; // extern "C"
#endif
+
+#endif
Modified: trunk/reactos/include/ndk/pstypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/pstypes.h?rev=…
==============================================================================
--- trunk/reactos/include/ndk/pstypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/pstypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -30,6 +30,10 @@
#ifndef NTOS_MODE_USER
#include <extypes.h>
#include <setypes.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
#endif
#ifndef NTOS_MODE_USER
@@ -1422,4 +1426,8 @@
#endif // !NTOS_MODE_USER
+#ifdef __cplusplus
+}; // extern "C"
+#endif
+
#endif // _PSTYPES_H
Modified: trunk/reactos/include/ndk/rtltypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/rtltypes.h?rev…
==============================================================================
--- trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] (original)
+++ trunk/reactos/include/ndk/rtltypes.h [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -25,6 +25,10 @@
#include <umtypes.h>
#include <mmtypes.h>
#include <ldrtypes.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
//
// Maximum Atom Length
@@ -1521,4 +1525,9 @@
} MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA;
#endif /* !NTOS_MODE_USER */
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RTLTYPES_H */
Modified: trunk/reactos/ntoskrnl/mm/ARM3/expool.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/expool.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/expool.c [iso-8859-1] Sun Jun 9 08:54:33 2013
@@ -1675,7 +1675,7 @@
//
// Handle lookaside list optimization for both paged and nonpaged pool
//
- if (i <= MAXIMUM_PROCESSORS)
+ if (i <= NUMBER_POOL_LOOKASIDE_LISTS)
{
//
// Try popping it from the per-CPU lookaside list
@@ -2258,7 +2258,7 @@
//
// Is this allocation small enough to have come from a lookaside list?
//
- if (BlockSize <= MAXIMUM_PROCESSORS)
+ if (BlockSize <= NUMBER_POOL_LOOKASIDE_LISTS)
{
//
// Try pushing it into the per-CPU lookaside list