2 * The PCI Library -- Types and Format Strings
4 * Copyright (c) 1997--2004 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
11 #ifndef PCI_HAVE_Uxx_TYPES
14 typedef unsigned char byte;
16 typedef unsigned short word;
18 typedef unsigned long u32;
20 typedef u_int8_t byte;
22 typedef u_int16_t word;
23 typedef u_int16_t u16;
24 typedef u_int32_t u32;
27 #ifdef PCI_HAVE_64BIT_ADDRESS
29 #if ULONG_MAX > 0xffffffff
30 typedef unsigned long u64;
31 #define PCI_U64_FMT "l"
33 typedef unsigned long long u64
34 #define PCI_U64_FMT "ll"
38 #endif /* PCI_HAVE_Uxx_TYPES */
40 #ifdef PCI_HAVE_64BIT_ADDRESS
41 typedef u64 pciaddr_t;
42 #define PCIADDR_T_FMT "%016" PCI_U64_FMT "x"
43 #define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
45 typedef u32 pciaddr_t;
46 #define PCIADDR_T_FMT "%08x"
47 #define PCIADDR_PORT_FMT "%04x"
50 #ifdef PCI_ARCH_SPARC64
51 /* On sparc64 Linux the kernel reports remapped port addresses and IRQ numbers */
52 #undef PCIADDR_PORT_FMT
53 #define PCIADDR_PORT_FMT PCIADDR_T_FMT
54 #define PCIIRQ_FMT "%08x"
56 #define PCIIRQ_FMT "%d"