From 83f21d7d2a5b01568dbf00a9b8ff572a76e5f1ac Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 21 Feb 2019 07:40:04 -0800 Subject: [PATCH] exo: don't forget to dereference your pointers kids --- exosphere/rebootstub/src/start.s | 4 ++++ exosphere/src/configitem.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/exosphere/rebootstub/src/start.s b/exosphere/rebootstub/src/start.s index 461ba2099..e29bd0acc 100644 --- a/exosphere/rebootstub/src/start.s +++ b/exosphere/rebootstub/src/start.s @@ -19,9 +19,13 @@ .global _start _start: adr r0, reboot_type + ldr r0, [r0] cmp r0, #0x0 beq do_shutdown b jump_to_reboot_payload + nop + nop + nop reboot_type: .word 0x00000001 diff --git a/exosphere/src/configitem.c b/exosphere/src/configitem.c index 7029297d3..c0f1a262d 100644 --- a/exosphere/src/configitem.c +++ b/exosphere/src/configitem.c @@ -101,7 +101,7 @@ uint32_t configitem_set(bool privileged, ConfigItem item, uint64_t value) { MAKE_REG32(MMIO_GET_DEVICE_ADDRESS(MMIO_DEVID_AMS_IRAM_PAGE) + i) = read32le(rebootstub_bin, i); } /* Tell rebootstub to shut down. */ - MAKE_REG32(MMIO_GET_DEVICE_ADDRESS(MMIO_DEVID_AMS_IRAM_PAGE) + 0x10) = 0x0; + MAKE_REG32(MMIO_GET_DEVICE_ADDRESS(MMIO_DEVID_AMS_IRAM_PAGE) + 0x20) = 0x0; ams_unmap_irampage(); MAKE_REG32(MMIO_GET_DEVICE_ADDRESS(MMIO_DEVID_RTC_PMC) + 0x400ull) = 0x10;