arch: Cleanup of __ARM__ checks

* gcc 7.x defines __arm__ and __ARM__ (and others)
* clang defines __arm__ and __arm
* cleanup a few related ifdef vs if macros

Change-Id: I5da4bafac590f6fa3e10e543688001c2449f840d
This commit is contained in:
Alexander von Gluck IV
2018-07-31 19:12:20 -05:00
parent 26ae216d0e
commit 9642f7705b
12 changed files with 26 additions and 27 deletions
+7 -7
View File
@@ -18,7 +18,7 @@
__HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures
(defaults to undefined)
*/
#ifdef __INTEL__
#if defined(__INTEL__)
# define __HAIKU_ARCH x86
# if __GNUC__ == 2
# define __HAIKU_ARCH_ABI "x86_gcc2"
@@ -27,31 +27,31 @@
# endif
# define __HAIKU_ARCH_X86 1
# define __HAIKU_ARCH_PHYSICAL_BITS 64
#elif __x86_64__
#elif defined(__x86_64__)
# define __HAIKU_ARCH x86_64
# define __HAIKU_ARCH_ABI "x86_64"
# define __HAIKU_ARCH_X86_64 1
# define __HAIKU_ARCH_BITS 64
#elif __POWERPC__
#elif defined(__POWERPC__)
# define __HAIKU_ARCH ppc
# define __HAIKU_ARCH_ABI "ppc"
# define __HAIKU_ARCH_PPC 1
# define __HAIKU_ARCH_PHYSICAL_BITS 64
# define __HAIKU_BIG_ENDIAN 1
#elif __M68K__
#elif defined(__M68K__)
# define __HAIKU_ARCH m68k
# define __HAIKU_ARCH_ABI "m68k"
# define __HAIKU_ARCH_M68K 1
# define __HAIKU_BIG_ENDIAN 1
#elif __MIPSEL__
#elif defined(__MIPSEL__)
# define __HAIKU_ARCH mipsel
# define __HAIKU_ARCH_ABI "mipsel"
# define __HAIKU_ARCH_MIPSEL 1
#elif __ARM__ || __ARMEL__
#elif defined(__ARMEL__) || defined(__arm__)
# define __HAIKU_ARCH arm
# define __HAIKU_ARCH_ABI "arm"
# define __HAIKU_ARCH_ARM 1
#elif __ARMEB__
#elif defined(__ARMEB__)
# define __HAIKU_ARCH armeb
# define __HAIKU_ARCH_ABI "armeb"
# define __HAIKU_ARCH_ARM 1
+6 -6
View File
@@ -20,17 +20,17 @@
#include <arch/arm/arch_debugger.h>
#ifdef __x86_64__
#if defined(__x86_64__)
typedef struct x86_64_debug_cpu_state debug_cpu_state;
#elif __INTEL__
#elif defined( __INTEL__)
typedef struct x86_debug_cpu_state debug_cpu_state;
#elif __POWERPC__
#elif defined(__POWERPC__)
typedef struct ppc_debug_cpu_state debug_cpu_state;
#elif __M68K__
#elif defined(__M68K__)
typedef struct m68k_debug_cpu_state debug_cpu_state;
#elif __MIPSEL__
#elif defined(__MIPSEL__)
typedef struct mipsel_debug_cpu_state debug_cpu_state;
#elif __ARM__
#elif defined(__arm__)
typedef struct arm_debug_cpu_state debug_cpu_state;
#else
#error unsupported architecture
+2 -2
View File
@@ -10,7 +10,7 @@
* Architecture-specific structure passed to signal handlers
*/
#if __ARM__
#if defined(__arm__)
struct vregs
{
ulong r0;
@@ -32,7 +32,7 @@ struct vregs
ulong cpsr;
// TODO: ARM: fix floats in vregs, add missing stuff.
};
#endif /* __ARM__ */
#endif /* defined(__arm__) */
#endif /* _ARCH_SIGNAL_H_ */
+1 -1
View File
@@ -5,7 +5,7 @@
# include <arch/x86/fenv.h>
#elif defined(__x86_64__)
# include <arch/x86_64/fenv.h>
#elif defined(__ARM__)
#elif defined(__arm__)
# include <arch/arm/fenv.h>
#elif defined(__POWERPC__)
# include <arch/ppc/fenv.h>
+1 -1
View File
@@ -15,7 +15,7 @@
#include <arch/generic/debug_uart_8250.h>
#if defined(__ARM__)
#if defined(__arm__)
#include <arch/arm/arch_uart_pl011.h>
#endif
+2 -2
View File
@@ -70,7 +70,7 @@ extern "C" void _start(void);
extern "C" int start_gen(int argc, const char **argv,
struct image_header *uimage=NULL, void *fdt=NULL);
extern "C" void dump_uimage(struct image_header *image);
#if defined(__ARM__)
#if defined(__arm__)
extern "C" status_t arch_mailbox_init();
#endif
@@ -230,7 +230,7 @@ start_gen(int argc, const char **argv, struct image_header *uimage, void *fdt)
serial_init(gFDT);
#if defined(__ARM__)
#if defined(__arm__)
arch_mailbox_init();
#endif
+1 -1
View File
@@ -105,7 +105,7 @@ platform_init_video(void)
{
#warning TODO: Fix u-boot arm framebuffer location from fdt!
#ifdef __ARM__
#if defined(__arm__)
#if defined(BOARD_CPU_ARM920T)
extern ArchFramebuffer *arch_get_fb_arm_920(addr_t base);
gFramebuffer = arch_get_fb_arm_920(0x88000000);
@@ -17,7 +17,7 @@
#include <arch/generic/debug_uart_8250.h>
#ifdef __ARM__
#if defined(__arm__)
#include <arch/arm/arch_uart_pl011.h>
#endif
@@ -101,7 +101,7 @@ debug_uart_from_fdt(const void *fdt)
|| fdt_node_check_compatible(fdt, node, "ns16550") == 0) {
TRACE(("serial: Found 8250 serial UART!\n"));
uart = arch_get_uart_8250(regs, clock);
#ifdef __ARM__
#if defined(__arm__)
} else if (fdt_node_check_compatible(fdt, node, "ti,omap3-uart") == 0
|| fdt_node_check_compatible(fdt, node, "ti,omap4-uart") == 0
|| fdt_node_check_compatible(fdt, node, "ti,omap5-uart") == 0
+1 -1
View File
@@ -108,7 +108,7 @@ atomic_get64(int64 *value)
#endif /* ATOMIC64_FUNCS_ARE_SYSCALLS */
#ifdef __ARM__
#if defined(__arm__)
/* GCC compatibility: libstdc++ needs this one.
* TODO: Update libstdc++ and drop this.
+1 -2
View File
@@ -126,8 +126,7 @@
#if defined(__i386__) || defined(__ia64__) || defined(__alpha__) || \
defined(__sparc64__) || defined(__powerpc__) || defined(__POWERPC__) || \
defined(__m68k__) || defined(__M68K__) || defined(__arm__) || \
defined(__ARM__) || defined(__mipsel__) || defined(__MIPSEL__) || \
defined(__x86_64__)
defined(__mipsel__) || defined(__MIPSEL__) || defined(__x86_64__)1
# include <sys/types.h>
# if BYTE_ORDER == BIG_ENDIAN
# define IEEE_BIG_ENDIAN
@@ -18,7 +18,7 @@ memset(void *s, int c, size_t count)
return s;
}
#ifdef __ARM__
#if defined(__arm__)
void* __aeabi_memset(void *s, int c, size_t count)
__attribute__((__alias__("memset")));
#endif
+1 -1
View File
@@ -70,7 +70,7 @@ memmove(void* dest, void const* src, size_t count)
return dest;
}
#ifdef __ARM__
#if defined(__arm__)
void* __aeabi_memmove(void* dest, void const* src, size_t count)
__attribute__((__alias__("memmove")));
#endif