8 #ifdef OS_HEAP_AREA_BEGIN // defined in libctru 2.0+
9 #define USE_CTRULIB_2 1
16 #define DEBUG_HOLD() do{printf("%s@%s:%d.\n",__FUNCTION__, __FILE__, __LINE__);fflush(stdout);wait_for_input();}while(0)
18 void wait_for_input(void);
20 extern __attribute__((weak)) int __ctr_svchax;
22 static bool has_rosalina;
24 static inline void check_rosalina() {
30 if (!svcGetSystemInfo(&version, 0x10000, 0)) {
31 major = GET_VERSION_MAJOR(version);
38 void ctr_clear_cache(void);
40 typedef int32_t (*ctr_callback_type)(void);
42 static inline void ctr_invalidate_ICache_kernel(void)
47 "mcr p15, 0, r0, c7, c5, 0\n\t");
50 static inline void ctr_flush_DCache_kernel(void)
55 "mcr p15, 0, r0, c7, c10, 0\n\t");
58 static inline void ctr_invalidate_ICache(void)
60 svcBackdoor((ctr_callback_type)ctr_invalidate_ICache_kernel);
63 static inline void ctr_flush_DCache(void)
65 svcBackdoor((ctr_callback_type)ctr_flush_DCache_kernel);
68 static inline void ctr_flush_invalidate_cache(void)
74 ctr_invalidate_ICache();
78 #endif // _3DS_UTILS_H