Statistics
| Branch: | Revision:

root / target-ppc / exec.h @ ac9eb073

History | View | Annotate | Download (3.8 kB)

1 79aceca5 bellard
/*
2 79aceca5 bellard
 *  PPC emulation definitions for qemu.
3 79aceca5 bellard
 * 
4 79aceca5 bellard
 *  Copyright (c) 2003 Jocelyn Mayer
5 79aceca5 bellard
 *
6 79aceca5 bellard
 * This library is free software; you can redistribute it and/or
7 79aceca5 bellard
 * modify it under the terms of the GNU Lesser General Public
8 79aceca5 bellard
 * License as published by the Free Software Foundation; either
9 79aceca5 bellard
 * version 2 of the License, or (at your option) any later version.
10 79aceca5 bellard
 *
11 79aceca5 bellard
 * This library is distributed in the hope that it will be useful,
12 79aceca5 bellard
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 79aceca5 bellard
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 79aceca5 bellard
 * Lesser General Public License for more details.
15 79aceca5 bellard
 *
16 79aceca5 bellard
 * You should have received a copy of the GNU Lesser General Public
17 79aceca5 bellard
 * License along with this library; if not, write to the Free Software
18 79aceca5 bellard
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19 79aceca5 bellard
 */
20 79aceca5 bellard
#if !defined (__PPC_H__)
21 79aceca5 bellard
#define __PPC_H__
22 79aceca5 bellard
23 79aceca5 bellard
#include "dyngen-exec.h"
24 79aceca5 bellard
25 79aceca5 bellard
register struct CPUPPCState *env asm(AREG0);
26 79aceca5 bellard
register uint32_t T0 asm(AREG1);
27 79aceca5 bellard
register uint32_t T1 asm(AREG2);
28 79aceca5 bellard
register uint32_t T2 asm(AREG3);
29 79aceca5 bellard
30 79aceca5 bellard
#define PARAM(n) ((uint32_t)PARAM##n)
31 79aceca5 bellard
#define SPARAM(n) ((int32_t)PARAM##n)
32 fb0eaffc bellard
#define FT0 (env->ft0)
33 fb0eaffc bellard
#define FT1 (env->ft1)
34 fb0eaffc bellard
#define FT2 (env->ft2)
35 fb0eaffc bellard
#define FTS0 ((float)env->ft0)
36 fb0eaffc bellard
#define FTS1 ((float)env->ft1)
37 fb0eaffc bellard
#define FTS2 ((float)env->ft2)
38 79aceca5 bellard
39 79aceca5 bellard
#define RETURN() __asm__ __volatile__("");
40 79aceca5 bellard
41 79aceca5 bellard
#include "cpu.h"
42 79aceca5 bellard
#include "exec-all.h"
43 79aceca5 bellard
44 9a64fbe4 bellard
static inline uint32_t rotl (uint32_t i, int n)
45 79aceca5 bellard
{
46 9a64fbe4 bellard
    return ((i << n) | (i >> (32 - n)));
47 79aceca5 bellard
}
48 79aceca5 bellard
49 9a64fbe4 bellard
/* XXX: move that to a generic header */
50 9a64fbe4 bellard
#if !defined(CONFIG_USER_ONLY)
51 79aceca5 bellard
52 9a64fbe4 bellard
#define ldul_user ldl_user
53 9a64fbe4 bellard
#define ldul_kernel ldl_kernel
54 79aceca5 bellard
55 9a64fbe4 bellard
#define ACCESS_TYPE 0
56 9a64fbe4 bellard
#define MEMSUFFIX _kernel
57 9a64fbe4 bellard
#define DATA_SIZE 1
58 9a64fbe4 bellard
#include "softmmu_header.h"
59 79aceca5 bellard
60 9a64fbe4 bellard
#define DATA_SIZE 2
61 9a64fbe4 bellard
#include "softmmu_header.h"
62 79aceca5 bellard
63 9a64fbe4 bellard
#define DATA_SIZE 4
64 9a64fbe4 bellard
#include "softmmu_header.h"
65 79aceca5 bellard
66 9a64fbe4 bellard
#define DATA_SIZE 8
67 9a64fbe4 bellard
#include "softmmu_header.h"
68 9a64fbe4 bellard
#undef ACCESS_TYPE
69 9a64fbe4 bellard
#undef MEMSUFFIX
70 79aceca5 bellard
71 9a64fbe4 bellard
#define ACCESS_TYPE 1
72 9a64fbe4 bellard
#define MEMSUFFIX _user
73 9a64fbe4 bellard
#define DATA_SIZE 1
74 9a64fbe4 bellard
#include "softmmu_header.h"
75 79aceca5 bellard
76 9a64fbe4 bellard
#define DATA_SIZE 2
77 9a64fbe4 bellard
#include "softmmu_header.h"
78 79aceca5 bellard
79 9a64fbe4 bellard
#define DATA_SIZE 4
80 9a64fbe4 bellard
#include "softmmu_header.h"
81 79aceca5 bellard
82 9a64fbe4 bellard
#define DATA_SIZE 8
83 9a64fbe4 bellard
#include "softmmu_header.h"
84 9a64fbe4 bellard
#undef ACCESS_TYPE
85 9a64fbe4 bellard
#undef MEMSUFFIX
86 79aceca5 bellard
87 9a64fbe4 bellard
/* these access are slower, they must be as rare as possible */
88 9a64fbe4 bellard
#define ACCESS_TYPE 2
89 9a64fbe4 bellard
#define MEMSUFFIX _data
90 9a64fbe4 bellard
#define DATA_SIZE 1
91 9a64fbe4 bellard
#include "softmmu_header.h"
92 79aceca5 bellard
93 9a64fbe4 bellard
#define DATA_SIZE 2
94 9a64fbe4 bellard
#include "softmmu_header.h"
95 79aceca5 bellard
96 9a64fbe4 bellard
#define DATA_SIZE 4
97 9a64fbe4 bellard
#include "softmmu_header.h"
98 79aceca5 bellard
99 9a64fbe4 bellard
#define DATA_SIZE 8
100 9a64fbe4 bellard
#include "softmmu_header.h"
101 9a64fbe4 bellard
#undef ACCESS_TYPE
102 9a64fbe4 bellard
#undef MEMSUFFIX
103 79aceca5 bellard
104 9a64fbe4 bellard
#define ldub(p) ldub_data(p)
105 9a64fbe4 bellard
#define ldsb(p) ldsb_data(p)
106 9a64fbe4 bellard
#define lduw(p) lduw_data(p)
107 9a64fbe4 bellard
#define ldsw(p) ldsw_data(p)
108 9a64fbe4 bellard
#define ldl(p) ldl_data(p)
109 9a64fbe4 bellard
#define ldq(p) ldq_data(p)
110 79aceca5 bellard
111 9a64fbe4 bellard
#define stb(p, v) stb_data(p, v)
112 9a64fbe4 bellard
#define stw(p, v) stw_data(p, v)
113 9a64fbe4 bellard
#define stl(p, v) stl_data(p, v)
114 9a64fbe4 bellard
#define stq(p, v) stq_data(p, v)
115 79aceca5 bellard
116 9a64fbe4 bellard
#endif /* !defined(CONFIG_USER_ONLY) */
117 79aceca5 bellard
118 9a64fbe4 bellard
int check_exception_state (CPUState *env);
119 79aceca5 bellard
120 9a64fbe4 bellard
void do_queue_exception_err (uint32_t exception, int error_code);
121 9a64fbe4 bellard
void do_queue_exception (uint32_t exception);
122 9a64fbe4 bellard
void do_process_exceptions (void);
123 9a64fbe4 bellard
void do_check_exception_state (void);
124 79aceca5 bellard
125 9a64fbe4 bellard
void do_load_cr (void);
126 9a64fbe4 bellard
void do_store_cr (uint32_t mask);
127 9a64fbe4 bellard
void do_load_xer (void);
128 9a64fbe4 bellard
void do_store_xer (void);
129 9a64fbe4 bellard
void do_load_msr (void);
130 9a64fbe4 bellard
void do_store_msr (void);
131 fb0eaffc bellard
void do_load_fpscr (void);
132 fb0eaffc bellard
void do_store_fpscr (uint32_t mask);
133 79aceca5 bellard
134 9a64fbe4 bellard
void do_sraw(void);
135 9a64fbe4 bellard
136 9a64fbe4 bellard
void do_fctiw (void);
137 9a64fbe4 bellard
void do_fctiwz (void);
138 9a64fbe4 bellard
void do_fsqrt (void);
139 9a64fbe4 bellard
void do_fsqrts (void);
140 9a64fbe4 bellard
void do_fres (void);
141 9a64fbe4 bellard
void do_fsqrte (void);
142 9a64fbe4 bellard
void do_fsel (void);
143 9a64fbe4 bellard
void do_fcmpu (void);
144 9a64fbe4 bellard
void do_fcmpo (void);
145 9a64fbe4 bellard
void do_fabs (void);
146 9a64fbe4 bellard
void do_fnabs (void);
147 79aceca5 bellard
148 fb0eaffc bellard
void do_icbi (void);
149 9a64fbe4 bellard
void do_tlbia (void);
150 9a64fbe4 bellard
void do_tlbie (void);
151 9a64fbe4 bellard
152 9a64fbe4 bellard
void dump_rfi (void);
153 9a64fbe4 bellard
void dump_store_sr (int srnum);
154 9a64fbe4 bellard
void dump_store_ibat (int ul, int nr);
155 9a64fbe4 bellard
void dump_store_dbat (int ul, int nr);
156 9a64fbe4 bellard
void dump_store_tb (int ul);
157 9a64fbe4 bellard
void dump_update_tb(uint32_t param);
158 fb0eaffc bellard
159 79aceca5 bellard
#endif /* !defined (__PPC_H__) */