2009-07-20 Joe Auricchio <jauricchio@gmail.com>
[grub2/phcoder.git] / include / grub / pci.h
blob7c8b505289b0cc4b265cdae8611364247319d379
1 /*
2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2008 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_PCI_H
20 #define GRUB_PCI_H 1
22 #include <grub/types.h>
23 #include <grub/symbol.h>
25 #define GRUB_PCI_ADDR_SPACE_MASK 0x01
26 #define GRUB_PCI_ADDR_SPACE_MEMORY 0x00
27 #define GRUB_PCI_ADDR_SPACE_IO 0x01
29 #define GRUB_PCI_ADDR_MEM_TYPE_MASK 0x06
30 #define GRUB_PCI_ADDR_MEM_TYPE_32 0x00 /* 32 bit address */
31 #define GRUB_PCI_ADDR_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */
32 #define GRUB_PCI_ADDR_MEM_TYPE_64 0x04 /* 64 bit address */
33 #define GRUB_PCI_ADDR_MEM_PREFETCH 0x08 /* prefetchable */
35 #define GRUB_PCI_ADDR_MEM_MASK ~0xf
36 #define GRUB_PCI_ADDR_IO_MASK ~0x03
38 typedef grub_uint32_t grub_pci_id_t;
39 typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t)
40 (int bus, int device, int func, grub_pci_id_t pciid);
41 typedef grub_uint32_t grub_pci_address_t;
43 grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device,
44 int function, int reg);
46 void EXPORT_FUNC(grub_pci_iterate) (grub_pci_iteratefunc_t hook);
48 #include <grub/cpu/pci.h>
50 #endif /* GRUB_PCI_H */