nyx: Release the shackles

This commit is contained in:
Kostas Missos 2019-12-07 20:16:38 +02:00
parent edc2b12f0f
commit 48c15a8fde
23 changed files with 1 additions and 117 deletions

View file

@ -6,7 +6,7 @@ include $(DEVKITARM)/base_rules
################################################################################ ################################################################################
NYX_LOAD_ADDR := 0x40003000 NYX_LOAD_ADDR := 0x81000000
NYX_RES_ADDR := 0xEE000000 NYX_RES_ADDR := 0xEE000000
NYX_STORAGE_ADDR := 0xED000000 NYX_STORAGE_ADDR := 0xED000000
NYX_MAGIC := 0x43544347 #"GCTC" NYX_MAGIC := 0x43544347 #"GCTC"

View file

@ -32,9 +32,6 @@ extern hekate_config h_cfg;
extern bool sd_mount(); extern bool sd_mount();
extern void sd_unmount(bool deinit); extern void sd_unmount(bool deinit);
#pragma GCC push_options
#pragma GCC target ("thumb")
void set_default_configuration() void set_default_configuration()
{ {
h_cfg.autoboot = 0; h_cfg.autoboot = 0;
@ -169,4 +166,3 @@ int create_config_entry()
return 0; return 0;
} }
#pragma GCC pop_options

View file

@ -53,9 +53,6 @@ extern bool sd_mount();
extern void sd_unmount(bool deinit); extern void sd_unmount(bool deinit);
extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage); 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) static void get_valid_partition(u32 *sector_start, u32 *sector_size, u32 *part_idx, bool backup)
{ {
sd_mount(); sd_mount();
@ -144,8 +141,6 @@ static void _update_filename(char *outFilename, u32 sdPathLen, u32 currPartIdx)
itoa(currPartIdx, &outFilename[sdPathLen], 10); 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) 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; FIL fp;

View file

@ -49,9 +49,6 @@ extern hekate_config h_cfg;
extern bool sd_mount(); extern bool sd_mount();
extern void sd_unmount(bool deinit); 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) void save_emummc_cfg(u32 part_idx, u32 sector_start, const char *path)
{ {
sd_mount(); sd_mount();
@ -100,8 +97,6 @@ void save_emummc_cfg(u32 part_idx, u32 sector_start, const char *path)
f_close(&fp); f_close(&fp);
} }
#pragma GCC pop_options
static void _update_emummc_base_folder(char *outFilename, u32 sdPathLen, u32 currPartIdx) static void _update_emummc_base_folder(char *outFilename, u32 sdPathLen, u32 currPartIdx)
{ {
if (currPartIdx < 10) if (currPartIdx < 10)

View file

@ -327,9 +327,6 @@ lv_img_dsc_t *bmp_to_lvimg_obj(const char *path)
return (lv_img_dsc_t *)bitmap; 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_res_t nyx_generic_onoff_toggle(lv_obj_t *btn)
{ {
lv_obj_t *label_btn = lv_obj_get_child(btn, NULL); 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); lv_label_set_text(lbl_ver, version);
} }
#pragma GCC pop_options
static void _update_status_bar(void *params) static void _update_status_bar(void *params)
{ {
char *label = (char *)malloc(64); 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; 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) static void _create_tab_home(lv_theme_t *th, lv_obj_t *parent)
{ {
lv_page_set_scrl_layout(parent, LV_LAYOUT_OFF); 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() void nyx_load_and_run()
{ {
memset(&system_tasks, 0, sizeof(system_maintenance_tasks_t)); memset(&system_tasks, 0, sizeof(system_maintenance_tasks_t));

View file

@ -41,9 +41,6 @@ extern bool sd_mount();
extern int sd_save_to_file(void *buf, u32 size, const char *filename); 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); 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 typedef struct _emmc_backup_buttons_t
{ {
lv_obj_t *emmc_boot; 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; return LV_RES_OK;
} }
#pragma GCC pop_options

View file

@ -39,9 +39,6 @@ extern void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_st
static int part_idx; static int part_idx;
static u32 sector_start; static u32 sector_start;
#pragma GCC push_options
#pragma GCC target ("thumb")
static void _create_window_emummc() static void _create_window_emummc()
{ {
emmc_tool_gui_t emmc_tool_gui_ctxt; 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; return LV_RES_OK;
} }
#pragma GCC pop_options

View file

@ -45,9 +45,6 @@ extern void sd_unmount(bool deinit);
extern int sd_save_to_file(void *buf, u32 size, const char *filename); 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); 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) static lv_res_t _create_window_dump_done(int error, char *dump_filenames)
{ {
lv_style_t *darken; 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_set_style(label_txt6, &hint_small_style);
lv_obj_align(label_txt6, btn7, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3); lv_obj_align(label_txt6, btn7, LV_ALIGN_OUT_BOTTOM_LEFT, 0, LV_DPI / 3);
} }
#pragma GCC pop_options

View file

@ -41,9 +41,6 @@ extern void sd_unmount(bool deinit);
extern int sd_save_to_file(void *buf, u32 size, const char *filename); 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); 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) bool get_autorcm_status(bool change)
{ {
u8 corr_mod_byte0; 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); lv_tabview_set_tab_act(tv, 0, false);
} }
#pragma GCC pop_options

