Follow ARM's documentation on hw watchpoints to the letter

This commit is contained in:
TuxSH
2017-07-20 00:56:08 +02:00
parent 7e7ab124a3
commit 3907c46980
10 changed files with 222 additions and 32 deletions

View File

@@ -73,12 +73,12 @@ Result GetProcessInfoHook(s64 *out, Handle processHandle, u32 type)
*out = (s64)(u64)(u32)codeSetOfProcess(process)->dataSection.section.loadAddress;
break;
case 0x10008:
*out = (isN3DS ? hwInfoOfProcess(process)->N3DS.translationTableBase :
(kernelVersion >= SYSTEM_VERSION(2, 44, 6)
? hwInfoOfProcess(process)->O3DS8x.translationTableBase
: hwInfoOfProcess(process)->O3DSPre8x.translationTableBase)
) & ~((1 << (14 - TTBCR)) - 1);
{
KProcessHwInfo *hwInfo = hwInfoOfProcess(process);
u32 ttb = KPROCESSHWINFO_GET_RVALUE(hwInfo, translationTableBase);
*out = ttb & ~((1 << (14 - TTBCR)) - 1);
break;
}
default:
res = 0xD8E007ED; // invalid enum value
break;