mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-08-06 08:08:59 +00:00
add applet exit locking to haze and reboot_to_payload
This commit is contained in:
parent
8b88351cb4
commit
4c57189025
2 changed files with 10 additions and 0 deletions
|
@ -17,6 +17,9 @@
|
||||||
#include <haze/console_main_loop.hpp>
|
#include <haze/console_main_loop.hpp>
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
int main(int argc, char **argv) {
|
||||||
|
/* Lock exit so that cleanup is ensured. */
|
||||||
|
HAZE_R_ABORT_UNLESS(appletLockExit());
|
||||||
|
|
||||||
/* Load device firmware version and serial number. */
|
/* Load device firmware version and serial number. */
|
||||||
HAZE_R_ABORT_UNLESS(haze::LoadDeviceProperties());
|
HAZE_R_ABORT_UNLESS(haze::LoadDeviceProperties());
|
||||||
|
|
||||||
|
@ -24,5 +27,6 @@ int main(int argc, char **argv) {
|
||||||
haze::ConsoleMainLoop::RunApplication();
|
haze::ConsoleMainLoop::RunApplication();
|
||||||
|
|
||||||
/* Return to the loader. */
|
/* Return to the loader. */
|
||||||
|
appletUnlockExit();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,11 +8,17 @@
|
||||||
#define IRAM_PAYLOAD_MAX_SIZE 0x24000
|
#define IRAM_PAYLOAD_MAX_SIZE 0x24000
|
||||||
static u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE];
|
static u8 g_reboot_payload[IRAM_PAYLOAD_MAX_SIZE];
|
||||||
|
|
||||||
|
void userAppInit(void)
|
||||||
|
{
|
||||||
|
appletLockExit();
|
||||||
|
}
|
||||||
|
|
||||||
void userAppExit(void)
|
void userAppExit(void)
|
||||||
{
|
{
|
||||||
amsBpcExit();
|
amsBpcExit();
|
||||||
setsysExit();
|
setsysExit();
|
||||||
spsmExit();
|
spsmExit();
|
||||||
|
appletUnlockExit();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void reboot_to_payload(void) {
|
static void reboot_to_payload(void) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue