diff --git a/exosphere/program/source/smc/secmon_smc_info.cpp b/exosphere/program/source/smc/secmon_smc_info.cpp index 857eeccc..8d915ed3 100644 --- a/exosphere/program/source/smc/secmon_smc_info.cpp +++ b/exosphere/program/source/smc/secmon_smc_info.cpp @@ -93,50 +93,23 @@ namespace ams::secmon::smc { return false; } - pkg1::MemoryMode SanitizeMemoryMode(pkg1::MemoryMode mode) { - if (IsValidMemoryMode(mode)) { - return mode; - } - return pkg1::MemoryMode_Auto; - } - - pkg1::MemorySize GetAvailableMemorySize(pkg1::MemorySize size) { - return std::min(GetPhysicalMemorySize(), size); - } - - pkg1::MemoryMode GetMemoryMode(pkg1::MemoryMode mode) { - /* Sanitize the mode. */ - mode = SanitizeMemoryMode(mode); - - /* If the mode is auto, construct the memory mode. */ - if (mode == pkg1::MemoryMode_Auto) { - return pkg1::MakeMemoryMode(GetPhysicalMemorySize(), pkg1::MemoryArrange_Normal); - } else { - const auto mode_size = GetMemorySize(mode); - const auto mode_arrange = GetMemoryArrange(mode); - const auto size = GetAvailableMemorySize(mode_size); - const auto arrange = (size == mode_size) ? mode_arrange : pkg1::MemoryArrange_Normal; - return pkg1::MakeMemoryMode(size, arrange); - } - } - u32 GetMemoryMode() { /* Unless development function is enabled, we're 4 GB. */ - u32 memory_mode = pkg1::MemoryMode_4GB; + u32 memory_mode = pkg1::MemoryMode_6GB; if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) { - memory_mode = GetMemoryMode(bcd.GetMemoryMode()); + memory_mode = pkg1::MemoryMode_6GB; } return memory_mode; } u32 GetKernelConfiguration() { - pkg1::MemorySize memory_size = pkg1::MemorySize_4GB; + pkg1::MemorySize memory_size = pkg1::MemorySize_6GB; util::BitPack32 value = {}; if (const auto &bcd = GetBootConfig().data; bcd.IsDevelopmentFunctionEnabled()) { - memory_size = GetMemorySize(GetMemoryMode(bcd.GetMemoryMode())); + memory_size = pkg1::MemorySize_6GB; value.Set(bcd.GetKernelFlags1()); value.Set(bcd.GetKernelFlags0()); diff --git a/fusee/fusee-mtc/src/fuse.c b/fusee/fusee-mtc/src/fuse.c index 8ef10e11..dcecdac8 100644 --- a/fusee/fusee-mtc/src/fuse.c +++ b/fusee/fusee-mtc/src/fuse.c @@ -171,7 +171,7 @@ uint32_t fuse_get_reserved_odm(uint32_t idx) { /* Get the DRAM ID using values in the shadow cache. */ uint32_t fuse_get_dram_id(void) { - return ((fuse_get_reserved_odm(4) >> 3) & 0x7); + return 0x3; } /* Derive the Device ID using values in the shadow cache. */ diff --git a/fusee/fusee-primary/src/fuse.c b/fusee/fusee-primary/src/fuse.c index 8ef10e11..dcecdac8 100644 --- a/fusee/fusee-primary/src/fuse.c +++ b/fusee/fusee-primary/src/fuse.c @@ -171,7 +171,7 @@ uint32_t fuse_get_reserved_odm(uint32_t idx) { /* Get the DRAM ID using values in the shadow cache. */ uint32_t fuse_get_dram_id(void) { - return ((fuse_get_reserved_odm(4) >> 3) & 0x7); + return 0x3; } /* Derive the Device ID using values in the shadow cache. */ diff --git a/fusee/fusee-secondary/src/fuse.c b/fusee/fusee-secondary/src/fuse.c index 3236a395..b3620018 100644 --- a/fusee/fusee-secondary/src/fuse.c +++ b/fusee/fusee-secondary/src/fuse.c @@ -171,7 +171,7 @@ uint32_t fuse_get_reserved_odm(uint32_t idx) { /* Get the DRAM ID using values in the shadow cache. */ uint32_t fuse_get_dram_id(void) { - return ((fuse_get_reserved_odm(4) >> 3) & 0x7); + return 0x3; } /* Derive the Device ID using values in the shadow cache. */ diff --git a/libraries/config/templates/exosphere.mk b/libraries/config/templates/exosphere.mk index e2629d9f..41c285db 100644 --- a/libraries/config/templates/exosphere.mk +++ b/libraries/config/templates/exosphere.mk @@ -8,13 +8,13 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../common.mk #--------------------------------------------------------------------------------- ifeq ($(strip $(ATMOSPHERE_ARCH_NAME)),arm64) DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_EXOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -mgeneral-regs-only -ffixed-x18 -Os -Wextra -Werror -fno-non-call-exceptions +SETTINGS := $(ATMOSPHERE_SETTINGS) -mgeneral-regs-only -ffixed-x18 -Os -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) else ifeq ($(strip $(ATMOSPHERE_ARCH_NAME)),arm) DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_EXOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -Werror -fno-non-call-exceptions +SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) diff --git a/libraries/libexosphere/arm.mk b/libraries/libexosphere/arm.mk index f82386e0..6c23d8fb 100644 --- a/libraries/libexosphere/arm.mk +++ b/libraries/libexosphere/arm.mk @@ -14,7 +14,7 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../config/common.mk #--------------------------------------------------------------------------------- DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_EXOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -Wextra -Werror -flto -fno-non-call-exceptions +SETTINGS := $(ATMOSPHERE_SETTINGS) -Os -flto -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) diff --git a/libraries/libexosphere/arm64.mk b/libraries/libexosphere/arm64.mk index 3ce1165b..bedec701 100644 --- a/libraries/libexosphere/arm64.mk +++ b/libraries/libexosphere/arm64.mk @@ -14,7 +14,7 @@ include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/../config/common.mk #--------------------------------------------------------------------------------- DEFINES := $(ATMOSPHERE_DEFINES) -DATMOSPHERE_IS_EXOSPHERE -SETTINGS := $(ATMOSPHERE_SETTINGS) -mgeneral-regs-only -ffixed-x18 -Os -Wextra -Werror -fno-non-call-exceptions +SETTINGS := $(ATMOSPHERE_SETTINGS) -mgeneral-regs-only -ffixed-x18 -Os -fno-non-call-exceptions CFLAGS := $(ATMOSPHERE_CFLAGS) $(SETTINGS) $(DEFINES) $(INCLUDE) CXXFLAGS := $(CFLAGS) $(ATMOSPHERE_CXXFLAGS) -fno-use-cxa-atexit ASFLAGS := $(ATMOSPHERE_ASFLAGS) $(SETTINGS) diff --git a/libraries/libexosphere/include/exosphere/pkg1/pkg1_boot_config.hpp b/libraries/libexosphere/include/exosphere/pkg1/pkg1_boot_config.hpp index 8f67ab2f..5eef5ded 100644 --- a/libraries/libexosphere/include/exosphere/pkg1/pkg1_boot_config.hpp +++ b/libraries/libexosphere/include/exosphere/pkg1/pkg1_boot_config.hpp @@ -49,15 +49,15 @@ namespace ams::pkg1 { }; constexpr ALWAYS_INLINE MemorySize GetMemorySize(MemoryMode mode) { - return static_cast(mode >> MemoryMode_SizeShift); + return MemorySize_6GB; } constexpr ALWAYS_INLINE MemoryArrange GetMemoryArrange(MemoryMode mode) { - return static_cast(mode & MemoryMode_ArrangeMask); + return MemoryArrange_Normal; } constexpr ALWAYS_INLINE MemoryMode MakeMemoryMode(MemorySize size, MemoryArrange arrange) { - return static_cast((size << MemoryMode_SizeShift) | (arrange)); + return MemoryMode_6GB; } struct BootConfigData { @@ -87,7 +87,7 @@ namespace ams::pkg1 { } constexpr MemoryMode GetMemoryMode() const { - return static_cast(this->flags0[3]); + return MemoryMode_6GB; } constexpr bool IsInitialTscValueValid() const { diff --git a/libraries/libexosphere/source/fuse/fuse_api.cpp b/libraries/libexosphere/source/fuse/fuse_api.cpp index 17e4b256..84949f49 100644 --- a/libraries/libexosphere/source/fuse/fuse_api.cpp +++ b/libraries/libexosphere/source/fuse/fuse_api.cpp @@ -300,7 +300,7 @@ namespace ams::fuse { } DramId GetDramId() { - return static_cast(util::BitPack32{GetCommonOdmWord(4)}.Get()); + return DramId_IcosaSamsung6GB; } HardwareType GetHardwareType() {