2 C based implemention of IA32 interrupt handling only
3 requiring a minimal assembly interrupt entry point.
5 Copyright (c) 2006 - 2010, 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
;
45 GDT_ENTRY LinearCode64
;
52 #define NULL_SEL OFFSET_OF (GDT_ENTRIES, Null)
53 #define LINEAR_SEL OFFSET_OF (GDT_ENTRIES, Linear)
54 #define LINEAR_CODE_SEL OFFSET_OF (GDT_ENTRIES, LinearCode)
55 #define SYS_DATA_SEL OFFSET_OF (GDT_ENTRIES, SysData)
56 #define SYS_CODE_SEL OFFSET_OF (GDT_ENTRIES, SysCode)
57 #define LINEAR_CODE64_SEL OFFSET_OF (GDT_ENTRIES, LinearCode64)
58 #define SPARE4_SEL OFFSET_OF (GDT_ENTRIES, Spare4)
59 #define SPARE5_SEL OFFSET_OF (GDT_ENTRIES, Spare5)
61 #if defined (MDE_CPU_IA32)
62 #define CPU_CODE_SEL LINEAR_CODE_SEL
63 #define CPU_DATA_SEL LINEAR_SEL
64 #elif defined (MDE_CPU_X64)
65 #define CPU_CODE_SEL LINEAR_CODE64_SEL
66 #define CPU_DATA_SEL LINEAR_SEL
68 #error CPU type not supported for CPU GDT initialization!