Commit a9049a07bbeabe118c97d40e638958a946436b6f

Authored by bellard
1 parent bb3911a6

moved common softmmu code to common header (Paul Brook)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1580 c046a42c-6fe2-441c-8c8c-71466251a162
softmmu_exec.h 0 → 100644
  1 +/* Common softmmu definitions and inline routines. */
  2 +
  3 +#define ldul_user ldl_user
  4 +#define ldul_kernel ldl_kernel
  5 +
  6 +#define ACCESS_TYPE 0
  7 +#define MEMSUFFIX _kernel
  8 +#define DATA_SIZE 1
  9 +#include "softmmu_header.h"
  10 +
  11 +#define DATA_SIZE 2
  12 +#include "softmmu_header.h"
  13 +
  14 +#define DATA_SIZE 4
  15 +#include "softmmu_header.h"
  16 +
  17 +#define DATA_SIZE 8
  18 +#include "softmmu_header.h"
  19 +#undef ACCESS_TYPE
  20 +#undef MEMSUFFIX
  21 +
  22 +#define ACCESS_TYPE 1
  23 +#define MEMSUFFIX _user
  24 +#define DATA_SIZE 1
  25 +#include "softmmu_header.h"
  26 +
  27 +#define DATA_SIZE 2
  28 +#include "softmmu_header.h"
  29 +
  30 +#define DATA_SIZE 4
  31 +#include "softmmu_header.h"
  32 +
  33 +#define DATA_SIZE 8
  34 +#include "softmmu_header.h"
  35 +#undef ACCESS_TYPE
  36 +#undef MEMSUFFIX
  37 +
  38 +/* these access are slower, they must be as rare as possible */
  39 +#define ACCESS_TYPE 2
  40 +#define MEMSUFFIX _data
  41 +#define DATA_SIZE 1
  42 +#include "softmmu_header.h"
  43 +
  44 +#define DATA_SIZE 2
  45 +#include "softmmu_header.h"
  46 +
  47 +#define DATA_SIZE 4
  48 +#include "softmmu_header.h"
  49 +
  50 +#define DATA_SIZE 8
  51 +#include "softmmu_header.h"
  52 +#undef ACCESS_TYPE
  53 +#undef MEMSUFFIX
  54 +
  55 +#define ldub(p) ldub_data(p)
  56 +#define ldsb(p) ldsb_data(p)
  57 +#define lduw(p) lduw_data(p)
  58 +#define ldsw(p) ldsw_data(p)
  59 +#define ldl(p) ldl_data(p)
  60 +#define ldq(p) ldq_data(p)
  61 +
  62 +#define stb(p, v) stb_data(p, v)
  63 +#define stw(p, v) stw_data(p, v)
  64 +#define stl(p, v) stl_data(p, v)
  65 +#define stq(p, v) stq_data(p, v)
... ...
target-arm/exec.h
... ... @@ -75,3 +75,4 @@ void do_vfp_cmpes(void);
75 75 void do_vfp_cmped(void);
76 76 void do_vfp_set_fpscr(void);
77 77 void do_vfp_get_fpscr(void);
  78 +
