summaryrefslogtreecommitdiffstats
path: root/OvmfPkg
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:18:09 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-01-04 16:18:09 +0000
commit141815f3c71f5a3d21a4e34aa1386d28fe63923c (patch)
treecdceba75adaaa98775c1409cc6a2600546765387 /OvmfPkg
parentd22d1f535bd13dfa6c94d9ed61631813fe205c2f (diff)
downloadedk2-141815f3c71f5a3d21a4e34aa1386d28fe63923c.tar.gz
edk2-141815f3c71f5a3d21a4e34aa1386d28fe63923c.tar.bz2
edk2-141815f3c71f5a3d21a4e34aa1386d28fe63923c.zip
OVMF VTF0 Reset Vector: Cleanup Global Descriptor Table (GDT)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9676 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg')
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.ia32.port80.rawbin548 -> 500 bytes
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.ia32.rawbin532 -> 484 bytes
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.ia32.serial.rawbin932 -> 884 bytes
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.x64.port80.rawbin28676 -> 28676 bytes
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.x64.rawbin28676 -> 28676 bytes
-rw-r--r--OvmfPkg/ResetVector/Bin/ResetVector.x64.serial.rawbin28676 -> 28676 bytes
-rw-r--r--OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm123
7 files changed, 58 insertions, 65 deletions
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.port80.raw b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.port80.raw
index ad5f156b97..c071f1afaf 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.port80.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.port80.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.raw b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.raw
index 5761a75af6..97e639ab70 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.serial.raw b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.serial.raw
index 779553e4ae..c775900fbf 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.ia32.serial.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.ia32.serial.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.x64.port80.raw b/OvmfPkg/ResetVector/Bin/ResetVector.x64.port80.raw
index 5c9a7a3d54..09c9117072 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.x64.port80.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.x64.port80.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw b/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
index b93599e174..4b98137b1d 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.x64.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Bin/ResetVector.x64.serial.raw b/OvmfPkg/ResetVector/Bin/ResetVector.x64.serial.raw
index b7726e3a87..dfbb4f46d3 100644
--- a/OvmfPkg/ResetVector/Bin/ResetVector.x64.serial.raw
+++ b/OvmfPkg/ResetVector/Bin/ResetVector.x64.serial.raw
Binary files differ
diff --git a/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm b/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
index d4416ce85e..adf049cf77 100644
--- a/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
+++ b/OvmfPkg/ResetVector/Ia16/16RealTo32Flat.asm
@@ -63,78 +63,71 @@ gdtr:
ALIGN 16
+;
+; Macros for GDT entries
+;
+
+%define PRESENT_FLAG(p) (p << 7)
+%define DPL(dpl) (dpl << 5)
+%define SYSTEM_FLAG(s) (s << 4)
+%define DESC_TYPE(t) (t)
+
+; Type: data, expand-up, writable, accessed
+%define DATA32_TYPE 3
+
+; Type: execute, readable, expand-up, accessed
+%define CODE32_TYPE 0xb
+
+; Type: execute, readable, expand-up, accessed
+%define CODE64_TYPE 0xb
+
+%define GRANULARITY_FLAG(g) (g << 7)
+%define DEFAULT_SIZE32(d) (d << 6)
+%define CODE64_FLAG(l) (l << 5)
+%define UPPER_LIMIT(l) (l)
+
+;
+; The Global Descriptor Table (GDT)
+;
+
GDT_BASE:
; null descriptor
NULL_SEL equ $-GDT_BASE
- dw 0 ; limit 15:0
- dw 0 ; base 15:0
- db 0 ; base 23:16
- db 0 ; type
- db 0 ; limit 19:16, flags
- db 0 ; base 31:24
+ DW 0 ; limit 15:0
+ DW 0 ; base 15:0
+ DB 0 ; base 23:16
+ DB 0 ; sys flag, dpl, type
+ DB 0 ; limit 19:16, flags
+ DB 0 ; base 31:24
; linear data segment descriptor
-LINEAR_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 093h ; present, ring 0, data, expand-up, writable, accessed
- db 0CFh ; page-granular, 32-bit
- db 0
+LINEAR_SEL equ $-GDT_BASE
+ DW 0xffff ; limit 15:0
+ DW 0 ; base 15:0
+ DB 0 ; base 23:16
+ DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(DATA32_TYPE)
+ DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(1)|CODE64_FLAG(0)|UPPER_LIMIT(0xf)
+ DB 0 ; base 31:24
; linear code segment descriptor
-LINEAR_CODE_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 09Bh ; present, ring 0, data, expand-up, writable, accessed
- db 0CFh ; page-granular, 32-bit
- db 0
-
-; system data segment descriptor
-SYS_DATA_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 093h ; present, ring 0, data, expand-up, writable, accessed
- db 0CFh ; page-granular, 32-bit
- db 0
-
-; system code segment descriptor
-SYS_CODE_SEL equ $-GDT_BASE
- dw 0FFFFh ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 09Bh ; present, ring 0, data, expand-up, writable, accessed
- db 0CFh ; page-granular, 32-bit
- db 0
-
-; spare segment descriptor
-LINEAR_CODE64_SEL equ $-GDT_BASE
- DW -1 ; LimitLow
- DW 0 ; BaseLow
- DB 0 ; BaseMid
- DB 9bh
- DB 0afh ; LimitHigh (CS.L=1, CS.D=0)
- DB 0 ; BaseHigh
-
-; spare segment descriptor
-SPARE4_SEL equ $-GDT_BASE
- dw 0 ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 0 ; present, ring 0, data, expand-up, writable
- db 0 ; page-granular, 32-bit
- db 0
-
-; spare segment descriptor
-SPARE5_SEL equ $-GDT_BASE
- dw 0 ; limit 0xFFFFF
- dw 0 ; base 0
- db 0
- db 0 ; present, ring 0, data, expand-up, writable
- db 0 ; page-granular, 32-bit
- db 0
+LINEAR_CODE_SEL equ $-GDT_BASE
+ DW 0xffff ; limit 15:0
+ DW 0 ; base 15:0
+ DB 0 ; base 23:16
+ DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(CODE32_TYPE)
+ DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(1)|CODE64_FLAG(0)|UPPER_LIMIT(0xf)
+ DB 0 ; base 31:24
+
+%ifdef ARCH_X64
+; linear code (64-bit) segment descriptor
+LINEAR_CODE64_SEL equ $-GDT_BASE
+ DW 0xffff ; limit 15:0
+ DW 0 ; base 15:0
+ DB 0 ; base 23:16
+ DB PRESENT_FLAG(1)|DPL(0)|SYSTEM_FLAG(1)|DESC_TYPE(CODE64_TYPE)
+ DB GRANULARITY_FLAG(1)|DEFAULT_SIZE32(0)|CODE64_FLAG(1)|UPPER_LIMIT(0xf)
+ DB 0 ; base 31:24
+%endif
GDT_END: