2009-11-24 22:44:07 +03:00
|
|
|
/*
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
* Copyright 2009-2010, Haiku, Inc. All Rights Reserved.
|
2009-11-24 22:44:07 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _CONFIG_HAIKU_CONFIG_H
|
|
|
|
#define _CONFIG_HAIKU_CONFIG_H
|
|
|
|
|
|
|
|
|
|
|
|
/* Determine the architecture and define macros for some fundamental
|
|
|
|
properties:
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
__HAIKU_ARCH - short name of the architecture (used in paths)
|
2011-11-22 05:44:32 +04:00
|
|
|
__HAIKU_ARCH_ABI - name of ABI (as in package architecture)
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
__HAIKU_ARCH_<arch> - defined to 1 for the respective architecture
|
|
|
|
__HAIKU_ARCH_BITS - defined to 32/64 on 32/64 bit architectures
|
|
|
|
(defaults to 32)
|
|
|
|
__HAIKU_ARCH_PHYSICAL_BITS - defined to 32/64 on architectures with 32/64
|
|
|
|
(defaults to __HAIKU_ARCH_BITS)
|
|
|
|
__HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures
|
|
|
|
(defaults to undefined)
|
2009-11-24 22:44:07 +03:00
|
|
|
*/
|
2019-03-30 23:54:01 +03:00
|
|
|
#if defined(__i386__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH x86
|
2011-11-22 05:44:32 +04:00
|
|
|
# if __GNUC__ == 2
|
|
|
|
# define __HAIKU_ARCH_ABI "x86_gcc2"
|
|
|
|
# else
|
|
|
|
# define __HAIKU_ARCH_ABI "x86"
|
|
|
|
# endif
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_X86 1
|
2010-06-23 20:10:08 +04:00
|
|
|
# define __HAIKU_ARCH_PHYSICAL_BITS 64
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__x86_64__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH x86_64
|
2011-11-22 05:44:32 +04:00
|
|
|
# define __HAIKU_ARCH_ABI "x86_64"
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_X86_64 1
|
|
|
|
# define __HAIKU_ARCH_BITS 64
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__POWERPC__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH ppc
|
2011-11-22 05:44:32 +04:00
|
|
|
# define __HAIKU_ARCH_ABI "ppc"
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_PPC 1
|
2012-08-12 03:58:06 +04:00
|
|
|
# define __HAIKU_ARCH_PHYSICAL_BITS 64
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_BIG_ENDIAN 1
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__M68K__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH m68k
|
2011-11-22 05:44:32 +04:00
|
|
|
# define __HAIKU_ARCH_ABI "m68k"
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_M68K 1
|
|
|
|
# define __HAIKU_BIG_ENDIAN 1
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__MIPSEL__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH mipsel
|
2011-11-22 05:44:32 +04:00
|
|
|
# define __HAIKU_ARCH_ABI "mipsel"
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_MIPSEL 1
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__ARMEL__) || defined(__arm__)
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH arm
|
2011-11-22 05:44:32 +04:00
|
|
|
# define __HAIKU_ARCH_ABI "arm"
|
2010-06-11 20:26:11 +04:00
|
|
|
# define __HAIKU_ARCH_ARM 1
|
2018-08-01 03:12:18 +03:00
|
|
|
#elif defined(__ARMEB__)
|
2014-01-02 10:41:02 +04:00
|
|
|
# define __HAIKU_ARCH armeb
|
|
|
|
# define __HAIKU_ARCH_ABI "armeb"
|
|
|
|
# define __HAIKU_ARCH_ARM 1
|
|
|
|
# define __HAIKU_BIG_ENDIAN 1
|
2019-08-30 21:10:12 +03:00
|
|
|
#elif defined(__aarch64__) || defined(__arm64__)
|
2018-08-03 02:48:29 +03:00
|
|
|
# define __HAIKU_ARCH arm64
|
|
|
|
# define __HAIKU_ARCH_ABI "arm64"
|
|
|
|
# define __HAIKU_ARCH_ARM64 1
|
|
|
|
# define __HAIKU_ARCH_BITS 64
|
2018-11-04 22:37:09 +03:00
|
|
|
#elif defined(__riscv64__) || (defined(__riscv) && __riscv_xlen == 64)
|
|
|
|
# define __HAIKU_ARCH riscv64
|
|
|
|
# define __HAIKU_ARCH_ABI "riscv64"
|
2019-04-02 22:46:28 +03:00
|
|
|
# define __HAIKU_ARCH_RISCV64 1
|
2018-11-04 22:37:09 +03:00
|
|
|
# define __HAIKU_ARCH_BITS 64
|
2019-02-17 15:42:25 +03:00
|
|
|
#elif defined(__sparc64__)
|
|
|
|
# define __HAIKU_ARCH sparc64
|
|
|
|
# define __HAIKU_ARCH_ABI "sparc"
|
|
|
|
# define __HAIKU_ARCH_SPARC 1
|
|
|
|
# define __HAIKU_ARCH_PHYSICAL_BITS 64
|
|
|
|
# define __HAIKU_BIG_ENDIAN 1
|
|
|
|
# define __HAIKU_ARCH_BITS 64
|
2009-11-24 22:44:07 +03:00
|
|
|
#else
|
|
|
|
# error Unsupported architecture!
|
|
|
|
#endif
|
|
|
|
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
/* implied properties:
|
|
|
|
__HAIKU_ARCH_{32,64}_BIT - defined to 1 on 32/64 bit architectures, i.e.
|
|
|
|
using 32/64 bit virtual addresses
|
|
|
|
__HAIKU_ARCH_PHYSICAL_BITS - defined to 32/64 on architectures with 32/64
|
|
|
|
bit physical addresses
|
|
|
|
__HAIKU_ARCH_PHYSICAL_{32,64}_BIT - defined to 1 on architectures using 64
|
|
|
|
bit physical addresses
|
|
|
|
__HAIKU_BIG_ENDIAN - defined to 1 on big endian architectures
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* bitness */
|
|
|
|
#ifndef __HAIKU_ARCH_BITS
|
|
|
|
# define __HAIKU_ARCH_BITS 32
|
2009-11-24 22:44:07 +03:00
|
|
|
#endif
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
|
|
|
|
#if __HAIKU_ARCH_BITS == 32
|
|
|
|
# define __HAIKU_ARCH_32_BIT 1
|
|
|
|
#elif __HAIKU_ARCH_BITS == 64
|
|
|
|
# define __HAIKU_ARCH_64_BIT 1
|
|
|
|
#else
|
|
|
|
# error Unsupported bitness!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* physical bitness */
|
|
|
|
#ifndef __HAIKU_ARCH_PHYSICAL_BITS
|
|
|
|
# define __HAIKU_ARCH_PHYSICAL_BITS __HAIKU_ARCH_BITS
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if __HAIKU_ARCH_PHYSICAL_BITS == 32
|
|
|
|
# define __HAIKU_ARCH_PHYSICAL_32_BIT 1
|
|
|
|
#elif __HAIKU_ARCH_PHYSICAL_BITS == 64
|
|
|
|
# define __HAIKU_ARCH_PHYSICAL_64_BIT 1
|
|
|
|
#else
|
|
|
|
# error Unsupported physical bitness!
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* endianess */
|
2009-11-24 22:44:07 +03:00
|
|
|
#ifndef __HAIKU_BIG_ENDIAN
|
|
|
|
# define __HAIKU_LITTLE_ENDIAN 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* architecture specific include macros */
|
|
|
|
#define __HAIKU_ARCH_HEADER(header) <arch/__HAIKU_ARCH/header>
|
|
|
|
#define __HAIKU_SUBDIR_ARCH_HEADER(subdir, header) \
|
|
|
|
<subdir/arch/__HAIKU_ARCH/header>
|
|
|
|
|
|
|
|
/* BeOS R5 binary compatibility (gcc 2 on x86) */
|
|
|
|
#if defined(__HAIKU_ARCH_X86) && __GNUC__ == 2
|
|
|
|
# define __HAIKU_BEOS_COMPATIBLE 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* BeOS R5 compatible types */
|
2019-03-30 23:57:05 +03:00
|
|
|
#if defined(__HAIKU_ARCH_X86)
|
2009-11-24 22:44:07 +03:00
|
|
|
/* TODO: This should be "#ifdef __HAIKU_BEOS_COMPATIBLE", but this will
|
|
|
|
break all gcc 4 C++ optional packages. I.e. switch that at a suitable
|
|
|
|
time.
|
|
|
|
*/
|
|
|
|
# define __HAIKU_BEOS_COMPATIBLE_TYPES 1
|
|
|
|
#endif
|
|
|
|
|
* config/{HaikuConfig.h,types.h}:
- Added macro __HAIKU_ARCH_BITS specifying the architecture bitness (32/64)
(might be more convenient to use than __HAIKU_ARCH_{32,64}_BIT).
- Added macros __HAIKU_ARCH_PHYSICAL_BITS, __HAIKU_ARCH_PHYSICAL_{32,64}_BIT,
and the types __haiku_phys_[s]addr_t. The intention is to use separate
macros and types for virtual and physical addresses, since for some
architectures (e.g. x86 with PAE) those actually differ.
* sys/types.h, BeBuild.h, SupportDefs.h:
- Added types phys_[s]addr_t and respective printf() format macros.
- Added public macros B_HAIKU_BITS, B_HAIKU_PHYSICAL_BITS,
B_HAIKU_PHYSICAL_{32,64}_BIT.
Might break the build under older Haiku installations. Will test next.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36926 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-05-24 23:55:38 +04:00
|
|
|
|
2009-11-24 22:44:07 +03:00
|
|
|
#endif /* _CONFIG_HAIKU_CONFIG_H */
|