diff --git a/exosphere/src/bootconfig.c b/exosphere/src/bootconfig.c index 392b16b88..599503e83 100644 --- a/exosphere/src/bootconfig.c +++ b/exosphere/src/bootconfig.c @@ -123,7 +123,7 @@ uint64_t bootconfig_get_memory_arrangement(void) { } } -uint64_t bootconfig_get_kernel_memory_configuration(void) { +uint64_t bootconfig_get_kernel_configuration(void) { if (bootconfig_is_debug_mode()) { uint64_t high_val = 0; if (fuse_get_dram_id() == 4) { diff --git a/exosphere/src/bootconfig.h b/exosphere/src/bootconfig.h index 319a8f9a1..beabc2045 100644 --- a/exosphere/src/bootconfig.h +++ b/exosphere/src/bootconfig.h @@ -21,6 +21,14 @@ #include #include "memory_map.h" +/* This is kind of ConfigItem, but it's stored in BootConfig, so... */ +typedef enum { + KERNELCONFIGFLAG_INITIALIZE_MEMORY_TO_PATTERN = (1 << 0), + KERNELCONFIGFLAG_ENABLE_USER_EXCEPTION_HANDLERS = (1 << 1), + KERNELCONFIGFLAG_ENABLE_USER_PMU_ACCESS = (1 << 2), + KERNELCONFIGFLAG_CALL_SMC_PANIC_ON_KERNEL_ERROR = (1 << 8), +} KernelConfigFlag; + /* This provides management for Switch BootConfig. */ #define LOADED_BOOTCONFIG (get_loaded_bootconfig()) @@ -78,7 +86,7 @@ bool bootconfig_take_extabt_serror_to_el3(void); uint64_t bootconfig_get_value_for_sysctr0(void); uint64_t bootconfig_get_memory_arrangement(void); -uint64_t bootconfig_get_kernel_memory_configuration(void); +uint64_t bootconfig_get_kernel_configuration(void); bool bootconfig_is_recovery_boot(void); uint64_t bootconfig_get_boot_reason(void); diff --git a/exosphere/src/configitem.c b/exosphere/src/configitem.c index dc0a07d23..2e3c537ae 100644 --- a/exosphere/src/configitem.c +++ b/exosphere/src/configitem.c @@ -206,8 +206,13 @@ uint32_t configitem_get(bool privileged, ConfigItem item, uint64_t *p_outvalue) *p_outvalue = (int)(bootconfig_is_debug_mode()); } break; - case CONFIGITEM_KERNELMEMORYCONFIGURATION: - *p_outvalue = bootconfig_get_kernel_memory_configuration(); + case CONFIGITEM_KERNELCONFIGURATION: + { + uint64_t config = bootconfig_get_kernel_configuration(); + /* Always enable usermode exception handlers. */ + config |= KERNELCONFIGFLAG_ENABLE_USER_EXCEPTION_HANDLERS; + *p_outvalue = config; + } break; case CONFIGITEM_BATTERYPROFILE: *p_outvalue = (int)g_battery_profile; diff --git a/exosphere/src/configitem.h b/exosphere/src/configitem.h index 46dbbd738..2f2ed5c3e 100644 --- a/exosphere/src/configitem.h +++ b/exosphere/src/configitem.h @@ -32,7 +32,7 @@ typedef enum { CONFIGITEM_BOOTREASON = 9, CONFIGITEM_MEMORYARRANGE = 10, CONFIGITEM_ISDEBUGMODE = 11, - CONFIGITEM_KERNELMEMORYCONFIGURATION = 12, + CONFIGITEM_KERNELCONFIGURATION = 12, CONFIGITEM_BATTERYPROFILE = 13, CONFIGITEM_ISQUESTUNIT = 14, CONFIGITEM_NEWHARDWARETYPE_5X = 15,