mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-05-28 05:34:11 -04:00
exo2: first pass at backwards-compat
This commit is contained in:
parent
42f1a3bf60
commit
da4107996a
9 changed files with 195 additions and 48 deletions
|
@ -122,6 +122,15 @@ namespace ams::secmon::smc {
|
|||
{ 0xC3000012, Restriction_SafeModeNotAllowed, SmcPrepareEsCommonTitleKey }
|
||||
};
|
||||
|
||||
/* Deprecated handlerss. */
|
||||
constexpr inline const HandlerInfo DecryptAndImportEsDeviceKeyHandlerInfo = {
|
||||
0xC300100C, Restriction_DeviceUniqueDataNotAllowed, SmcDecryptAndImportEsDeviceKey
|
||||
};
|
||||
|
||||
constexpr inline const HandlerInfo DecryptAndImportLotusKeyHandlerInfo = {
|
||||
0xC300100E, Restriction_DeviceUniqueDataNotAllowed, SmcDecryptAndImportLotusKey
|
||||
};
|
||||
|
||||
constinit HandlerInfo g_kern_handlers[] = {
|
||||
{ 0x00000000, Restriction_SafeModeNotAllowed, nullptr },
|
||||
{ 0xC4000001, Restriction_SafeModeNotAllowed, SmcSuspendCpu },
|
||||
|
@ -266,6 +275,15 @@ namespace ams::secmon::smc {
|
|||
|
||||
}
|
||||
|
||||
void ConfigureSmcHandlersForTargetFirmware() {
|
||||
const auto target_fw = GetTargetFirmware();
|
||||
|
||||
if (target_fw < TargetFirmware_5_0_0) {
|
||||
g_user_handlers[DecryptAndImportEsDeviceKeyHandlerInfo.function_id & 0xFF] = DecryptAndImportEsDeviceKeyHandlerInfo;
|
||||
g_user_handlers[DecryptAndImportLotusKeyHandlerInfo.function_id & 0xFF] = DecryptAndImportLotusKeyHandlerInfo;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleSmc(int type, SmcArguments &args) {
|
||||
/* Get the table. */
|
||||
const auto &table = GetHandlerTable(static_cast<HandlerType>(type), args.r[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue