diff options
author | Ian Moffett <ian@osmora.org> | 2025-10-12 15:50:10 -0400 |
---|---|---|
committer | Ian Moffett <ian@osmora.org> | 2025-10-12 15:51:46 -0400 |
commit | 170d6bb02ef06bc878cbf3450432ea508e6a0510 (patch) | |
tree | f228677462b12e9cae2803371bf541994ca8d358 | |
parent | 5ad6058bf94f953462aab91ede6c15d4d5784d82 (diff) |
kern/amd64: reboot: Add I8042_REBOOT option
Adds I8042_REBOOT config option for the AMD64 port as a workaround
against certain hardware that doesn't support the i8042 reset
Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r-- | src/sys/arch/amd64/conf/GENERIC | 5 | ||||
-rw-r--r-- | src/sys/arch/amd64/os/os_reboot.c | 16 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/sys/arch/amd64/conf/GENERIC b/src/sys/arch/amd64/conf/GENERIC index cc5fe35..93919d8 100644 --- a/src/sys/arch/amd64/conf/GENERIC +++ b/src/sys/arch/amd64/conf/GENERIC @@ -1 +1,4 @@ -// GENERIC AMD64 +// Controls if an i8042 reboot would be attempted +// as a method. Some firmware (e.g., on some laptops) +// may not handle these well and hang. +option I8042_REBOOT yes diff --git a/src/sys/arch/amd64/os/os_reboot.c b/src/sys/arch/amd64/os/os_reboot.c index e414822..3ed82af 100644 --- a/src/sys/arch/amd64/os/os_reboot.c +++ b/src/sys/arch/amd64/os/os_reboot.c @@ -33,6 +33,12 @@ #include <os/reboot.h> #include <machine/pio.h> +#if defined(__I8042_REBOOT) +#define I8042_REBOOT __I8042_REBOOT +#else +#define I8042_REBOOT 0 +#endif /* __I8042_REBOOT */ + /* * Actual reboot core */ @@ -42,11 +48,13 @@ __reboot(void) void *dmmy_null = NULL; /* - * Try to be gentle and simply put the CPU into a - * reboot cycle through the i8042 reset line, though - * some chipsets may not like this. + * Use the i8042 to reboot the system if we can, this + * might be disabled in some L5 kernels. */ - outb(0x64, 0xFE); + if (I8042_REBOOT) { + outb(0x64, 0xFE); + } + /* * If somehow nothing we've tried worked, be very |