fusee/exo: add emunand configitem support
This commit is contained in:
@@ -284,6 +284,9 @@ uint32_t configitem_get(bool privileged, ConfigItem item, uint64_t *p_outvalue)
|
||||
/* UNOFFICIAL: Gets whether this unit has the RCM bug patched. */
|
||||
*p_outvalue = (int)(fuse_has_rcm_bug_patch());;
|
||||
break;
|
||||
case CONFIGITEM_EMUNAND_CONFIG:
|
||||
/* UNOFFICIAL: Gets configuration meta for emunand. */
|
||||
*p_outvalue = exosphere_get_emunand_config();
|
||||
default:
|
||||
result = 2;
|
||||
break;
|
||||
|
||||
@@ -45,6 +45,9 @@ typedef enum {
|
||||
CONFIGITEM_NEEDS_SHUTDOWN = 65002,
|
||||
CONFIGITEM_EXOSPHERE_VERHASH = 65003,
|
||||
CONFIGITEM_HAS_RCM_BUG_PATCH = 65004,
|
||||
|
||||
/* These are unofficial, emunand-related. */
|
||||
CONFIGITEM_EMUNAND_CONFIG = 65100,
|
||||
} ConfigItem;
|
||||
|
||||
#define REBOOT_KIND_NO_REBOOT 0
|
||||
|
||||
@@ -83,3 +83,11 @@ unsigned int exosphere_should_disable_usermode_exception_handlers(void) {
|
||||
|
||||
return EXOSPHERE_CHECK_FLAG(EXOSPHERE_FLAG_DISABLE_USERMODE_EXCEPTION_HANDLERS);
|
||||
}
|
||||
|
||||
uint64_t exosphere_get_emunand_config(void) {
|
||||
if (!g_has_loaded_config) {
|
||||
generic_panic();
|
||||
}
|
||||
|
||||
return g_exosphere_cfg.emunand_config;
|
||||
}
|
||||
|
||||
@@ -42,12 +42,15 @@
|
||||
#define EXOSPHERE_FLAGS_DEFAULT (EXOSPHERE_FLAG_IS_DEBUGMODE_PRIV)
|
||||
|
||||
typedef struct {
|
||||
unsigned int magic;
|
||||
unsigned int target_firmware;
|
||||
unsigned int flags;
|
||||
unsigned int reserved;
|
||||
uint32_t magic;
|
||||
uint32_t target_firmware;
|
||||
uint32_t flags;
|
||||
uint32_t reserved;
|
||||
uint64_t emunand_config;
|
||||
} exosphere_config_t;
|
||||
|
||||
_Static_assert(sizeof(exosphere_config_t) == 0x18, "exosphere config definition");
|
||||
|
||||
unsigned int exosphere_load_config(void);
|
||||
unsigned int exosphere_get_target_firmware(void);
|
||||
unsigned int exosphere_should_perform_620_keygen(void);
|
||||
@@ -55,6 +58,8 @@ unsigned int exosphere_should_override_debugmode_priv(void);
|
||||
unsigned int exosphere_should_override_debugmode_user(void);
|
||||
unsigned int exosphere_should_disable_usermode_exception_handlers(void);
|
||||
|
||||
uint64_t exosphere_get_emunand_config(void);
|
||||
|
||||
static inline unsigned int exosphere_get_target_firmware_for_init(void) {
|
||||
const unsigned int magic = MAILBOX_EXOSPHERE_CONFIG_PHYS.magic;
|
||||
if (magic == MAGIC_EXOSPHERE_CONFIG) {
|
||||
|
||||
Reference in New Issue
Block a user