settings: implement KeyValueStore (#1659)
* settings: implement KeyValueStore and dependencies * settings: update KeyValueStore for recent refactoring * settings: address feedback
This commit is contained in:
@@ -114,6 +114,7 @@ namespace ams::impl {
|
||||
/* settings. */
|
||||
AMS_DEFINE_SYSTEM_THREAD(21, settings, Main);
|
||||
AMS_DEFINE_SYSTEM_THREAD(21, settings, IpcServer);
|
||||
AMS_DEFINE_SYSTEM_THREAD(21, settings, LazyWriter);
|
||||
|
||||
/* erpt. */
|
||||
AMS_DEFINE_SYSTEM_THREAD(21, erpt, Main);
|
||||
|
||||
@@ -267,6 +267,10 @@ namespace ams::ncm {
|
||||
static const SystemDataId RebootlessSystemUpdateVersion;
|
||||
static const SystemDataId ContentActionTable;
|
||||
|
||||
static const SystemDataId PlatformConfigCalcio;
|
||||
|
||||
static const SystemDataId PlatformConfigAula;
|
||||
|
||||
static const SystemDataId End;
|
||||
};
|
||||
|
||||
@@ -312,6 +316,10 @@ namespace ams::ncm {
|
||||
inline constexpr const SystemDataId SystemDataId::RebootlessSystemUpdateVersion = { 0x0100000000000826ul };
|
||||
inline constexpr const SystemDataId SystemDataId::ContentActionTable = { 0x0100000000000827ul };
|
||||
|
||||
inline constexpr const SystemDataId SystemDataId::PlatformConfigCalcio = { 0x0100000000000829ul };
|
||||
|
||||
inline constexpr const SystemDataId SystemDataId::PlatformConfigAula = { 0x0100000000000831ul };
|
||||
|
||||
inline constexpr const SystemDataId SystemDataId::End = { 0x0100000000000FFFul };
|
||||
|
||||
inline constexpr bool IsSystemDataId(const DataId &data_id) {
|
||||
|
||||
@@ -20,19 +20,4 @@
|
||||
|
||||
namespace ams::settings::fwdbg {
|
||||
|
||||
constexpr size_t SettingsNameLengthMax = 0x40;
|
||||
constexpr size_t SettingsItemKeyLengthMax = 0x40;
|
||||
|
||||
struct SettingsName : sf::LargeData {
|
||||
char value[util::AlignUp(SettingsNameLengthMax + 1, alignof(u64))];
|
||||
};
|
||||
|
||||
static_assert(util::is_pod<SettingsName>::value && sizeof(SettingsName) > SettingsNameLengthMax);
|
||||
|
||||
struct SettingsItemKey : sf::LargeData {
|
||||
char value[util::AlignUp(SettingsItemKeyLengthMax + 1, alignof(u64))];
|
||||
};
|
||||
|
||||
static_assert(util::is_pod<SettingsItemKey>::value && sizeof(SettingsItemKey) > SettingsItemKeyLengthMax);
|
||||
|
||||
}
|
||||
|
||||
@@ -19,6 +19,21 @@
|
||||
|
||||
namespace ams::settings {
|
||||
|
||||
constexpr size_t SettingsNameLengthMax = 0x40;
|
||||
constexpr size_t SettingsItemKeyLengthMax = 0x40;
|
||||
|
||||
struct SettingsName : public sf::LargeData {
|
||||
char value[util::AlignUp(SettingsNameLengthMax + 1, alignof(u64))];
|
||||
};
|
||||
|
||||
static_assert(util::is_pod<SettingsName>::value && sizeof(SettingsName) > SettingsNameLengthMax);
|
||||
|
||||
struct SettingsItemKey : public sf::LargeData {
|
||||
char value[util::AlignUp(SettingsItemKeyLengthMax + 1, alignof(u64))];
|
||||
};
|
||||
|
||||
static_assert(util::is_pod<SettingsItemKey>::value && sizeof(SettingsItemKey) > SettingsItemKeyLengthMax);
|
||||
|
||||
enum Language {
|
||||
Language_Japanese,
|
||||
Language_AmericanEnglish,
|
||||
|
||||
@@ -60,6 +60,12 @@ namespace ams::spl {
|
||||
return static_cast<HardwareState>(v);
|
||||
}
|
||||
|
||||
inline RetailInteractiveDisplayState GetRetailInteractiveDisplayState() {
|
||||
u64 v;
|
||||
R_ABORT_UNLESS(::ams::spl::GetConfig(std::addressof(v), ::ams::spl::ConfigItem::RetailInteractiveDisplayState));
|
||||
return static_cast<RetailInteractiveDisplayState>(v);
|
||||
}
|
||||
|
||||
inline u64 GetDeviceIdLow() {
|
||||
u64 v;
|
||||
R_ABORT_UNLESS(::ams::spl::GetConfig(std::addressof(v), ::ams::spl::ConfigItem::DeviceId));
|
||||
|
||||
@@ -138,6 +138,11 @@ namespace ams::spl {
|
||||
MemoryArrangement_Count,
|
||||
};
|
||||
|
||||
enum RetailInteractiveDisplayState {
|
||||
RetailInteractiveDisplayState_Disabled = 0,
|
||||
RetailInteractiveDisplayState_Enabled = 1,
|
||||
};
|
||||
|
||||
struct BootReasonValue {
|
||||
union {
|
||||
struct {
|
||||
@@ -217,7 +222,7 @@ namespace ams::spl {
|
||||
IsDevelopmentFunctionEnabled = 11,
|
||||
KernelConfiguration = 12,
|
||||
IsChargerHiZModeEnabled = 13,
|
||||
QuestState = 14,
|
||||
RetailInteractiveDisplayState = 14,
|
||||
RegulatorType = 15,
|
||||
DeviceUniqueKeyGeneration = 16,
|
||||
Package2Hash = 17,
|
||||
|
||||
Reference in New Issue
Block a user