- 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

svn path=/trunk/; revision=59194
This commit is contained in:
Timo Kreuzer 2013-06-09 08:54:33 +00:00
parent 450943cf42
commit 740772014c
10 changed files with 91 additions and 13 deletions

View file

@ -124,6 +124,16 @@ Author:
#define MSR_GS_BASE 0xC0000101 #define MSR_GS_BASE 0xC0000101
#define MSR_GS_SWAP 0xC0000102 #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 // Flags in MSR_EFER
// //
@ -188,6 +198,11 @@ Author:
#define NMI_STACK_SIZE 0x2000 #define NMI_STACK_SIZE 0x2000
//
// Number of pool lookaside lists per pool in the PRCB
//
#define NUMBER_POOL_LOOKASIDE_LISTS 32
// //
// Trap Frame Definition // Trap Frame Definition
// //
@ -527,8 +542,8 @@ typedef struct _KPRCB
#endif #endif
KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; // 2003: 33, vista:49 KSPIN_LOCK_QUEUE LockQueue[LockQueueMaximumLock]; // 2003: 33, vista:49
PP_LOOKASIDE_LIST PPLookasideList[16]; PP_LOOKASIDE_LIST PPLookasideList[16];
GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[32]; GENERAL_LOOKASIDE_POOL PPNPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
GENERAL_LOOKASIDE_POOL PPPagedLookasideList[32]; GENERAL_LOOKASIDE_POOL PPPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
UINT64 PacketBarrier; UINT64 PacketBarrier;
SINGLE_LIST_ENTRY DeferredReadyListHead; SINGLE_LIST_ENTRY DeferredReadyListHead;
LONG MmPageFaultCount; LONG MmPageFaultCount;

View file

@ -20,6 +20,10 @@ Author:
#ifndef _AMD64_MMTYPES_H #ifndef _AMD64_MMTYPES_H
#define _AMD64_MMTYPES_H #define _AMD64_MMTYPES_H
#ifdef __cplusplus
extern "C" {
#endif
// //
// Dependencies // Dependencies
// //
@ -198,5 +202,8 @@ typedef struct _MMPTE_HARDWARE_LARGEPAGE
#endif #endif
} MMPTE_HARDWARE_LARGEPAGE, *PMMPTE_HARDWARE_LARGEPAGE; } MMPTE_HARDWARE_LARGEPAGE, *PMMPTE_HARDWARE_LARGEPAGE;
#ifdef __cplusplus
}; // extern "C"
#endif
#endif // !AMD64_MMTYPES_H #endif // !AMD64_MMTYPES_H

View file

@ -19,6 +19,10 @@ Author:
#ifndef _ARM_KETYPES_H #ifndef _ARM_KETYPES_H
#define _ARM_KETYPES_H #define _ARM_KETYPES_H
#ifdef __cplusplus
extern "C" {
#endif
// //
// Dependencies // Dependencies
// //
@ -525,5 +529,10 @@ KeGetCurrentPrcb(VOID)
#define KeGetPreviousMode() _KeGetPreviousMode() #define KeGetPreviousMode() _KeGetPreviousMode()
#define KeGetDcacheFillSize() PCR->DcacheFillSize #define KeGetDcacheFillSize() PCR->DcacheFillSize
#endif // !NTOS_MODE_USER
#ifdef __cplusplus
}; // extern "C"
#endif #endif
#endif
#endif // !_ARM_KETYPES_H

View file

@ -19,6 +19,10 @@ Author:
#ifndef _ARM_MMTYPES_H #ifndef _ARM_MMTYPES_H
#define _ARM_MMTYPES_H #define _ARM_MMTYPES_H
#ifdef __cplusplus
extern "C" {
#endif
// //
// Dependencies // Dependencies
// //
@ -191,4 +195,8 @@ typedef struct _MMPDE
#define HARDWARE_PTE HARDWARE_PTE_ARMV6 #define HARDWARE_PTE HARDWARE_PTE_ARMV6
#define PHARDWARE_PTE PHARDWARE_PTE_ARMV6 #define PHARDWARE_PTE PHARDWARE_PTE_ARMV6
#ifdef __cplusplus
}; // extern "C"
#endif
#endif #endif

View file

