#define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
void wait_for_input(void);
+void ctr_clear_cache(void);
+//void ctr_invalidate_icache(void); // only icache
extern __attribute__((weak)) int __ctr_svchax;
}
}
-void ctr_clear_cache(void);
-
typedef int32_t (*ctr_callback_type)(void);
static inline void ctr_invalidate_ICache_kernel(void)
cpsid aif
mov r0, #0
mcr p15, 0, r0, c7, c10, 0 @ Clean entire data cache
- mcr p15, 0, r0, c7, c10, 5 @ Data Memory Barrier
- mcr p15, 0, r0, c7, c5, 0 @ Invalidate entire instruction cache / Flush BTB
mcr p15, 0, r0, c7, c10, 4 @ Data Sync Barrier
+ mcr p15, 0, r0, c7, c5, 0 @ Invalidate entire instruction cache / Flush BTB
bx lr
.endfunc
.global ctr_clear_cache
.func ctr_clear_cache
ctr_clear_cache:
- ldr r0, =ctr_clear_cache_kernel
+ adr r0, ctr_clear_cache_kernel
+ svc 0x80 @ svcCustomBackdoor
+ bx lr
+ .endfunc
+
+#if 0
+ .func ctr_invalidate_icache_kernel
+ctr_invalidate_icache_kernel:
+ cpsid aif
+ mov r0, #0
+ mcr p15, 0, r0, c7, c10, 4 @ Data Sync Barrier
+ mcr p15, 0, r0, c7, c5, 0 @ Invalidate entire instruction cache / Flush BTB
+ bx lr
+ .endfunc
+
+ .global ctr_invalidate_icache
+ .func ctr_invalidate_icache
+ctr_invalidate_icache:
+ adr r0, ctr_invalidate_icache_kernel
svc 0x80 @ svcCustomBackdoor
bx lr
.endfunc
+#endif