]> Git Repo - qemu.git/blame - target-ppc/exec.h
Cirrus fix (Magnus Damm)
[qemu.git] / target-ppc / exec.h
CommitLineData
79aceca5
FB
1/*
2 * PPC emulation definitions for qemu.
3 *
4 * Copyright (c) 2003 Jocelyn Mayer
5 *
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.
10 *
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.
15 *
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
19 */
20#if !defined (__PPC_H__)
21#define __PPC_H__
22
23#include "dyngen-exec.h"
24
25register struct CPUPPCState *env asm(AREG0);
26register uint32_t T0 asm(AREG1);
27register uint32_t T1 asm(AREG2);
28register uint32_t T2 asm(AREG3);
29
30#define PARAM(n) ((uint32_t)PARAM##n)
31#define SPARAM(n) ((int32_t)PARAM##n)
fb0eaffc
FB
32#define FT0 (env->ft0)
33#define FT1 (env->ft1)
34#define FT2 (env->ft2)
79aceca5 35
a541f297
FB
36#if defined (DEBUG_OP)
37#define RETURN() __asm__ __volatile__("nop");
38#else
79aceca5 39#define RETURN() __asm__ __volatile__("");
a541f297 40#endif
79aceca5
FB
41
42#include "cpu.h"
43#include "exec-all.h"
44
9a64fbe4 45static inline uint32_t rotl (uint32_t i, int n)
79aceca5 46{
9a64fbe4 47 return ((i << n) | (i >> (32 - n)));
79aceca5
FB
48}
49
9a64fbe4
FB
50/* XXX: move that to a generic header */
51#if !defined(CONFIG_USER_ONLY)
79aceca5 52
9a64fbe4
FB
53#define ldul_user ldl_user
54#define ldul_kernel ldl_kernel
79aceca5 55
9a64fbe4
FB
56#define ACCESS_TYPE 0
57#define MEMSUFFIX _kernel
58#define DATA_SIZE 1
59#include "softmmu_header.h"
79aceca5 60
9a64fbe4
FB
61#define DATA_SIZE 2
62#include "softmmu_header.h"
79aceca5 63
9a64fbe4
FB
64#define DATA_SIZE 4
65#include "softmmu_header.h"
79aceca5 66
9a64fbe4
FB
67#define DATA_SIZE 8
68#include "softmmu_header.h"
69#undef ACCESS_TYPE
70#undef MEMSUFFIX
79aceca5 71
9a64fbe4
FB
72#define ACCESS_TYPE 1
73#define MEMSUFFIX _user
74#define DATA_SIZE 1
75#include "softmmu_header.h"
79aceca5 76
9a64fbe4
FB
77#define DATA_SIZE 2
78#include "softmmu_header.h"
79aceca5 79
9a64fbe4
FB
80#define DATA_SIZE 4
81#include "softmmu_header.h"
79aceca5 82
9a64fbe4
FB
83#define DATA_SIZE 8
84#include "softmmu_header.h"
85#undef ACCESS_TYPE
86#undef MEMSUFFIX
79aceca5 87
9a64fbe4
FB
88/* these access are slower, they must be as rare as possible */
89#define ACCESS_TYPE 2
90#define MEMSUFFIX _data
91#define DATA_SIZE 1
92#include "softmmu_header.h"
79aceca5 93
9a64fbe4
FB
94#define DATA_SIZE 2
95#include "softmmu_header.h"
79aceca5 96
9a64fbe4
FB
97#define DATA_SIZE 4
98#include "softmmu_header.h"
79aceca5 99
9a64fbe4
FB
100#define DATA_SIZE 8
101#include "softmmu_header.h"
102#undef ACCESS_TYPE
103#undef MEMSUFFIX
79aceca5 104
9a64fbe4
FB
105#define ldub(p) ldub_data(p)
106#define ldsb(p) ldsb_data(p)
107#define lduw(p) lduw_data(p)
108#define ldsw(p) ldsw_data(p)
109#define ldl(p) ldl_data(p)
110#define ldq(p) ldq_data(p)
79aceca5 111
9a64fbe4
FB
112#define stb(p, v) stb_data(p, v)
113#define stw(p, v) stw_data(p, v)
114#define stl(p, v) stl_data(p, v)
115#define stq(p, v) stq_data(p, v)
79aceca5 116
9a64fbe4 117#endif /* !defined(CONFIG_USER_ONLY) */
79aceca5 118
9fddaa0c
FB
119void do_raise_exception_err (uint32_t exception, int error_code);
120void do_raise_exception (uint32_t exception);
79aceca5 121
9a64fbe4
FB
122void do_load_cr (void);
123void do_store_cr (uint32_t mask);
124void do_load_xer (void);
125void do_store_xer (void);
126void do_load_msr (void);
127void do_store_msr (void);
fb0eaffc
FB
128void do_load_fpscr (void);
129void do_store_fpscr (uint32_t mask);
79aceca5 130
9a64fbe4
FB
131void do_sraw(void);
132
133void do_fctiw (void);
134void do_fctiwz (void);
4b3686fa
FB
135void do_fnmadd (void);
136void do_fnmsub (void);
9a64fbe4 137void do_fsqrt (void);
9a64fbe4 138void do_fres (void);
4ecc3190 139void do_frsqrte (void);
9a64fbe4
FB
140void do_fsel (void);
141void do_fcmpu (void);
142void do_fcmpo (void);
79aceca5 143
4b3686fa 144void do_check_reservation (void);
fb0eaffc 145void do_icbi (void);
4b3686fa
FB
146void do_store_sr (uint32_t srnum);
147void do_store_ibat (int ul, int nr);
148void do_store_dbat (int ul, int nr);
9a64fbe4
FB
149void do_tlbia (void);
150void do_tlbie (void);
151
a541f297 152void dump_state (void);
9a64fbe4
FB
153void dump_rfi (void);
154void dump_store_sr (int srnum);
155void dump_store_ibat (int ul, int nr);
156void dump_store_dbat (int ul, int nr);
157void dump_store_tb (int ul);
158void dump_update_tb(uint32_t param);
fb0eaffc 159
0d1a29f9
FB
160static inline void env_to_regs(void)
161{
162}
163
164static inline void regs_to_env(void)
165{
166}
167
0fa85d43
FB
168int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw,
169 int is_user, int is_softmmu);
170
79aceca5 171#endif /* !defined (__PPC_H__) */
This page took 0.102262 seconds and 4 git commands to generate.