mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2024-11-24 07:40:26 +01:00
emummc: add GetSocType/GetHardwareType utils
This commit is contained in:
parent
1525c66de7
commit
c77b76fbd2
@ -59,6 +59,35 @@ Result smcGetConfig(SplConfigItem config_item, u64 *out_config)
|
||||
return rc;
|
||||
}
|
||||
|
||||
SplHardwareType splGetHardwareType(void)
|
||||
{
|
||||
u64 value;
|
||||
Result rc = smcGetConfig(SplConfigItem_HardwareType, &value);
|
||||
if (rc != 0)
|
||||
{
|
||||
fatal_abort(Fatal_BadResult);
|
||||
}
|
||||
return (SplHardwareType)value;
|
||||
}
|
||||
|
||||
SplSocType splGetSocType(void)
|
||||
{
|
||||
switch (splGetHardwareType())
|
||||
{
|
||||
case SplHardwareType_Icosa:
|
||||
case SplHardwareType_Copper:
|
||||
return SplSocType_Erista;
|
||||
case SplHardwareType_Hoag:
|
||||
case SplHardwareType_Iowa:
|
||||
case SplHardwareType_Calcio:
|
||||
case SplHardwareType_Five:
|
||||
return SplSocType_Mariko;
|
||||
default:
|
||||
fatal_abort(Fatal_InvalidEnum);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Result smcCopyToIram(uintptr_t iram_addr, const void *src_addr, u32 size)
|
||||
{
|
||||
SecmonArgs args;
|
||||
|
@ -37,6 +37,20 @@ typedef enum {
|
||||
SplConfigItem_HasRcmBugPatch = 65004,
|
||||
} SplConfigItem;
|
||||
|
||||
typedef enum {
|
||||
SplSocType_Erista = 0,
|
||||
SplSocType_Mariko = 1,
|
||||
} SplSocType;
|
||||
|
||||
typedef enum {
|
||||
SplHardwareType_Icosa = 0,
|
||||
SplHardwareType_Copper = 1,
|
||||
SplHardwareType_Hoag = 2,
|
||||
SplHardwareType_Iowa = 3,
|
||||
SplHardwareType_Calcio = 4,
|
||||
SplHardwareType_Five = 5,
|
||||
} SplHardwareType;
|
||||
|
||||
typedef enum {
|
||||
EXO_EMUMMC_TYPE_NONE = 0,
|
||||
EXO_EMUMMC_TYPE_PARTITION = 1,
|
||||
@ -69,6 +83,9 @@ typedef struct {
|
||||
|
||||
Result smcGetConfig(SplConfigItem config_item, u64 *out_config);
|
||||
|
||||
SplHardwareType splGetHardwareType(void);
|
||||
SplSocType splGetSocType(void);
|
||||
|
||||
void smcRebootToRcm(void);
|
||||
void smcRebootToIramPayload(void);
|
||||
void smcPerformShutdown(void);
|
||||
|
@ -35,6 +35,7 @@ enum FatalReason
|
||||
Fatal_FatfsMount,
|
||||
Fatal_FatfsFileOpen,
|
||||
Fatal_FatfsMemExhaustion,
|
||||
Fatal_InvalidEnum,
|
||||
Fatal_Max
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user