2 C based implemention of IA32 interrupt handling only
3 requiring a minimal assembly interrupt entry point.
5 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
20 // Local structure definitions
26 // Global Descriptor Entry structures
29 typedef struct _GDT_ENTRY
{
34 UINT8 Limit19_16_and_flags
;
46 GDT_ENTRY LinearData64
;
47 GDT_ENTRY LinearCode64
;
53 #define NULL_SEL OFFSET_OF (GDT_ENTRIES, Null)
54 #define LINEAR_SEL OFFSET_OF (GDT_ENTRIES, Linear)
55 #define LINEAR_CODE_SEL OFFSET_OF (GDT_ENTRIES, LinearCode)
56 #define SYS_DATA_SEL OFFSET_OF (GDT_ENTRIES, SysData)
57 #define SYS_CODE_SEL OFFSET_OF (GDT_ENTRIES, SysCode)
58 #define SPARE4_SEL OFFSET_OF (GDT_ENTRIES, Spare4)
59 #define LINEAR_DATA64_SEL OFFSET_OF (GDT_ENTRIES, LinearData64)
60 #define LINEAR_CODE64_SEL OFFSET_OF (GDT_ENTRIES, LinearCode64)
61 #define SPARE5_SEL OFFSET_OF (GDT_ENTRIES, Spare5)
63 #if defined (MDE_CPU_IA32)
64 #define CPU_CODE_SEL LINEAR_CODE_SEL
65 #define CPU_DATA_SEL LINEAR_SEL
66 #elif defined (MDE_CPU_X64)
67 #define CPU_CODE_SEL LINEAR_CODE64_SEL
68 #define CPU_DATA_SEL LINEAR_DATA64_SEL
70 #error CPU type not supported for CPU GDT initialization!