1 | ; $Id: bs3-cpu-weird-1-template.mac 96407 2022-08-22 17:43:14Z vboxsync $
|
---|
2 | ;; @file
|
---|
3 | ; BS3Kit - bs3-cpu-weird-1 assembly template.
|
---|
4 | ;
|
---|
5 |
|
---|
6 | ;
|
---|
7 | ; Copyright (C) 2007-2022 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 |
|
---|
38 | ;*********************************************************************************************************************************
|
---|
39 | ;* Header Files *
|
---|
40 | ;*********************************************************************************************************************************
|
---|
41 | %include "bs3kit-template-header.mac" ; setup environment
|
---|
42 |
|
---|
43 |
|
---|
44 | ;*********************************************************************************************************************************
|
---|
45 | ;* External Symbols *
|
---|
46 | ;*********************************************************************************************************************************
|
---|
47 | TMPL_BEGIN_TEXT
|
---|
48 |
|
---|
49 |
|
---|
50 | ;
|
---|
51 | ; Test code snippets containing code which differs between 16-bit, 32-bit
|
---|
52 | ; and 64-bit CPUs modes.
|
---|
53 | ;
|
---|
54 | %ifdef BS3_INSTANTIATING_CMN
|
---|
55 |
|
---|
56 |
|
---|
57 | ;
|
---|
58 | ; Inhibited int 80h.
|
---|
59 | ;
|
---|
60 | BS3_PROC_BEGIN_CMN bs3CpuWeird1_InhibitedInt80, BS3_PBC_NEAR
|
---|
61 | ; Load SS from stack. This instruction causes fusing.
|
---|
62 | %if TMPL_BITS != 64
|
---|
63 | pop ss
|
---|
64 | %else
|
---|
65 | mov ss, [rsp]
|
---|
66 | %endif
|
---|
67 | ; The ring transition instruction.
|
---|
68 | BS3_GLOBAL_NAME_EX BS3_CMN_NM(bs3CpuWeird1_InhibitedInt80_int80), , 0
|
---|
69 | int 80h
|
---|
70 | ; We shouldn't get here!
|
---|
71 | .ud2_again:
|
---|
72 | ud2
|
---|
73 | jmp .ud2_again
|
---|
74 | BS3_PROC_END_CMN bs3CpuWeird1_InhibitedInt80
|
---|
75 |
|
---|
76 | ;
|
---|
77 | ; Inhibited int 3.
|
---|
78 | ;
|
---|
79 | BS3_PROC_BEGIN_CMN bs3CpuWeird1_InhibitedInt3, BS3_PBC_NEAR
|
---|
80 | ; Load SS from stack. This instruction causes fusing.
|
---|
81 | %if TMPL_BITS != 64
|
---|
82 | pop ss
|
---|
83 | %else
|
---|
84 | mov ss, [rsp]
|
---|
85 | %endif
|
---|
86 | ; The ring transition instruction.
|
---|
87 | BS3_GLOBAL_NAME_EX BS3_CMN_NM(bs3CpuWeird1_InhibitedInt3_int3), , 0
|
---|
88 | int 3
|
---|
89 | ; We shouldn't get here!
|
---|
90 | .ud2_again:
|
---|
91 | ud2
|
---|
92 | jmp .ud2_again
|
---|
93 | AssertCompile(.ud2_again - BS3_CMN_NM(bs3CpuWeird1_InhibitedInt3_int3) == 2)
|
---|
94 | BS3_PROC_END_CMN bs3CpuWeird1_InhibitedInt3
|
---|
95 |
|
---|
96 |
|
---|
97 | ;
|
---|
98 | ; Inhibited int3.
|
---|
99 | ;
|
---|
100 | BS3_PROC_BEGIN_CMN bs3CpuWeird1_InhibitedBp, BS3_PBC_NEAR
|
---|
101 | ; Load SS from stack. This instruction causes fusing.
|
---|
102 | %if TMPL_BITS != 64
|
---|
103 | pop ss
|
---|
104 | %else
|
---|
105 | mov ss, [rsp]
|
---|
106 | %endif
|
---|
107 | ; The ring transition instruction.
|
---|
108 | BS3_GLOBAL_NAME_EX BS3_CMN_NM(bs3CpuWeird1_InhibitedBp_int3), , 0
|
---|
109 | int3
|
---|
110 | ; We shouldn't get here!
|
---|
111 | .ud2_again:
|
---|
112 | ud2
|
---|
113 | jmp .ud2_again
|
---|
114 | AssertCompile(.ud2_again - BS3_CMN_NM(bs3CpuWeird1_InhibitedBp_int3) == 1)
|
---|
115 | BS3_PROC_END_CMN bs3CpuWeird1_InhibitedBp
|
---|
116 |
|
---|
117 |
|
---|
118 | %endif ; BS3_INSTANTIATING_CMN
|
---|
119 |
|
---|
120 | %include "bs3kit-template-footer.mac" ; reset environment
|
---|
121 |
|
---|