From d4363e41858e3e3bb2796e0ea6e561b87bcaf16c Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Thu, 6 Dec 2018 11:47:12 -0800 Subject: [PATCH] x86: print helpful message on FPU exception A few people have tripped over this recently. Signed-off-by: Andrew Boie --- arch/x86/core/fatal.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/x86/core/fatal.c b/arch/x86/core/fatal.c index af95bc318ec..445c93fd3f7 100644 --- a/arch/x86/core/fatal.c +++ b/arch/x86/core/fatal.c @@ -220,10 +220,16 @@ static FUNC_NORETURN void generic_exc_handle(unsigned int vector, const NANO_ESF *pEsf) { printk("***** "); - if (vector == 13) { + switch (vector) { + case IV_GENERAL_PROTECTION: printk("General Protection Fault\n"); - } else { + break; + case IV_DEVICE_NOT_AVAILABLE: + printk("Floating point unit not enabled\n"); + break; + default: printk("CPU exception %d\n", vector); + break; } if ((1 << vector) & _EXC_ERROR_CODE_FAULTS) { printk("***** Exception code: 0x%x\n", pEsf->errorCode);