2 * The PCI Library -- Internal Include File
4 * Copyright (c) 1997--2000 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
12 #define UNUSED __attribute__((unused))
18 #ifdef HAVE_PM_LINUX_BYTEORDER_H
20 #include <asm/byteorder.h>
21 #define cpu_to_le16 __cpu_to_le16
22 #define cpu_to_le32 __cpu_to_le32
23 #define le16_to_cpu __le16_to_cpu
24 #define le32_to_cpu __le32_to_cpu
30 #define BYTE_ORDER __BYTE_ORDER
31 #define BIG_ENDIAN __BIG_ENDIAN
35 #include <sys/types.h>
38 #if BYTE_ORDER == BIG_ENDIAN
39 #define cpu_to_le16 swab16
40 #define cpu_to_le32 swab32
41 #define le16_to_cpu swab16
42 #define le32_to_cpu swab32
44 static inline word swab16(word w)
46 return (w << 8) | ((w >> 8) & 0xff);
49 static inline u32 swab32(u32 w)
51 return ((w & 0xff000000) >> 24) |
52 ((w & 0x00ff0000) >> 8) |
53 ((w & 0x0000ff00) << 8) |
54 ((w & 0x000000ff) << 24);
57 #define cpu_to_le16(x) (x)
58 #define cpu_to_le32(x) (x)
59 #define le16_to_cpu(x) (x)
60 #define le32_to_cpu(x) (x)
67 void (*config)(struct pci_access *);
68 int (*detect)(struct pci_access *);
69 void (*init)(struct pci_access *);
70 void (*cleanup)(struct pci_access *);
71 void (*scan)(struct pci_access *);
72 int (*fill_info)(struct pci_dev *, int flags);
73 int (*read)(struct pci_dev *, int pos, byte *buf, int len);
74 int (*write)(struct pci_dev *, int pos, byte *buf, int len);
75 void (*init_dev)(struct pci_dev *);
76 void (*cleanup_dev)(struct pci_dev *);
79 void pci_generic_scan_bus(struct pci_access *, byte *busmap, int bus);
80 void pci_generic_scan(struct pci_access *);
81 int pci_generic_fill_info(struct pci_dev *, int flags);
82 int pci_generic_block_read(struct pci_dev *, int pos, byte *buf, int len);
83 int pci_generic_block_write(struct pci_dev *, int pos, byte *buf, int len);
85 void *pci_malloc(struct pci_access *, int);
86 void pci_mfree(void *);
88 struct pci_dev *pci_alloc_dev(struct pci_access *);
89 int pci_link_dev(struct pci_access *, struct pci_dev *);
91 extern struct pci_methods pm_intel_conf1, pm_intel_conf2, pm_linux_proc,
92 pm_syscalls, pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_dump;