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