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