root / target-ppc / exec.h @ 6cc721cf
History | View | Annotate | Download (3.5 kB)
1 |
/*
|
---|---|
2 |
* PowerPC emulation definitions for qemu.
|
3 |
*
|
4 |
* Copyright (c) 2003-2005 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 "config.h" |
24 |
|
25 |
#include "dyngen-exec.h" |
26 |
|
27 |
#define TARGET_LONG_BITS 32 |
28 |
|
29 |
register struct CPUPPCState *env asm(AREG0); |
30 |
register uint32_t T0 asm(AREG1); |
31 |
register uint32_t T1 asm(AREG2); |
32 |
register uint32_t T2 asm(AREG3); |
33 |
|
34 |
#define PARAM(n) ((uint32_t)PARAM##n) |
35 |
#define SPARAM(n) ((int32_t)PARAM##n) |
36 |
#define FT0 (env->ft0)
|
37 |
#define FT1 (env->ft1)
|
38 |
#define FT2 (env->ft2)
|
39 |
|
40 |
#if defined (DEBUG_OP)
|
41 |
#define RETURN() __asm__ __volatile__("nop"); |
42 |
#else
|
43 |
#define RETURN() __asm__ __volatile__(""); |
44 |
#endif
|
45 |
|
46 |
#include "cpu.h" |
47 |
#include "exec-all.h" |
48 |
|
49 |
static inline uint32_t rotl (uint32_t i, int n) |
50 |
{ |
51 |
return ((i << n) | (i >> (32 - n))); |
52 |
} |
53 |
|
54 |
/* XXX: move that to a generic header */
|
55 |
#if !defined(CONFIG_USER_ONLY)
|
56 |
|
57 |
#define ldul_user ldl_user
|
58 |
#define ldul_kernel ldl_kernel
|
59 |
|
60 |
#define ACCESS_TYPE 0 |
61 |
#define MEMSUFFIX _kernel
|
62 |
#define DATA_SIZE 1 |
63 |
#include "softmmu_header.h" |
64 |
|
65 |
#define DATA_SIZE 2 |
66 |
#include "softmmu_header.h" |
67 |
|
68 |
#define DATA_SIZE 4 |
69 |
#include "softmmu_header.h" |
70 |
|
71 |
#define DATA_SIZE 8 |
72 |
#include "softmmu_header.h" |
73 |
#undef ACCESS_TYPE
|
74 |
#undef MEMSUFFIX
|
75 |
|
76 |
#define ACCESS_TYPE 1 |
77 |
#define MEMSUFFIX _user
|
78 |
#define DATA_SIZE 1 |
79 |
#include "softmmu_header.h" |
80 |
|
81 |
#define DATA_SIZE 2 |
82 |
#include "softmmu_header.h" |
83 |
|
84 |
#define DATA_SIZE 4 |
85 |
#include "softmmu_header.h" |
86 |
|
87 |
#define DATA_SIZE 8 |
88 |
#include "softmmu_header.h" |
89 |
#undef ACCESS_TYPE
|
90 |
#undef MEMSUFFIX
|
91 |
|
92 |
/* these access are slower, they must be as rare as possible */
|
93 |
#define ACCESS_TYPE 2 |
94 |
#define MEMSUFFIX _data
|
95 |
#define DATA_SIZE 1 |
96 |
#include "softmmu_header.h" |
97 |
|
98 |
#define DATA_SIZE 2 |
99 |
#include "softmmu_header.h" |
100 |
|
101 |
#define DATA_SIZE 4 |
102 |
#include "softmmu_header.h" |
103 |
|
104 |
#define DATA_SIZE 8 |
105 |
#include "softmmu_header.h" |
106 |
#undef ACCESS_TYPE
|
107 |
#undef MEMSUFFIX
|
108 |
|
109 |
#define ldub(p) ldub_data(p)
|
110 |
#define ldsb(p) ldsb_data(p)
|
111 |
#define lduw(p) lduw_data(p)
|
112 |
#define ldsw(p) ldsw_data(p)
|
113 |
#define ldl(p) ldl_data(p)
|
114 |
#define ldq(p) ldq_data(p)
|
115 |
|
116 |
#define stb(p, v) stb_data(p, v)
|
117 |
#define stw(p, v) stw_data(p, v)
|
118 |
#define stl(p, v) stl_data(p, v)
|
119 |
#define stq(p, v) stq_data(p, v)
|
120 |
|
121 |
#endif /* !defined(CONFIG_USER_ONLY) */ |
122 |
|
123 |
void do_raise_exception_err (uint32_t exception, int error_code); |
124 |
void do_raise_exception (uint32_t exception);
|
125 |
|
126 |
void do_sraw(void); |
127 |
|
128 |
void do_fctiw (void); |
129 |
void do_fctiwz (void); |
130 |
void do_fnmadd (void); |
131 |
void do_fnmsub (void); |
132 |
void do_fsqrt (void); |
133 |
void do_fres (void); |
134 |
void do_frsqrte (void); |
135 |
void do_fsel (void); |
136 |
void do_fcmpu (void); |
137 |
void do_fcmpo (void); |
138 |
|
139 |
void do_check_reservation (void); |
140 |
void do_icbi (void); |
141 |
void do_tlbia (void); |
142 |
void do_tlbie (void); |
143 |
|
144 |
static inline void env_to_regs(void) |
145 |
{ |
146 |
} |
147 |
|
148 |
static inline void regs_to_env(void) |
149 |
{ |
150 |
} |
151 |
|
152 |
int cpu_ppc_handle_mmu_fault (CPUState *env, uint32_t address, int rw, |
153 |
int is_user, int is_softmmu); |
154 |
|
155 |
#endif /* !defined (__PPC_H__) */ |