mirror of
https://github.com/CTCaer/hekate
synced 2024-12-22 19:31:12 +00:00
minerva: More protections
This commit is contained in:
parent
91a241dafa
commit
52874f9113
4 changed files with 9 additions and 4 deletions
|
@ -34,6 +34,7 @@ u32 minerva_init()
|
||||||
|
|
||||||
minerva_cfg = NULL;
|
minerva_cfg = NULL;
|
||||||
mtc_config_t *mtc_cfg = (mtc_config_t *)&nyx_str->mtc_cfg;
|
mtc_config_t *mtc_cfg = (mtc_config_t *)&nyx_str->mtc_cfg;
|
||||||
|
memset(mtc_cfg, 0, sizeof(mtc_config_t));
|
||||||
|
|
||||||
// Set table to nyx storage.
|
// Set table to nyx storage.
|
||||||
mtc_cfg->mtc_table = (emc_table_t *)&nyx_str->mtc_table;
|
mtc_cfg->mtc_table = (emc_table_t *)&nyx_str->mtc_table;
|
||||||
|
@ -46,6 +47,8 @@ u32 minerva_init()
|
||||||
// Ensure that Minerva is new.
|
// Ensure that Minerva is new.
|
||||||
if (mtc_cfg->init_done == MTC_INIT_MAGIC)
|
if (mtc_cfg->init_done == MTC_INIT_MAGIC)
|
||||||
minerva_cfg = (void *)ep_addr;
|
minerva_cfg = (void *)ep_addr;
|
||||||
|
else
|
||||||
|
mtc_cfg->init_done = 0;
|
||||||
|
|
||||||
if (!minerva_cfg)
|
if (!minerva_cfg)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef struct _nyx_storage_t
|
||||||
u8 rsvd[0x800000 - sizeof(nyx_info_t)];
|
u8 rsvd[0x800000 - sizeof(nyx_info_t)];
|
||||||
nyx_info_t info;
|
nyx_info_t info;
|
||||||
mtc_config_t mtc_cfg;
|
mtc_config_t mtc_cfg;
|
||||||
emc_table_t mtc_table;
|
emc_table_t mtc_table[10];
|
||||||
} nyx_storage_t;
|
} nyx_storage_t;
|
||||||
|
|
||||||
u32 get_tmr_us();
|
u32 get_tmr_us();
|
||||||
|
|
|
@ -36,7 +36,7 @@ u32 minerva_init()
|
||||||
mtc_config_t *mtc_cfg = (mtc_config_t *)&nyx_str->mtc_cfg;
|
mtc_config_t *mtc_cfg = (mtc_config_t *)&nyx_str->mtc_cfg;
|
||||||
|
|
||||||
// Set table to nyx storage.
|
// Set table to nyx storage.
|
||||||
mtc_cfg->mtc_table = (emc_table_t *)&nyx_str->mtc_table;
|
mtc_cfg->mtc_table = (emc_table_t *)nyx_str->mtc_table;
|
||||||
|
|
||||||
// Check if Minerva is already initialized.
|
// Check if Minerva is already initialized.
|
||||||
if (mtc_cfg->init_done == MTC_INIT_MAGIC)
|
if (mtc_cfg->init_done == MTC_INIT_MAGIC)
|
||||||
|
@ -60,6 +60,8 @@ u32 minerva_init()
|
||||||
// Ensure that Minerva is new.
|
// Ensure that Minerva is new.
|
||||||
if (mtc_tmp.init_done == MTC_INIT_MAGIC)
|
if (mtc_tmp.init_done == MTC_INIT_MAGIC)
|
||||||
minerva_cfg = (void *)ep_addr;
|
minerva_cfg = (void *)ep_addr;
|
||||||
|
else
|
||||||
|
mtc_cfg->init_done = 0;
|
||||||
|
|
||||||
// Copy Minerva context to Nyx storage.
|
// Copy Minerva context to Nyx storage.
|
||||||
if (minerva_cfg)
|
if (minerva_cfg)
|
||||||
|
|
|
@ -57,7 +57,7 @@ typedef struct _nyx_storage_t
|
||||||
u8 rsvd[0x800000 - sizeof(nyx_info_t)];
|
u8 rsvd[0x800000 - sizeof(nyx_info_t)];
|
||||||
nyx_info_t info;
|
nyx_info_t info;
|
||||||
mtc_config_t mtc_cfg;
|
mtc_config_t mtc_cfg;
|
||||||
emc_table_t mtc_table;
|
emc_table_t mtc_table[10];
|
||||||
} nyx_storage_t;
|
} nyx_storage_t;
|
||||||
|
|
||||||
u32 get_tmr_us();
|
u32 get_tmr_us();
|
||||||
|
|
Loading…
Reference in a new issue