View file

@ -29,10 +29,6 @@
#include "../soc/t210.h" #include "../soc/t210.h"
#include "../utils/util.h" #include "../utils/util.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
#pragma GCC optimize ("Os")
#include "di.inl" #include "di.inl"
static u32 _display_ver = 0; static u32 _display_ver = 0;
@ -288,4 +284,3 @@ u32 *display_init_framebuffer2()
return (u32 *)FB_ADDRESS; return (u32 *)FB_ADDRESS;
} }
#pragma GCC pop_options

View file

@ -19,10 +19,6 @@
#include <string.h> #include <string.h>
#include "gfx.h" #include "gfx.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
#pragma GCC optimize ("Os")
static const u8 _gfx_font[] = { static const u8 _gfx_font[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 032 ( ) 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Char 032 ( )
0x00, 0x30, 0x30, 0x18, 0x18, 0x00, 0x0C, 0x00, // Char 033 (!) 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) void gfx_set_rect_grey(const u8 *buf, u32 size_x, u32 size_y, u32 pos_x, u32 pos_y)
{ {
u32 pos = 0; u32 pos = 0;

View file

@ -19,9 +19,6 @@
#include "elfload.h" #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) 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; return ctx->pread(ctx, def, nb, offset) ? EL_OK : EL_EIO;
@ -325,5 +322,3 @@ el_status el_relocate(el_ctx *ctx)
return rv; return rv;
} }
#pragma GCC pop_options

View file

@ -40,9 +40,6 @@
#include "diskio.h" /* Declarations of device I/O functions */ #include "diskio.h" /* Declarations of device I/O functions */
#include "../../gfx/gfx.h" #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(text, ...) print_error(); gfx_printf("%k"text"%k\n", 0xFFFFFF00, 0xFFFFFFFF);
//#define EFSPRINTF(...) //#define EFSPRINTF(...)
@ -6862,5 +6859,3 @@ FRESULT f_setcp (
return FR_OK; return FR_OK;
} }
#endif /* FF_CODE_PAGE == 0 */ #endif /* FF_CODE_PAGE == 0 */
#pragma GCC pop_options

View file

@ -34,10 +34,6 @@
#define MERGE2(a, b) a ## b #define MERGE2(a, b) a ## b
#define CVTBL(tbl, cp) MERGE2(tbl, cp) #define CVTBL(tbl, cp) MERGE2(tbl, cp)
#pragma GCC push_options
#pragma GCC target ("thumb")
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
/* Code Conversion Tables */ /* Code Conversion Tables */
/*------------------------------------------------------------------------*/ /*------------------------------------------------------------------------*/
@ -626,7 +622,4 @@ DWORD ff_wtoupper ( /* Returns up-converted code point */
return uni; return uni;
} }
#pragma GCC pop_options
#endif /* #if FF_USE_LFN */ #endif /* #if FF_USE_LFN */

View file

@ -169,9 +169,6 @@ int sd_save_to_file(void *buf, u32 size, const char *filename)
return 0; 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) void emmcsn_path_impl(char *path, char *sub_dir, char *filename, sdmmc_storage_t *storage)
{ {
sdmmc_storage_t storage2; sdmmc_storage_t storage2;
@ -438,5 +435,3 @@ void ipl_main()
while (true) while (true)
bpmp_halt(); bpmp_halt();
} }
#pragma GCC pop_options

View file

@ -20,9 +20,6 @@
#include "../soc/i2c.h" #include "../soc/i2c.h"
#include "../utils/util.h" #include "../utils/util.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
int bq24193_get_property(enum BQ24193_reg_prop prop, int *value) int bq24193_get_property(enum BQ24193_reg_prop prop, int *value)
{ {
u8 data; u8 data;
@ -163,5 +160,3 @@ void bq24193_fake_battery_removal()
value |= BQ24193_MISC_BATFET_DI_MASK; value |= BQ24193_MISC_BATFET_DI_MASK;
i2c_send_byte(I2C_1, BQ24193_I2C_ADDR, BQ24193_Misc, value); i2c_send_byte(I2C_1, BQ24193_I2C_ADDR, BQ24193_Misc, value);
} }
#pragma GCC pop_options

View file

