aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/hostb_pci.c2
-rw-r--r--sys/dev/pci/isa_pci.c6
-rw-r--r--sys/dev/pci/pci.c14
-rw-r--r--sys/dev/pci/pci_host_generic.c8
-rw-r--r--sys/dev/pci/pci_iov.c8
-rw-r--r--sys/dev/pci/pci_pci.c47
-rw-r--r--sys/dev/pci/pci_private.h12
-rw-r--r--sys/dev/pci/pci_subr.c16
-rw-r--r--sys/dev/pci/pcib_private.h21
-rw-r--r--sys/dev/pci/pcivar.h4
-rw-r--r--sys/dev/pci/vga_pci.c5
11 files changed, 74 insertions, 69 deletions
diff --git a/sys/dev/pci/hostb_pci.c b/sys/dev/pci/hostb_pci.c
index 4e28691d31f9..84878caf900d 100644
--- a/sys/dev/pci/hostb_pci.c
+++ b/sys/dev/pci/hostb_pci.c
@@ -102,7 +102,7 @@ pci_hostb_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
static struct resource *
pci_hostb_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
return (bus_alloc_resource(dev, type, rid, start, end, count, flags));
diff --git a/sys/dev/pci/isa_pci.c b/sys/dev/pci/isa_pci.c
index 7819b7e4cc83..950920da0c82 100644
--- a/sys/dev/pci/isa_pci.c
+++ b/sys/dev/pci/isa_pci.c
@@ -52,8 +52,8 @@ __FBSDID("$FreeBSD$");
static int isab_pci_probe(device_t dev);
static int isab_pci_attach(device_t dev);
static struct resource * isab_pci_alloc_resource(device_t dev,
- device_t child, int type, int *rid, u_long start, u_long end, u_long count,
- u_int flags);
+ device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags);
static int isab_pci_release_resource(device_t dev, device_t child,
int type, int rid, struct resource *r);
@@ -169,7 +169,7 @@ isab_pci_attach(device_t dev)
static struct resource *
isab_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct isab_pci_softc *sc;
int bar;
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c
index 261aa0cd96d9..81caa48daa7f 100644
--- a/sys/dev/pci/pci.c
+++ b/sys/dev/pci/pci.c
@@ -3353,7 +3353,7 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg,
{
struct resource *res;
char *cp;
- u_long start, end, count;
+ rman_res_t start, end, count;
int rid, sec_bus, sec_reg, sub_bus, sub_reg, sup_bus;
switch (cfg->hdrtype & PCIM_HDRTYPE) {
@@ -3453,8 +3453,8 @@ clear:
}
static struct resource *
-pci_alloc_secbus(device_t dev, device_t child, int *rid, u_long start,
- u_long end, u_long count, u_int flags)
+pci_alloc_secbus(device_t dev, device_t child, int *rid, rman_res_t start,
+ rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
pcicfgregs *cfg;
@@ -4618,7 +4618,8 @@ DB_SHOW_COMMAND(pciregs, db_pci_dump)
static struct resource *
pci_reserve_map(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int num, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int num,
+ u_int flags)
{
struct pci_devinfo *dinfo = device_get_ivars(child);
struct resource_list *rl = &dinfo->resources;
@@ -4716,7 +4717,8 @@ out:
struct resource *
pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_long num, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_long num,
+ u_int flags)
{
struct pci_devinfo *dinfo;
struct resource_list *rl;
@@ -4791,7 +4793,7 @@ pci_alloc_multi_resource(device_t dev, device_t child, int type, int *rid,
struct resource *
pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
#ifdef PCI_IOV
struct pci_devinfo *dinfo;
diff --git a/sys/dev/pci/pci_host_generic.c b/sys/dev/pci/pci_host_generic.c
index e4260e0355f4..d6d21257eb34 100644
--- a/sys/dev/pci/pci_host_generic.c
+++ b/sys/dev/pci/pci_host_generic.c
@@ -124,8 +124,8 @@ static int generic_pcie_read_ivar(device_t dev, device_t child, int index,
static int generic_pcie_write_ivar(device_t dev, device_t child, int index,
uintptr_t value);
static struct resource *generic_pcie_alloc_resource(device_t dev,
- device_t child, int type, int *rid, u_long start, u_long end,
- u_long count, u_int flags);
+ device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags);
static int generic_pcie_release_resource(device_t dev, device_t child,
int type, int rid, struct resource *res);
@@ -482,7 +482,7 @@ generic_pcie_release_resource(device_t dev, device_t child, int type,
static struct resource *
generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct generic_pcie_softc *sc;
struct resource *res;
@@ -527,7 +527,7 @@ fail:
static int
generic_pcie_adjust_resource(device_t dev, device_t child, int type,
- struct resource *res, u_long start, u_long end)
+ struct resource *res, rman_res_t start, rman_res_t end)
{
struct generic_pcie_softc *sc;
struct rman *rm;
diff --git a/sys/dev/pci/pci_iov.c b/sys/dev/pci/pci_iov.c
index 58e692649df5..85ddc319e68f 100644
--- a/sys/dev/pci/pci_iov.c
+++ b/sys/dev/pci/pci_iov.c
@@ -320,7 +320,7 @@ pci_iov_alloc_bar(struct pci_devinfo *dinfo, int bar, pci_addr_t bar_shift)
struct resource *res;
struct pcicfg_iov *iov;
device_t dev, bus;
- u_long start, end;
+ rman_res_t start, end;
pci_addr_t bar_size;
int rid;
@@ -890,15 +890,15 @@ pci_iov_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
}
struct resource *
-pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid, u_long start,
- u_long end, u_long count, u_int flags)
+pci_vf_alloc_mem_resource(device_t dev, device_t child, int *rid,
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_devinfo *dinfo;
struct pcicfg_iov *iov;
struct pci_map *map;
struct resource *res;
struct resource_list_entry *rle;
- u_long bar_start, bar_end;
+ rman_res_t bar_start, bar_end;
pci_addr_t bar_length;
int error;
diff --git a/sys/dev/pci/pci_pci.c b/sys/dev/pci/pci_pci.c
index f5a5b7415f0b..a6c69311dbee 100644
--- a/sys/dev/pci/pci_pci.c
+++ b/sys/dev/pci/pci_pci.c
@@ -212,9 +212,10 @@ pcib_write_windows(struct pcib_softc *sc, int mask)
* ISA alias range.
*/
static int
-pcib_is_isa_range(struct pcib_softc *sc, u_long start, u_long end, u_long count)
+pcib_is_isa_range(struct pcib_softc *sc, rman_res_t start, rman_res_t end,
+ rman_res_t count)
{
- u_long next_alias;
+ rman_res_t next_alias;
if (!(sc->bridgectl & PCIB_BCR_ISA_ENABLE))
return (0);
@@ -275,13 +276,13 @@ pcib_add_window_resources(struct pcib_window *w, struct resource **res,
}
}
-typedef void (nonisa_callback)(u_long start, u_long end, void *arg);
+typedef void (nonisa_callback)(rman_res_t start, rman_res_t end, void *arg);
static void
-pcib_walk_nonisa_ranges(u_long start, u_long end, nonisa_callback *cb,
+pcib_walk_nonisa_ranges(rman_res_t start, rman_res_t end, nonisa_callback *cb,
void *arg)
{
- u_long next_end;
+ rman_res_t next_end;
/*
* If start is within an ISA alias range, move up to the start
@@ -309,7 +310,7 @@ pcib_walk_nonisa_ranges(u_long start, u_long end, nonisa_callback *cb,
}
static void
-count_ranges(u_long start, u_long end, void *arg)
+count_ranges(rman_res_t start, rman_res_t end, void *arg)
{
int *countp;
@@ -324,7 +325,7 @@ struct alloc_state {
};
static void
-alloc_ranges(u_long start, u_long end, void *arg)
+alloc_ranges(rman_res_t start, rman_res_t end, void *arg)
{
struct alloc_state *as;
struct pcib_window *w;
@@ -348,7 +349,7 @@ alloc_ranges(u_long start, u_long end, void *arg)
}
static int
-pcib_alloc_nonisa_ranges(struct pcib_softc *sc, u_long start, u_long end)
+pcib_alloc_nonisa_ranges(struct pcib_softc *sc, rman_res_t start, rman_res_t end)
{
struct alloc_state as;
int i, new_count;
@@ -609,7 +610,7 @@ pcib_setup_secbus(device_t dev, struct pcib_secbus *bus, int min_count)
static struct resource *
pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
@@ -633,9 +634,9 @@ pcib_suballoc_bus(struct pcib_secbus *bus, device_t child, int *rid,
* subbus.
*/
static int
-pcib_grow_subbus(struct pcib_secbus *bus, u_long new_end)
+pcib_grow_subbus(struct pcib_secbus *bus, rman_res_t new_end)
{
- u_long old_end;
+ rman_res_t old_end;
int error;
old_end = rman_get_end(bus->res);
@@ -658,10 +659,10 @@ pcib_grow_subbus(struct pcib_secbus *bus, u_long new_end)
struct resource *
pcib_alloc_subbus(struct pcib_secbus *bus, device_t child, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
- u_long start_free, end_free, new_end;
+ rman_res_t start_free, end_free, new_end;
/*
* First, see if the request can be satisified by the existing
@@ -1158,8 +1159,8 @@ pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
*/
static struct resource *
pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
- device_t child, int type, int *rid, u_long start, u_long end, u_long count,
- u_int flags)
+ device_t child, int type, int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags)
{
struct resource *res;
@@ -1196,10 +1197,10 @@ pcib_suballoc_resource(struct pcib_softc *sc, struct pcib_window *w,
/* Allocate a fresh resource range for an unconfigured window. */
static int
pcib_alloc_new_window(struct pcib_softc *sc, struct pcib_window *w, int type,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource *res;
- u_long base, limit, wmask;
+ rman_res_t base, limit, wmask;
int rid;
/*
@@ -1269,7 +1270,7 @@ pcib_alloc_new_window(struct pcib_softc *sc, struct pcib_window *w, int type,
/* Try to expand an existing window to the requested base and limit. */
static int
pcib_expand_window(struct pcib_softc *sc, struct pcib_window *w, int type,
- u_long base, u_long limit)
+ rman_res_t base, rman_res_t limit)
{
struct resource *res;
int error, i, force_64k_base;
@@ -1367,9 +1368,9 @@ pcib_expand_window(struct pcib_softc *sc, struct pcib_window *w, int type,
*/
static int
pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
- u_long align, start_free, end_free, front, back, wmask;
+ rman_res_t align, start_free, end_free, front, back, wmask;
int error;
/*
@@ -1534,7 +1535,7 @@ updatewin:
*/
struct resource *
pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pcib_softc *sc;
struct resource *r;
@@ -1623,7 +1624,7 @@ pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
int
pcib_adjust_resource(device_t bus, device_t child, int type, struct resource *r,
- u_long start, u_long end)
+ rman_res_t start, rman_res_t end)
{
struct pcib_softc *sc;
@@ -1658,7 +1659,7 @@ pcib_release_resource(device_t dev, device_t child, int type, int rid,
*/
struct resource *
pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct pcib_softc *sc = device_get_softc(dev);
const char *name, *suffix;
diff --git a/sys/dev/pci/pci_private.h b/sys/dev/pci/pci_private.h
index 7795747bd219..a49435e03562 100644
--- a/sys/dev/pci/pci_private.h
+++ b/sys/dev/pci/pci_private.h
@@ -105,8 +105,8 @@ int pci_msix_count_method(device_t dev, device_t child);
int pci_msix_pba_bar_method(device_t dev, device_t child);
int pci_msix_table_bar_method(device_t dev, device_t child);
struct resource *pci_alloc_resource(device_t dev, device_t child,
- int type, int *rid, u_long start, u_long end, u_long count,
- u_int flags);
+ int type, int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags);
int pci_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *r);
int pci_activate_resource(device_t dev, device_t child, int type,
@@ -151,8 +151,8 @@ struct pci_map *pci_add_bar(device_t dev, int reg, pci_addr_t value,
pci_addr_t size);
struct resource *pci_alloc_multi_resource(device_t dev, device_t child,
- int type, int *rid, u_long start, u_long end, u_long count,
- u_long num, u_int flags);
+ int type, int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_long num, u_int flags);
int pci_iov_attach_method(device_t bus, device_t dev,
struct nvlist *pf_schema, struct nvlist *vf_schema);
@@ -162,8 +162,8 @@ device_t pci_create_iov_child_method(device_t bus, device_t pf,
uint16_t rid, uint16_t vid, uint16_t did);
struct resource *pci_vf_alloc_mem_resource(device_t dev, device_t child,
- int *rid, u_long start, u_long end, u_long count,
- u_int flags);
+ int *rid, rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags);
int pci_vf_release_mem_resource(device_t dev, device_t child,
int rid, struct resource *r);
#endif /* _PCI_PRIVATE_H_ */
diff --git a/sys/dev/pci/pci_subr.c b/sys/dev/pci/pci_subr.c
index 03bcdc088b9f..77c60c3baab8 100644
--- a/sys/dev/pci/pci_subr.c
+++ b/sys/dev/pci/pci_subr.c
@@ -178,8 +178,8 @@ pcib_host_res_free(device_t pcib, struct pcib_host_resources *hr)
}
int
-pcib_host_res_decodes(struct pcib_host_resources *hr, int type, u_long start,
- u_long end, u_int flags)
+pcib_host_res_decodes(struct pcib_host_resources *hr, int type, rman_res_t start,
+ rman_res_t end, u_int flags)
{
struct resource_list_entry *rle;
int rid;
@@ -201,11 +201,11 @@ pcib_host_res_decodes(struct pcib_host_resources *hr, int type, u_long start,
struct resource *
pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
- int *rid, u_long start, u_long end, u_long count, u_int flags)
+ int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list_entry *rle;
struct resource *r;
- u_long new_start, new_end;
+ rman_res_t new_start, new_end;
if (flags & RF_PREFETCHABLE)
KASSERT(type == SYS_RES_MEMORY,
@@ -261,7 +261,7 @@ restart:
int
pcib_host_res_adjust(struct pcib_host_resources *hr, device_t dev, int type,
- struct resource *r, u_long start, u_long end)
+ struct resource *r, rman_res_t start, rman_res_t end)
{
struct resource_list_entry *rle;
@@ -329,8 +329,8 @@ pci_find_domain(int domain)
}
struct resource *
-pci_domain_alloc_bus(int domain, device_t dev, int *rid, u_long start,
- u_long end, u_long count, u_int flags)
+pci_domain_alloc_bus(int domain, device_t dev, int *rid, rman_res_t start,
+ rman_res_t end, rman_res_t count, u_int flags)
{
struct pci_domain *d;
struct resource *res;
@@ -349,7 +349,7 @@ pci_domain_alloc_bus(int domain, device_t dev, int *rid, u_long start,
int
pci_domain_adjust_bus(int domain, device_t dev, struct resource *r,
- u_long start, u_long end)
+ rman_res_t start, rman_res_t end)
{
#ifdef INVARIANTS
struct pci_domain *d;
diff --git a/sys/dev/pci/pcib_private.h b/sys/dev/pci/pcib_private.h
index bba4ce290926..417c107925e3 100644
--- a/sys/dev/pci/pcib_private.h
+++ b/sys/dev/pci/pcib_private.h
@@ -49,13 +49,13 @@ int pcib_host_res_init(device_t pcib,
int pcib_host_res_free(device_t pcib,
struct pcib_host_resources *hr);
int pcib_host_res_decodes(struct pcib_host_resources *hr, int type,
- u_long start, u_long end, u_int flags);
+ rman_res_t start, rman_res_t end, u_int flags);
struct resource *pcib_host_res_alloc(struct pcib_host_resources *hr,
- device_t dev, int type, int *rid, u_long start, u_long end,
- u_long count, u_int flags);
+ device_t dev, int type, int *rid, rman_res_t start,
+ rman_res_t end, rman_res_t count, u_int flags);
int pcib_host_res_adjust(struct pcib_host_resources *hr,
- device_t dev, int type, struct resource *r, u_long start,
- u_long end);
+ device_t dev, int type, struct resource *r, rman_res_t start,
+ rman_res_t end);
#endif
/*
@@ -132,13 +132,13 @@ int host_pcib_get_busno(pci_read_config_fn read_config, int bus,
int slot, int func, uint8_t *busnum);
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
struct resource *pci_domain_alloc_bus(int domain, device_t dev, int *rid,
- u_long start, u_long end, u_long count, u_int flags);
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int pci_domain_adjust_bus(int domain, device_t dev,
- struct resource *r, u_long start, u_long end);
+ struct resource *r, rman_res_t start, rman_res_t end);
int pci_domain_release_bus(int domain, device_t dev, int rid,
struct resource *r);
struct resource *pcib_alloc_subbus(struct pcib_secbus *bus, device_t child,
- int *rid, u_long start, u_long end, u_long count,
+ int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void pcib_setup_secbus(device_t dev, struct pcib_secbus *bus,
int min_count);
@@ -152,10 +152,11 @@ const char *pcib_child_name(device_t child);
int pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result);
int pcib_write_ivar(device_t dev, device_t child, int which, uintptr_t value);
struct resource *pcib_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags);
+ rman_res_t start, rman_res_t end,
+ rman_res_t count, u_int flags);
#ifdef NEW_PCIB
int pcib_adjust_resource(device_t bus, device_t child, int type,
- struct resource *r, u_long start, u_long end);
+ struct resource *r, rman_res_t start, rman_res_t end);
int pcib_release_resource(device_t dev, device_t child, int type, int rid,
struct resource *r);
#endif
diff --git a/sys/dev/pci/pcivar.h b/sys/dev/pci/pcivar.h
index d8df42fea2e1..7c1403522191 100644
--- a/sys/dev/pci/pcivar.h
+++ b/sys/dev/pci/pcivar.h
@@ -397,7 +397,7 @@ pci_get_vpd_readonly(device_t dev, const char *kw, const char **vptr)
* Check if the address range falls within the VGA defined address range(s)
*/
static __inline int
-pci_is_vga_ioport_range(u_long start, u_long end)
+pci_is_vga_ioport_range(rman_res_t start, rman_res_t end)
{
return (((start >= 0x3b0 && end <= 0x3bb) ||
@@ -405,7 +405,7 @@ pci_is_vga_ioport_range(u_long start, u_long end)
}
static __inline int
-pci_is_vga_memory_range(u_long start, u_long end)
+pci_is_vga_memory_range(rman_res_t start, rman_res_t end)
{
return ((start >= 0xa0000 && end <= 0xbffff) ? 1 : 0);
diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c
index 0c49ca09c324..048bc91cecc4 100644
--- a/sys/dev/pci/vga_pci.c
+++ b/sys/dev/pci/vga_pci.c
@@ -68,7 +68,8 @@ SYSCTL_DECL(_hw_pci);
static struct vga_resource *lookup_res(struct vga_pci_softc *sc, int rid);
static struct resource *vga_pci_alloc_resource(device_t dev, device_t child,
- int type, int *rid, u_long start, u_long end, u_long count, u_int flags);
+ int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
+ u_int flags);
static int vga_pci_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *r);
@@ -333,7 +334,7 @@ lookup_res(struct vga_pci_softc *sc, int rid)
static struct resource *
vga_pci_alloc_resource(device_t dev, device_t child, int type, int *rid,
- u_long start, u_long end, u_long count, u_int flags)
+ rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct vga_resource *vr;