blob: a43e6219425f8012f6224bf7b449fd8e93ce0bb2 [file] [log] [blame]
bellarda9049a02005-10-30 18:16:26 +00001/* Common softmmu definitions and inline routines. */
2
j_mayer6ebbf392007-10-14 07:07:08 +00003/* XXX: find something cleaner.
4 * Furthermore, this is false for 64 bits targets
5 */
6#define ldul_user ldl_user
7#define ldul_kernel ldl_kernel
8#define ldul_hypv ldl_hypv
9#define ldul_executive ldl_executive
10#define ldul_supervisor ldl_supervisor
bellarda9049a02005-10-30 18:16:26 +000011
blueswir179383c92008-08-30 09:51:20 +000012#include "softmmu_defs.h"
13
bellarda9049a02005-10-30 18:16:26 +000014#define ACCESS_TYPE 0
j_mayer6ebbf392007-10-14 07:07:08 +000015#define MEMSUFFIX MMU_MODE0_SUFFIX
bellarda9049a02005-10-30 18:16:26 +000016#define DATA_SIZE 1
17#include "softmmu_header.h"
18
19#define DATA_SIZE 2
20#include "softmmu_header.h"
21
22#define DATA_SIZE 4
23#include "softmmu_header.h"
24
25#define DATA_SIZE 8
26#include "softmmu_header.h"
27#undef ACCESS_TYPE
28#undef MEMSUFFIX
29
30#define ACCESS_TYPE 1
j_mayer6ebbf392007-10-14 07:07:08 +000031#define MEMSUFFIX MMU_MODE1_SUFFIX
bellarda9049a02005-10-30 18:16:26 +000032#define DATA_SIZE 1
33#include "softmmu_header.h"
34
35#define DATA_SIZE 2
36#include "softmmu_header.h"
37
38#define DATA_SIZE 4
39#include "softmmu_header.h"
40
41#define DATA_SIZE 8
42#include "softmmu_header.h"
43#undef ACCESS_TYPE
44#undef MEMSUFFIX
45
j_mayer6ebbf392007-10-14 07:07:08 +000046#if (NB_MMU_MODES >= 3)
47
bellarda9049a02005-10-30 18:16:26 +000048#define ACCESS_TYPE 2
j_mayer6ebbf392007-10-14 07:07:08 +000049#define MEMSUFFIX MMU_MODE2_SUFFIX
50#define DATA_SIZE 1
51#include "softmmu_header.h"
52
53#define DATA_SIZE 2
54#include "softmmu_header.h"
55
56#define DATA_SIZE 4
57#include "softmmu_header.h"
58
59#define DATA_SIZE 8
60#include "softmmu_header.h"
61#undef ACCESS_TYPE
62#undef MEMSUFFIX
aurel32e37e6ee2009-04-07 21:47:27 +000063#endif /* (NB_MMU_MODES >= 3) */
j_mayer6ebbf392007-10-14 07:07:08 +000064
65#if (NB_MMU_MODES >= 4)
66
67#define ACCESS_TYPE 3
68#define MEMSUFFIX MMU_MODE3_SUFFIX
69#define DATA_SIZE 1
70#include "softmmu_header.h"
71
72#define DATA_SIZE 2
73#include "softmmu_header.h"
74
75#define DATA_SIZE 4
76#include "softmmu_header.h"
77
78#define DATA_SIZE 8
79#include "softmmu_header.h"
80#undef ACCESS_TYPE
81#undef MEMSUFFIX
aurel32e37e6ee2009-04-07 21:47:27 +000082#endif /* (NB_MMU_MODES >= 4) */
j_mayer6ebbf392007-10-14 07:07:08 +000083
aurel32e37e6ee2009-04-07 21:47:27 +000084#if (NB_MMU_MODES >= 5)
85
86#define ACCESS_TYPE 4
87#define MEMSUFFIX MMU_MODE4_SUFFIX
88#define DATA_SIZE 1
89#include "softmmu_header.h"
90
91#define DATA_SIZE 2
92#include "softmmu_header.h"
93
94#define DATA_SIZE 4
95#include "softmmu_header.h"
96
97#define DATA_SIZE 8
98#include "softmmu_header.h"
99#undef ACCESS_TYPE
100#undef MEMSUFFIX
101#endif /* (NB_MMU_MODES >= 5) */
102
103#if (NB_MMU_MODES > 5)
104#error "NB_MMU_MODES > 5 is not supported for now"
105#endif /* (NB_MMU_MODES > 5) */
j_mayer6ebbf392007-10-14 07:07:08 +0000106
107/* these access are slower, they must be as rare as possible */
108#define ACCESS_TYPE (NB_MMU_MODES)
bellarda9049a02005-10-30 18:16:26 +0000109#define MEMSUFFIX _data
110#define DATA_SIZE 1
111#include "softmmu_header.h"
112
113#define DATA_SIZE 2
114#include "softmmu_header.h"
115
116#define DATA_SIZE 4
117#include "softmmu_header.h"
118
119#define DATA_SIZE 8
120#include "softmmu_header.h"
121#undef ACCESS_TYPE
122#undef MEMSUFFIX
123
124#define ldub(p) ldub_data(p)
125#define ldsb(p) ldsb_data(p)
126#define lduw(p) lduw_data(p)
127#define ldsw(p) ldsw_data(p)
128#define ldl(p) ldl_data(p)
129#define ldq(p) ldq_data(p)
130
131#define stb(p, v) stb_data(p, v)
132#define stw(p, v) stw_data(p, v)
133#define stl(p, v) stl_data(p, v)
134#define stq(p, v) stq_data(p, v)