@ -35,6 +35,10 @@ Author:
#include <obtypes.h> #include <obtypes.h>
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
// //
// GCC compatibility // GCC compatibility
// //
@ -1462,5 +1466,10 @@ typedef struct _SYSTEM_MEMORY_LIST_INFORMATION
SIZE_T ModifiedPageCountPageFile; SIZE_T ModifiedPageCountPageFile;
} SYSTEM_MEMORY_LIST_INFORMATION, *PSYSTEM_MEMORY_LIST_INFORMATION; } SYSTEM_MEMORY_LIST_INFORMATION, *PSYSTEM_MEMORY_LIST_INFORMATION;
#endif // !NTOS_MODE_USER
#ifdef __cplusplus
}; // extern "C"
#endif #endif
#endif
#endif // !_EXTYPES_H

View file

@ -186,6 +186,11 @@ typedef KIO_ACCESS_MAP *PKIO_ACCESS_MAP;
#endif #endif
#endif #endif
//
// Number of pool lookaside lists per pool in the PRCB
//
#define NUMBER_POOL_LOOKASIDE_LISTS 32
// //
// Trap Frame Definition // Trap Frame Definition
// //
@ -558,8 +563,8 @@ typedef struct _KPRCB
ULONG SpareCounter1[8]; ULONG SpareCounter1[8];
#endif #endif
PP_LOOKASIDE_LIST PPLookasideList[16]; PP_LOOKASIDE_LIST PPLookasideList[16];
PP_LOOKASIDE_LIST PPNPagedLookasideList[32]; PP_LOOKASIDE_LIST PPNPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
PP_LOOKASIDE_LIST PPPagedLookasideList[32]; PP_LOOKASIDE_LIST PPPagedLookasideList[NUMBER_POOL_LOOKASIDE_LISTS];
volatile ULONG PacketBarrier; volatile ULONG PacketBarrier;
volatile ULONG ReverseStall; volatile ULONG ReverseStall;
PVOID IpiFrame; PVOID IpiFrame;

View file

@ -19,6 +19,10 @@ Author:
#ifndef _I386_MMTYPES_H #ifndef _I386_MMTYPES_H
#define _I386_MMTYPES_H #define _I386_MMTYPES_H
#ifdef __cplusplus
extern "C" {
#endif
// //
// Dependencies // Dependencies
// //
@ -171,4 +175,8 @@ typedef struct _MMPTE_HARDWARE
#define HARDWARE_PTE HARDWARE_PTE_X86 #define HARDWARE_PTE HARDWARE_PTE_X86
#define PHARDWARE_PTE PHARDWARE_PTE_X86 #define PHARDWARE_PTE PHARDWARE_PTE_X86
#ifdef __cplusplus
}; // extern "C"
#endif
#endif #endif

View file

@ -32,6 +32,10 @@ Author:
#include <setypes.h> #include <setypes.h>
#endif #endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef NTOS_MODE_USER #ifndef NTOS_MODE_USER
// //
@ -1422,4 +1426,8 @@ typedef struct _WIN32_CALLOUTS_FPNS
#endif // !NTOS_MODE_USER #endif // !NTOS_MODE_USER
#ifdef __cplusplus
}; // extern "C"
#endif
#endif // _PSTYPES_H #endif // _PSTYPES_H

View file

@ -26,6 +26,10 @@ Author:
#include <mmtypes.h> #include <mmtypes.h>
#include <ldrtypes.h> #include <ldrtypes.h>
#ifdef __cplusplus
extern "C" {
#endif
// //
// Maximum Atom Length // Maximum Atom Length
// //
@ -1521,4 +1525,9 @@ typedef struct _MESSAGE_RESOURCE_DATA
} MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA; } MESSAGE_RESOURCE_DATA, *PMESSAGE_RESOURCE_DATA;
#endif /* !NTOS_MODE_USER */ #endif /* !NTOS_MODE_USER */
#ifdef __cplusplus
}
#endif
#endif /* !_RTLTYPES_H */ #endif /* !_RTLTYPES_H */

View file

@ -1675,7 +1675,7 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
// //
// Handle lookaside list optimization for both paged and nonpaged pool // 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 // Try popping it from the per-CPU lookaside list
@ -2258,7 +2258,7 @@ ExFreePoolWithTag(IN PVOID P,
// //
// Is this allocation small enough to have come from a lookaside list? // 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 // Try pushing it into the per-CPU lookaside list