Commit e58ffeb322e2ef88cc23e9505366418bf793316d
1 parent
bc575e95
Remove all traces of __powerpc__
According to $GCC/gcc/config/rs6000/rs6000-c.c _ARCH_PPC is the ubiquitous define which should be used to test whether gcc targets PowerPC, on 64bit platforms _ARCH_PPC64 will be also defined. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6301 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
15 changed files
with
23 additions
and
30 deletions
Makefile.target
@@ -98,11 +98,6 @@ HELPER_CFLAGS+=-fomit-frame-pointer | @@ -98,11 +98,6 @@ HELPER_CFLAGS+=-fomit-frame-pointer | ||
98 | OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer | 98 | OP_CFLAGS+=-mpreferred-stack-boundary=2 -fomit-frame-pointer |
99 | endif | 99 | endif |
100 | 100 | ||
101 | -ifeq ($(ARCH),ppc) | ||
102 | -CPPFLAGS+= -D__powerpc__ | ||
103 | -OP_CFLAGS+= -mlongcall | ||
104 | -endif | ||
105 | - | ||
106 | ifeq ($(ARCH),sparc) | 101 | ifeq ($(ARCH),sparc) |
107 | CFLAGS+=-ffixed-g2 -ffixed-g3 | 102 | CFLAGS+=-ffixed-g2 -ffixed-g3 |
108 | OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 | 103 | OP_CFLAGS+=-fno-delayed-branch -ffixed-i0 |
bsd-user/elfload.c
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | #include "qemu.h" | 12 | #include "qemu.h" |
13 | #include "disas.h" | 13 | #include "disas.h" |
14 | 14 | ||
15 | -#ifdef __powerpc64__ | 15 | +#ifdef _ARCH_PPC64 |
16 | #undef ARCH_DLINFO | 16 | #undef ARCH_DLINFO |
17 | #undef ELF_PLATFORM | 17 | #undef ELF_PLATFORM |
18 | #undef ELF_HWCAP | 18 | #undef ELF_HWCAP |
bswap.h
@@ -134,7 +134,7 @@ CPU_CONVERT(le, 64, uint64_t) | @@ -134,7 +134,7 @@ CPU_CONVERT(le, 64, uint64_t) | ||
134 | 134 | ||
135 | /* unaligned versions (optimized for frequent unaligned accesses)*/ | 135 | /* unaligned versions (optimized for frequent unaligned accesses)*/ |
136 | 136 | ||
137 | -#if defined(__i386__) || defined(__powerpc__) | 137 | +#if defined(__i386__) || defined(_ARCH_PPC) |
138 | 138 | ||
139 | #define cpu_to_le16wu(p, v) cpu_to_le16w(p, v) | 139 | #define cpu_to_le16wu(p, v) cpu_to_le16w(p, v) |
140 | #define cpu_to_le32wu(p, v) cpu_to_le32w(p, v) | 140 | #define cpu_to_le32wu(p, v) cpu_to_le32w(p, v) |
cache-utils.c
1 | #include "cache-utils.h" | 1 | #include "cache-utils.h" |
2 | 2 | ||
3 | -#if defined HOST_PPC || defined HOST_PPC64 | 3 | +#if defined(_ARCH_PPC) |
4 | struct qemu_cache_conf qemu_cache_conf = { | 4 | struct qemu_cache_conf qemu_cache_conf = { |
5 | .dcache_bsize = 16, | 5 | .dcache_bsize = 16, |
6 | .icache_bsize = 16 | 6 | .icache_bsize = 16 |
@@ -68,4 +68,4 @@ void qemu_cache_utils_init(char **envp) | @@ -68,4 +68,4 @@ void qemu_cache_utils_init(char **envp) | ||
68 | } | 68 | } |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | -#endif /* HOST_PPC || HOST_PPC64 */ | 71 | +#endif /* _ARCH_PPC */ |
cache-utils.h
1 | #ifndef QEMU_CACHE_UTILS_H | 1 | #ifndef QEMU_CACHE_UTILS_H |
2 | #define QEMU_CACHE_UTILS_H | 2 | #define QEMU_CACHE_UTILS_H |
3 | 3 | ||
4 | -#include "config-host.h" | ||
5 | - | ||
6 | -#if defined HOST_PPC || defined HOST_PPC64 | 4 | +#if defined(_ARCH_PPC) |
7 | struct qemu_cache_conf { | 5 | struct qemu_cache_conf { |
8 | unsigned long dcache_bsize; | 6 | unsigned long dcache_bsize; |
9 | unsigned long icache_bsize; | 7 | unsigned long icache_bsize; |
cpu-all.h
@@ -229,7 +229,7 @@ static inline void stb_p(void *ptr, int v) | @@ -229,7 +229,7 @@ static inline void stb_p(void *ptr, int v) | ||
229 | /* conservative code for little endian unaligned accesses */ | 229 | /* conservative code for little endian unaligned accesses */ |
230 | static inline int lduw_le_p(const void *ptr) | 230 | static inline int lduw_le_p(const void *ptr) |
231 | { | 231 | { |
232 | -#ifdef __powerpc__ | 232 | +#ifdef _ARCH_PPC |
233 | int val; | 233 | int val; |
234 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 234 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
235 | return val; | 235 | return val; |
@@ -241,7 +241,7 @@ static inline int lduw_le_p(const void *ptr) | @@ -241,7 +241,7 @@ static inline int lduw_le_p(const void *ptr) | ||
241 | 241 | ||
242 | static inline int ldsw_le_p(const void *ptr) | 242 | static inline int ldsw_le_p(const void *ptr) |
243 | { | 243 | { |
244 | -#ifdef __powerpc__ | 244 | +#ifdef _ARCH_PPC |
245 | int val; | 245 | int val; |
246 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 246 | __asm__ __volatile__ ("lhbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
247 | return (int16_t)val; | 247 | return (int16_t)val; |
@@ -253,7 +253,7 @@ static inline int ldsw_le_p(const void *ptr) | @@ -253,7 +253,7 @@ static inline int ldsw_le_p(const void *ptr) | ||
253 | 253 | ||
254 | static inline int ldl_le_p(const void *ptr) | 254 | static inline int ldl_le_p(const void *ptr) |
255 | { | 255 | { |
256 | -#ifdef __powerpc__ | 256 | +#ifdef _ARCH_PPC |
257 | int val; | 257 | int val; |
258 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (ptr)); | 258 | __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (val) : "r" (ptr)); |
259 | return val; | 259 | return val; |
@@ -274,7 +274,7 @@ static inline uint64_t ldq_le_p(const void *ptr) | @@ -274,7 +274,7 @@ static inline uint64_t ldq_le_p(const void *ptr) | ||
274 | 274 | ||
275 | static inline void stw_le_p(void *ptr, int v) | 275 | static inline void stw_le_p(void *ptr, int v) |
276 | { | 276 | { |
277 | -#ifdef __powerpc__ | 277 | +#ifdef _ARCH_PPC |
278 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*(uint16_t *)ptr) : "r" (v), "r" (ptr)); | 278 | __asm__ __volatile__ ("sthbrx %1,0,%2" : "=m" (*(uint16_t *)ptr) : "r" (v), "r" (ptr)); |
279 | #else | 279 | #else |
280 | uint8_t *p = ptr; | 280 | uint8_t *p = ptr; |
@@ -285,7 +285,7 @@ static inline void stw_le_p(void *ptr, int v) | @@ -285,7 +285,7 @@ static inline void stw_le_p(void *ptr, int v) | ||
285 | 285 | ||
286 | static inline void stl_le_p(void *ptr, int v) | 286 | static inline void stl_le_p(void *ptr, int v) |
287 | { | 287 | { |
288 | -#ifdef __powerpc__ | 288 | +#ifdef _ARCH_PPC |
289 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr)); | 289 | __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr)); |
290 | #else | 290 | #else |
291 | uint8_t *p = ptr; | 291 | uint8_t *p = ptr; |
@@ -985,7 +985,7 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size); | @@ -985,7 +985,7 @@ void qemu_unregister_coalesced_mmio(target_phys_addr_t addr, ram_addr_t size); | ||
985 | /*******************************************/ | 985 | /*******************************************/ |
986 | /* host CPU ticks (if available) */ | 986 | /* host CPU ticks (if available) */ |
987 | 987 | ||
988 | -#if defined(__powerpc__) | 988 | +#if defined(_ARCH_PPC) |
989 | 989 | ||
990 | static inline uint32_t get_tbl(void) | 990 | static inline uint32_t get_tbl(void) |
991 | { | 991 | { |
cpu-exec.c
@@ -1218,7 +1218,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | @@ -1218,7 +1218,7 @@ int cpu_signal_handler(int host_signum, void *pinfo, | ||
1218 | &uc->uc_sigmask, puc); | 1218 | &uc->uc_sigmask, puc); |
1219 | } | 1219 | } |
1220 | 1220 | ||
1221 | -#elif defined(__powerpc__) | 1221 | +#elif defined(_ARCH_PPC) |
1222 | 1222 | ||
1223 | /*********************************************************************** | 1223 | /*********************************************************************** |
1224 | * signal context platform-specific definitions | 1224 | * signal context platform-specific definitions |
darwin-user/commpage.c
@@ -181,7 +181,7 @@ static inline void install_commpage_backdoor_for_entry(struct commpage_entry ent | @@ -181,7 +181,7 @@ static inline void install_commpage_backdoor_for_entry(struct commpage_entry ent | ||
181 | */ | 181 | */ |
182 | void commpage_init(void) | 182 | void commpage_init(void) |
183 | { | 183 | { |
184 | -#if (defined(__i386__) ^ defined(TARGET_I386)) || (defined(__powerpc__) ^ defined(TARGET_PPC)) | 184 | +#if (defined(__i386__) ^ defined(TARGET_I386)) || (defined(_ARCH_PPC) ^ defined(TARGET_PPC)) |
185 | int i; | 185 | int i; |
186 | void * commpage = (void *)target_mmap( COMMPAGE_START, COMMPAGE_SIZE, | 186 | void * commpage = (void *)target_mmap( COMMPAGE_START, COMMPAGE_SIZE, |
187 | PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_FIXED, -1, 0); | 187 | PROT_WRITE | PROT_READ, MAP_ANONYMOUS | MAP_FIXED, -1, 0); |
disas.c
@@ -250,7 +250,7 @@ void disas(FILE *out, void *code, unsigned long size) | @@ -250,7 +250,7 @@ void disas(FILE *out, void *code, unsigned long size) | ||
250 | #elif defined(__x86_64__) | 250 | #elif defined(__x86_64__) |
251 | disasm_info.mach = bfd_mach_x86_64; | 251 | disasm_info.mach = bfd_mach_x86_64; |
252 | print_insn = print_insn_i386; | 252 | print_insn = print_insn_i386; |
253 | -#elif defined(__powerpc__) | 253 | +#elif defined(_ARCH_PPC) |
254 | print_insn = print_insn_ppc; | 254 | print_insn = print_insn_ppc; |
255 | #elif defined(__alpha__) | 255 | #elif defined(__alpha__) |
256 | print_insn = print_insn_alpha; | 256 | print_insn = print_insn_alpha; |
dyngen-exec.h
@@ -41,7 +41,7 @@ typedef unsigned int uint32_t; | @@ -41,7 +41,7 @@ typedef unsigned int uint32_t; | ||
41 | // Linux/Sparc64 defines uint64_t | 41 | // Linux/Sparc64 defines uint64_t |
42 | #if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__)) | 42 | #if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__)) |
43 | /* XXX may be done for all 64 bits targets ? */ | 43 | /* XXX may be done for all 64 bits targets ? */ |
44 | -#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__) | 44 | +#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(_ARCH_PPC64) |
45 | typedef unsigned long uint64_t; | 45 | typedef unsigned long uint64_t; |
46 | #else | 46 | #else |
47 | typedef unsigned long long uint64_t; | 47 | typedef unsigned long long uint64_t; |
@@ -58,7 +58,7 @@ typedef signed short int16_t; | @@ -58,7 +58,7 @@ typedef signed short int16_t; | ||
58 | typedef signed int int32_t; | 58 | typedef signed int int32_t; |
59 | // Linux/Sparc64 defines int64_t | 59 | // Linux/Sparc64 defines int64_t |
60 | #if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__)) | 60 | #if !(defined (__sparc_v9__) && defined(__linux__)) && !(defined(__APPLE__) && defined(__x86_64__)) |
61 | -#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(__powerpc64__) | 61 | +#if defined (__x86_64__) || defined(__ia64) || defined(__s390x__) || defined(__alpha__) || defined(_ARCH_PPC64) |
62 | typedef signed long int64_t; | 62 | typedef signed long int64_t; |
63 | #else | 63 | #else |
64 | typedef signed long long int64_t; | 64 | typedef signed long long int64_t; |
@@ -105,7 +105,7 @@ extern int printf(const char *, ...); | @@ -105,7 +105,7 @@ extern int printf(const char *, ...); | ||
105 | #define AREG3 "r13" | 105 | #define AREG3 "r13" |
106 | //#define AREG4 "rbp" | 106 | //#define AREG4 "rbp" |
107 | //#define AREG5 "rbx" | 107 | //#define AREG5 "rbx" |
108 | -#elif defined(__powerpc__) | 108 | +#elif defined(_ARCH_PPC) |
109 | #define AREG0 "r27" | 109 | #define AREG0 "r27" |
110 | #define AREG1 "r24" | 110 | #define AREG1 "r24" |
111 | #define AREG2 "r25" | 111 | #define AREG2 "r25" |
exec-all.h
@@ -117,7 +117,7 @@ static inline int tlb_set_page(CPUState *env1, target_ulong vaddr, | @@ -117,7 +117,7 @@ static inline int tlb_set_page(CPUState *env1, target_ulong vaddr, | ||
117 | #define CODE_GEN_AVG_BLOCK_SIZE 64 | 117 | #define CODE_GEN_AVG_BLOCK_SIZE 64 |
118 | #endif | 118 | #endif |
119 | 119 | ||
120 | -#if defined(__powerpc__) || defined(__x86_64__) || defined(__arm__) | 120 | +#if defined(_ARCH_PPC) || defined(__x86_64__) || defined(__arm__) |
121 | #define USE_DIRECT_JUMP | 121 | #define USE_DIRECT_JUMP |
122 | #endif | 122 | #endif |
123 | #if defined(__i386__) && !defined(_WIN32) | 123 | #if defined(__i386__) && !defined(_WIN32) |
@@ -192,7 +192,7 @@ extern int code_gen_max_blocks; | @@ -192,7 +192,7 @@ extern int code_gen_max_blocks; | ||
192 | 192 | ||
193 | #if defined(USE_DIRECT_JUMP) | 193 | #if defined(USE_DIRECT_JUMP) |
194 | 194 | ||
195 | -#if defined(__powerpc__) | 195 | +#if defined(_ARCH_PPC) |
196 | extern void ppc_tb_set_jmp_target(unsigned long jmp_addr, unsigned long addr); | 196 | extern void ppc_tb_set_jmp_target(unsigned long jmp_addr, unsigned long addr); |
197 | #define tb_set_jmp_target1 ppc_tb_set_jmp_target | 197 | #define tb_set_jmp_target1 ppc_tb_set_jmp_target |
198 | #elif defined(__i386__) || defined(__x86_64__) | 198 | #elif defined(__i386__) || defined(__x86_64__) |
fpu/softfloat-native.c
@@ -51,7 +51,7 @@ ldexpl(long double x, int n) { | @@ -51,7 +51,7 @@ ldexpl(long double x, int n) { | ||
51 | #endif | 51 | #endif |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | -#if defined(__powerpc__) | 54 | +#if defined(_ARCH_PPC) |
55 | 55 | ||
56 | /* correct (but slow) PowerPC rint() (glibc version is incorrect) */ | 56 | /* correct (but slow) PowerPC rint() (glibc version is incorrect) */ |
57 | double qemu_rint(double x) | 57 | double qemu_rint(double x) |
linux-user/elfload.c
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | #include "qemu.h" | 12 | #include "qemu.h" |
13 | #include "disas.h" | 13 | #include "disas.h" |
14 | 14 | ||
15 | -#ifdef __powerpc64__ | 15 | +#ifdef _ARCH_PPC64 |
16 | #undef ARCH_DLINFO | 16 | #undef ARCH_DLINFO |
17 | #undef ELF_PLATFORM | 17 | #undef ELF_PLATFORM |
18 | #undef ELF_HWCAP | 18 | #undef ELF_HWCAP |
qemu-lock.h
@@ -58,7 +58,7 @@ static inline void resetlock (spinlock_t *p) | @@ -58,7 +58,7 @@ static inline void resetlock (spinlock_t *p) | ||
58 | 58 | ||
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | -#if defined(__powerpc__) | 61 | +#if defined(_ARCH_PPC) |
62 | static inline int testandset (int *p) | 62 | static inline int testandset (int *p) |
63 | { | 63 | { |
64 | int ret; | 64 | int ret; |
tcg/tcg.h
@@ -457,7 +457,7 @@ uint64_t tcg_helper_divu_i64(uint64_t arg1, uint64_t arg2); | @@ -457,7 +457,7 @@ uint64_t tcg_helper_divu_i64(uint64_t arg1, uint64_t arg2); | ||
457 | uint64_t tcg_helper_remu_i64(uint64_t arg1, uint64_t arg2); | 457 | uint64_t tcg_helper_remu_i64(uint64_t arg1, uint64_t arg2); |
458 | 458 | ||
459 | extern uint8_t code_gen_prologue[]; | 459 | extern uint8_t code_gen_prologue[]; |
460 | -#if defined(__powerpc__) && !defined(__powerpc64__) | 460 | +#if defined(_ARCH_PPC) && !defined(_ARCH_PPC64) |
461 | #define tcg_qemu_tb_exec(tb_ptr) \ | 461 | #define tcg_qemu_tb_exec(tb_ptr) \ |
462 | ((long REGPARM __attribute__ ((longcall)) (*)(void *))code_gen_prologue)(tb_ptr) | 462 | ((long REGPARM __attribute__ ((longcall)) (*)(void *))code_gen_prologue)(tb_ptr) |
463 | #else | 463 | #else |