bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 1 | /* Common softmmu definitions and inline routines. */ |
| 2 | |
j_mayer | 6ebbf39 | 2007-10-14 07:07:08 +0000 | [diff] [blame] | 3 | /* 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 |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 11 | |
blueswir1 | 79383c9 | 2008-08-30 09:51:20 +0000 | [diff] [blame] | 12 | #include "softmmu_defs.h" |
| 13 | |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 14 | #define ACCESS_TYPE 0 |
j_mayer | 6ebbf39 | 2007-10-14 07:07:08 +0000 | [diff] [blame] | 15 | #define MEMSUFFIX MMU_MODE0_SUFFIX |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 16 | #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_mayer | 6ebbf39 | 2007-10-14 07:07:08 +0000 | [diff] [blame] | 31 | #define MEMSUFFIX MMU_MODE1_SUFFIX |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 32 | #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_mayer | 6ebbf39 | 2007-10-14 07:07:08 +0000 | [diff] [blame] | 46 | #if (NB_MMU_MODES >= 3) |
| 47 | |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 48 | #define ACCESS_TYPE 2 |
j_mayer | 6ebbf39 | 2007-10-14 07:07:08 +0000 | [diff] [blame] | 49 | #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 |
| 63 | |
| 64 | #if (NB_MMU_MODES >= 4) |
| 65 | |
| 66 | #define ACCESS_TYPE 3 |
| 67 | #define MEMSUFFIX MMU_MODE3_SUFFIX |
| 68 | #define DATA_SIZE 1 |
| 69 | #include "softmmu_header.h" |
| 70 | |
| 71 | #define DATA_SIZE 2 |
| 72 | #include "softmmu_header.h" |
| 73 | |
| 74 | #define DATA_SIZE 4 |
| 75 | #include "softmmu_header.h" |
| 76 | |
| 77 | #define DATA_SIZE 8 |
| 78 | #include "softmmu_header.h" |
| 79 | #undef ACCESS_TYPE |
| 80 | #undef MEMSUFFIX |
| 81 | |
| 82 | #if (NB_MMU_MODES > 4) |
| 83 | #error "NB_MMU_MODES > 4 is not supported for now" |
| 84 | #endif /* (NB_MMU_MODES > 4) */ |
| 85 | #endif /* (NB_MMU_MODES == 4) */ |
| 86 | #endif /* (NB_MMU_MODES >= 3) */ |
| 87 | |
| 88 | /* these access are slower, they must be as rare as possible */ |
| 89 | #define ACCESS_TYPE (NB_MMU_MODES) |
bellard | a9049a0 | 2005-10-30 18:16:26 +0000 | [diff] [blame] | 90 | #define MEMSUFFIX _data |
| 91 | #define DATA_SIZE 1 |
| 92 | #include "softmmu_header.h" |
| 93 | |
| 94 | #define DATA_SIZE 2 |
| 95 | #include "softmmu_header.h" |
| 96 | |
| 97 | #define DATA_SIZE 4 |
| 98 | #include "softmmu_header.h" |
| 99 | |
| 100 | #define DATA_SIZE 8 |
| 101 | #include "softmmu_header.h" |
| 102 | #undef ACCESS_TYPE |
| 103 | #undef MEMSUFFIX |
| 104 | |
| 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) |
| 111 | |
| 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) |