[NTOSKRNL]

Fix MSVC and amd64 build 

svn path=/trunk/; revision=52121
This commit is contained in:
Timo Kreuzer 2011-06-06 19:08:39 +00:00
parent 116862c485
commit 63ed94244c
10 changed files with 16 additions and 11 deletions

View file

@ -423,7 +423,11 @@ endif()
add_executable(ntoskrnl ${SOURCE})
set_entrypoint(ntoskrnl KiSystemStartup@4)
if (ARCH MATCHES i386)
set_entrypoint(ntoskrnl KiSystemStartup@4)
else()
set_entrypoint(ntoskrnl KiSystemStartup)
endif()
set_subsystem(ntoskrnl native)
if(MSVC)

View file

@ -71,9 +71,10 @@ MiSimpleReadComplete
PIRP Irp,
PVOID Context)
{
PMDL Mdl = Irp->MdlAddress;
/* Unlock MDL Pages, page 167. */
DPRINT("MiSimpleReadComplete %x\n", Irp);
PMDL Mdl = Irp->MdlAddress;
while (Mdl)
{
DPRINT("MDL Unlock %x\n", Mdl);

View file

@ -104,8 +104,6 @@ static __inline__ __attribute__((always_inline)) void __str(unsigned short *Dest
#elif defined(_MSC_VER)
#define UNIMPLEMENTED DbgPrint("%s is unimplemented!!!\n", __FUNCTION__);
void __lgdt(void *Source);
void __sgdt(void *Destination);

View file

@ -142,6 +142,9 @@ MiIsPdeForAddressValid(PVOID Address)
(MiAddressToPde(Address)->u.Hard.Valid));
}
#define MiPdeToPte(PDE) ((PMMPTE)MiPteToAddress(PDE))
#define MiPteToPde(PTE) ((PMMPDE)MiAddressToPte(PTE))
#define ADDR_TO_PAGE_TABLE(v) (((ULONG_PTR)(v)) / (512 * PAGE_SIZE))
#define ADDR_TO_PDE_OFFSET(v) ((((ULONG_PTR)(v)) / (512 * PAGE_SIZE)))
#define ADDR_TO_PTE_OFFSET(v) ((((ULONG_PTR)(v)) % (512 * PAGE_SIZE)) / PAGE_SIZE)

View file

@ -480,7 +480,7 @@ ULONG
ExGetCountFastReference(IN EX_FAST_REF FastRef)
{
/* Return the reference count */
return FastRef.RefCnt;
return (ULONG)FastRef.RefCnt;
}
FORCEINLINE

View file

@ -1140,7 +1140,7 @@ MiGetPfnEntry(IN PFN_NUMBER Pfn)
if (Pfn > MmHighestPhysicalPage) return NULL;
/* Make sure this page actually has a PFN entry */
if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, Pfn))) return NULL;
if ((MiPfnBitMap.Buffer) && !(RtlTestBit(&MiPfnBitMap, (ULONG)Pfn))) return NULL;
/* Get the entry */
Page = &MmPfnDatabase[Pfn];

View file

@ -17,6 +17,7 @@
#ifdef _M_AMD64
#define IoAllocateAdapterChannel _IoAllocateAdapterChannel
#define KeGetCurrentThread _KeGetCurrentThread
#define RtlFillMemoryUlong _RtlFillMemoryUlong
#endif
/* Version Data */

View file

@ -8,7 +8,6 @@
/* INCLUDES ******************************************************************/
#include <asm.inc>
#include <ksamd64.inc>
EXTERN KiInitializeKernelAndGotoIdleLoop:PROC
@ -19,7 +18,6 @@ EXTERN KiInitializeKernelAndGotoIdleLoop:PROC
/* FUNCTIONS *****************************************************************/
.code64
.text
/**
* VOID

View file

@ -10,7 +10,6 @@
/* INCLUDES ******************************************************************/
#include <asm.inc>
#include <ksamd64.inc>
/* FUNCTIONS ****************************************************************/
@ -166,7 +165,7 @@ KiSwapContext:
mov [rsp+0], rbp
/* Get the PCR */
mov rbx, gs:[KPCR_SELF]
mov rbx, gs:[PcSelf]
/* Get the current thread */
mov rdi, rcx

View file

@ -259,7 +259,6 @@ ENDM
/* FUNCTIONS *****************************************************************/
.text
.code64
ALIGN 8
@ -907,6 +906,8 @@ PUBLIC KiUnexpectedInterrupt
.ENDP KiUnexpectedInterrupt
#ifdef _MSC_VER
#undef lgdt
#undef lidt
//void __lgdt(void *Source);
PUBLIC __lgdt