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_TYPES_H
|
|
|
|
#define _CONFIG_TYPES_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <config/HaikuConfig.h>
|
|
|
|
|
|
|
|
|
|
|
|
/* fixed-width types -- the __haiku_std_[u]int* types correspond to the POSIX
|
|
|
|
[u]int*_t types, the _haiku_[u]int* types to the BeOS [u]int* types. If
|
|
|
|
__HAIKU_BEOS_COMPATIBLE_TYPES is not defined both sets are identical. Once
|
|
|
|
we drop compatibility for good, we can consolidate the types.
|
|
|
|
*/
|
|
|
|
typedef signed char __haiku_std_int8;
|
|
|
|
typedef unsigned char __haiku_std_uint8;
|
|
|
|
typedef signed short __haiku_std_int16;
|
|
|
|
typedef unsigned short __haiku_std_uint16;
|
|
|
|
typedef signed int __haiku_std_int32;
|
|
|
|
typedef unsigned int __haiku_std_uint32;
|
|
|
|
typedef signed long long __haiku_std_int64;
|
|
|
|
typedef unsigned long long __haiku_std_uint64;
|
|
|
|
|
|
|
|
typedef __haiku_std_int8 __haiku_int8;
|
|
|
|
typedef __haiku_std_uint8 __haiku_uint8;
|
|
|
|
typedef __haiku_std_int16 __haiku_int16;
|
|
|
|
typedef __haiku_std_uint16 __haiku_uint16;
|
|
|
|
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
|
|
|
|
typedef signed long int __haiku_int32;
|
|
|
|
typedef unsigned long int __haiku_uint32;
|
|
|
|
#else
|
|
|
|
typedef __haiku_std_int32 __haiku_int32;
|
|
|
|
typedef __haiku_std_uint32 __haiku_uint32;
|
|
|
|
#endif
|
|
|
|
typedef __haiku_std_int64 __haiku_int64;
|
|
|
|
typedef __haiku_std_uint64 __haiku_uint64;
|
|
|
|
|
|
|
|
/* address types */
|
|
|
|
#ifdef __HAIKU_ARCH_64_BIT
|
|
|
|
typedef __haiku_int64 __haiku_saddr_t;
|
|
|
|
typedef __haiku_uint64 __haiku_addr_t;
|
|
|
|
#else
|
|
|
|
typedef __haiku_int32 __haiku_saddr_t;
|
|
|
|
typedef __haiku_uint32 __haiku_addr_t;
|
|
|
|
#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
|
|
|
#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
|
|
|
|
typedef __haiku_int64 __haiku_phys_saddr_t;
|
|
|
|
typedef __haiku_uint64 __haiku_phys_addr_t;
|
|
|
|
#else
|
|
|
|
typedef __haiku_int32 __haiku_phys_saddr_t;
|
|
|
|
typedef __haiku_uint32 __haiku_phys_addr_t;
|
|
|
|
#endif
|
|
|
|
|
2009-11-24 22:44:07 +03:00
|
|
|
/* address type limits */
|
|
|
|
#ifdef __HAIKU_ARCH_64_BIT
|
* 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
|
|
|
# define __HAIKU_SADDR_MAX (9223372036854775807LL)
|
|
|
|
# define __HAIKU_ADDR_MAX (18446744073709551615ULL)
|
2009-11-24 22:44:07 +03:00
|
|
|
#else
|
* 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
|
|
|
# define __HAIKU_SADDR_MAX (2147483647)
|
|
|
|
# define __HAIKU_ADDR_MAX (4294967295U)
|
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
|
|
|
#define __HAIKU_SADDR_MIN (-__HAIKU_SADDR_MAX-1)
|
|
|
|
|
|
|
|
#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
|
|
|
|
# define __HAIKU_PHYS_SADDR_MAX (9223372036854775807LL)
|
|
|
|
# define __HAIKU_PHYS_ADDR_MAX (18446744073709551615ULL)
|
|
|
|
#else
|
|
|
|
# define __HAIKU_PHYS_SADDR_MAX (2147483647)
|
|
|
|
# define __HAIKU_PHYS_ADDR_MAX (4294967295U)
|
|
|
|
#endif
|
|
|
|
#define __HAIKU_PHYS_SADDR_MIN (-__HAIKU_SADDR_MAX-1)
|
2009-11-24 22:44:07 +03:00
|
|
|
|
|
|
|
|
|
|
|
/* printf()/scanf() format prefixes */
|
|
|
|
#define __HAIKU_STD_PRI_PREFIX_32 ""
|
|
|
|
#define __HAIKU_STD_PRI_PREFIX_64 "ll"
|
|
|
|
|
|
|
|
#ifdef __HAIKU_BEOS_COMPATIBLE_TYPES
|
|
|
|
# define __HAIKU_PRI_PREFIX_32 "l"
|
|
|
|
#else
|
|
|
|
# define __HAIKU_PRI_PREFIX_32 __HAIKU_STD_PRI_PREFIX_32
|
|
|
|
#endif
|
|
|
|
#define __HAIKU_PRI_PREFIX_64 __HAIKU_STD_PRI_PREFIX_64
|
|
|
|
|
|
|
|
#ifdef __HAIKU_ARCH_64_BIT
|
2009-12-06 18:46:03 +03:00
|
|
|
# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_64
|
2009-11-24 22:44:07 +03:00
|
|
|
#else
|
2009-12-06 18:46:03 +03:00
|
|
|
# define __HAIKU_PRI_PREFIX_ADDR __HAIKU_PRI_PREFIX_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
|
|
|
#ifdef __HAIKU_ARCH_PHYSICAL_64_BIT
|
|
|
|
# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_64
|
|
|
|
#else
|
|
|
|
# define __HAIKU_PRI_PREFIX_PHYS_ADDR __HAIKU_PRI_PREFIX_32
|
|
|
|
#endif
|
|
|
|
|
2009-11-24 22:44:07 +03:00
|
|
|
|
2010-06-02 22:22:38 +04:00
|
|
|
/* a generic address type wide enough for virtual and physical addresses */
|
|
|
|
#if __HAIKU_ARCH_BITS >= __HAIKU_ARCH_PHYSICAL_BITS
|
|
|
|
typedef __haiku_addr_t __haiku_generic_addr_t;
|
|
|
|
# define __HAIKU_GENERIC_ADDR_MAX __HAIKU_ADDR_MAX
|
|
|
|
# define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_ADDR
|
|
|
|
#else
|
|
|
|
typedef __haiku_phys_addr_t __haiku_generic_addr_t;
|
|
|
|
# define __HAIKU_GENERIC_ADDR_MAX __HAIKU_PHYS_ADDR_MAX
|
|
|
|
# define __HAIKU_PRI_PREFIX_GENERIC_ADDR __HAIKU_PRI_PREFIX_PHYS_ADDR
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2009-11-24 22:44:07 +03:00
|
|
|
#endif /* _CONFIG_TYPES_H */
|