From 48c15a8fdec7ab011f32871717f73cdfa56c2ec8 Mon Sep 17 00:00:00 2001 From: Kostas Missos Date: Sat, 7 Dec 2019 20:16:38 +0200 Subject: [PATCH] nyx: Release the shackles --- nyx/Makefile | 2 +- nyx/nyx_gui/config/config.c | 4 ---- nyx/nyx_gui/frontend/fe_emmc_tools.c | 5 ----- nyx/nyx_gui/frontend/fe_emummc_tools.c | 5 ----- nyx/nyx_gui/frontend/gui.c | 10 ---------- nyx/nyx_gui/frontend/gui_emmc_tools.c | 5 ----- nyx/nyx_gui/frontend/gui_emummc_tools.c | 5 ----- nyx/nyx_gui/frontend/gui_info.c | 5 ----- nyx/nyx_gui/frontend/gui_tools.c | 5 ----- nyx/nyx_gui/gfx/di.c | 5 ----- nyx/nyx_gui/gfx/gfx.c | 6 ------ nyx/nyx_gui/libs/elfload/elfload.c | 5 ----- nyx/nyx_gui/libs/fatfs/ff.c | 5 ----- nyx/nyx_gui/libs/fatfs/ffunicode.c | 7 ------- nyx/nyx_gui/nyx.c | 5 ----- nyx/nyx_gui/power/bq24193.c | 5 ----- nyx/nyx_gui/power/max17050.c | 5 ----- nyx/nyx_gui/power/max7762x.c | 5 ----- nyx/nyx_gui/soc/bpmp.c | 4 ---- nyx/nyx_gui/soc/clock.c | 5 ----- nyx/nyx_gui/soc/cluster.c | 5 ----- nyx/nyx_gui/soc/fuse.c | 5 ----- nyx/nyx_gui/storage/sdmmc.c | 5 ----- 23 files changed, 1 insertion(+), 117 deletions(-) diff --git a/nyx/Makefile b/nyx/Makefile index 92e6cf8..eeb21fc 100644 --- a/nyx/Makefile +++ b/nyx/Makefile @@ -6,7 +6,7 @@ include $(DEVKITARM)/base_rules ################################################################################ -NYX_LOAD_ADDR := 0x40003000 +NYX_LOAD_ADDR := 0x81000000 NYX_RES_ADDR := 0xEE000000 NYX_STORAGE_ADDR := 0xED000000 NYX_MAGIC := 0x43544347 #"GCTC" diff --git a/nyx/nyx_gui/config/config.c b/nyx/nyx_gui/config/config.c index 177f374..af234b8 100644 --- a/nyx/nyx_gui/config/config.c +++ b/nyx/nyx_gui/config/config.c @@ -32,9 +32,6 @@ extern hekate_config h_cfg; extern bool sd_mount(); extern void sd_unmount(bool deinit); -#pragma GCC push_options -#pragma GCC target ("thumb") - void set_default_configuration() { h_cfg.autoboot = 0; @@ -169,4 +166,3 @@ int create_config_entry() return 0; } -#pragma GCC pop_options diff --git a/nyx/nyx_gui/frontend/fe_emmc_tools.c b/nyx/nyx_gui/frontend/fe_emmc_tools.c index 1dfc05e..9d8f56f 100644 --- a/nyx/nyx_gui/frontend/fe_emmc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emmc_tools.c @@ -53,9 +53,6 @@ extern bool sd_mount(); extern void sd_unmount(bool deinit); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); -#pragma GCC push_options -#pragma GCC target ("thumb") - static void get_valid_partition(u32 *sector_start, u32 *sector_size, u32 *part_idx, bool backup) { sd_mount(); @@ -144,8 +141,6 @@ static void _update_filename(char *outFilename, u32 sdPathLen, u32 currPartIdx) itoa(currPartIdx, &outFilename[sdPathLen], 10); } -#pragma GCC pop_options - static int _dump_emmc_verify(emmc_tool_gui_t *gui, sdmmc_storage_t *storage, u32 lba_curr, char *outFilename, emmc_part_t *part) { FIL fp; diff --git a/nyx/nyx_gui/frontend/fe_emummc_tools.c b/nyx/nyx_gui/frontend/fe_emummc_tools.c index a9d4e41..98834c0 100644 --- a/nyx/nyx_gui/frontend/fe_emummc_tools.c +++ b/nyx/nyx_gui/frontend/fe_emummc_tools.c @@ -49,9 +49,6 @@ extern hekate_config h_cfg; extern bool sd_mount(); extern void sd_unmount(bool deinit); -#pragma GCC push_options -#pragma GCC target ("thumb") - void save_emummc_cfg(u32 part_idx, u32 sector_start, const char *path) { sd_mount(); @@ -100,8 +97,6 @@ void save_emummc_cfg(u32 part_idx, u32 sector_start, const char *path) f_close(&fp); } -#pragma GCC pop_options - static void _update_emummc_base_folder(char *outFilename, u32 sdPathLen, u32 currPartIdx) { if (currPartIdx < 10) diff --git a/nyx/nyx_gui/frontend/gui.c b/nyx/nyx_gui/frontend/gui.c index 62d1d47..52bc791 100644 --- a/nyx/nyx_gui/frontend/gui.c +++ b/nyx/nyx_gui/frontend/gui.c @@ -327,9 +327,6 @@ lv_img_dsc_t *bmp_to_lvimg_obj(const char *path) return (lv_img_dsc_t *)bitmap; } -#pragma GCC push_options -#pragma GCC target ("thumb") - lv_res_t nyx_generic_onoff_toggle(lv_obj_t *btn) { lv_obj_t *label_btn = lv_obj_get_child(btn, NULL); @@ -766,8 +763,6 @@ static void _create_tab_about(lv_theme_t * th, lv_obj_t * parent) lv_label_set_text(lbl_ver, version); } -#pragma GCC pop_options - static void _update_status_bar(void *params) { char *label = (char *)malloc(64); @@ -1216,9 +1211,6 @@ static lv_res_t _create_window_home_launch(lv_obj_t *btn) return LV_RES_OK; } -#pragma GCC push_options -#pragma GCC target ("thumb") - static void _create_tab_home(lv_theme_t *th, lv_obj_t *parent) { lv_page_set_scrl_layout(parent, LV_LAYOUT_OFF); @@ -1598,8 +1590,6 @@ static void _nyx_main_menu(lv_theme_t * th) } } -#pragma GCC pop_options - void nyx_load_and_run() { memset(&system_tasks, 0, sizeof(system_maintenance_tasks_t)); diff --git a/nyx/nyx_gui/frontend/gui_emmc_tools.c b/nyx/nyx_gui/frontend/gui_emmc_tools.c index 09e0a3b..acb54de 100644 --- a/nyx/nyx_gui/frontend/gui_emmc_tools.c +++ b/nyx/nyx_gui/frontend/gui_emmc_tools.c @@ -41,9 +41,6 @@ extern bool sd_mount(); extern int sd_save_to_file(void *buf, u32 size, const char *filename); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); -#pragma GCC push_options -#pragma GCC target ("thumb") - typedef struct _emmc_backup_buttons_t { lv_obj_t *emmc_boot; @@ -470,5 +467,3 @@ lv_res_t create_window_backup_restore_tool(lv_obj_t *btn) return LV_RES_OK; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/frontend/gui_emummc_tools.c b/nyx/nyx_gui/frontend/gui_emummc_tools.c index b0ab039..2a487aa 100644 --- a/nyx/nyx_gui/frontend/gui_emummc_tools.c +++ b/nyx/nyx_gui/frontend/gui_emummc_tools.c @@ -39,9 +39,6 @@ extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_st static int part_idx; static u32 sector_start; -#pragma GCC push_options -#pragma GCC target ("thumb") - static void _create_window_emummc() { emmc_tool_gui_t emmc_tool_gui_ctxt; @@ -1151,5 +1148,3 @@ lv_res_t create_win_emummc_tools(lv_obj_t *btn) return LV_RES_OK; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/frontend/gui_info.c b/nyx/nyx_gui/frontend/gui_info.c index bba78f7..1fb55fb 100644 --- a/nyx/nyx_gui/frontend/gui_info.c +++ b/nyx/nyx_gui/frontend/gui_info.c @@ -45,9 +45,6 @@ extern void sd_unmount(bool deinit); extern int sd_save_to_file(void *buf, u32 size, const char *filename); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); -#pragma GCC push_options -#pragma GCC target ("thumb") - static lv_res_t _create_window_dump_done(int error, char *dump_filenames) { lv_style_t *darken; @@ -1171,5 +1168,3 @@ void create_tab_info(lv_theme_t *th, lv_obj_t *parent) lv_obj_set_style(label_txt6, &hint_small_style); lv_obj_align(label_txt6, btn7, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/frontend/gui_tools.c b/nyx/nyx_gui/frontend/gui_tools.c index 357090a..76b2b2f 100644 --- a/nyx/nyx_gui/frontend/gui_tools.c +++ b/nyx/nyx_gui/frontend/gui_tools.c @@ -41,9 +41,6 @@ extern void sd_unmount(bool deinit); extern int sd_save_to_file(void *buf, u32 size, const char *filename); extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); -#pragma GCC push_options -#pragma GCC target ("thumb") - bool get_autorcm_status(bool change) { u8 corr_mod_byte0; @@ -894,5 +891,3 @@ void create_tab_tools(lv_theme_t *th, lv_obj_t *parent) lv_tabview_set_tab_act(tv, 0, false); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/gfx/di.c b/nyx/nyx_gui/gfx/di.c index 74bca70..97c4320 100644 --- a/nyx/nyx_gui/gfx/di.c +++ b/nyx/nyx_gui/gfx/di.c @@ -29,10 +29,6 @@ #include "../soc/t210.h" #include "../utils/util.h" -#pragma GCC push_options -#pragma GCC target ("thumb") -#pragma GCC optimize ("Os") - #include "di.inl" static u32 _display_ver = 0; @@ -288,4 +284,3 @@ u32 *display_init_framebuffer2() return (u32 *)FB_ADDRESS; } -#pragma GCC pop_options diff --git a/nyx/nyx_gui/gfx/gfx.c b/nyx/nyx_gui/gfx/gfx.c index 578c8f7..8baa1d9 100644 --- a/nyx/nyx_gui/gfx/gfx.c +++ b/nyx/nyx_gui/gfx/gfx.c @@ -19,10 +19,6 @@ #include #include "gfx.h" -#pragma GCC push_options -#pragma GCC target ("thumb") -#pragma GCC optimize ("Os") - static const u8 _gfx_font[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 032 ( ) 0x00, 0x30, 0x30, 0x18, 0x18, 0x00, 0x0C, 0x00, // Char 033 (!) @@ -482,8 +478,6 @@ void gfx_line(int x0, int y0, int x1, int y1, u32 color) } } -#pragma GCC pop_options - void gfx_set_rect_grey(const u8 *buf, u32 size_x, u32 size_y, u32 pos_x, u32 pos_y) { u32 pos = 0; diff --git a/nyx/nyx_gui/libs/elfload/elfload.c b/nyx/nyx_gui/libs/elfload/elfload.c index 1c3e464..16f8200 100644 --- a/nyx/nyx_gui/libs/elfload/elfload.c +++ b/nyx/nyx_gui/libs/elfload/elfload.c @@ -19,9 +19,6 @@ #include "elfload.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - el_status el_pread(el_ctx *ctx, void *def, size_t nb, size_t offset) { return ctx->pread(ctx, def, nb, offset) ? EL_OK : EL_EIO; @@ -325,5 +322,3 @@ el_status el_relocate(el_ctx *ctx) return rv; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/libs/fatfs/ff.c b/nyx/nyx_gui/libs/fatfs/ff.c index 6d7be7c..f7fdf20 100644 --- a/nyx/nyx_gui/libs/fatfs/ff.c +++ b/nyx/nyx_gui/libs/fatfs/ff.c @@ -40,9 +40,6 @@ #include "diskio.h" /* Declarations of device I/O functions */ #include "../../gfx/gfx.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - #define EFSPRINTF(text, ...) print_error(); gfx_printf("%k"text"%k\n", 0xFFFFFF00, 0xFFFFFFFF); //#define EFSPRINTF(...) @@ -6862,5 +6859,3 @@ FRESULT f_setcp ( return FR_OK; } #endif /* FF_CODE_PAGE == 0 */ - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/libs/fatfs/ffunicode.c b/nyx/nyx_gui/libs/fatfs/ffunicode.c index 35d3fa2..9f03963 100644 --- a/nyx/nyx_gui/libs/fatfs/ffunicode.c +++ b/nyx/nyx_gui/libs/fatfs/ffunicode.c @@ -34,10 +34,6 @@ #define MERGE2(a, b) a ## b #define CVTBL(tbl, cp) MERGE2(tbl, cp) -#pragma GCC push_options -#pragma GCC target ("thumb") - - /*------------------------------------------------------------------------*/ /* Code Conversion Tables */ /*------------------------------------------------------------------------*/ @@ -626,7 +622,4 @@ DWORD ff_wtoupper ( /* Returns up-converted code point */ return uni; } -#pragma GCC pop_options - - #endif /* #if FF_USE_LFN */ diff --git a/nyx/nyx_gui/nyx.c b/nyx/nyx_gui/nyx.c index bce3992..8eaa546 100644 --- a/nyx/nyx_gui/nyx.c +++ b/nyx/nyx_gui/nyx.c @@ -169,9 +169,6 @@ int sd_save_to_file(void *buf, u32 size, const char *filename) return 0; } -#pragma GCC push_options -#pragma GCC target ("thumb") - void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage) { sdmmc_storage_t storage2; @@ -438,5 +435,3 @@ void ipl_main() while (true) bpmp_halt(); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/power/bq24193.c b/nyx/nyx_gui/power/bq24193.c index 0f01aef..6aa5dcb 100644 --- a/nyx/nyx_gui/power/bq24193.c +++ b/nyx/nyx_gui/power/bq24193.c @@ -20,9 +20,6 @@ #include "../soc/i2c.h" #include "../utils/util.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - int bq24193_get_property(enum BQ24193_reg_prop prop, int *value) { u8 data; @@ -163,5 +160,3 @@ void bq24193_fake_battery_removal() value |= BQ24193_MISC_BATFET_DI_MASK; i2c_send_byte(I2C_1, BQ24193_I2C_ADDR, BQ24193_Misc, value); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/power/max17050.c b/nyx/nyx_gui/power/max17050.c index 4fe05e0..b3a8b21 100644 --- a/nyx/nyx_gui/power/max17050.c +++ b/nyx/nyx_gui/power/max17050.c @@ -43,9 +43,6 @@ #define MAX17050_VMAX_TOLERANCE 50 /* 50 mV */ -#pragma GCC push_options -#pragma GCC target ("thumb") - int max17050_get_property(enum MAX17050_reg reg, int *value) { u16 data; @@ -267,5 +264,3 @@ int max17050_fix_configuration() return 0; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/power/max7762x.c b/nyx/nyx_gui/power/max7762x.c index 6ed7acf..0e7a6b5 100644 --- a/nyx/nyx_gui/power/max7762x.c +++ b/nyx/nyx_gui/power/max7762x.c @@ -23,9 +23,6 @@ #define REGULATOR_SD 0 #define REGULATOR_LDO 1 -#pragma GCC push_options -#pragma GCC target ("thumb") - typedef struct _max77620_regulator_t { u8 type; @@ -177,5 +174,3 @@ void max77620_low_battery_monitor_config() MAX77620_CNFGGLBL1_LBDAC_EN | MAX77620_CNFGGLBL1_MPPLD | MAX77620_CNFGGLBL1_LBHYST_200 | MAX77620_CNFGGLBL1_LBDAC_2800); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/soc/bpmp.c b/nyx/nyx_gui/soc/bpmp.c index f73d511..05c3f9a 100644 --- a/nyx/nyx_gui/soc/bpmp.c +++ b/nyx/nyx_gui/soc/bpmp.c @@ -72,9 +72,6 @@ #define MMU_EN_READ (1 << 2) #define MMU_EN_WRITE (1 << 3) -#pragma GCC push_options -#pragma GCC target ("thumb") - bpmp_mmu_entry_t mmu_entries[] = { { 0x80000000, 0xFFFFFFFF, MMU_EN_READ | MMU_EN_WRITE | MMU_EN_EXEC | MMU_EN_CACHED, true }, @@ -249,4 +246,3 @@ void bpmp_halt() FLOW_CTLR(FLOW_CTLR_HALT_COP_EVENTS) = HALT_COP_WAIT_EVENT | HALT_COP_JTAG; } -#pragma GCC pop_options diff --git a/nyx/nyx_gui/soc/clock.c b/nyx/nyx_gui/soc/clock.c index c5008a9..dda6d4b 100644 --- a/nyx/nyx_gui/soc/clock.c +++ b/nyx/nyx_gui/soc/clock.c @@ -19,9 +19,6 @@ #include "../utils/util.h" #include "../storage/sdmmc.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - /* clock_t: reset, enable, source, index, clk_src, clk_div */ static const clock_t _clock_uart[] = { @@ -535,5 +532,3 @@ void clock_sdmmc_disable(u32 id) _clock_sdmmc_clear_enable(id); _clock_sdmmc_is_reset(id); } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/soc/cluster.c b/nyx/nyx_gui/soc/cluster.c index 3628bd3..79538ed 100644 --- a/nyx/nyx_gui/soc/cluster.c +++ b/nyx/nyx_gui/soc/cluster.c @@ -23,9 +23,6 @@ #include "../power/max77620.h" #include "../power/max7762x.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - void _cluster_enable_power() { u8 tmp = i2c_recv_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_AME_GPIO); // Get current pinmuxing @@ -141,5 +138,3 @@ void cluster_boot_cpu0(u32 entry) // < 5.x: 0x411F000F, Clear CPU{0,1,2,3} POR and CORE, CX0, L2, and DBG reset. CLOCK(CLK_RST_CONTROLLER_RST_CPUG_CMPLX_CLR) = 0x41010001; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/soc/fuse.c b/nyx/nyx_gui/soc/fuse.c index e5273cd..04d3612 100644 --- a/nyx/nyx_gui/soc/fuse.c +++ b/nyx/nyx_gui/soc/fuse.c @@ -22,9 +22,6 @@ #include "../soc/fuse.h" #include "../soc/t210.h" -#pragma GCC push_options -#pragma GCC target ("thumb") - #define ARRAYSIZE(x) (sizeof(x) / sizeof(*x)) static const u32 evp_thunk_template[] = { @@ -350,5 +347,3 @@ bool fuse_check_patched_rcm() return false; } - -#pragma GCC pop_options diff --git a/nyx/nyx_gui/storage/sdmmc.c b/nyx/nyx_gui/storage/sdmmc.c index b860f73..0eb4e39 100644 --- a/nyx/nyx_gui/storage/sdmmc.c +++ b/nyx/nyx_gui/storage/sdmmc.c @@ -26,9 +26,6 @@ //#define DPRINTF(...) gfx_printf(__VA_ARGS__) #define DPRINTF(...) -#pragma GCC push_options -#pragma GCC target ("thumb") - static inline u32 unstuff_bits(u32 *resp, u32 start, u32 size) { const u32 mask = (size < 32 ? 1 << size : 0) - 1; @@ -1249,5 +1246,3 @@ DPRINTF("[gc] after tuning\n"); return 1; } - -#pragma GCC pop_options