1 /* Common definitions for QEMU Emulation PALcode
3 Copyright (C) 2011 Richard Henderson
5 This file is part of QEMU PALcode.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the text
15 of the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not see
19 <http://www.gnu.org/licenses/>. */
24 /* General Purpose Registers. */
42 /* PALcode Shadow Registers. These registers are swapped out when
43 QEMU is in PALmode. Unlike real hardware, there is no enable bit.
44 However, also unlike real hardware, the originals can be accessed
52 #define p6 $14 // Used to save exc_addr for machine check
55 /* QEMU Processor Registers. */
58 #define qemu_pcc_ofs 2
59 #define qemu_trap_arg0 3
60 #define qemu_trap_arg1 4
61 #define qemu_trap_arg2 5
62 #define qemu_exc_addr 6
66 #define qemu_unique 10
67 #define qemu_sysval 11
70 #define qemu_shadow0 32
71 #define qemu_shadow1 33
72 #define qemu_shadow2 34
73 #define qemu_shadow3 35
74 #define qemu_shadow4 36
75 #define qemu_shadow5 37
76 #define qemu_shadow6 38
77 #define qemu_shadow7 39
79 /* PALcode Processor Register Private Storage. */
105 /* QEMU function calls, via mtpr. */
106 #define qemu_tbia 255
107 #define qemu_tbis 254
108 #define qemu_wait 253
109 #define qemu_halt 252
110 #define qemu_alarm 251
111 #define qemu_walltime 250
112 #define qemu_vmtime 249
114 /* PALcode uses of the private storage slots. */
119 #define ptEntArith pt4
137 * Shortcuts for various PALmode instructions.
141 #define stq_p hw_stq/p
142 #define stl_p hw_stl/p
143 #define ldl_p hw_ldl/p
144 #define ldq_p hw_ldq/p
146 /* QEMU recognizes the EV4/EV5 HW_REI instruction as a special case of
147 the EV6 HW_RET instruction. This pulls the destination address from
148 the EXC_ADDR processor register. */
149 #define hw_rei hw_ret ($31)
152 .macro ENDFN function
153 .type
\function
, @function
154 .size
\function
, . - \function