relocator: reduce number of warning in the logs by using our memory mapping test before the real one

This commit is contained in:
Maschell 2020-05-31 02:24:18 +02:00
parent 9809b1b48d
commit 6695815a6e

View File

@ -83,17 +83,18 @@ DECL(int32_t, KiPhysicalToEffectiveUncached, uint32_t addressSpace, uint32_t vir
return result; return result;
} }
DECL(int32_t, IPCKDriver_ValidatePhysicalAddress, uint32_t u1, uint32_t physStart, uint32_t physEnd) { DECL(uint32_t, IPCKDriver_ValidatePhysicalAddress, uint32_t u1, uint32_t physStart, uint32_t physEnd) {
int32_t result = real_IPCKDriver_ValidatePhysicalAddress(u1, physStart, physEnd); uint32_t result = 0;
if (result == 0) {
if(MemoryMappingPhysicalToEffectivePTR != 0){ if(MemoryMappingPhysicalToEffectivePTR != 0){
return ((uint32_t (*)(uint32_t)) ((uint32_t *) MemoryMappingPhysicalToEffectivePTR))(physStart) > 0; result = ((uint32_t (*)(uint32_t)) ((uint32_t *) MemoryMappingPhysicalToEffectivePTR))(physStart) > 0;
}
return 1;
} }
if(result){
return result; return result;
} }
return real_IPCKDriver_ValidatePhysicalAddress(u1, physStart, physEnd);
}
hooks_magic_t method_hooks_hooks_static[] __attribute__((section(".data"))) = { hooks_magic_t method_hooks_hooks_static[] __attribute__((section(".data"))) = {
MAKE_MAGIC(KiEffectiveToPhysical, LIB_CORE_INIT, STATIC_FUNCTION), MAKE_MAGIC(KiEffectiveToPhysical, LIB_CORE_INIT, STATIC_FUNCTION),
MAKE_MAGIC(KiPhysicalToEffectiveCached, LIB_CORE_INIT, STATIC_FUNCTION), MAKE_MAGIC(KiPhysicalToEffectiveCached, LIB_CORE_INIT, STATIC_FUNCTION),