1 | ; $Id: bootsector2-common-traprec-template.mac 93115 2022-01-01 11:31:46Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; Boot sector 2 - Trap Records, Code Template.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2007-2022 Oracle Corporation
|
---|
8 | ;
|
---|
9 | ; This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | ; available from http://www.virtualbox.org. This file is free software;
|
---|
11 | ; you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | ; General Public License (GPL) as published by the Free Software
|
---|
13 | ; Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | ; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | ; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | ;
|
---|
17 | ; The contents of this file may alternatively be used under the terms
|
---|
18 | ; of the Common Development and Distribution License Version 1.0
|
---|
19 | ; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
20 | ; VirtualBox OSE distribution, in which case the provisions of the
|
---|
21 | ; CDDL are applicable instead of those of the GPL.
|
---|
22 | ;
|
---|
23 | ; You may elect to license modified versions of this file under the
|
---|
24 | ; terms and conditions of either the GPL or the CDDL or both.
|
---|
25 | ;
|
---|
26 |
|
---|
27 | %include "bootsector2-template-header.mac"
|
---|
28 |
|
---|
29 |
|
---|
30 | ;;
|
---|
31 | ; Internal worker for reporting a missing trap
|
---|
32 | ;
|
---|
33 | ; The callee cleans up the arguments on the stack.
|
---|
34 | ;
|
---|
35 | ; @param [xBP + xCB*2] bExpected Expected exception number.
|
---|
36 | ; @param [xBP + xCB*2+1] szExpected The name of the exception (2 bytes + terminator).
|
---|
37 | ; @uses None
|
---|
38 | ;
|
---|
39 | BEGINPROC TMPL_NM_CMN(TestFailedMissingTrapInternal)
|
---|
40 | push xBP
|
---|
41 | mov xBP, xSP
|
---|
42 | pushf
|
---|
43 | push sAX
|
---|
44 |
|
---|
45 | movzx eax, byte [xBP + xCB*2]
|
---|
46 | push xAX
|
---|
47 | lea sAX, [sBP + xCB*2+1]
|
---|
48 | %ifdef TMPL_16BIT
|
---|
49 | push ss
|
---|
50 | %endif
|
---|
51 | push xAX
|
---|
52 | %ifdef TMPL_16BIT
|
---|
53 | push cs
|
---|
54 | %endif
|
---|
55 | push .szFmt
|
---|
56 | call TMPL_NM_CMN(TestFailedF)
|
---|
57 | %ifdef TMPL_16BIT
|
---|
58 | add xSP, xCB*5
|
---|
59 | %else
|
---|
60 | add xSP, xCB*3
|
---|
61 | %endif
|
---|
62 |
|
---|
63 | pop sAX
|
---|
64 | popf
|
---|
65 | leave
|
---|
66 | ret sCB
|
---|
67 | .szFmt: db 'Missing trap #%s (%RX8)', 13, 10, 0
|
---|
68 | ENDPROC TMPL_NM_CMN(TestFailedMissingTrapInternal)
|
---|
69 |
|
---|
70 | %ifndef TestFailedMissingTrapTemplate_defined
|
---|
71 | ;;
|
---|
72 | ; Internal template.
|
---|
73 | %macro TestFailedMissingTrapTemplate 4
|
---|
74 | BEGINPROC TMPL_NM_CMN(TestFailedMissingTrap_%1)
|
---|
75 | push dword RT_MAKE_U32_FROM_U8(%1, %2, %3, %4)
|
---|
76 | call TMPL_NM_CMN(TestFailedMissingTrapInternal)
|
---|
77 | ret
|
---|
78 | ENDPROC TMPL_NM_CMN(TestFailedMissingTrap_%1)
|
---|
79 | %endmacro
|
---|
80 | %define TestFailedMissingTrapTemplate_defined
|
---|
81 | %endif
|
---|
82 |
|
---|
83 | TestFailedMissingTrapTemplate X86_XCPT_DE, 'D', 'E', 0
|
---|
84 | TestFailedMissingTrapTemplate X86_XCPT_DB, 'D', 'B', 0
|
---|
85 | TestFailedMissingTrapTemplate X86_XCPT_NMI, 'N', 'M', 0
|
---|
86 | TestFailedMissingTrapTemplate X86_XCPT_BP, 'B', 'P', 0
|
---|
87 | TestFailedMissingTrapTemplate X86_XCPT_OF, 'O', 'F', 0
|
---|
88 | TestFailedMissingTrapTemplate X86_XCPT_BR, 'B', 'R', 0
|
---|
89 | TestFailedMissingTrapTemplate X86_XCPT_UD, 'U', 'D', 0
|
---|
90 | TestFailedMissingTrapTemplate X86_XCPT_NM, 'N', 'M', 0
|
---|
91 | ;TestFailedMissingTrapTemplate X86_XCPT_DF, 'D', 'F', 0
|
---|
92 | ;TestFailedMissingTrapTemplate X86_XCPT_CO_SEG_OVERRUN, 'C', 'O', 0
|
---|
93 | TestFailedMissingTrapTemplate X86_XCPT_TS, 'T', 'S', 0
|
---|
94 | TestFailedMissingTrapTemplate X86_XCPT_NP, 'N', 'P', 0
|
---|
95 | TestFailedMissingTrapTemplate X86_XCPT_SS, 'S', 'S', 0
|
---|
96 | TestFailedMissingTrapTemplate X86_XCPT_GP, 'G', 'P', 0
|
---|
97 | TestFailedMissingTrapTemplate X86_XCPT_PF, 'P', 'F', 0
|
---|
98 | TestFailedMissingTrapTemplate X86_XCPT_MF, 'M', 'F', 0
|
---|
99 | TestFailedMissingTrapTemplate X86_XCPT_AC, 'A', 'C', 0
|
---|
100 | ;TestFailedMissingTrapTemplate X86_XCPT_MC, 'M', 'C', 0
|
---|
101 | TestFailedMissingTrapTemplate X86_XCPT_XF, 'X', 'F', 0
|
---|
102 |
|
---|
103 |
|
---|
104 | %include "bootsector2-template-footer.mac"
|
---|
105 |
|
---|