1/* 2 * Copyright 2009-2010, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef _CONFIG_HAIKU_CONFIG_H 6#define _CONFIG_HAIKU_CONFIG_H 7 8 9/* Determine the architecture and define macros for some fundamental 10 properties: 11 __HAIKU_ARCH - short name of the architecture (used in paths) 12 __HAIKU_ARCH_<arch> - defined to 1 for the respective architecture 13 __HAIKU_ARCH_BITS - defined to 32/64 on 32/64 bit architectures 14 (defaults to 32) 15 __HAIKU_ARCH_PHYSICAL_BITS - defined to 32/64 on architectures with 32/64 16 (defaults to __HAIKU_ARCH_BITS) 17 __HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures 18 (defaults to undefined) 19*/ 20#ifdef __INTEL__ 21# define __HAIKU_ARCH x86 22# define __HAIKU_ARCH_X86 1 23#elif __x86_64__ 24# define __HAIKU_ARCH x86_64 25# define __HAIKU_ARCH_X86_64 1 26# define __HAIKU_ARCH_BITS 64 27#elif __POWERPC__ 28# define __HAIKU_ARCH ppc 29# define __HAIKU_ARCH_PPC 1 30# define __HAIKU_BIG_ENDIAN 1 31#elif __M68K__ 32# define __HAIKU_ARCH m68k 33# define __HAIKU_ARCH_M68K 1 34# define __HAIKU_BIG_ENDIAN 1 35#elif __MIPSEL__ 36# define __HAIKU_ARCH mipsel 37# define __HAIKU_ARCH_MIPSEL 1 38#elif __ARM__ 39# define __HAIKU_ARCH arm 40# define __HAIKU_ARCH_ARM 1 41#else 42# error Unsupported architecture! 43#endif 44 45/* implied properties: 46 __HAIKU_ARCH_{32,64}_BIT - defined to 1 on 32/64 bit architectures, i.e. 47 using 32/64 bit virtual addresses 48 __HAIKU_ARCH_PHYSICAL_BITS - defined to 32/64 on architectures with 32/64 49 bit physical addresses 50 __HAIKU_ARCH_PHYSICAL_{32,64}_BIT - defined to 1 on architectures using 64 51 bit physical addresses 52 __HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures 53*/ 54 55/* bitness */ 56#ifndef __HAIKU_ARCH_BITS 57# define __HAIKU_ARCH_BITS 32 58#endif 59 60#if __HAIKU_ARCH_BITS == 32 61# define __HAIKU_ARCH_32_BIT 1 62#elif __HAIKU_ARCH_BITS == 64 63# define __HAIKU_ARCH_64_BIT 1 64#else 65# error Unsupported bitness! 66#endif 67 68/* physical bitness */ 69#ifndef __HAIKU_ARCH_PHYSICAL_BITS 70# define __HAIKU_ARCH_PHYSICAL_BITS __HAIKU_ARCH_BITS 71#endif 72 73#if __HAIKU_ARCH_PHYSICAL_BITS == 32 74# define __HAIKU_ARCH_PHYSICAL_32_BIT 1 75#elif __HAIKU_ARCH_PHYSICAL_BITS == 64 76# define __HAIKU_ARCH_PHYSICAL_64_BIT 1 77#else 78# error Unsupported physical bitness! 79#endif 80 81/* endianess */ 82#ifndef __HAIKU_BIG_ENDIAN 83# define __HAIKU_LITTLE_ENDIAN 1 84#endif 85 86/* architecture specific include macros */ 87#define __HAIKU_ARCH_HEADER(header) <arch/__HAIKU_ARCH/header> 88#define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \ 89 <subdir/arch/__HAIKU_ARCH/header> 90 91 92#endif /* _CONFIG_HAIKU_CONFIG_H */ 93