Add remaining PRI* macros
[openbios/afaerber.git] / include / arch / sparc64 / types.h
blob339d190a2d0dcc6810bed33ee0fd60e11658bb0c
1 /* tag: data types for forth engine
3 * Copyright (C) 2003-2005 Patrick Mauritz, Stefan Reinauer
5 * See the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
7 */
9 #ifndef __TYPES_H
10 #define __TYPES_H
12 #include "mconfig.h"
14 #ifdef BOOTSTRAP
15 #include <inttypes.h>
16 #else
17 typedef unsigned char uint8_t;
18 typedef unsigned short uint16_t;
19 typedef unsigned int uint32_t;
20 typedef unsigned long long uint64_t;
21 typedef unsigned long uintptr_t;
23 typedef signed char int8_t;
24 typedef short int16_t;
25 typedef int int32_t;
26 typedef long long int64_t;
27 typedef long intptr_t;
29 #define PRId32 "d"
30 #define PRIu32 "u"
31 #define PRIx32 "x"
32 #define PRIX32 "X"
33 #define PRId64 "lld"
34 #define PRIu64 "llu"
35 #define PRIx64 "llx"
36 #define PRIX64 "llX"
37 #endif
39 /* endianess */
40 #include "autoconf.h"
42 /* physical address */
43 typedef uint64_t phys_addr_t;
45 #define FMT_plx "%016" PRIx64
47 /* cell based types */
48 typedef long long cell;
49 typedef unsigned long long ucell;
51 #define FMT_cell "%lld"
52 #define FMT_ucell "%llu"
53 #define FMT_ucellx "%016llx"
54 #define FMT_ucellX "%016llX"
56 #define FMT_elf "%#llx"
57 #define FMT_sizet "%lx"
58 #define FMT_aout_ehdr "%x"
60 #ifdef NEED_FAKE_INT128_T
61 typedef struct {
62 uint64_t hi;
63 uint64_t lo;
64 } blob_128_t;
66 typedef blob_128_t dcell;
67 typedef blob_128_t ducell;
68 #else
69 typedef __int128_t dcell;
70 typedef __uint128_t ducell;
71 #endif
73 #define bitspercell (sizeof(cell)<<3)
74 #define bitsperdcell (sizeof(dcell)<<3)
76 #define BITS 64
78 /* size named types */
80 typedef unsigned char u8;
81 typedef unsigned short u16;
82 typedef unsigned int u32;
83 typedef unsigned long long u64;
85 typedef signed char s8;
86 typedef short s16;
87 typedef int s32;
88 typedef long long s64;
90 #endif