]>
Commit | Line | Data |
---|---|---|
f45af90b | 1 | #/** @file\r |
2 | # \r | |
3 | # IDT vector entry.\r | |
4 | # \r | |
cd5ebaa0 HT |
5 | # Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r |
6 | # This program and the accompanying materials\r | |
f45af90b | 7 | # are licensed and made available under the terms and conditions of the BSD License\r |
8 | # which accompanies this distribution. The full text of the license may be found at\r | |
9 | # http://opensource.org/licenses/bsd-license.php\r | |
10 | # \r | |
11 | # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | # \r | |
96226baa | 14 | #**/\r |
5d582956 | 15 | \r |
16 | .text\r | |
17 | .code32\r | |
18 | \r | |
19 | \r | |
9d37f82f | 20 | .p2align 3\r |
132f41f0 | 21 | ASM_GLOBAL ASM_PFX(AsmGetVectorTemplatInfo)\r |
22 | ASM_GLOBAL ASM_PFX(AsmVectorFixup)\r | |
5d582956 | 23 | /*\r |
24 | ;\r | |
25 | ;-----------------------------------------------------------------------\r | |
26 | ; Template of IDT Vector Handlers. \r | |
27 | ;\r | |
28 | ;-----------------------------------------------------------------------\r | |
29 | */\r | |
ed0b86b1 | 30 | VectorTemplateBase:\r |
5d582956 | 31 | pushl %eax\r |
32 | .byte 0x6a # push #VectorNum\r | |
ed0b86b1 | 33 | VectorNum:\r |
5d582956 | 34 | .byte 0\r |
35 | movl CommonInterruptEntry, %eax\r | |
36 | jmp *%eax\r | |
ed0b86b1 | 37 | VectorTemplateEnd:\r |
5d582956 | 38 | \r |
39 | \r | |
40 | ASM_PFX(AsmGetVectorTemplatInfo):\r | |
41 | movl 4(%esp), %ecx\r | |
ed0b86b1 | 42 | movl $VectorTemplateBase, (%ecx)\r |
43 | movl $(VectorTemplateEnd - VectorTemplateBase), %eax\r | |
5d582956 | 44 | ret\r |
45 | \r | |
46 | ASM_PFX(AsmVectorFixup):\r | |
47 | movl 8(%esp), %eax\r | |
48 | movl 4(%esp), %ecx\r | |
ed0b86b1 | 49 | movb %al, (VectorNum - VectorTemplateBase)(%ecx)\r |
5d582956 | 50 | ret\r |
51 | \r | |
52 | /*\r | |
53 | ; The follow algorithm is used for the common interrupt routine.\r | |
54 | \r | |
55 | ;\r | |
56 | ; +---------------------+ <-- 16-byte aligned ensured by processor\r | |
57 | ; + Old SS +\r | |
58 | ; +---------------------+\r | |
59 | ; + Old RSP +\r | |
60 | ; +---------------------+\r | |
61 | ; + RFlags +\r | |
62 | ; +---------------------+\r | |
63 | ; + CS +\r | |
64 | ; +---------------------+\r | |
65 | ; + RIP +\r | |
66 | ; +---------------------+\r | |
67 | ; + Error Code +\r | |
68 | ; +---------------------+\r | |
69 | ; + Vector Number +\r | |
70 | ; +---------------------+\r | |
71 | */\r | |
72 | \r | |
73 | CommonInterruptEntry: \r | |
74 | cli\r | |
ed0b86b1 | 75 | 1:\r |
76 | jmp 1b\r | |
5d582956 | 77 | \r |
78 | \r | |
79 | \r | |
80 | \r |