- 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_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
//
@ -188,6 +198,11 @@ Author:
#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 @@ typedef struct _KPRCB
#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;

View file

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

View file

@ -19,6 +19,10 @@ Author:
#ifndef _ARM_KETYPES_H
#define _ARM_KETYPES_H
#ifdef __cplusplus
extern "C" {
#endif
//
// Dependencies
//
@ -105,7 +109,7 @@ typedef struct _KEXCEPTION_FRAME
// ULONG R0;
// ULONG R1;
// ULONG R2;
// ULONG R3;
// ULONG R3;
ULONG R4;
ULONG R5;
ULONG R6;
@ -134,7 +138,7 @@ typedef union _ARM_TTB_REGISTER
typedef union _ARM_STATUS_REGISTER
{
struct
{
ULONG Mode:5;
@ -239,7 +243,7 @@ typedef union _ARM_CACHE_REGISTER
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 @@ typedef struct _KIPCR
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 @@ KeGetCurrentPrcb(VOID)
#define KeGetPreviousMode() _KeGetPreviousMode()
#define KeGetDcacheFillSize() PCR->DcacheFillSize
#endif // !NTOS_MODE_USER
#ifdef __cplusplus
}; // extern "C"
#endif
#endif
#endif // !_ARM_KETYPES_H

View file

@ -19,6 +19,10 @@ Author:
#ifndef _ARM_MMTYPES_H
#define _ARM_MMTYPES_H
#ifdef __cplusplus
extern "C" {
#endif
//
// Dependencies
//
@ -178,7 +182,7 @@ typedef union _MMPDE_HARDWARE
typedef struct _MMPDE
{
union
union
{
MMPDE_HARDWARE Hard;
ULONG Long;
@ -191,4 +195,8 @@ typedef struct _MMPDE
#define HARDWARE_PTE HARDWARE_PTE_ARMV6
#define PHARDWARE_PTE PHARDWARE_PTE_ARMV6
#ifdef __cplusplus
}; // extern "C"
#endif
#endif

View file

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

View file

@ -186,6 +186,11 @@ typedef KIO_ACCESS_MAP *PKIO_ACCESS_MAP;
#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 @@ typedef struct _KPRCB
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;

View file

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

View file

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

View file

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

View file

@ -1675,7 +1675,7 @@ ExAllocatePoolWithTag(IN POOL_TYPE PoolType,
//
// 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 @@ ExFreePoolWithTag(IN PVOID P,
//
// 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