ReactOS  0.4.15-dev-3217-gc6d1646
i386idt.c
Go to the documentation of this file.
1 
2 #include <freeldr.h>
3 
4 
5 KIDTENTRY DECLSPEC_ALIGN(4) i386Idt[32];
6 KDESCRIPTOR i386IdtDescriptor = {0, 255, (ULONG)i386Idt};
7 
8 static
9 void
11  UCHAR Vector,
13  USHORT Access)
14 {
15  i386Idt[Vector].Offset = (ULONG)ServiceHandler & 0xffff;
16  i386Idt[Vector].ExtendedOffset = (ULONG)ServiceHandler >> 16;
17  i386Idt[Vector].Selector = PMODE_CS;
18  i386Idt[Vector].Access = Access;
19 }
20 
21 void
22 __cdecl
23 InitIdt(void)
24 {
25  InitIdtVector(0, i386DivideByZero, 0x8e00);
27  InitIdtVector(2, i386NMIException, 0x8e00);
28  InitIdtVector(3, i386Breakpoint, 0x8e00);
29  InitIdtVector(4, i386Overflow, 0x8e00);
31  InitIdtVector(6, i386InvalidOpcode, 0x8e00);
33  InitIdtVector(8, i386DoubleFault, 0x8e00);
35  InitIdtVector(10, i386InvalidTSS, 0x8e00);
37  InitIdtVector(12, i386StackException, 0x8e00);
39  InitIdtVector(14, i386PageFault, 0x8e00);
41  InitIdtVector(17, i386AlignmentCheck, 0x8e00);
42  InitIdtVector(18, i386MachineCheck, 0x8e00);
43 }
void __cdecl i386InvalidOpcode(void)
void __cdecl i386BoundException(void)
void __cdecl i386InvalidTSS(void)
#define __cdecl
Definition: accygwin.h:79
void __cdecl i386PageFault(void)
void __cdecl i386Overflow(void)
void __cdecl i386StackException(void)
void __cdecl i386DoubleFault(void)
void __cdecl i386NMIException(void)
void __cdecl i386DebugException(void)
static void InitIdtVector(UCHAR Vector, PVOID ServiceHandler, USHORT Access)
Definition: i386idt.c:10
void __cdecl i386DivideByZero(void)
void __cdecl InitIdt(void)
Definition: i386idt.c:23
void __cdecl i386CoprocessorError(void)
unsigned char UCHAR
Definition: xmlstorage.h:181
void __cdecl i386FPUNotAvailable(void)
void __cdecl i386GeneralProtectionFault(void)
void __cdecl i386SegmentNotPresent(void)
unsigned short USHORT
Definition: pedump.c:61
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG Vector
Definition: iofuncs.h:800
void __cdecl i386Breakpoint(void)
void __cdecl i386AlignmentCheck(void)
void __cdecl i386CoprocessorSegment(void)
unsigned int ULONG
Definition: retypes.h:1
#define PMODE_CS
Definition: x86common.h:69
void __cdecl i386MachineCheck(void)
static DWORD WINAPI ServiceHandler(DWORD ctrl, DWORD event_type, LPVOID event_data, LPVOID context)
Definition: service.c:57
KIDTENTRY DECLSPEC_ALIGN(4)
Definition: i386idt.c:5