2
* The PCI Library -- Types and Format Strings
4
* Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz>
6
* May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar.
8
* Can be freely distributed and used under the terms of the GNU GPL.
11
#include <sys/types.h>
13
#ifndef PCI_HAVE_Uxx_TYPES
19
#ifdef PCI_HAVE_64BIT_ADDRESS
21
#if ULONG_MAX > 0xffffffff
22
typedef unsigned long u64;
23
#define PCI_U64_FMT "l"
25
typedef unsigned long long u64;
26
#define PCI_U64_FMT "ll"
30
#endif /* PCI_HAVE_Uxx_TYPES */
32
#ifdef PCI_HAVE_64BIT_ADDRESS
33
typedef u64 pciaddr_t;
34
#define PCIADDR_T_FMT "%08" PCI_U64_FMT "x"
35
#define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
37
typedef u32 pciaddr_t;
38
#define PCIADDR_T_FMT "%08x"
39
#define PCIADDR_PORT_FMT "%04x"
42
#ifdef PCI_ARCH_SPARC64
43
/* On sparc64 Linux the kernel reports remapped port addresses and IRQ numbers */
44
#undef PCIADDR_PORT_FMT
45
#define PCIADDR_PORT_FMT PCIADDR_T_FMT
46
#define PCIIRQ_FMT "%08x"
48
#define PCIIRQ_FMT "%d"