From 4094c014ffa79facb330863066dc4f6ecfe22a2c Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 2 May 2019 18:14:50 -0700 Subject: [PATCH] spl: fix BootReason command names --- nx/include/switch/services/spl.h | 4 ++-- nx/source/services/spl.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/nx/include/switch/services/spl.h b/nx/include/switch/services/spl.h index ada7b3bc..de4b3874 100644 --- a/nx/include/switch/services/spl.h +++ b/nx/include/switch/services/spl.h @@ -57,8 +57,8 @@ Result splUserExpMod(const void *input, const void *modulus, const void *exp, si Result splSetConfig(SplConfigItem config_item, u64 value); Result splGetRandomBytes(void *out, size_t out_size); Result splIsDevelopment(bool *out_is_development); -Result splSetSharedData(u32 value); -Result splGetSharedData(u32 *out_value); +Result splSetBootReason(u32 value); +Result splGetBootReason(u32 *out_value); Result splCryptoGenerateAesKek(const void *wrapped_kek, u32 key_generation, u32 option, void *out_sealed_kek); Result splCryptoLoadAesKey(const void *sealed_kek, const void *wrapped_key, u32 keyslot); diff --git a/nx/source/services/spl.c b/nx/source/services/spl.c index 7d42327e..c275b412 100644 --- a/nx/source/services/spl.c +++ b/nx/source/services/spl.c @@ -344,7 +344,11 @@ Result splIsDevelopment(bool *out_is_development) { return rc; } -Result splSetSharedData(u32 value) { +Result splSetBootReason(u32 value) { + if (hosversionBefore(3,0,0)) { + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + } + IpcCommand c; ipcInitialize(&c); @@ -377,7 +381,11 @@ Result splSetSharedData(u32 value) { return rc; } -Result splGetSharedData(u32 *out_value) { +Result splGetBootReason(u32 *out_value) { + if (hosversionBefore(3,0,0)) { + return MAKERESULT(Module_Libnx, LibnxError_IncompatSysVer); + } + IpcCommand c; ipcInitialize(&c);