]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S
PI spec will be updated to make it clear that this HOB should describe the stack...
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ia32 / IdtVectorAsm.S
1 /*
2 ;-------------------------------------------------------------------------------
3 ;
4 ; Copyright (c) 2007, Intel Corporation
5 ; All rights reserved. This program and the accompanying materials
6 ; are licensed and made available under the terms and conditions of the BSD License
7 ; which accompanies this distribution. The full text of the license may be found at
8 ; http://opensource.org/licenses/bsd-license.php
9
10 ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 ;
13 ;
14 ; Module Name:
15 ;
16 ; IdtVectorAsm.S
17 ;
18 ; Abstract:
19 ;
20 ;
21 ;-------------------------------------------------------------------- --------
22 */
23
24 .text
25 .code32
26
27
28 .align 8
29 .globl ASM_PFX(AsmGetVectorTemplatInfo)
30 .globl ASM_PFX(AsmVectorFixup)
31 /*
32 ;
33 ;-----------------------------------------------------------------------
34 ; Template of IDT Vector Handlers.
35 ;
36 ;-----------------------------------------------------------------------
37 */
38 @VectorTemplateBase:
39 pushl %eax
40 .byte 0x6a # push #VectorNum
41 @VectorNum:
42 .byte 0
43 movl CommonInterruptEntry, %eax
44 jmp *%eax
45 @VectorTemplateEnd:
46
47
48 ASM_PFX(AsmGetVectorTemplatInfo):
49 movl 4(%esp), %ecx
50 movl $@VectorTemplateBase, (%ecx)
51 movl $(@VectorTemplateEnd - @VectorTemplateBase), %eax
52 ret
53
54 ASM_PFX(AsmVectorFixup):
55 movl 8(%esp), %eax
56 movl 4(%esp), %ecx
57 movb %al, (@VectorNum - @VectorTemplateBase)(%ecx)
58 ret
59
60 /*
61 ; The follow algorithm is used for the common interrupt routine.
62
63 ;
64 ; +---------------------+ <-- 16-byte aligned ensured by processor
65 ; + Old SS +
66 ; +---------------------+
67 ; + Old RSP +
68 ; +---------------------+
69 ; + RFlags +
70 ; +---------------------+
71 ; + CS +
72 ; +---------------------+
73 ; + RIP +
74 ; +---------------------+
75 ; + Error Code +
76 ; +---------------------+
77 ; + Vector Number +
78 ; +---------------------+
79 */
80
81 CommonInterruptEntry:
82 cli
83 @@:
84 jmp @@
85
86
87
88