revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / kernel / apic_error.c
blobbeea503a23dfe476202ffe660c1538e4a85bfbae
1 /*
2 Copyright © 2017, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <asm/cpu.h>
7 #include <asm/io.h>
8 #include <aros/libcall.h>
9 #include <aros/asmcall.h>
10 #include <exec/execbase.h>
11 #include <exec/lists.h>
13 #include "kernel_base.h"
14 #include "kernel_intern.h"
15 #include "kernel_debug.h"
16 #include "kernel_globals.h"
18 #define D(x)
20 int core_APICErrorHandle(struct ExceptionContext *regs, struct KernelBase *KernelBase, void *HandlerData2)
22 ULONG error_code = 0;
23 struct PlatformData *pdata = KernelBase->kb_PlatformData;
24 struct APICData *apicData = pdata->kb_APIC;
25 IPTR __LAPICBase = apicData->lapicBase;
27 // IN order to read APIC_ESR register one has to first write it with anything (zero is fine)
28 // This forces update of the contents and new error codes may be read
29 APIC_REG(__LAPICBase, APIC_ESR) = error_code;
30 error_code = APIC_REG(__LAPICBase, APIC_ESR);
32 bug("[KERNEL] %s: APIC Error interrupt! Error code=%08x\n", __func__, error_code);
34 return TRUE;
37 int core_APICSpuriousHandle(struct ExceptionContext *regs, struct KernelBase *KernelBase, void *HandlerData2)
39 bug("[KERNEL] %s: APIC Spurious interrupt!\n", __func__);
41 return TRUE;