Rob Herring | f4ffd5e | 2011-06-29 11:46:54 -0500 | [diff] [blame] | 1 | /* |
| 2 | * This program is free software; you can redistribute it and/or |
| 3 | * modify it under the terms of the GNU General Public License |
| 4 | * as published by the Free Software Foundation; either version |
| 5 | * 2 of the License, or (at your option) any later version. |
| 6 | */ |
| 7 | #ifndef _ASM_GENERIC_PCI_BRIDGE_H |
| 8 | #define _ASM_GENERIC_PCI_BRIDGE_H |
| 9 | |
| 10 | #ifdef __KERNEL__ |
| 11 | |
| 12 | enum { |
| 13 | /* Force re-assigning all resources (ignore firmware |
| 14 | * setup completely) |
| 15 | */ |
| 16 | PCI_REASSIGN_ALL_RSRC = 0x00000001, |
| 17 | |
| 18 | /* Re-assign all bus numbers */ |
| 19 | PCI_REASSIGN_ALL_BUS = 0x00000002, |
| 20 | |
| 21 | /* Do not try to assign, just use existing setup */ |
| 22 | PCI_PROBE_ONLY = 0x00000004, |
| 23 | |
| 24 | /* Don't bother with ISA alignment unless the bridge has |
| 25 | * ISA forwarding enabled |
| 26 | */ |
| 27 | PCI_CAN_SKIP_ISA_ALIGN = 0x00000008, |
| 28 | |
| 29 | /* Enable domain numbers in /proc */ |
| 30 | PCI_ENABLE_PROC_DOMAINS = 0x00000010, |
| 31 | /* ... except for domain 0 */ |
| 32 | PCI_COMPAT_DOMAIN_0 = 0x00000020, |
| 33 | }; |
| 34 | |
| 35 | #ifdef CONFIG_PCI |
| 36 | extern unsigned int pci_flags; |
| 37 | |
| 38 | static inline void pci_set_flags(int flags) |
| 39 | { |
| 40 | pci_flags = flags; |
| 41 | } |
| 42 | |
| 43 | static inline void pci_add_flags(int flags) |
| 44 | { |
| 45 | pci_flags |= flags; |
| 46 | } |
| 47 | |
Bjorn Helgaas | dcce6dc | 2012-02-23 20:18:56 -0700 | [diff] [blame] | 48 | static inline void pci_clear_flags(int flags) |
| 49 | { |
| 50 | pci_flags &= ~flags; |
| 51 | } |
| 52 | |
Rob Herring | f4ffd5e | 2011-06-29 11:46:54 -0500 | [diff] [blame] | 53 | static inline int pci_has_flag(int flag) |
| 54 | { |
| 55 | return pci_flags & flag; |
| 56 | } |
| 57 | #else |
| 58 | static inline void pci_set_flags(int flags) { } |
| 59 | static inline void pci_add_flags(int flags) { } |
Bjorn Helgaas | dcce6dc | 2012-02-23 20:18:56 -0700 | [diff] [blame] | 60 | static inline void pci_clear_flags(int flags) { } |
Rob Herring | f4ffd5e | 2011-06-29 11:46:54 -0500 | [diff] [blame] | 61 | static inline int pci_has_flag(int flag) |
| 62 | { |
| 63 | return 0; |
| 64 | } |
| 65 | #endif /* CONFIG_PCI */ |
| 66 | |
| 67 | #endif /* __KERNEL__ */ |
| 68 | #endif /* _ASM_GENERIC_PCI_BRIDGE_H */ |