;------------------------------------------------------------------------------ ;\r
-; Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>\r
; This program and the accompanying materials\r
; are licensed and made available under the terms and conditions of the BSD License\r
; which accompanies this distribution. The full text of the license may be found at\r
\r
EXTERNDEF SmiPFHandler:PROC\r
EXTERNDEF PageFaultStubFunction:PROC\r
-EXTERNDEF gSmiMtrrs:QWORD\r
EXTERNDEF gcSmiIdtr:FWORD\r
EXTERNDEF gcSmiGdtr:FWORD\r
+EXTERNDEF gTaskGateDescriptor:QWORD\r
EXTERNDEF gcPsd:BYTE\r
EXTERNDEF FeaturePcdGet (PcdCpuSmmProfileEnable):BYTE\r
\r
GDT_SIZE = $ - offset NullSeg\r
\r
TssSeg LABEL QWORD\r
- DW TSS_DESC_SIZE ; LimitLow\r
+ DW TSS_DESC_SIZE - 1 ; LimitLow\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
- DB 080h ; LimitHigh\r
+ DB 00h ; LimitHigh\r
DB 0 ; BaseHigh\r
ExceptionTssSeg LABEL QWORD\r
- DW TSS_DESC_SIZE ; LimitLow\r
+ DW TSS_DESC_SIZE - 1 ; LimitLow\r
DW 0 ; BaseLow\r
DB 0 ; BaseMid\r
DB 89h\r
- DB 080h ; LimitHigh\r
+ DB 00h ; LimitHigh\r
DB 0 ; BaseHigh\r
\r
CODE_SEL = offset CodeSeg32 - offset NullSeg\r
DD GDT_SIZE\r
DD 0\r
DB 24 dup (0)\r
- DQ offset gSmiMtrrs\r
+ DQ 0\r
PSD_SIZE = $ - offset gcPsd\r
\r
gcSmiGdtr LABEL FWORD\r
DD offset NullSeg\r
\r
gcSmiIdtr LABEL FWORD\r
- DW IDT_SIZE - 1\r
- DD offset _SmiIDT\r
-\r
-_SmiIDT LABEL QWORD\r
-REPEAT 32\r
- DW 0 ; Offset 0:15\r
- DW CODE_SEL ; Segment selector\r
- DB 0 ; Unused\r
- DB 8eh ; Interrupt Gate, Present\r
- DW 0 ; Offset 16:31\r
- ENDM\r
-IDT_SIZE = $ - offset _SmiIDT\r
-\r
-TaskGateDescriptor LABEL DWORD\r
+ DW 0\r
+ DD 0\r
+\r
+gTaskGateDescriptor LABEL QWORD\r
DW 0 ; Reserved\r
DW EXCEPTION_TSS_SEL ; TSS Segment selector\r
DB 0 ; Reserved\r
iretd\r
PageFaultStubFunction ENDP\r
\r
-InitializeIDTSmmStackGuard PROC USES ebx\r
-;\r
-; If SMM Stack Guard feature is enabled, the Page Fault Exception entry in IDT\r
-; is a Task Gate Descriptor so that when a Page Fault Exception occurs,\r
-; the processors can use a known good stack in case stack is ran out.\r
-;\r
- lea ebx, _SmiIDT + 14 * 8\r
- lea edx, TaskGateDescriptor\r
- mov eax, [edx]\r
- mov [ebx], eax\r
- mov eax, [edx + 4]\r
- mov [ebx + 4], eax\r
- ret\r
-InitializeIDTSmmStackGuard ENDP\r
-\r
END\r