- Make FORCEINLINE extern (not static)
- Declare WspiapiLegacyFreeAddrInfo, WspiapiLegacyGetAddrInfo and WspiapiLegacyGetNameInfo as static __inline.
[CRT]
- Convert FillBuf to static __inline.
[NTOS]
- Convert MmProtectToPteMask to extern.
- Convert LpcpAllocateFromPortZone to static __inline.

svn path=/trunk/; revision=48239
This commit is contained in:
Amine Khaldi 2010-07-25 01:22:15 +00:00
parent 0bbdcf4d8b
commit fbdc7009aa
7 changed files with 64 additions and 60 deletions

View file

@ -240,7 +240,7 @@
#elif (_MSC_VER) #elif (_MSC_VER)
#define FORCEINLINE __inline #define FORCEINLINE __inline
#else #else
#define FORCEINLINE static __inline__ __attribute__((always_inline)) #define FORCEINLINE extern __inline__ __attribute__((always_inline))
#endif #endif
#endif #endif

View file

@ -79,7 +79,7 @@ extern "C" {
#elif (_MSC_VER) #elif (_MSC_VER)
#define FORCEINLINE __inline #define FORCEINLINE __inline
#else #else
#define FORCEINLINE static __inline__ __attribute__((always_inline)) #define FORCEINLINE extern __inline__ __attribute__((always_inline))
#endif #endif
#endif #endif
@ -5112,7 +5112,7 @@ static __inline__ PVOID GetCurrentFiber(void)
#endif #endif
#if defined(_M_IX86) #if defined(_M_IX86)
static __inline__ struct _TEB * NtCurrentTeb(void) extern __inline__ struct _TEB * NtCurrentTeb(void)
{ {
struct _TEB *ret; struct _TEB *ret;
@ -5137,12 +5137,12 @@ FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self)); return (struct _TEB *)__readgsqword(FIELD_OFFSET(NT_TIB, Self));
} }
#elif defined(_M_PPC) #elif defined(_M_PPC)
static __inline__ struct _TEB * NtCurrentTeb(void) extern __inline__ struct _TEB * NtCurrentTeb(void)
{ {
return __readfsdword_winnt(0x18); return __readfsdword_winnt(0x18);
} }
#else #else
static __inline__ struct _TEB * NtCurrentTeb(void) extern __inline__ struct _TEB * NtCurrentTeb(void)
{ {
return __readfsdword_winnt(0x18); return __readfsdword_winnt(0x18);
} }

View file

