Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Functions
eeh_cache.c File Reference
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/rbtree.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
#include <linux/atomic.h>
#include <asm/pci-bridge.h>
#include <asm/ppc-pci.h>

Go to the source code of this file.

Data Structures

struct  pci_io_addr_range
 
struct  pci_io_addr_cache
 

Functions

struct eeh_dev * eeh_addr_cache_get_dev (unsigned long addr)
 
void eeh_addr_cache_insert_dev (struct pci_dev *dev)
 
void eeh_addr_cache_rmv_dev (struct pci_dev *dev)
 
void __init eeh_addr_cache_build (void)
 

Function Documentation

void __init eeh_addr_cache_build ( void  )

eeh_addr_cache_build - Build a cache of I/O addresses

Build a cache of pci i/o addresses. This cache will be used to find the pci device that corresponds to a given address. This routine scans all pci busses to build the cache. Must be run late in boot process, after the pci controllers have been scanned for devices (after all device resources are known).

Definition at line 288 of file eeh_cache.c.

struct eeh_dev* eeh_addr_cache_get_dev ( unsigned long  addr)
read

eeh_addr_cache_get_dev - Get device, given only address : mmio (PIO) phys address or i/o port number

Given an mmio phys address, or a port number, find a pci device that implements this address. Be sure to pci_dev_put the device when finished. I/O port numbers are assumed to be offset from zero (that is, they do not have pci_io_addr added in). It is safe to call this function within an interrupt.

Definition at line 96 of file eeh_cache.c.

void eeh_addr_cache_insert_dev ( struct pci_dev dev)

eeh_addr_cache_insert_dev - Add a device to the address cache : PCI device whose I/O addresses we are interested in.

In order to support the fast lookup of devices based on addresses, we maintain a cache of devices that can be quickly searched. This routine adds a device to that cache.

Definition at line 228 of file eeh_cache.c.

void eeh_addr_cache_rmv_dev ( struct pci_dev dev)

eeh_addr_cache_rmv_dev - remove pci device from addr cache : device to remove

Remove a device from the addr-cache tree. This is potentially expensive, since it will walk the tree multiple times (once per resource). But so what; device removal doesn't need to be that fast.

Definition at line 270 of file eeh_cache.c.