~ubuntu-branches/ubuntu/trusty/virtualbox-lts-xenial/trusty-updates

« back to all changes in this revision

Viewing changes to src/VBox/Devices/EFI/Firmware/MdeModulePkg/Core/DxeIplPeim/Ia32/IdtVectorAsm.S

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2016-02-23 14:28:26 UTC
  • Revision ID: package-import@ubuntu.com-20160223142826-bdu69el2z6wa2a44
Tags: upstream-4.3.36-dfsg
ImportĀ upstreamĀ versionĀ 4.3.36-dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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