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