Basic implementation of MmMapIoSpace (Kernel API 0xB1 / 177)

This commit is contained in:
Echelon9 2013-07-22 18:41:57 +10:00
parent 17f3e3279f
commit 3fbc55978a
2 changed files with 29 additions and 1 deletions

View File

@ -2412,6 +2412,34 @@ XBSYSAPI EXPORTNUM(172) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmFreeSystemMemory
return STATUS_SUCCESS;
}
// ******************************************************************
// * 0x00B1 - MmMapIoSpace
// ******************************************************************
XBSYSAPI EXPORTNUM(177) xboxkrnl::PVOID NTAPI xboxkrnl::MmMapIoSpace
(
IN PHYSICAL_ADDRESS PhysicalAddress,
IN ULONG NumberOfBytes,
IN ULONG ProtectionType
)
{
EmuSwapFS(); // Win2k/XP FS
DbgPrintf("EmuKrnl (0x%X): MmMapIoSpace\n"
"(\n"
" PhysicalAddress : 0x%.08X\n"
" NumberOfBytes : 0x%.08X\n"
" ProtectionType : 0x%.08X\n"
");\n",
GetCurrentThreadId(), PhysicalAddress, NumberOfBytes, ProtectionType);
// TODO: should this be aligned?
PVOID pRet = CxbxMalloc(NumberOfBytes);
EmuSwapFS(); // Xbox FS
return pRet;
}
// ******************************************************************
// * 0x00B2 - MmPersistContiguousMemory
// ******************************************************************

View File

@ -234,7 +234,7 @@ extern "C" CXBXKRNL_API uint32 CxbxKrnl_KernelThunkTable[367] =
(uint32)PANIC(0x00AE), // 0x00AE (174) MmIsAddressValid
(uint32)PANIC(0x00AF), // 0x00AF (175) MmLockUnlockBufferPages
(uint32)PANIC(0x00B0), // 0x00B0 (176) MmLockUnlockPhysicalPage
(uint32)PANIC(0x00B1), // 0x00B1 (177) MmMapIoSpace
(uint32)&xboxkrnl::MmMapIoSpace, // 0x00B1 (177) MmMapIoSpace
(uint32)&xboxkrnl::MmPersistContiguousMemory, // 0x00B2 (178)
(uint32)PANIC(0x00B3), // 0x00B3 (179) MmQueryAddressProtect
(uint32)&xboxkrnl::MmQueryAllocationSize, // 0x00B4 (180)