diff --git a/reactos/ntoskrnl/CMakeLists.txt b/reactos/ntoskrnl/CMakeLists.txt index 45c985e89ec..6aca456b8c9 100644 --- a/reactos/ntoskrnl/CMakeLists.txt +++ b/reactos/ntoskrnl/CMakeLists.txt @@ -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) diff --git a/reactos/ntoskrnl/cache/section/io.c b/reactos/ntoskrnl/cache/section/io.c index a49e1820a62..9acf4e26b54 100644 --- a/reactos/ntoskrnl/cache/section/io.c +++ b/reactos/ntoskrnl/cache/section/io.c @@ -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); diff --git a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h index d3dca40eaf2..bbfaff7e251 100644 --- a/reactos/ntoskrnl/include/internal/amd64/intrin_i.h +++ b/reactos/ntoskrnl/include/internal/amd64/intrin_i.h @@ -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); diff --git a/reactos/ntoskrnl/include/internal/amd64/mm.h b/reactos/ntoskrnl/include/internal/amd64/mm.h index 38380cfd90e..8c5db54af6f 100644 --- a/reactos/ntoskrnl/include/internal/amd64/mm.h +++ b/reactos/ntoskrnl/include/internal/amd64/mm.h @@ -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) diff --git a/reactos/ntoskrnl/include/internal/ex.h b/reactos/ntoskrnl/include/internal/ex.h index 85a726b0cd8..548dd90a9b5 100644 --- a/reactos/ntoskrnl/include/internal/ex.h +++ b/reactos/ntoskrnl/include/internal/ex.h @@ -480,7 +480,7 @@ ULONG ExGetCountFastReference(IN EX_FAST_REF FastRef) { /* Return the reference count */ - return FastRef.RefCnt; + return (ULONG)FastRef.RefCnt; } FORCEINLINE diff --git a/reactos/ntoskrnl/include/internal/mm.h b/reactos/ntoskrnl/include/internal/mm.h index 02fa7e9d6d6..eec33616a54 100644 --- a/reactos/ntoskrnl/include/internal/mm.h +++ b/reactos/ntoskrnl/include/internal/mm.h @@ -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]; diff --git a/reactos/ntoskrnl/include/ntoskrnl.h b/reactos/ntoskrnl/include/ntoskrnl.h index 40c03b89d1d..ed37af715e6 100644 --- a/reactos/ntoskrnl/include/ntoskrnl.h +++ b/reactos/ntoskrnl/include/ntoskrnl.h @@ -17,6 +17,7 @@ #ifdef _M_AMD64 #define IoAllocateAdapterChannel _IoAllocateAdapterChannel #define KeGetCurrentThread _KeGetCurrentThread +#define RtlFillMemoryUlong _RtlFillMemoryUlong #endif /* Version Data */ diff --git a/reactos/ntoskrnl/ke/amd64/boot.S b/reactos/ntoskrnl/ke/amd64/boot.S index 4efbef3f94a..03da69ede75 100644 --- a/reactos/ntoskrnl/ke/amd64/boot.S +++ b/reactos/ntoskrnl/ke/amd64/boot.S @@ -8,7 +8,6 @@ /* INCLUDES ******************************************************************/ #include - #include EXTERN KiInitializeKernelAndGotoIdleLoop:PROC @@ -19,7 +18,6 @@ EXTERN KiInitializeKernelAndGotoIdleLoop:PROC /* FUNCTIONS *****************************************************************/ .code64 -.text /** * VOID diff --git a/reactos/ntoskrnl/ke/amd64/ctxswitch.S b/reactos/ntoskrnl/ke/amd64/ctxswitch.S index 1c9b13e5737..b0c52c233bc 100644 --- a/reactos/ntoskrnl/ke/amd64/ctxswitch.S +++ b/reactos/ntoskrnl/ke/amd64/ctxswitch.S @@ -10,7 +10,6 @@ /* INCLUDES ******************************************************************/ #include - #include /* 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 diff --git a/reactos/ntoskrnl/ke/amd64/trap.S b/reactos/ntoskrnl/ke/amd64/trap.S index e0831d24f1e..4c41a877102 100644 --- a/reactos/ntoskrnl/ke/amd64/trap.S +++ b/reactos/ntoskrnl/ke/amd64/trap.S @@ -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