- Fix compilation error in KeIpiGenericCall.

- Revert my last changes in RPoolMgr.h. Currently they cause more harm than good. :(

svn path=/trunk/; revision=12972
This commit is contained in:
Filip Navara 2005-01-12 16:09:12 +00:00
parent af3dff11b7
commit 030b0867f6
2 changed files with 20 additions and 19 deletions

View file

@ -157,7 +157,7 @@ KiIpiSendPacket(ULONG TargetSet, VOID STDCALL (*WorkerRoutine)(PVOID), PVOID Arg
}
VOID
KeIpiGenericCall(VOID STDCALL (*Function)(PVOID), PVOID Argument)
KeIpiGenericCall(VOID (STDCALL *Function)(PVOID), PVOID Argument)
{
KIRQL oldIrql;
ULONG TargetSet;

View file

@ -12,18 +12,17 @@
#define RPOOLMGR_H
typedef unsigned long rulong;
typedef ULONG_PTR rulong_ptr;
#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (rulong_ptr)(ptr) < ((rulong_ptr)pool->UserBase + pool->UserSize)
#define R_IS_POOL_PTR(pool,ptr) (void*)(ptr) >= pool->UserBase && (ULONG_PTR)(ptr) < ((ULONG_PTR)pool->UserBase + pool->UserSize)
#define R_ASSERT_PTR(pool,ptr) ASSERT( R_IS_POOL_PTR(pool,ptr) )
#define R_ASSERT_SIZE(pool,sz) ASSERT( sz > (sizeof(R_USED)+2*R_RZ) && sz >= sizeof(R_FREE) && sz < pool->UserSize )
#ifndef R_ROUND_UP
#define R_ROUND_UP(x,s) ((PVOID)(((rulong_ptr)(x)+(s)-1) & ~((rulong_ptr)(s)-1)))
#define R_ROUND_UP(x,s) ((PVOID)(((ULONG_PTR)(x)+(s)-1) & ~((ULONG_PTR)(s)-1)))
#endif//R_ROUND_UP
#ifndef R_ROUND_DOWN
#define R_ROUND_DOWN(x,s) ((PVOID)(((rulong_ptr)(x)) & ~((rulong_ptr)(s)-1)))
#define R_ROUND_DOWN(x,s) ((PVOID)(((ULONG_PTR)(x)) & ~((ULONG_PTR)(s)-1)))
#endif//R_ROUND_DOWN
#ifndef R_QUEMIN
@ -78,9 +77,9 @@ typedef struct _R_FREE
#endif//R_MAGIC
rulong PrevSize : 30;
rulong Status : 2;
rulong_ptr Size;
rulong Size;
#if R_STACK
rulong_ptr LastOwnerStack[R_STACK];
ULONG_PTR LastOwnerStack[R_STACK];
#endif//R_STACK
struct _R_FREE* NextFree;
struct _R_FREE* PrevFree;
@ -94,9 +93,9 @@ typedef struct _R_USED
#endif//R_MAGIC
rulong PrevSize : 30;
rulong Status : 2;
rulong_ptr Size;
rulong Size;
#if R_STACK
rulong_ptr LastOwnerStack[R_STACK];
ULONG_PTR LastOwnerStack[R_STACK];
#endif//R_STACK
struct _R_USED* NextUsed;
#if R_RZ
@ -116,9 +115,9 @@ R_QUE, *PR_QUE;
typedef struct _R_POOL
{
void* PoolBase;
rulong_ptr PoolSize;
rulong PoolSize;
void* UserBase;
rulong_ptr UserSize;
rulong UserSize;
rulong Alignments[3];
PR_FREE FirstFree, LastFree;
R_QUE Que[R_QUECOUNT][3];
@ -148,7 +147,7 @@ RiPrintLastOwner ( PR_USED Block )
#endif//R_STACK
static int
RQueWhich ( rulong_ptr size )
RQueWhich ( rulong size )
{
rulong que, quesize;
for ( que=0, quesize=16; que < R_QUECOUNT; que++, quesize<<=1 )
@ -288,7 +287,7 @@ RFreeInit ( void* memory )
}
PR_POOL
RPoolInit ( void* PoolBase, rulong_ptr PoolSize, int align1, int align2, int align3 )
RPoolInit ( void* PoolBase, rulong PoolSize, int align1, int align2, int align3 )
{
int align, que;
PR_POOL pool = (PR_POOL)PoolBase;
@ -568,7 +567,7 @@ RPoolRedZoneCheck ( PR_POOL pool, const char* file, int line )
}
static void
RSetSize ( PR_POOL pool, PR_FREE Block, rulong_ptr NewSize, PR_FREE NextBlock )
RSetSize ( PR_POOL pool, PR_FREE Block, rulong NewSize, PR_FREE NextBlock )
{
R_ASSERT_PTR(pool,Block);
ASSERT ( NewSize < pool->UserSize );
@ -581,7 +580,7 @@ RSetSize ( PR_POOL pool, PR_FREE Block, rulong_ptr NewSize, PR_FREE NextBlock )
}
static PR_FREE
RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong_ptr NewSize )
RFreeSplit ( PR_POOL pool, PR_FREE Block, rulong NewSize )
{
PR_FREE NewBlock = (PR_FREE)((char*)Block + NewSize);
RSetSize ( pool, NewBlock, Block->Size - NewSize, NULL );
@ -655,7 +654,7 @@ RiUsedInit ( PR_USED Block, rulong Tag )
#define RiUsedInitRedZone(Block,UserSize)
#else//R_RZ
static void
RiUsedInitRedZone ( PR_USED Block, rulong_ptr UserSize )
RiUsedInitRedZone ( PR_USED Block, rulong UserSize )
{
// write out buffer-overrun detection bytes
char* Addr = (char*)RHdrToBody(Block);
@ -669,7 +668,7 @@ RiUsedInitRedZone ( PR_USED Block, rulong_ptr UserSize )
#endif//R_RZ
static void*
RPoolAlloc ( PR_POOL pool, rulong_ptr NumberOfBytes, rulong Tag, rulong align )
RPoolAlloc ( PR_POOL pool, rulong NumberOfBytes, rulong Tag, rulong align )
{
PR_USED NewBlock;
PR_FREE BestBlock,
@ -678,8 +677,10 @@ RPoolAlloc ( PR_POOL pool, rulong_ptr NumberOfBytes, rulong Tag, rulong align )
BestPreviousBlock,
CurrentBlock;
void* BestAlignedAddr;
rulong_ptr que, queBytes = NumberOfBytes;
rulong BlockSize, Alignment;
int que,
queBytes = NumberOfBytes;
rulong BlockSize,
Alignment;
int que_reclaimed = 0;
ASSERT ( pool );