@ -236,7 +236,7 @@ WspiapiClone(
return 0; return 0;
} }
FORCEINLINE static __inline
void void
WINAPI WINAPI
WspiapiLegacyFreeAddrInfo( WspiapiLegacyFreeAddrInfo(
@ -252,7 +252,7 @@ WspiapiLegacyFreeAddrInfo(
} }
} }
FORCEINLINE static __inline
int int
WINAPI WINAPI
WspiapiLegacyGetAddrInfo( WspiapiLegacyGetAddrInfo(
@ -352,7 +352,7 @@ WspiapiLegacyGetAddrInfo(
return (iError); return (iError);
} }
FORCEINLINE static __inline
int int
WINAPI WINAPI
WspiapiLegacyGetNameInfo( WspiapiLegacyGetNameInfo(

View file

@ -73,7 +73,7 @@ IntToChar2(int x)
return u.char2; return u.char2;
} }
FORCEINLINE static __inline
void void
FillBuf(timebuf_t *buf, const struct tm *ptm) FillBuf(timebuf_t *buf, const struct tm *ptm)
{ {

View file

@ -95,7 +95,7 @@
// //
// Allocates a new message // Allocates a new message
// //
FORCEINLINE static __inline
PLPCP_MESSAGE PLPCP_MESSAGE
LpcpAllocateFromPortZone(VOID) LpcpAllocateFromPortZone(VOID)
{ {

View file

@ -139,56 +139,9 @@
#else #else
#error Define these please! #error Define these please!
#endif #endif
static const
ULONG extern const ULONG MmProtectToPteMask[32];
MmProtectToPteMask[32] =
{
//
// These are the base MM_ protection flags
//
0,
PTE_READONLY | PTE_ENABLE_CACHE,
PTE_EXECUTE | PTE_ENABLE_CACHE,
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
PTE_READWRITE | PTE_ENABLE_CACHE,
PTE_WRITECOPY | PTE_ENABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
//
// These OR in the MM_NOCACHE flag
//
0,
PTE_READONLY | PTE_DISABLE_CACHE,
PTE_EXECUTE | PTE_DISABLE_CACHE,
PTE_EXECUTE_READ | PTE_DISABLE_CACHE,
PTE_READWRITE | PTE_DISABLE_CACHE,
PTE_WRITECOPY | PTE_DISABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_DISABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_DISABLE_CACHE,
//
// These OR in the MM_DECOMMIT flag, which doesn't seem supported on x86/64/ARM
//
0,
PTE_READONLY | PTE_ENABLE_CACHE,
PTE_EXECUTE | PTE_ENABLE_CACHE,
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
PTE_READWRITE | PTE_ENABLE_CACHE,
PTE_WRITECOPY | PTE_ENABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
//
// These OR in the MM_NOACCESS flag, which seems to enable WriteCombining?
//
0,
PTE_READONLY | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_READ | PTE_WRITECOMBINED_CACHE,
PTE_READWRITE | PTE_WRITECOMBINED_CACHE,
PTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_READWRITE | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
};
// //
// Assertions for session images, addresses, and PTEs // Assertions for session images, addresses, and PTEs
// //

View file

@ -12,6 +12,7 @@
#include <ntoskrnl.h> #include <ntoskrnl.h>
#define NDEBUG #define NDEBUG
#include <debug.h> #include <debug.h>
#include "../ARM3/miarm.h"
#if defined (ALLOC_PRAGMA) #if defined (ALLOC_PRAGMA)
#pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory) #pragma alloc_text(INIT, MmInitGlobalKernelPageDirectory)
@ -58,6 +59,56 @@ __inline LARGE_INTEGER PTE_TO_PAGE(ULONG npage)
} }
#endif #endif
const
ULONG
MmProtectToPteMask[32] =
{
//
// These are the base MM_ protection flags
//
0,
PTE_READONLY | PTE_ENABLE_CACHE,
PTE_EXECUTE | PTE_ENABLE_CACHE,
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
PTE_READWRITE | PTE_ENABLE_CACHE,
PTE_WRITECOPY | PTE_ENABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
//
// These OR in the MM_NOCACHE flag
//
0,
PTE_READONLY | PTE_DISABLE_CACHE,
PTE_EXECUTE | PTE_DISABLE_CACHE,
PTE_EXECUTE_READ | PTE_DISABLE_CACHE,
PTE_READWRITE | PTE_DISABLE_CACHE,
PTE_WRITECOPY | PTE_DISABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_DISABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_DISABLE_CACHE,
//
// These OR in the MM_DECOMMIT flag, which doesn't seem supported on x86/64/ARM
//
0,
PTE_READONLY | PTE_ENABLE_CACHE,
PTE_EXECUTE | PTE_ENABLE_CACHE,
PTE_EXECUTE_READ | PTE_ENABLE_CACHE,
PTE_READWRITE | PTE_ENABLE_CACHE,
PTE_WRITECOPY | PTE_ENABLE_CACHE,
PTE_EXECUTE_READWRITE | PTE_ENABLE_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_ENABLE_CACHE,
//
// These OR in the MM_NOACCESS flag, which seems to enable WriteCombining?
//
0,
PTE_READONLY | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_READ | PTE_WRITECOMBINED_CACHE,
PTE_READWRITE | PTE_WRITECOMBINED_CACHE,
PTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_READWRITE | PTE_WRITECOMBINED_CACHE,
PTE_EXECUTE_WRITECOPY | PTE_WRITECOMBINED_CACHE,
};
/* FUNCTIONS ***************************************************************/ /* FUNCTIONS ***************************************************************/
BOOLEAN MmUnmapPageTable(PULONG Pt); BOOLEAN MmUnmapPageTable(PULONG Pt);