2 * Alpha emulation cpu micro-operations for qemu.
4 * Copyright (c) 2007 Jocelyn Mayer
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "host-utils.h"
26 #include "op_helper.h"
29 #define MEMSUFFIX _raw
31 #if !defined(CONFIG_USER_ONLY)
32 #define MEMSUFFIX _kernel
34 #define MEMSUFFIX _executive
36 #define MEMSUFFIX _supervisor
38 #define MEMSUFFIX _user
40 /* This is used for pal modes */
41 #define MEMSUFFIX _data
45 /* PALcode support special instructions */
46 #if !defined (CONFIG_USER_ONLY)
47 void OPPROTO op_hw_rei (void)
49 env->pc = env->ipr[IPR_EXC_ADDR] & ~3;
50 env->ipr[IPR_EXC_ADDR] = env->ipr[IPR_EXC_ADDR] & 1;
51 /* XXX: re-enable interrupts and memory mapping */
55 void OPPROTO op_hw_ret (void)
58 env->ipr[IPR_EXC_ADDR] = T0 & 1;
59 /* XXX: re-enable interrupts and memory mapping */
63 void OPPROTO op_mfpr (void)
65 helper_mfpr(PARAM(1));
69 void OPPROTO op_mtpr (void)
71 helper_mtpr(PARAM(1));
75 void OPPROTO op_set_alt_mode (void)
77 env->saved_mode = env->ps & 0xC;
78 env->ps = (env->ps & ~0xC) | (env->ipr[IPR_ALT_MODE] & 0xC);
82 void OPPROTO op_restore_mode (void)
84 env->ps = (env->ps & ~0xC) | env->saved_mode;
88 void OPPROTO op_ld_phys_to_virt (void)
90 helper_ld_phys_to_virt();
94 void OPPROTO op_st_phys_to_virt (void)
96 helper_st_phys_to_virt();
99 #endif /* !defined (CONFIG_USER_ONLY) */