From edfd63e1f71d22838c60219e4f333c6f6ef37c4e Mon Sep 17 00:00:00 2001 From: TuxSH Date: Fri, 10 Jun 2016 23:33:03 +0200 Subject: [PATCH] We don't need to flush DCache when launching payloads. Fixes a derp as well. --- loader/source/main.c | 1 - loader/source/memory.c | 5 ----- loader/source/memory.h | 12 +----------- source/fs.c | 1 - source/memory.h | 1 - source/screen.c | 2 +- 6 files changed, 2 insertions(+), 20 deletions(-) diff --git a/loader/source/main.c b/loader/source/main.c index 18aea19..b611bfe 100644 --- a/loader/source/main.c +++ b/loader/source/main.c @@ -5,7 +5,6 @@ void main(void) void *payloadAddress = (void *)0x23F00000; memcpy(payloadAddress, (void*)0x24F00000, *(u32 *)0x24FFFF04); - cleanInvalidateDCacheAndDMB(); //Ensure that all memory transfers have completed and that the data cache has been flushed ((void (*)())payloadAddress)(); } \ No newline at end of file diff --git a/loader/source/memory.c b/loader/source/memory.c index 69dd2f2..4f4c96a 100644 --- a/loader/source/memory.c +++ b/loader/source/memory.c @@ -7,9 +7,4 @@ void memcpy(void *dest, const void *src, u32 size) for(u32 i = 0; i < size; i++) destc[i] = srcc[i]; -} - -void cleanInvalidateDCacheAndDMB(void) -{ - ((void (*)())0xFFFF0830)(); //Why write our own code when it's well implemented in the unprotected bootROM? } \ No newline at end of file diff --git a/loader/source/memory.h b/loader/source/memory.h index 4c74b6d..466220c 100644 --- a/loader/source/memory.h +++ b/loader/source/memory.h @@ -2,14 +2,4 @@ #include "types.h" -void memcpy(void *dest, const void *src, u32 size); - -/*** - Cleans and invalidates the data cache, then waits for all memory transfers to be finished. - This function MUST be called before doing the following: - - rebooting - - powering down - - setting the ARM11 entrypoint to execute a function - - jumping to a payload (?) -***/ -void cleanInvalidateDCacheAndDMB(void); \ No newline at end of file +void memcpy(void *dest, const void *src, u32 size); \ No newline at end of file diff --git a/source/fs.c b/source/fs.c index 375dbed..61b2c04 100644 --- a/source/fs.c +++ b/source/fs.c @@ -85,7 +85,6 @@ void loadPayload(u32 pressed) loaderAddress[1] = fileRead((void *)0x24F00000, path); - cleanInvalidateDCacheAndDMB(); //Ensure that all memory transfers have completed and that the data cache has been flushed ((void (*)())loaderAddress)(); } } diff --git a/source/memory.h b/source/memory.h index d1877c6..c120581 100644 --- a/source/memory.h +++ b/source/memory.h @@ -19,6 +19,5 @@ u8 *memsearch(u8 *startPos, const void *pattern, u32 size, u32 patternSize); - rebooting - powering down - setting the ARM11 entrypoint to execute a function - - jumping to a payload (?) ***/ void cleanInvalidateDCacheAndDMB(void); \ No newline at end of file diff --git a/source/screen.c b/source/screen.c index 588d014..e55c4bb 100644 --- a/source/screen.c +++ b/source/screen.c @@ -36,7 +36,7 @@ static inline void invokeArm11Function(void (*func)()) *arm11Entry = (u32)func; while(*arm11Entry); - *arm11Entry = (u32)arm11Stub; + *arm11Entry = ARM11_STUB_ADDRESS; } static const u32 brightness[4] = {0x5F, 0x4C, 0x39, 0x26};