... ...
target-i386/exec.h
... ... @@ -210,72 +210,9 @@ void check_iob_DX(void);
210 210 void check_iow_DX(void);
211 211 void check_iol_DX(void);
212 212  
213   -/* XXX: move that to a generic header */
214 213 #if !defined(CONFIG_USER_ONLY)
215 214  
216   -#define ldul_user ldl_user
217   -#define ldul_kernel ldl_kernel
218   -
219   -#define ACCESS_TYPE 0
220   -#define MEMSUFFIX _kernel
221   -#define DATA_SIZE 1
222   -#include "softmmu_header.h"
223   -
224   -#define DATA_SIZE 2
225   -#include "softmmu_header.h"
226   -
227   -#define DATA_SIZE 4
228   -#include "softmmu_header.h"
229   -
230   -#define DATA_SIZE 8
231   -#include "softmmu_header.h"
232   -#undef ACCESS_TYPE
233   -#undef MEMSUFFIX
234   -
235   -#define ACCESS_TYPE 1
236   -#define MEMSUFFIX _user
237   -#define DATA_SIZE 1
238   -#include "softmmu_header.h"
239   -
240   -#define DATA_SIZE 2
241   -#include "softmmu_header.h"
242   -
243   -#define DATA_SIZE 4
244   -#include "softmmu_header.h"
245   -
246   -#define DATA_SIZE 8
247   -#include "softmmu_header.h"
248   -#undef ACCESS_TYPE
249   -#undef MEMSUFFIX
250   -
251   -/* these access are slower, they must be as rare as possible */
252   -#define ACCESS_TYPE 2
253   -#define MEMSUFFIX _data
254   -#define DATA_SIZE 1
255   -#include "softmmu_header.h"
256   -
257   -#define DATA_SIZE 2
258   -#include "softmmu_header.h"
259   -
260   -#define DATA_SIZE 4
261   -#include "softmmu_header.h"
262   -
263   -#define DATA_SIZE 8
264   -#include "softmmu_header.h"
265   -#undef ACCESS_TYPE
266   -#undef MEMSUFFIX
267   -
268   -#define ldub(p) ldub_data(p)
269   -#define ldsb(p) ldsb_data(p)
270   -#define lduw(p) lduw_data(p)
271   -#define ldsw(p) ldsw_data(p)
272   -#define ldl(p) ldl_data(p)
273   -#define ldq(p) ldq_data(p)
274   -
275   -#define stb(p, v) stb_data(p, v)
276   -#define stw(p, v) stw_data(p, v)
277   -#define stl(p, v) stl_data(p, v)
278   -#define stq(p, v) stq_data(p, v)
  215 +#include "softmmu_exec.h"
279 216  
280 217 static inline double ldfq(target_ulong ptr)
281 218 {
... ...
target-mips/exec.h
... ... @@ -40,71 +40,7 @@ register double FT2 asm(FREG2);
40 40 #include "exec-all.h"
41 41  
42 42 #if !defined(CONFIG_USER_ONLY)
43   -
44   -#define ldul_user ldl_user
45   -#define ldul_kernel ldl_kernel
46   -
47   -#define ACCESS_TYPE 0
48   -#define MEMSUFFIX _kernel
49   -#define DATA_SIZE 1
50   -#include "softmmu_header.h"
51   -
52   -#define DATA_SIZE 2
53   -#include "softmmu_header.h"
54   -
55   -#define DATA_SIZE 4
56   -#include "softmmu_header.h"
57   -
58   -#define DATA_SIZE 8
59   -#include "softmmu_header.h"
60   -#undef ACCESS_TYPE
61   -#undef MEMSUFFIX
62   -
63   -#define ACCESS_TYPE 1
64   -#define MEMSUFFIX _user
65   -#define DATA_SIZE 1
66   -#include "softmmu_header.h"
67   -
68   -#define DATA_SIZE 2
69   -#include "softmmu_header.h"
70   -
71   -#define DATA_SIZE 4
72   -#include "softmmu_header.h"
73   -
74   -#define DATA_SIZE 8
75   -#include "softmmu_header.h"
76   -#undef ACCESS_TYPE
77   -#undef MEMSUFFIX
78   -
79   -/* these access are slower, they must be as rare as possible */
80   -#define ACCESS_TYPE 2
81   -#define MEMSUFFIX _data
82   -#define DATA_SIZE 1
83   -#include "softmmu_header.h"
84   -
85   -#define DATA_SIZE 2
86   -#include "softmmu_header.h"
87   -
88   -#define DATA_SIZE 4
89   -#include "softmmu_header.h"
90   -
91   -#define DATA_SIZE 8
92   -#include "softmmu_header.h"
93   -#undef ACCESS_TYPE
94   -#undef MEMSUFFIX
95   -
96   -#define ldub(p) ldub_data(p)
97   -#define ldsb(p) ldsb_data(p)
98   -#define lduw(p) lduw_data(p)
99   -#define ldsw(p) ldsw_data(p)
100   -#define ldl(p) ldl_data(p)
101   -#define ldq(p) ldq_data(p)
102   -
103   -#define stb(p, v) stb_data(p, v)
104   -#define stw(p, v) stw_data(p, v)
105   -#define stl(p, v) stl_data(p, v)
106   -#define stq(p, v) stq_data(p, v)
107   -
  43 +#include "softmmu_exec.h"
108 44 #endif /* !defined(CONFIG_USER_ONLY) */
109 45  
110 46 static inline void env_to_regs(void)
... ...
target-ppc/exec.h
... ... @@ -51,73 +51,8 @@ static inline uint32_t rotl (uint32_t i, int n)
51 51 return ((i << n) | (i >> (32 - n)));
52 52 }
53 53  
54   -/* XXX: move that to a generic header */
55 54 #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   -
  55 +#include "softmmu_exec.h"
