12 #define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
14 void wait_for_input(void);
16 extern __attribute__((weak)) int __ctr_svchax;
18 static bool has_rosalina;
20 static void check_rosalina() {
26 if (!svcGetSystemInfo(&version, 0x10000, 0)) {
27 major = GET_VERSION_MAJOR(version);
34 void ctr_clear_cache(void);
36 typedef int32_t (*ctr_callback_type)(void);
38 static inline void ctr_invalidate_ICache_kernel(void)
43 "mcr p15, 0, r0, c7, c5, 0\n\t");
46 static inline void ctr_flush_DCache_kernel(void)
51 "mcr p15, 0, r0, c7, c10, 0\n\t");
54 static inline void ctr_invalidate_ICache(void)
56 svcBackdoor((ctr_callback_type)ctr_invalidate_ICache_kernel);
59 static inline void ctr_flush_DCache(void)
61 svcBackdoor((ctr_callback_type)ctr_flush_DCache_kernel);
64 static inline void ctr_flush_invalidate_cache(void)
70 ctr_invalidate_ICache();
74 #endif // _3DS_UTILS_H