Stefan Reinauer | 0508273 | 2015-10-21 13:00:41 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2016 Google Inc |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU General Public License as published by |
| 8 | * the Free Software Foundation; version 2 of the License. |
| 9 | * |
| 10 | * This program 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. |
| 14 | */ |
| 15 | |
Stefan Reinauer | 850e7d4 | 2015-09-28 13:12:04 -0700 | [diff] [blame] | 16 | #ifndef __PCI_USERSPACE_H__ |
| 17 | #define __PCI_USERSPACE_H__ |
| 18 | |
Stefan Reinauer | 0508273 | 2015-10-21 13:00:41 -0700 | [diff] [blame] | 19 | struct device { |
| 20 | int busno; |
| 21 | int slot; |
| 22 | int func; |
Li-Ta Lo | 8152126 | 2004-07-08 17:18:27 +0000 | [diff] [blame] | 23 | }; |
| 24 | |
Stefan Reinauer | 0508273 | 2015-10-21 13:00:41 -0700 | [diff] [blame] | 25 | int pci_initialize(void); |
| 26 | int pci_exit(void); |
Li-Ta Lo | 8152126 | 2004-07-08 17:18:27 +0000 | [diff] [blame] | 27 | |
Stefan Reinauer | 0508273 | 2015-10-21 13:00:41 -0700 | [diff] [blame] | 28 | u8 pci_read_config8(struct device *dev, unsigned int where); |
| 29 | u16 pci_read_config16(struct device *dev, unsigned int where); |
| 30 | u32 pci_read_config32(struct device *dev, unsigned int where); |
| 31 | void pci_write_config8(struct device *dev, unsigned int where, u8 val); |
| 32 | void pci_write_config16(struct device *dev, unsigned int where, u16 val); |
| 33 | void pci_write_config32(struct device *dev, unsigned int where, u32 val); |
Stefan Reinauer | 850e7d4 | 2015-09-28 13:12:04 -0700 | [diff] [blame] | 34 | |
| 35 | #endif |