From a409016a8883be5a87c94986f8b76b50ec526f25 Mon Sep 17 00:00:00 2001 From: TuxSH Date: Wed, 7 Mar 2018 23:24:38 +0100 Subject: [PATCH] Fix fuse_get_hardware_type for 4.x --- exosphere/src/fuse.c | 3 ++- exosphere/src/smc_api.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/exosphere/src/fuse.c b/exosphere/src/fuse.c index e3cf5ba74..e5006b333 100644 --- a/exosphere/src/fuse.c +++ b/exosphere/src/fuse.c @@ -185,7 +185,8 @@ uint32_t fuse_get_hardware_type(void) { if (mkey_get_revision() >= MASTERKEY_REVISION_400_CURRENT) { static const uint32_t types[] = {0,1,4,3}; - hardware_type |= ((FUSE_CHIP_REGS->FUSE_RESERVED_ODM[4] >> 14) & 0x3C) - 1; + hardware_type |= (FUSE_CHIP_REGS->FUSE_RESERVED_ODM[4] >> 14) & 0x3C; + hardware_type--; return hardware_type > 3 ? 4 : types[hardware_type]; } else { if (hardware_type >= 1) { diff --git a/exosphere/src/smc_api.c b/exosphere/src/smc_api.c index 1f3c16b50..d72ed83d0 100644 --- a/exosphere/src/smc_api.c +++ b/exosphere/src/smc_api.c @@ -204,8 +204,8 @@ void call_smc_handler(uint32_t handler_id, smc_args_t *args) { int num_called = atomic_fetch_add(&g_num_smcs_called, 1); /* DEBUG: use num_called to determine panic behavior. */ - if (num_called == 0x30) { - /* panic(COLOR_F); */ + if (num_called == 0x21A) { + panic(COLOR_F); } /* Call function. */