#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/cache.h>
#include <linux/limits.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include "pci.h"
unsigned int pci_flags;
EXPORT_SYMBOL_GPL(…);
struct pci_dev_resource { … };
static void free_list(struct list_head *head)
{ … }
static int add_to_list(struct list_head *head, struct pci_dev *dev,
struct resource *res, resource_size_t add_size,
resource_size_t min_align)
{ … }
static void remove_from_list(struct list_head *head, struct resource *res)
{ … }
static struct pci_dev_resource *res_to_dev_res(struct list_head *head,
struct resource *res)
{ … }
static resource_size_t get_res_add_size(struct list_head *head,
struct resource *res)
{ … }
static resource_size_t get_res_add_align(struct list_head *head,
struct resource *res)
{ … }
static void pdev_sort_resources(struct pci_dev *dev, struct list_head *head)
{ … }
static void __dev_sort_resources(struct pci_dev *dev, struct list_head *head)
{ … }
static inline void reset_resource(struct resource *res)
{ … }
static void reassign_resources_sorted(struct list_head *realloc_head,
struct list_head *head)
{ … }
static void assign_requested_resources_sorted(struct list_head *head,
struct list_head *fail_head)
{ … }
static unsigned long pci_fail_res_type_mask(struct list_head *fail_head)
{ … }
static bool pci_need_to_release(unsigned long mask, struct resource *res)
{ … }
static void __assign_resources_sorted(struct list_head *head,
struct list_head *realloc_head,
struct list_head *fail_head)
{ … }
static void pdev_assign_resources_sorted(struct pci_dev *dev,
struct list_head *add_head,
struct list_head *fail_head)
{ … }
static void pbus_assign_resources_sorted(const struct pci_bus *bus,
struct list_head *realloc_head,
struct list_head *fail_head)
{ … }
void pci_setup_cardbus(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL(…);
static void pci_setup_bridge_io(struct pci_dev *bridge)
{ … }
static void pci_setup_bridge_mmio(struct pci_dev *bridge)
{ … }
static void pci_setup_bridge_mmio_pref(struct pci_dev *bridge)
{ … }
static void __pci_setup_bridge(struct pci_bus *bus, unsigned long type)
{ … }
void __weak pcibios_setup_bridge(struct pci_bus *bus, unsigned long type)
{ … }
void pci_setup_bridge(struct pci_bus *bus)
{ … }
int pci_claim_bridge_resource(struct pci_dev *bridge, int i)
{ … }
static void pci_bridge_check_ranges(struct pci_bus *bus)
{ … }
static struct resource *find_bus_resource_of_type(struct pci_bus *bus,
unsigned long type_mask,
unsigned long type)
{ … }
static resource_size_t calculate_iosize(resource_size_t size,
resource_size_t min_size,
resource_size_t size1,
resource_size_t add_size,
resource_size_t children_add_size,
resource_size_t old_size,
resource_size_t align)
{ … }
static resource_size_t calculate_memsize(resource_size_t size,
resource_size_t min_size,
resource_size_t add_size,
resource_size_t children_add_size,
resource_size_t old_size,
resource_size_t align)
{ … }
resource_size_t __weak pcibios_window_alignment(struct pci_bus *bus,
unsigned long type)
{ … }
#define PCI_P2P_DEFAULT_MEM_ALIGN …
#define PCI_P2P_DEFAULT_IO_ALIGN …
#define PCI_P2P_DEFAULT_IO_ALIGN_1K …
static resource_size_t window_alignment(struct pci_bus *bus, unsigned long type)
{ … }
static void pbus_size_io(struct pci_bus *bus, resource_size_t min_size,
resource_size_t add_size,
struct list_head *realloc_head)
{ … }
static inline resource_size_t calculate_mem_align(resource_size_t *aligns,
int max_order)
{ … }
static bool pbus_upstream_space_available(struct pci_bus *bus, unsigned long mask,
unsigned long type, resource_size_t size,
resource_size_t align)
{ … }
static int pbus_size_mem(struct pci_bus *bus, unsigned long mask,
unsigned long type, unsigned long type2,
unsigned long type3, resource_size_t min_size,
resource_size_t add_size,
struct list_head *realloc_head)
{ … }
unsigned long pci_cardbus_resource_alignment(struct resource *res)
{ … }
static void pci_bus_size_cardbus(struct pci_bus *bus,
struct list_head *realloc_head)
{ … }
void __pci_bus_size_bridges(struct pci_bus *bus, struct list_head *realloc_head)
{ … }
void pci_bus_size_bridges(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL(…);
static void assign_fixed_resource_on_bus(struct pci_bus *b, struct resource *r)
{ … }
static void pdev_assign_fixed_resources(struct pci_dev *dev)
{ … }
void __pci_bus_assign_resources(const struct pci_bus *bus,
struct list_head *realloc_head,
struct list_head *fail_head)
{ … }
void pci_bus_assign_resources(const struct pci_bus *bus)
{ … }
EXPORT_SYMBOL(…);
static void pci_claim_device_resources(struct pci_dev *dev)
{ … }
static void pci_claim_bridge_resources(struct pci_dev *dev)
{ … }
static void pci_bus_allocate_dev_resources(struct pci_bus *b)
{ … }
static void pci_bus_allocate_resources(struct pci_bus *b)
{ … }
void pci_bus_claim_resources(struct pci_bus *b)
{ … }
EXPORT_SYMBOL(…);
static void __pci_bridge_assign_resources(const struct pci_dev *bridge,
struct list_head *add_head,
struct list_head *fail_head)
{ … }
#define PCI_RES_TYPE_MASK …
static void pci_bridge_release_resources(struct pci_bus *bus,
unsigned long type)
{ … }
enum release_type { … };
static void pci_bus_release_bridge_resources(struct pci_bus *bus,
unsigned long type,
enum release_type rel_type)
{ … }
static void pci_bus_dump_res(struct pci_bus *bus)
{ … }
static void pci_bus_dump_resources(struct pci_bus *bus)
{ … }
static int pci_bus_get_depth(struct pci_bus *bus)
{ … }
enum enable_type { … };
static enum enable_type pci_realloc_enable = …;
void __init pci_realloc_get_opt(char *str)
{ … }
static bool pci_realloc_enabled(enum enable_type enable)
{ … }
#if defined(CONFIG_PCI_IOV) && defined(CONFIG_PCI_REALLOC_ENABLE_AUTO)
static int iov_resources_unassigned(struct pci_dev *dev, void *data)
{ … }
static enum enable_type pci_realloc_detect(struct pci_bus *bus,
enum enable_type enable_local)
{ … }
#else
static enum enable_type pci_realloc_detect(struct pci_bus *bus,
enum enable_type enable_local)
{
return enable_local;
}
#endif
static void adjust_bridge_window(struct pci_dev *bridge, struct resource *res,
struct list_head *add_list,
resource_size_t new_size)
{ … }
static void remove_dev_resource(struct resource *avail, struct pci_dev *dev,
struct resource *res)
{ … }
static void remove_dev_resources(struct pci_dev *dev, struct resource *io,
struct resource *mmio,
struct resource *mmio_pref)
{ … }
static void pci_bus_distribute_available_resources(struct pci_bus *bus,
struct list_head *add_list,
struct resource io,
struct resource mmio,
struct resource mmio_pref)
{ … }
static void pci_bridge_distribute_available_resources(struct pci_dev *bridge,
struct list_head *add_list)
{ … }
static bool pci_bridge_resources_not_assigned(struct pci_dev *dev)
{ … }
static void
pci_root_bus_distribute_available_resources(struct pci_bus *bus,
struct list_head *add_list)
{ … }
void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)
{ … }
void pci_assign_unassigned_resources(void)
{ … }
void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)
{ … }
EXPORT_SYMBOL_GPL(…);
int pci_reassign_bridge_resources(struct pci_dev *bridge, unsigned long type)
{ … }
void pci_assign_unassigned_bus_resources(struct pci_bus *bus)
{ … }
EXPORT_SYMBOL_GPL(…);