@ -43,9 +43,6 @@
#define MAX17050_VMAX_TOLERANCE 50 /* 50 mV */ #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) int max17050_get_property(enum MAX17050_reg reg, int *value)
{ {
u16 data; u16 data;
@ -267,5 +264,3 @@ int max17050_fix_configuration()
return 0; return 0;
} }
#pragma GCC pop_options

View file

@ -23,9 +23,6 @@
#define REGULATOR_SD 0 #define REGULATOR_SD 0
#define REGULATOR_LDO 1 #define REGULATOR_LDO 1
#pragma GCC push_options
#pragma GCC target ("thumb")
typedef struct _max77620_regulator_t typedef struct _max77620_regulator_t
{ {
u8 type; u8 type;
@ -177,5 +174,3 @@ void max77620_low_battery_monitor_config()
MAX77620_CNFGGLBL1_LBDAC_EN | MAX77620_CNFGGLBL1_MPPLD | MAX77620_CNFGGLBL1_LBDAC_EN | MAX77620_CNFGGLBL1_MPPLD |
MAX77620_CNFGGLBL1_LBHYST_200 | MAX77620_CNFGGLBL1_LBDAC_2800); MAX77620_CNFGGLBL1_LBHYST_200 | MAX77620_CNFGGLBL1_LBDAC_2800);
} }
#pragma GCC pop_options

View file

@ -72,9 +72,6 @@
#define MMU_EN_READ (1 << 2) #define MMU_EN_READ (1 << 2)
#define MMU_EN_WRITE (1 << 3) #define MMU_EN_WRITE (1 << 3)
#pragma GCC push_options
#pragma GCC target ("thumb")
bpmp_mmu_entry_t mmu_entries[] = bpmp_mmu_entry_t mmu_entries[] =
{ {
{ 0x80000000, 0xFFFFFFFF, MMU_EN_READ | MMU_EN_WRITE | MMU_EN_EXEC | MMU_EN_CACHED, true }, { 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; FLOW_CTLR(FLOW_CTLR_HALT_COP_EVENTS) = HALT_COP_WAIT_EVENT | HALT_COP_JTAG;
} }
#pragma GCC pop_options

View file

@ -19,9 +19,6 @@
#include "../utils/util.h" #include "../utils/util.h"
#include "../storage/sdmmc.h" #include "../storage/sdmmc.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
/* clock_t: reset, enable, source, index, clk_src, clk_div */ /* clock_t: reset, enable, source, index, clk_src, clk_div */
static const clock_t _clock_uart[] = { static const clock_t _clock_uart[] = {
@ -535,5 +532,3 @@ void clock_sdmmc_disable(u32 id)
_clock_sdmmc_clear_enable(id); _clock_sdmmc_clear_enable(id);
_clock_sdmmc_is_reset(id); _clock_sdmmc_is_reset(id);
} }
#pragma GCC pop_options

View file

@ -23,9 +23,6 @@
#include "../power/max77620.h" #include "../power/max77620.h"
#include "../power/max7762x.h" #include "../power/max7762x.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
void _cluster_enable_power() void _cluster_enable_power()
{ {
u8 tmp = i2c_recv_byte(I2C_5, MAX77620_I2C_ADDR, MAX77620_REG_AME_GPIO); // Get current pinmuxing 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. // < 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; CLOCK(CLK_RST_CONTROLLER_RST_CPUG_CMPLX_CLR) = 0x41010001;
} }
#pragma GCC pop_options

View file

@ -22,9 +22,6 @@
#include "../soc/fuse.h" #include "../soc/fuse.h"
#include "../soc/t210.h" #include "../soc/t210.h"
#pragma GCC push_options
#pragma GCC target ("thumb")
#define ARRAYSIZE(x) (sizeof(x) / sizeof(*x)) #define ARRAYSIZE(x) (sizeof(x) / sizeof(*x))
static const u32 evp_thunk_template[] = { static const u32 evp_thunk_template[] = {
@ -350,5 +347,3 @@ bool fuse_check_patched_rcm()
return false; return false;
} }
#pragma GCC pop_options

View file

@ -26,9 +26,6 @@
//#define DPRINTF(...) gfx_printf(__VA_ARGS__) //#define DPRINTF(...) gfx_printf(__VA_ARGS__)
#define DPRINTF(...) #define DPRINTF(...)
#pragma GCC push_options
#pragma GCC target ("thumb")
static inline u32 unstuff_bits(u32 *resp, u32 start, u32 size) static inline u32 unstuff_bits(u32 *resp, u32 start, u32 size)
{ {
const u32 mask = (size < 32 ? 1 << size : 0) - 1; const u32 mask = (size < 32 ? 1 << size : 0) - 1;
@ -1249,5 +1246,3 @@ DPRINTF("[gc] after tuning\n");
return 1; return 1;
} }
#pragma GCC pop_options