mirror of
https://github.com/Atmosphere-NX/Atmosphere.git
synced 2025-06-04 00:28:51 -04:00
Implement BootReason config
This commit is contained in:
parent
ff9322a468
commit
3d8ff446ad
5 changed files with 33 additions and 4 deletions
|
@ -8,6 +8,8 @@
|
|||
#include "fuse.h"
|
||||
#include "bootconfig.h"
|
||||
|
||||
static boot_reason_t g_boot_reason = {0};
|
||||
|
||||
bool bootconfig_matches_hardware_info(void) {
|
||||
uint32_t hardware_info[4];
|
||||
fuse_get_hardware_info(hardware_info);
|
||||
|
@ -107,3 +109,15 @@ uint64_t bootconfig_get_kernel_memory_configuration(void) {
|
|||
return 0ull;
|
||||
}
|
||||
}
|
||||
|
||||
void bootconfig_load_boot_reason(volatile boot_reason_t *boot_reason) {
|
||||
g_boot_reason = *boot_reason;
|
||||
}
|
||||
|
||||
bool bootconfig_is_recovery_boot(void) {
|
||||
return (g_boot_reason.is_recovery_boot != 0);
|
||||
}
|
||||
|
||||
uint64_t bootconfig_get_boot_reason(void) {
|
||||
return ((uint64_t)g_boot_reason.boot_reason_high << 24) | (g_boot_reason.boot_reason_low & 0xFFFFFF);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue