boot: refactor to use sts::boot namespace

This commit is contained in:
Michael Scire
2019-06-22 00:10:21 -07:00
parent 4fbae9e5a4
commit 06416aeded
91 changed files with 3665 additions and 3155 deletions

View File

@@ -14,17 +14,29 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "boot_functions.hpp"
#include "boot_power_utils.hpp"
#include "boot_repair_boot_images.hpp"
#include "boot_spl_utils.hpp"
#include "updater/updater_api.hpp"
static u8 __attribute__((__aligned__(0x1000))) g_boot_image_work_buffer[0x10000];
namespace sts::boot {
void Boot::CheckAndRepairBootImages() {
const auto boot_image_update_type = sts::updater::GetBootImageUpdateType(Boot::GetHardwareType());
namespace {
/* Globals. */
u8 __attribute__((aligned(0x1000))) g_boot_image_work_buffer[0x10000];
bool repaired_normal, repaired_safe;
if (R_SUCCEEDED(sts::updater::VerifyBootImagesAndRepairIfNeeded(&repaired_normal, &repaired_safe, g_boot_image_work_buffer, sizeof(g_boot_image_work_buffer), boot_image_update_type)) && repaired_normal) {
/* Nintendo only performs a reboot on successful normal repair. */
Boot::RebootSystem();
}
void CheckAndRepairBootImages() {
const auto boot_image_update_type = sts::updater::GetBootImageUpdateType(GetHardwareType());
bool repaired_normal, repaired_safe;
if (R_SUCCEEDED(sts::updater::VerifyBootImagesAndRepairIfNeeded(&repaired_normal, &repaired_safe, g_boot_image_work_buffer, sizeof(g_boot_image_work_buffer), boot_image_update_type)) && repaired_normal) {
/* Nintendo only performs a reboot on successful normal repair. */
RebootSystem();
}
}
}