]>
Commit | Line | Data |
---|---|---|
96226baa | 1 | ;/** @file\r |
f45af90b | 2 | ; \r |
96226baa | 3 | ; IDT vector entry.\r |
4 | ; \r | |
5 | ; Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r | |
6 | ; All rights reserved. This program and the accompanying materials\r | |
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 | |
14 | ;**/\r | |
5d582956 | 15 | \r |
16 | .686p\r | |
17 | .model flat,C\r | |
18 | .code\r | |
19 | \r | |
20 | ;\r | |
21 | ;------------------------------------------------------------------------------\r | |
22 | ; Generic IDT Vector Handlers for the Host. \r | |
23 | ;\r | |
24 | ;------------------------------------------------------------------------------\r | |
25 | \r | |
26 | ALIGN 8\r | |
27 | PUBLIC AsmGetVectorTemplatInfo\r | |
28 | PUBLIC AsmVectorFixup\r | |
29 | \r | |
30 | PUBLIC AsmVectorFixup\r | |
31 | \r | |
32 | @VectorTemplateBase:\r | |
33 | push eax\r | |
34 | db 6ah ; push #VectorNumber\r | |
35 | @VectorNum:\r | |
36 | db 0\r | |
37 | mov eax, CommonInterruptEntry\r | |
38 | jmp eax\r | |
39 | @VectorTemplateEnd:\r | |
40 | \r | |
41 | \r | |
42 | AsmGetVectorTemplatInfo PROC\r | |
43 | mov ecx, [esp + 4]\r | |
44 | mov [ecx], @VectorTemplateBase\r | |
45 | mov eax, (@VectorTemplateEnd - @VectorTemplateBase)\r | |
46 | ret\r | |
47 | AsmGetVectorTemplatInfo ENDP\r | |
48 | \r | |
49 | \r | |
50 | AsmVectorFixup PROC\r | |
51 | mov eax, dword ptr [esp + 8]\r | |
52 | mov ecx, [esp + 4]\r | |
53 | mov [ecx + (@VectorNum - @VectorTemplateBase)], al\r | |
54 | ret\r | |
55 | AsmVectorFixup ENDP\r | |
56 | \r | |
57 | \r | |
58 | ;---------------------------------------;\r | |
59 | ; CommonInterruptEntry ;\r | |
60 | ;---------------------------------------;\r | |
61 | ; The follow algorithm is used for the common interrupt routine.\r | |
62 | \r | |
63 | ;\r | |
64 | ; +---------------------+ <-- 16-byte aligned ensured by processor\r | |
65 | ; + Old SS +\r | |
66 | ; +---------------------+\r | |
67 | ; + Old RSP +\r | |
68 | ; +---------------------+\r | |
69 | ; + RFlags +\r | |
70 | ; +---------------------+\r | |
71 | ; + CS +\r | |
72 | ; +---------------------+\r | |
73 | ; + RIP +\r | |
74 | ; +---------------------+\r | |
75 | ; + Error Code +\r | |
76 | ; +---------------------+\r | |
77 | ; + Vector Number +\r | |
78 | ; +---------------------+\r | |
79 | \r | |
80 | CommonInterruptEntry PROC \r | |
81 | cli\r | |
82 | \r | |
83 | jmp $\r | |
84 | CommonInterruptEntry ENDP\r | |
85 | \r | |
86 | END\r | |
87 | \r | |
88 | \r |