Introduced types [__haiku_]generic_{addr,size}_t which are wide enough for

virtual and physical addresses.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36996 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2010-06-02 18:22:38 +00:00
parent 0c538753e2
commit 4a57f84396
6 changed files with 57 additions and 0 deletions

View File

@ -70,5 +70,14 @@ typedef __haiku_std_uint64 __haiku_uint64;
#endif
#define __HAIKU_PHYS_SADDR_MIN (-__HAIKU_SADDR_MAX-1)
/* 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
#else
typedef __haiku_phys_addr_t __haiku_generic_addr_t;
# define __HAIKU_GENERIC_ADDR_MAX __HAIKU_PHYS_ADDR_MAX
#endif
#endif /* _CONFIG_BUILD_TYPES_H */

View File

@ -64,6 +64,9 @@ typedef uint32 phys_addr_t;
#endif
typedef phys_addr_t phys_size_t;
typedef addr_t generic_addr_t;
typedef size_t generic_size_t;
/* printf()/scanf() format strings for [u]int* types */
#define B_PRId8 PRId8
@ -150,6 +153,11 @@ typedef phys_addr_t phys_size_t;
# define B_PRIxPHYSADDR B_PRIx32
# define B_PRIXPHYSADDR B_PRIX32
#endif
/* generic_addr_t */
#define B_PRIuGENADDR B_PRIuADDR
#define B_PRIoGENADDR B_PRIoADDR
#define B_PRIxGENADDR B_PRIxADDR
#define B_PRIXGENADDR B_PRIXADDR
/* off_t */
#define B_PRIdOFF B_PRId64
#define B_PRIiOFF B_PRIi64

View File

@ -98,4 +98,16 @@ typedef __haiku_std_uint64 __haiku_uint64;
#endif
/* 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
#endif /* _CONFIG_TYPES_H */

View File

@ -59,6 +59,9 @@ typedef uint32 perform_code;
typedef __haiku_phys_addr_t phys_addr_t;
typedef phys_addr_t phys_size_t;
typedef __haiku_generic_addr_t generic_addr_t;
typedef generic_addr_t generic_size_t;
/* printf()/scanf() format strings for [u]int* types */
#define B_PRId8 "d"
@ -126,6 +129,11 @@ typedef phys_addr_t phys_size_t;
#define B_PRIoPHYSADDR __HAIKU_PRI_PREFIX_PHYS_ADDR "o"
#define B_PRIxPHYSADDR __HAIKU_PRI_PREFIX_PHYS_ADDR "x"
#define B_PRIXPHYSADDR __HAIKU_PRI_PREFIX_PHYS_ADDR "X"
/* generic_addr_t */
#define B_PRIuGENADDR __HAIKU_PRI_PREFIX_GENERIC_ADDR "u"
#define B_PRIoGENADDR __HAIKU_PRI_PREFIX_GENERIC_ADDR "o"
#define B_PRIxGENADDR __HAIKU_PRI_PREFIX_GENERIC_ADDR "x"
#define B_PRIXGENADDR __HAIKU_PRI_PREFIX_GENERIC_ADDR "X"
/* off_t */
#define B_PRIdOFF B_PRId64
#define B_PRIiOFF B_PRIi64

View File

@ -1493,6 +1493,8 @@
#define addr_t fssh_addr_t
#define phys_addr_t fssh_phys_addr_t
#define phys_size_t fssh_phys_size_t
#define generic_addr_t fssh_generic_addr_t
#define generic_size_t fssh_generic_size_t
#define dev_t fssh_dev_t
#define ino_t fssh_ino_t
@ -1573,6 +1575,16 @@
#define B_PRIoADDR FSSH_B_PRIoADDR
#define B_PRIxADDR FSSH_B_PRIxADDR
#define B_PRIXADDR FSSH_B_PRIXADDR
/* phys_addr_t */
#define B_PRIuPHYSADDR FSSH_B_PRIuPHYSADDR
#define B_PRIoPHYSADDR FSSH_B_PRIoPHYSADDR
#define B_PRIxPHYSADDR FSSH_B_PRIxPHYSADDR
#define B_PRIXPHYSADDR FSSH_B_PRIXPHYSADDR
/* generic_addr_t */
#define B_PRIuGENADDR FSSH_B_PRIuGENADDR
#define B_PRIoGENADDR FSSH_B_PRIoGENADDR
#define B_PRIxGENADDR FSSH_B_PRIxGENADDR
#define B_PRIXGENADDR FSSH_B_PRIXGENADDR
/* off_t */
#define B_PRIdOFF FSSH_B_PRIdOFF
#define B_PRIiOFF FSSH_B_PRIiOFF

View File

@ -15,15 +15,18 @@ typedef volatile int64_t vint64_t;
#ifdef HAIKU_HOST_PLATFORM_64_BIT
typedef uint64_t fssh_addr_t;
typedef uint64_t fssh_phys_addr_t;
typedef uint64_t fssh_generic_addr_t;
typedef uint64_t fssh_size_t;
typedef int64_t fssh_ssize_t;
#else
typedef uint32_t fssh_addr_t;
typedef uint32_t fssh_phys_addr_t;
typedef uint32_t fssh_generic_addr_t;
typedef uint32_t fssh_size_t;
typedef int32_t fssh_ssize_t;
#endif
typedef fssh_phys_addr_t fssh_phys_size_t;
typedef fssh_generic_addr_t fssh_generic_size_t;
typedef int32_t fssh_dev_t;
typedef int64_t fssh_ino_t;
@ -134,6 +137,11 @@ typedef int32_t fssh_pid_t;
# define FSSH_B_PRIxPHYSADDR FSSH_B_PRIx32
# define FSSH_B_PRIXPHYSADDR FSSH_B_PRIX32
#endif
/* generic_addr_t */
#define FSSH_B_PRIuGENADDR FSSH_B_PRIuPHYSADDR
#define FSSH_B_PRIoGENADDR FSSH_B_PRIoPHYSADDR
#define FSSH_B_PRIxGENADDR FSSH_B_PRIxPHYSADDR
#define FSSH_B_PRIXGENADDR FSSH_B_PRIXPHYSADDR
/* off_t */
#define FSSH_B_PRIdOFF FSSH_B_PRId64
#define FSSH_B_PRIiOFF FSSH_B_PRIi64