121 56 #endif /* !defined(CONFIG_USER_ONLY) */
122 57  
123 58 void do_raise_exception_err (uint32_t exception, int error_code);
... ...
target-sparc/exec.h
... ... @@ -83,71 +83,7 @@ void do_rdpsr();
83 83  
84 84 /* XXX: move that to a generic header */
85 85 #if !defined(CONFIG_USER_ONLY)
86   -
87   -#define ldul_user ldl_user
88   -#define ldul_kernel ldl_kernel
89   -
90   -#define ACCESS_TYPE 0
91   -#define MEMSUFFIX _kernel
92   -#define DATA_SIZE 1
93   -#include "softmmu_header.h"
94   -
95   -#define DATA_SIZE 2
96   -#include "softmmu_header.h"
97   -
98   -#define DATA_SIZE 4
99   -#include "softmmu_header.h"
100   -
101   -#define DATA_SIZE 8
102   -#include "softmmu_header.h"
103   -#undef ACCESS_TYPE
104   -#undef MEMSUFFIX
105   -
106   -#define ACCESS_TYPE 1
107   -#define MEMSUFFIX _user
108   -#define DATA_SIZE 1
109   -#include "softmmu_header.h"
110   -
111   -#define DATA_SIZE 2
112   -#include "softmmu_header.h"
113   -
114   -#define DATA_SIZE 4
115   -#include "softmmu_header.h"
116   -
117   -#define DATA_SIZE 8
118   -#include "softmmu_header.h"
119   -#undef ACCESS_TYPE
120   -#undef MEMSUFFIX
121   -
122   -/* these access are slower, they must be as rare as possible */
123   -#define ACCESS_TYPE 2
124   -#define MEMSUFFIX _data
125   -#define DATA_SIZE 1
126   -#include "softmmu_header.h"
127   -
128   -#define DATA_SIZE 2
129   -#include "softmmu_header.h"
130   -
131   -#define DATA_SIZE 4
132   -#include "softmmu_header.h"
133   -
134   -#define DATA_SIZE 8
135   -#include "softmmu_header.h"
136   -#undef ACCESS_TYPE
137   -#undef MEMSUFFIX
138   -
139   -#define ldub(p) ldub_data(p)
140   -#define ldsb(p) ldsb_data(p)
141   -#define lduw(p) lduw_data(p)
142   -#define ldsw(p) ldsw_data(p)
143   -#define ldl(p) ldl_data(p)
144   -#define ldq(p) ldq_data(p)
145   -
146   -#define stb(p, v) stb_data(p, v)
147   -#define stw(p, v) stw_data(p, v)
148   -#define stl(p, v) stl_data(p, v)
149   -#define stq(p, v) stq_data(p, v)
150   -
  86 +#include "softmmu_exec.h"
151 87 #endif /* !defined(CONFIG_USER_ONLY) */
152 88  
153 89 static inline void env_to_regs(void)
... ...