From c01753370af223cd725efba49364aca5e5fc9644 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Mon, 13 Jul 2020 17:34:48 -0700 Subject: [PATCH] ams: update to know about 10.1.0 --- fusee/fusee-secondary/src/nxboot.c | 1 + .../include/stratosphere/hos/hos_types.hpp | 3 + .../include/vapours/ams/ams_api_version.h | 4 +- .../include/vapours/ams/ams_target_firmware.h | 5 +- .../source/ldr_anti_downgrade_tables.inc | 73 +++++++++++++++++++ .../loader/source/ldr_process_creation.cpp | 5 +- 6 files changed, 87 insertions(+), 4 deletions(-) diff --git a/fusee/fusee-secondary/src/nxboot.c b/fusee/fusee-secondary/src/nxboot.c index 1161be07b..cf6e5303a 100644 --- a/fusee/fusee-secondary/src/nxboot.c +++ b/fusee/fusee-secondary/src/nxboot.c @@ -236,6 +236,7 @@ static uint32_t nxboot_get_specific_target_firmware(uint32_t target_firmware){ #define CHECK_NCA(NCA_ID, VERSION) do { if (is_nca_present(NCA_ID)) { return ATMOSPHERE_TARGET_FIRMWARE_##VERSION; } } while(0) if (target_firmware >= ATMOSPHERE_TARGET_FIRMWARE_10_0_0) { + CHECK_NCA("fd1faed0ca750700d254c0915b93d506", 10_1_0); CHECK_NCA("34728c771299443420820d8ae490ea41", 10_0_4); CHECK_NCA("5b1df84f88c3334335bbb45d8522cbb4", 10_0_3); CHECK_NCA("e951bc9dedcd54f65ffd83d4d050f9e0", 10_0_2); diff --git a/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp b/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp index 8a31591ae..961fc2805 100644 --- a/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/hos/hos_types.hpp @@ -54,6 +54,9 @@ namespace ams::hos { Version_10_0_0 = ::ams::TargetFirmware_10_0_0, Version_10_0_1 = ::ams::TargetFirmware_10_0_1, Version_10_0_2 = ::ams::TargetFirmware_10_0_2, + Version_10_0_3 = ::ams::TargetFirmware_10_0_3, + Version_10_0_4 = ::ams::TargetFirmware_10_0_4, + Version_10_1_0 = ::ams::TargetFirmware_10_1_0, Version_Current = ::ams::TargetFirmware_Current, diff --git a/libraries/libvapours/include/vapours/ams/ams_api_version.h b/libraries/libvapours/include/vapours/ams/ams_api_version.h index 50a6a065b..d8204f782 100644 --- a/libraries/libvapours/include/vapours/ams/ams_api_version.h +++ b/libraries/libvapours/include/vapours/ams/ams_api_version.h @@ -22,5 +22,5 @@ #define ATMOSPHERE_RELEASE_VERSION ATMOSPHERE_RELEASE_VERSION_MAJOR, ATMOSPHERE_RELEASE_VERSION_MINOR, ATMOSPHERE_RELEASE_VERSION_MICRO #define ATMOSPHERE_SUPPORTED_HOS_VERSION_MAJOR 10 -#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 0 -#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 4 +#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MINOR 1 +#define ATMOSPHERE_SUPPORTED_HOS_VERSION_MICRO 0 diff --git a/libraries/libvapours/include/vapours/ams/ams_target_firmware.h b/libraries/libvapours/include/vapours/ams/ams_target_firmware.h index 3273cf24c..d20febba7 100644 --- a/libraries/libvapours/include/vapours/ams/ams_target_firmware.h +++ b/libraries/libvapours/include/vapours/ams/ams_target_firmware.h @@ -53,8 +53,9 @@ #define ATMOSPHERE_TARGET_FIRMWARE_10_0_2 ATMOSPHERE_TARGET_FIRMWARE(10, 0, 2) #define ATMOSPHERE_TARGET_FIRMWARE_10_0_3 ATMOSPHERE_TARGET_FIRMWARE(10, 0, 3) #define ATMOSPHERE_TARGET_FIRMWARE_10_0_4 ATMOSPHERE_TARGET_FIRMWARE(10, 0, 4) +#define ATMOSPHERE_TARGET_FIRMWARE_10_1_0 ATMOSPHERE_TARGET_FIRMWARE(10, 1, 0) -#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_10_0_4 +#define ATMOSPHERE_TARGET_FIRMWARE_CURRENT ATMOSPHERE_TARGET_FIRMWARE_10_1_0 #define ATMOSPHERE_TARGET_FIRMWARE_MIN ATMOSPHERE_TARGET_FIRMWARE(0, 0, 0) #define ATMOSPHERE_TARGET_FIRMWARE_MAX ATMOSPHERE_TARGET_FIRMWARE_CURRENT @@ -99,6 +100,8 @@ namespace ams { TargetFirmware_10_0_1 = ATMOSPHERE_TARGET_FIRMWARE_10_0_1, TargetFirmware_10_0_2 = ATMOSPHERE_TARGET_FIRMWARE_10_0_2, TargetFirmware_10_0_3 = ATMOSPHERE_TARGET_FIRMWARE_10_0_3, + TargetFirmware_10_0_4 = ATMOSPHERE_TARGET_FIRMWARE_10_0_4, + TargetFirmware_10_1_0 = ATMOSPHERE_TARGET_FIRMWARE_10_1_0, TargetFirmware_Current = ATMOSPHERE_TARGET_FIRMWARE_CURRENT, diff --git a/stratosphere/loader/source/ldr_anti_downgrade_tables.inc b/stratosphere/loader/source/ldr_anti_downgrade_tables.inc index 894acb128..0d57586ae 100644 --- a/stratosphere/loader/source/ldr_anti_downgrade_tables.inc +++ b/stratosphere/loader/source/ldr_anti_downgrade_tables.inc @@ -251,3 +251,76 @@ constexpr MinimumProgramVersion g_MinimumProgramVersions1000[] = { {ncm::WebAppletId::WifiWebAuth, MakeSystemVersion(10, 0, 0)}, }; constexpr size_t g_MinimumProgramVersionsCount1000 = util::size(g_MinimumProgramVersions1000); + +constexpr MinimumProgramVersion g_MinimumProgramVersions1010[] = { + /* All non-Development System Modules. */ + {ncm::SystemProgramId::Usb, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Tma, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Boot2, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Settings, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Bus, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Bluetooth, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Bcat, MakeSystemVersion(10, 0, 0)}, + /* {ncm::SystemProgramId::Dmnt, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Friends, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Nifm, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Ptm, MakeSystemVersion(10, 0, 2)}, + /* {ncm::SystemProgramId::Shell, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::BsdSockets, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Hid, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Audio, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::LogManager, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Wlan, MakeSystemVersion(10, 1, 0)}, + /* {ncm::SystemProgramId::Cs, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Ldn, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::NvServices, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Pcv, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Ppc, MakeSystemVersion( 9, 0, 0)}, + {ncm::SystemProgramId::NvnFlinger, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Pcie, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Account, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Ns, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Nfc, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Psc, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::CapSrv, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Am, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Ssl, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Nim, MakeSystemVersion(10, 1, 0)}, + /* {ncm::SystemProgramId::Cec, MakeSystemVersion(10, 0, 0)}, */ + /* {ncm::SystemProgramId::Tspm, MakeSystemVersion(10, 0, 0)}, */ + /* {ncm::SystemProgramId::Spl, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Lbl, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Btm, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Erpt, MakeSystemVersion(10, 0, 0)}, + /* {ncm::SystemProgramId::Time, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Vi, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Pctl, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Npns, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Eupld, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Glue, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Eclct, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Es, MakeSystemVersion(10, 1, 0)}, + {ncm::SystemProgramId::Fatal, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Grc, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Creport, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Ro, MakeSystemVersion(10, 0, 0)}, + /* {ncm::SystemProgramId::Profiler, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Sdb, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Migration, MakeSystemVersion(10, 1, 0)}, + /* {ncm::SystemProgramId::Jit, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::JpegDec, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::SafeMode, MakeSystemVersion(10, 0, 0)}, + {ncm::SystemProgramId::Olsc, MakeSystemVersion(10, 1, 0)}, + /* {ncm::SystemProgramId::Dt, MakeSystemVersion(10, 0, 0)}, */ + /* {ncm::SystemProgramId::Nd, MakeSystemVersion(10, 0, 0)}, */ + {ncm::SystemProgramId::Ngct, MakeSystemVersion(10, 0, 0)}, + /* {ncm::SystemProgramId::Pgl, MakeSystemVersion(10, 0, 0)}, */ + + /* All Web Applets. */ + {ncm::WebAppletId::Web, MakeSystemVersion(10, 0, 0)}, + {ncm::WebAppletId::Shop, MakeSystemVersion(10, 0, 0)}, + {ncm::WebAppletId::OfflineWeb, MakeSystemVersion(10, 0, 0)}, + {ncm::WebAppletId::LoginShare, MakeSystemVersion(10, 0, 0)}, + {ncm::WebAppletId::WifiWebAuth, MakeSystemVersion(10, 0, 0)}, +}; +constexpr size_t g_MinimumProgramVersionsCount1010 = util::size(g_MinimumProgramVersions1010); diff --git a/stratosphere/loader/source/ldr_process_creation.cpp b/stratosphere/loader/source/ldr_process_creation.cpp index 780368634..10e359c07 100644 --- a/stratosphere/loader/source/ldr_process_creation.cpp +++ b/stratosphere/loader/source/ldr_process_creation.cpp @@ -96,7 +96,10 @@ namespace ams::ldr { size_t num_entries = 0; const auto hos_version = hos::GetVersion(); - if (hos_version >= hos::Version_10_0_0) { + if (hos_version >= hos::Version_10_1_0) { + entries = g_MinimumProgramVersions1010; + num_entries = g_MinimumProgramVersionsCount1010; + } elseif (hos_version >= hos::Version_10_0_0) { entries = g_MinimumProgramVersions1000; num_entries = g_MinimumProgramVersionsCount1000; } else if (hos_version >= hos::Version_9_1_0) {