source: mainline/pci/libpci/types.h@ 8a568e3

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 8a568e3 was 8071af9f, checked in by Jakub Jermar <jakub@…>, 20 years ago

Add GPL for reference and add modification dates into libpci to better comply with GPL.
Also, do some formatting changes in libpci.

  • Property mode set to 100644
File size: 1.1 KB
Line 
1/*
2 * The PCI Library -- Types and Format Strings
3 *
4 * Copyright (c) 1997--2005 Martin Mares <mj@ucw.cz>
5 *
6 * May 8, 2006 - Modified and ported to HelenOS by Jakub Jermar.
7 *
8 * Can be freely distributed and used under the terms of the GNU GPL.
9 */
10
11#include <types.h>
12
13#ifndef PCI_HAVE_Uxx_TYPES
14
15typedef uint8_t u8;
16typedef uint16_t u16;
17typedef uint32_t u32;
18
19#ifdef PCI_HAVE_64BIT_ADDRESS
20#include <limits.h>
21#if ULONG_MAX > 0xffffffff
22typedef unsigned long u64;
23#define PCI_U64_FMT "l"
24#else
25typedef unsigned long long u64;
26#define PCI_U64_FMT "ll"
27#endif
28#endif
29
30#endif /* PCI_HAVE_Uxx_TYPES */
31
32#ifdef PCI_HAVE_64BIT_ADDRESS
33typedef u64 pciaddr_t;
34#define PCIADDR_T_FMT "%08" PCI_U64_FMT "x"
35#define PCIADDR_PORT_FMT "%04" PCI_U64_FMT "x"
36#else
37typedef u32 pciaddr_t;
38#define PCIADDR_T_FMT "%08x"
39#define PCIADDR_PORT_FMT "%04x"
40#endif
41
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"
47#else
48#define PCIIRQ_FMT "%d"
49#endif
Note: See TracBrowser for help on using the repository browser.