MmMapIoSpace and MmUnmapIoSpace : Write-combined addresses are now passed-through
This commit is contained in:
parent
c2ec131a73
commit
f454211bc8
|
@ -84,6 +84,13 @@ typedef uint32 xbaddr;
|
|||
|
||||
/*! base addresses of various components */
|
||||
#define XBOX_KERNEL_BASE (MM_SYSTEM_PHYSICAL_MAP + XBE_IMAGE_BASE)
|
||||
|
||||
#define XBOX_WRITE_COMBINED_BASE 0xF0000000
|
||||
#define XBOX_WRITE_COMBINED_SIZE 0x08000000 // - 0xF7FFFFF
|
||||
|
||||
#define XBOX_UNCACHED_BASE 0xF8000000
|
||||
#define XBOX_UNCACHED_SIZE 0x07F00000 // - 0xFFEFFFFF
|
||||
|
||||
#define XBOX_NV2A_INIT_VECTOR 0xFF000008
|
||||
|
||||
#define XBOX_FLASH_ROM_BASE 0xFFF00000
|
||||
|
|
|
@ -414,9 +414,18 @@ XBSYSAPI EXPORTNUM(177) xboxkrnl::PVOID NTAPI xboxkrnl::MmMapIoSpace
|
|||
LOG_FUNC_ARG(ProtectionType)
|
||||
LOG_FUNC_END;
|
||||
|
||||
PVOID pRet;
|
||||
|
||||
// Is it a physical address for hardware devices (flash, NV2A, etc) ?
|
||||
if (PhysicalAddress >= XBOX_WRITE_COMBINED_BASE) { // 0xF0000000
|
||||
// Return physical address as virtual (accesses will go through EmuException) :
|
||||
pRet = (PVOID)PhysicalAddress;
|
||||
}
|
||||
else {
|
||||
// TODO: should this be aligned?
|
||||
PVOID pRet = g_MemoryManager.Allocate(NumberOfBytes);
|
||||
pRet = g_MemoryManager.Allocate(NumberOfBytes);
|
||||
LOG_INCOMPLETE();
|
||||
}
|
||||
|
||||
RETURN(pRet);
|
||||
}
|
||||
|
@ -611,8 +620,13 @@ XBSYSAPI EXPORTNUM(183) xboxkrnl::NTSTATUS NTAPI xboxkrnl::MmUnmapIoSpace
|
|||
LOG_FUNC_ARG(NumberOfBytes)
|
||||
LOG_FUNC_END;
|
||||
|
||||
if ((xbaddr)BaseAddress >= XBOX_WRITE_COMBINED_BASE) { // 0xF0000000
|
||||
// Don't free hardware devices (flash, NV2A, etc)
|
||||
}
|
||||
else {
|
||||
g_MemoryManager.Free(BaseAddress);
|
||||
LOG_INCOMPLETE();
|
||||
}
|
||||
|
||||
RETURN(STATUS_SUCCESS);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue