|
|
|
|
@@ -37,8 +37,10 @@ namespace ams::secmon {
|
|
|
|
|
|
|
|
|
|
u32 magic;
|
|
|
|
|
ams::TargetFirmware target_firmware;
|
|
|
|
|
u32 flags;
|
|
|
|
|
u32 reserved[5];
|
|
|
|
|
u32 flags[2];
|
|
|
|
|
u16 lcd_vendor;
|
|
|
|
|
u16 reserved0;
|
|
|
|
|
u32 reserved1[3];
|
|
|
|
|
EmummcConfiguration emummc_cfg;
|
|
|
|
|
|
|
|
|
|
constexpr bool IsValid() const { return this->magic == Magic; }
|
|
|
|
|
@@ -53,12 +55,16 @@ namespace ams::secmon {
|
|
|
|
|
u8 soc_type;
|
|
|
|
|
u8 hardware_state;
|
|
|
|
|
u8 pad_0B[1];
|
|
|
|
|
u32 flags;
|
|
|
|
|
u32 reserved[(0x80 - 0x10) / sizeof(u32)];
|
|
|
|
|
u32 flags[2];
|
|
|
|
|
u16 lcd_vendor;
|
|
|
|
|
u16 reserved0;
|
|
|
|
|
u32 reserved1[(0x80 - 0x18) / sizeof(u32)];
|
|
|
|
|
|
|
|
|
|
constexpr void CopyFrom(const SecureMonitorStorageConfiguration &storage) {
|
|
|
|
|
this->target_firmware = storage.target_firmware;
|
|
|
|
|
this->flags = storage.flags;
|
|
|
|
|
this->flags[0] = storage.flags[0];
|
|
|
|
|
this->flags[1] = storage.flags[1];
|
|
|
|
|
this->lcd_vendor = storage.lcd_vendor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SetFuseInfo() {
|
|
|
|
|
@@ -73,14 +79,16 @@ namespace ams::secmon {
|
|
|
|
|
constexpr fuse::SocType GetSocType() const { return static_cast<fuse::SocType>(this->soc_type); }
|
|
|
|
|
constexpr fuse::HardwareState GetHardwareState() const { return static_cast<fuse::HardwareState>(this->hardware_state); }
|
|
|
|
|
|
|
|
|
|
constexpr u16 GetLcdVendor() const { return this->lcd_vendor; }
|
|
|
|
|
|
|
|
|
|
constexpr bool IsProduction() const { return this->GetHardwareState() != fuse::HardwareState_Development; }
|
|
|
|
|
|
|
|
|
|
constexpr bool IsDevelopmentFunctionEnabledForKernel() const { return (this->flags & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel) != 0; }
|
|
|
|
|
constexpr bool IsDevelopmentFunctionEnabledForUser() const { return (this->flags & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForUser) != 0; }
|
|
|
|
|
constexpr bool DisableUserModeExceptionHandlers() const { return (this->flags & SecureMonitorConfigurationFlag_DisableUserModeExceptionHandlers) != 0; }
|
|
|
|
|
constexpr bool EnableUserModePerformanceCounterAccess() const { return (this->flags & SecureMonitorConfigurationFlag_EnableUserModePerformanceCounterAccess) != 0; }
|
|
|
|
|
constexpr bool ShouldUseBlankCalibrationBinary() const { return (this->flags & SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary) != 0; }
|
|
|
|
|
constexpr bool AllowWritingToCalibrationBinarySysmmc() const { return (this->flags & SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc) != 0; }
|
|
|
|
|
constexpr bool IsDevelopmentFunctionEnabledForKernel() const { return (this->flags[0] & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForKernel) != 0; }
|
|
|
|
|
constexpr bool IsDevelopmentFunctionEnabledForUser() const { return (this->flags[0] & SecureMonitorConfigurationFlag_IsDevelopmentFunctionEnabledForUser) != 0; }
|
|
|
|
|
constexpr bool DisableUserModeExceptionHandlers() const { return (this->flags[0] & SecureMonitorConfigurationFlag_DisableUserModeExceptionHandlers) != 0; }
|
|
|
|
|
constexpr bool EnableUserModePerformanceCounterAccess() const { return (this->flags[0] & SecureMonitorConfigurationFlag_EnableUserModePerformanceCounterAccess) != 0; }
|
|
|
|
|
constexpr bool ShouldUseBlankCalibrationBinary() const { return (this->flags[0] & SecureMonitorConfigurationFlag_ShouldUseBlankCalibrationBinary) != 0; }
|
|
|
|
|
constexpr bool AllowWritingToCalibrationBinarySysmmc() const { return (this->flags[0] & SecureMonitorConfigurationFlag_AllowWritingToCalibrationBinarySysmmc) != 0; }
|
|
|
|
|
|
|
|
|
|
constexpr bool IsDevelopmentFunctionEnabled(bool for_kern) const { return for_kern ? this->IsDevelopmentFunctionEnabledForKernel() : this->IsDevelopmentFunctionEnabledForUser(); }
|
|
|
|
|
};
|
|
|
|
|
@@ -94,8 +102,10 @@ namespace ams::secmon {
|
|
|
|
|
.soc_type = {},
|
|
|
|
|
.hardware_state = {},
|
|
|
|
|
.pad_0B = {},
|
|
|
|
|
.flags = SecureMonitorConfigurationFlag_Default,
|
|
|
|
|
.reserved = {},
|
|
|
|
|
.flags = { SecureMonitorConfigurationFlag_Default, SecureMonitorConfigurationFlag_None },
|
|
|
|
|
.lcd_vendor = {},
|
|
|
|
|
.reserved0 = {},
|
|
|
|
|
.reserved1 = {},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|