]>
git.ipfire.org Git - thirdparty/pciutils.git/blob - lib/types.h
2 * The PCI Library -- Types and Format Strings
4 * Copyright (c) 1997--2008 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
18 #elif defined(PCI_HAVE_STDINT_H) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
25 typedef u_int16_t u16
;
26 typedef u_int32_t u32
;
29 #ifdef PCI_HAVE_64BIT_ADDRESS
31 #if ULONG_MAX > 0xffffffff
32 typedef unsigned long u64
;
33 #define PCI_U64_FMT "l"
35 typedef unsigned long long u64
;
36 #define PCI_U64_FMT "ll"
40 #endif /* PCI_HAVE_Uxx_TYPES */
42 #ifdef PCI_HAVE_64BIT_ADDRESS
43 typedef u64 pciaddr_t
;
44 #define PCIADDR_T_FMT "%08" PCI_U64_FMT "x"
45 #define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
47 typedef u32 pciaddr_t
;
48 #define PCIADDR_T_FMT "%08x"
49 #define PCIADDR_PORT_FMT "%04x"
52 #ifdef PCI_ARCH_SPARC64
53 /* On sparc64 Linux the kernel reports remapped port addresses and IRQ numbers */
54 #undef PCIADDR_PORT_FMT
55 #define PCIADDR_PORT_FMT PCIADDR_T_FMT
56 #define PCIIRQ_FMT "%08x"
58 #define PCIIRQ_FMT "%d"
61 #if defined(__GNUC__) && __GNUC__ > 2
62 #define PCI_PRINTF(x,y) __attribute__((format(printf, x, y)))
64 #define PCI_PRINTF(x,y)