Convert rman to use rman_res_t instead of u_long

Summary:
Migrate to using the semi-opaque type rman_res_t to specify rman resources.  For
now, this is still compatible with u_long.

This is step one in migrating rman to use uintmax_t for resources instead of
u_long.

Going forward, this could feasibly be used to specify architecture-specific
definitions of resource ranges, rather than baking a specific integer type into
the API.

This change has been broken out to facilitate MFC'ing drivers back to 10 without
breaking ABI.

Reviewed By: jhb
Sponsored by:	Alex Perez/Inertial Computing
Differential Revision: https://reviews.freebsd.org/D5075
This commit is contained in:
Justin Hibbits 2016-01-27 02:23:54 +00:00
parent 1cdc5f0b87
commit 2dd1bdf183
162 changed files with 538 additions and 491 deletions

View File

@ -110,8 +110,8 @@ struct devinfo_dev {
struct devinfo_rman {
devinfo_handle_t dm_handle; /* resource manager handle */
u_long dm_start; /* resource start */
u_long dm_size; /* resource size */
rman_res_t dm_start; /* resource start */
rman_res_t dm_size; /* resource size */
char *dm_desc; /* resource description */
};
@ -119,8 +119,8 @@ struct devinfo_res {
devinfo_handle_t dr_handle; /* resource handle */
devinfo_handle_t dr_rman; /* resource manager handle */
devinfo_handle_t dr_device; /* owning device */
u_long dr_start; /* region start */
u_long dr_size; /* region size */
rman_res_t dr_start; /* region start */
rman_res_t dr_size; /* region size */
};
.Ed
.Pp

View File

@ -56,8 +56,8 @@ struct devinfo_dev {
struct devinfo_rman {
devinfo_handle_t dm_handle; /* resource manager handle */
unsigned long dm_start; /* resource start */
unsigned long dm_size; /* resource size */
rman_res_t dm_start; /* resource start */
rman_res_t dm_size; /* resource size */
char *dm_desc; /* resource description */
};
@ -67,8 +67,8 @@ struct devinfo_res {
devinfo_handle_t dr_rman; /* resource manager handle */
devinfo_handle_t dr_device; /* owning device */
unsigned long dr_start; /* region start */
unsigned long dr_size; /* region size */
rman_res_t dr_start; /* region start */
rman_res_t dr_size; /* region size */
/* XXX add flags */
};

View File

@ -41,7 +41,8 @@
.In sys/rman.h
.In machine/resource.h
.Ft int
.Fn bus_adjust_resource "device_t dev" "int type" "struct resource *r" "u_long start" "u_long end"
.Fo bus_adjust_resource
.Fa "device_t dev" "int type" "struct resource *r" "rman_res_t start" "rman_res_t end"
.Sh DESCRIPTION
This function is used to ask the parent bus to adjust the resource range
assigned to an allocated resource.

View File

@ -43,7 +43,10 @@
.In sys/rman.h
.In machine/resource.h
.Ft struct resource *
.Fn bus_alloc_resource "device_t dev" "int type" "int *rid" "u_long start" "u_long end" "u_long count" "u_int flags"
.Fo bus_alloc_resource
.Fa "device_t dev" "int type" "int *rid" "rman_res_t start" "rman_res_t end"
.Fa "rman_res_t count" "u_int flags"
.Fc
.Ft struct resource *
.Fn bus_alloc_resource_any "device_t dev" "int type" "int *rid" "u_int flags"
.Sh DESCRIPTION

View File

@ -44,7 +44,7 @@
.In sys/rman.h
.Ft int
.Fo bus_get_resource
.Fa "device_t dev" "int type" "int rid" "u_long *startp" "u_long *countp"
.Fa "device_t dev" "int type" "int rid" "rman_res_t *startp" "rman_res_t *countp"
.Fc
.Sh DESCRIPTION
The

View File

@ -43,7 +43,7 @@
.In machine/resource.h
.Ft int
.Fo bus_set_resource
.Fa "device_t dev" "int type" "int rid" "u_long start" "u_long count"
.Fa "device_t dev" "int type" "int rid" "rman_res_t start" "rman_res_t count"
.Fc
.Sh DESCRIPTION
The

View File

@ -65,7 +65,7 @@
.Ft int
.Fn rman_activate_resource "struct resource *r"
.Ft int
.Fn rman_adjust_resource "struct resource *r" "u_long start" "u_long end"
.Fn rman_adjust_resource "struct resource *r" "rman_res_t start" "rman_res_t end"
.Ft int
.Fn rman_await_resource "struct resource *r" "int pri2" "int timo"
.Ft int
@ -79,32 +79,32 @@
.Ft int
.Fn rman_is_region_manager "struct resource *r" "struct rman *rm"
.Ft int
.Fn rman_manage_region "struct rman *rm" "u_long start" "u_long end"
.Fn rman_manage_region "struct rman *rm" "rman_res_t start" "rman_res_t end"
.Ft int
.Fn rman_first_free_region "struct rman *rm" "u_long *start" "u_long *end"
.Fn rman_first_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end"
.Ft int
.Fn rman_last_free_region "struct rman *rm" "u_long *start" "u_long *end"
.Fn rman_last_free_region "struct rman *rm" "rman_res_t *start" "rman_res_t *end"
.Ft int
.Fn rman_release_resource "struct resource *r"
.Ft "struct resource *"
.Fo rman_reserve_resource
.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count"
.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count"
.Fa "u_int flags" "struct device *dev"
.Fc
.Ft "struct resource *"
.Fo rman_reserve_resource_bound
.Fa "struct rman *rm" "u_long start" "u_long end" "u_long count"
.Fa "u_long bound" "u_int flags" "struct device *dev"
.Fa "struct rman *rm" "rman_res_t start" "rman_res_t end" "rman_res_t count"
.Fa "rman_res_t bound" "u_int flags" "struct device *dev"
.Fc
.Ft uint32_t
.Fn rman_make_alignment_flags "uint32_t size"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_start "struct resource *r"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_end "struct resource *r"
.Ft "struct device *"
.Fn rman_get_device "struct resource *r"
.Ft u_long
.Ft rman_res_t
.Fn rman_get_size "struct resource *r"
.Ft u_int
.Fn rman_get_flags "struct resource *r"

View File

@ -82,7 +82,7 @@ static int nexus_attach(device_t);
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t, u_int, const char *, int);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
#ifdef ARM_INTRNG
@ -212,7 +212,7 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit)
*/
static struct resource *
nexus_alloc_resource(device_t bus, 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 resource *rv;
struct rman *rm;

View File

@ -147,7 +147,7 @@ at91_attach(device_t dev)
static struct resource *
at91_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 at91_softc *sc = device_get_softc(dev);
struct resource_list_entry *rle;
@ -255,7 +255,7 @@ at91_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
#if 0
u_long p;
rman_res_t p;
int error;
if (type == SYS_RES_MEMORY) {

View File

@ -408,7 +408,7 @@ econa_attach(device_t dev)
static struct resource *
econa_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 econa_softc *sc = device_get_softc(dev);
struct resource_list_entry *rle;

View File

@ -100,7 +100,7 @@ static int localbus_attach(device_t);
static int localbus_print_child(device_t, device_t);
static struct resource *localbus_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static struct resource_list *localbus_get_resource_list(device_t, device_t);
static ofw_bus_get_devinfo_t localbus_get_devinfo;
@ -332,7 +332,7 @@ localbus_print_child(device_t dev, device_t child)
static struct resource *
localbus_alloc_resource(device_t bus, 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 localbus_devinfo *di;
struct resource_list_entry *rle;

View File

@ -332,7 +332,7 @@ static int mv_pcib_probe(device_t);
static int mv_pcib_attach(device_t);
static struct resource *mv_pcib_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int mv_pcib_release_resource(device_t, device_t, int, int,
struct resource *);
static int mv_pcib_read_ivar(device_t, device_t, int, uintptr_t *);
@ -830,7 +830,7 @@ mv_pcib_init_all_bars(struct mv_pcib_softc *sc, int bus, int slot,
static struct resource *
mv_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 mv_pcib_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;

View File

@ -305,7 +305,7 @@ versatile_pci_write_ivar(device_t dev, device_t child, int which,
static struct resource *
versatile_pci_alloc_resource(device_t bus, 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 versatile_pci_softc *sc = device_get_softc(bus);

View File

@ -409,7 +409,7 @@ i81342_attach(device_t dev)
static struct resource *
i81342_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 i81342_softc *sc = device_get_softc(dev);
struct resource *rv;

View File

@ -328,7 +328,7 @@ i81342_pci_write_config(device_t dev, u_int bus, u_int slot, u_int func,
static struct resource *
i81342_pci_alloc_resource(device_t bus, 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 i81342_pci_softc *sc = device_get_softc(bus);
struct resource *rv;
@ -383,7 +383,7 @@ static int
i81342_pci_activate_resource(device_t bus, device_t child, int type, int rid,
struct resource *r)
{
u_long p;
bus_space_handle_t p;
int error;
if (type == SYS_RES_MEMORY) {

View File

@ -91,7 +91,7 @@ obio_attach(device_t dev)
static struct resource *
obio_alloc_resource(device_t bus, 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 resource *rv;
struct rman *rm;

View File

@ -282,7 +282,7 @@ ata_avila_intr(void *xsc)
static struct resource *
ata_avila_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 ata_avila_softc *sc = device_get_softc(dev);

View File

@ -496,7 +496,7 @@ getvbase(uint32_t hwbase, uint32_t size, uint32_t *vbase)
static struct resource *
ixp425_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 ixp425_softc *sc = device_get_softc(dev);
const struct hwvtrans *vtrans;

View File

@ -269,7 +269,7 @@ ixppcib_teardown_intr(device_t dev, device_t child, struct resource *vec,
static struct resource *
ixppcib_alloc_resource(device_t bus, 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 ixppcib_softc *sc = device_get_softc(bus);
struct rman *rmanp;

View File

@ -50,14 +50,14 @@ static int pxa_read_ivar(device_t, device_t, int, uintptr_t *);
static struct resource_list * pxa_get_resource_list(device_t, device_t);
static struct resource * pxa_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int pxa_release_resource(device_t, device_t, int,
int, struct resource *);
static int pxa_activate_resource(device_t, device_t,
int, int, struct resource *);
static struct resource * pxa_alloc_gpio_irq(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
struct obio_device {
const char *od_name;
@ -224,7 +224,7 @@ pxa_get_resource_list(device_t dev, device_t child)
static struct resource *
pxa_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 obio_softc *sc;
struct obio_device *od;
@ -351,7 +351,7 @@ DRIVER_MODULE(pxa, nexus, pxa_driver, pxa_devclass, 0, 0);
static struct resource *
pxa_alloc_gpio_irq(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 obio_softc *sc;
struct obio_device *od;

View File

@ -70,7 +70,7 @@ static int pxa_smi_print_child(device_t, device_t);
static int pxa_smi_read_ivar(device_t, device_t, int, uintptr_t *);
static struct resource * pxa_smi_alloc_resource(device_t, device_t,
int, int *, u_long, u_long, u_long, u_int);
int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int pxa_smi_release_resource(device_t, device_t,
int, int, struct resource *);
static int pxa_smi_activate_resource(device_t, device_t,
@ -176,7 +176,7 @@ pxa_smi_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
static struct resource *
pxa_smi_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 pxa_smi_softc *sc;
struct smi_ivars *smid;

View File

@ -54,7 +54,7 @@ static int gic_v3_fdt_probe(device_t);
static int gic_v3_fdt_attach(device_t);
static struct resource *gic_v3_ofw_bus_alloc_res(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static const struct ofw_bus_devinfo *gic_v3_ofw_get_devinfo(device_t, device_t);
static device_method_t gic_v3_fdt_methods[] = {
@ -174,7 +174,7 @@ gic_v3_ofw_get_devinfo(device_t bus __unused, device_t child)
static struct resource *
gic_v3_ofw_bus_alloc_res(device_t bus, 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 gic_v3_ofw_devinfo *di;
struct resource_list_entry *rle;

View File

@ -99,13 +99,14 @@ static device_attach_t nexus_acpi_attach;
static int nexus_print_child(device_t, device_t);
static device_t nexus_add_child(device_t, u_int, const char *, int);
static struct resource *nexus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
rman_res_t, rman_res_t, rman_res_t, u_int);
static int nexus_activate_resource(device_t, device_t, int, int,
struct resource *);
static int nexus_config_intr(device_t dev, int irq, enum intr_trigger trig,
enum intr_polarity pol);
static struct resource_list *nexus_get_reslist(device_t, device_t);
static int nexus_set_resource(device_t, device_t, int, int, u_long, u_long);
static int nexus_set_resource(device_t, device_t, int, int,
rman_res_t, rman_res_t);
static int nexus_deactivate_resource(device_t, device_t, int, int,
struct resource *);
@ -201,7 +202,7 @@ nexus_add_child(device_t bus, u_int order, const char *name, int unit)
*/
static struct resource *
nexus_alloc_resource(device_t bus, 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 nexus_device *ndev = DEVTONX(child);
struct resource *rv;
@ -332,7 +333,7 @@ nexus_get_reslist(device_t dev, device_t child)
static int
nexus_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct nexus_device *ndev = DEVTONX(child);
struct resource_list *rl = &ndev->nx_resources;

View File

@ -110,7 +110,7 @@ SYSCTL_INT(_hw, OID_AUTO, thunder_pcie_max_vfs, CTLFLAG_RWTUN,
/* Forward prototypes */
static struct resource *thunder_pcie_alloc_resource(device_t,
device_t, int, int *, u_long, u_long, u_long, u_int);
device_t, int, int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pcie_attach(device_t);
static int thunder_pcie_identify_pcib(device_t);
static int thunder_pcie_maxslots(device_t);
@ -431,7 +431,7 @@ thunder_pcie_release_resource(device_t dev, device_t child, int type, int rid,
static struct resource *
thunder_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 thunder_pcie_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;
@ -519,7 +519,7 @@ static int
thunder_pcie_identify_pcib(device_t dev)
{
struct thunder_pcie_softc *sc;
u_long start;
rman_res_t start;
sc = device_get_softc(dev);
start = bus_get_resource_start(dev, SYS_RES_MEMORY, 0);

View File

@ -126,7 +126,7 @@ struct thunder_pem_softc {
};
static struct resource * thunder_pem_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static int thunder_pem_attach(device_t);
static int thunder_pem_detach(device_t);
static uint64_t thunder_pem_config_reg_read(struct thunder_pem_softc *, int);
@ -230,7 +230,7 @@ static int
thunder_pem_identify(device_t dev)
{
struct thunder_pem_softc *sc;
u_long start;
rman_res_t start;
sc = device_get_softc(dev);
start = rman_get_start(sc->reg);
@ -426,7 +426,7 @@ thunder_pem_write_config(device_t dev, u_int bus, u_int slot,
static struct resource *
thunder_pem_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 thunder_pem_softc *sc = device_get_softc(dev);
struct rman *rm = NULL;

View File

@ -121,12 +121,12 @@ static struct resource_list *acpi_get_rlist(device_t dev, device_t child);
static void acpi_reserve_resources(device_t dev);
static int acpi_sysres_alloc(device_t dev);
static int acpi_set_resource(device_t dev, device_t child, int type,
int rid, u_long start, u_long count);
int rid, rman_res_t start, rman_res_t count);
static struct resource *acpi_alloc_resource(device_t bus, 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 acpi_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);
static int acpi_release_resource(device_t bus, device_t child, int type,
int rid, struct resource *r);
static void acpi_delete_resource(device_t bus, device_t child, int type,
@ -1247,13 +1247,13 @@ acpi_reserve_resources(device_t dev)
static int
acpi_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct acpi_softc *sc = device_get_softc(dev);
struct acpi_device *ad = device_get_ivars(child);
struct resource_list *rl = &ad->ad_rl;
ACPI_DEVICE_INFO *devinfo;
u_long end;
rman_res_t end;
/* Ignore IRQ resources for PCI link devices. */
if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL)
@ -1323,7 +1323,7 @@ acpi_set_resource(device_t dev, device_t child, int type, int rid,
static struct resource *
acpi_alloc_resource(device_t bus, 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)
{
ACPI_RESOURCE ares;
struct acpi_device *ad;
@ -1399,8 +1399,8 @@ acpi_alloc_resource(device_t bus, device_t child, int type, int *rid,
* system resources.
*/
struct resource *
acpi_alloc_sysres(device_t child, int type, int *rid, u_long start, u_long end,
u_long count, u_int flags)
acpi_alloc_sysres(device_t child, int type, int *rid, rman_res_t start,
rman_res_t end, rman_res_t count, u_int flags)
{
struct rman *rm;
struct resource *res;
@ -1450,7 +1450,7 @@ acpi_is_resource_managed(int type, struct resource *r)
static int
acpi_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)
{
if (acpi_is_resource_managed(type, r))

View File

@ -322,7 +322,7 @@ hpet_find(ACPI_HANDLE handle, UINT32 level, void *context,
static int
hpet_find_irq_rid(device_t dev, u_long start, u_long end)
{
u_long irq;
rman_res_t irq;
int error, rid;
for (rid = 0;; rid++) {

View File

@ -91,12 +91,12 @@ static int acpi_pcib_alloc_msix(device_t pcib, device_t dev,
int *irq);
static struct resource *acpi_pcib_acpi_alloc_resource(device_t dev,
device_t child, int type, int *rid,
u_long start, u_long end, u_long count,
rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
#ifdef NEW_PCIB
static int acpi_pcib_acpi_adjust_resource(device_t dev,
device_t child, int type, struct resource *r,
u_long start, u_long end);
rman_res_t start, rman_res_t end);
#ifdef PCI_RES_BUS
static int acpi_pcib_acpi_release_resource(device_t dev,
device_t child, int type, int rid,
@ -283,7 +283,7 @@ acpi_pcib_producer_handler(ACPI_RESOURCE *res, void *context)
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
static int
first_decoded_bus(struct acpi_hpcib_softc *sc, u_long *startp)
first_decoded_bus(struct acpi_hpcib_softc *sc, rman_res_t *startp)
{
struct resource_list_entry *rle;
@ -304,7 +304,7 @@ acpi_pcib_acpi_attach(device_t dev)
u_int slot, func, busok;
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
struct resource *bus_res;
u_long start;
rman_res_t start;
int rid;
#endif
uint8_t busno;
@ -584,7 +584,7 @@ acpi_pcib_map_msi(device_t pcib, device_t dev, int irq, uint64_t *addr,
struct resource *
acpi_pcib_acpi_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
struct acpi_hpcib_softc *sc;
@ -625,7 +625,7 @@ acpi_pcib_acpi_alloc_resource(device_t dev, device_t child, int type, int *rid,
#ifdef NEW_PCIB
int
acpi_pcib_acpi_adjust_resource(device_t dev, 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)
{
struct acpi_hpcib_softc *sc;

View File

@ -671,7 +671,7 @@ acpi_sysres_attach(device_t dev)
struct resource_list_entry *bus_rle, *dev_rle;
struct resource_list *bus_rl, *dev_rl;
int done, type;
u_long start, end, count;
rman_res_t start, end, count;
/*
* Loop through all current resources to see if the new one overlaps

View File

@ -122,7 +122,7 @@ static void
acpi_timer_identify(driver_t *driver, device_t parent)
{
device_t dev;
u_long rlen, rstart;
rman_res_t rlen, rstart;
int rid, rtype;
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);

View File

@ -383,7 +383,8 @@ ACPI_STATUS acpi_lookup_irq_resource(device_t dev, int rid,
ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
struct acpi_parse_resource_set *set, void *arg);
struct resource *acpi_alloc_sysres(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);
/* ACPI event handling */
UINT32 acpi_event_power_button_sleep(void *context);

View File

@ -109,7 +109,7 @@ adv_isa_probe(device_t dev)
{
int port_index;
int max_port_index;
u_long iobase, iocount, irq;
rman_res_t iobase, iocount, irq;
int user_iobase = 0;
int rid = 0;
void *ih;

View File

@ -523,7 +523,7 @@ ahci_intr_one_edge(void *data)
struct resource *
ahci_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 ahci_controller *ctlr = device_get_softc(dev);
struct resource *res;

View File

@ -626,7 +626,7 @@ int ahci_detach(device_t dev);
int ahci_setup_interrupt(device_t dev);
int ahci_print_child(device_t dev, device_t child);
struct resource *ahci_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);
int ahci_release_resource(device_t dev, device_t child, int type, int rid,
struct resource *r);
int ahci_setup_intr(device_t dev, device_t child, struct resource *irq,

View File

@ -67,7 +67,7 @@ ata_cbus_probe(device_t dev)
{
struct resource *io;
int rid;
u_long tmp;
rman_res_t tmp;
/* dont probe PnP devices */
if (isa_get_vendorid(dev))
@ -168,7 +168,8 @@ ata_cbus_attach(device_t dev)
static struct resource *
ata_cbus_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 ata_cbus_controller *ctlr = device_get_softc(dev);

View File

@ -60,7 +60,7 @@ static int
ata_isa_probe(device_t dev)
{
struct resource *io = NULL, *ctlio = NULL;
u_long tmp;
rman_res_t tmp;
int rid;
/* check isapnp ids */
@ -100,7 +100,7 @@ ata_isa_attach(device_t dev)
{
struct ata_channel *ch = device_get_softc(dev);
struct resource *io = NULL, *ctlio = NULL;
u_long tmp;
rman_res_t tmp;
int i, rid;
if (ch->attached)

View File

@ -217,7 +217,8 @@ ata_pci_write_config(device_t dev, device_t child, int reg,
struct resource *
ata_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 ata_pci_controller *controller = device_get_softc(dev);
struct resource *res = NULL;

View File

@ -535,7 +535,7 @@ void ata_pci_write_config(device_t dev, device_t child, int reg,
int ata_pci_print_child(device_t dev, device_t child);
int ata_pci_child_location_str(device_t dev, device_t child, char *buf,
size_t buflen);
struct resource * ata_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);
struct resource * ata_pci_alloc_resource(device_t dev, device_t child, int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags);
int ata_pci_release_resource(device_t dev, device_t child, int type, int rid, struct resource *r);
int ata_pci_setup_intr(device_t dev, device_t child, struct resource *irq, int flags, driver_filter_t *filter, driver_intr_t *function, void *argument, void **cookiep);
int ata_pci_teardown_intr(device_t dev, device_t child, struct resource *irq, void *cookie);

View File

@ -91,7 +91,7 @@ static int
atkbdc_ebus_probe(device_t dev)
{
struct resource *port0, *port1;
u_long count, start;
rman_res_t count, start;
int error, rid;
if (strcmp(ofw_bus_get_name(dev), "8042") != 0)
@ -176,7 +176,7 @@ atkbdc_ebus_attach(device_t dev)
atkbdc_device_t *adi;
device_t cdev;
phandle_t child;
u_long count, intr, start;
rman_res_t count, intr, start;
int children, error, rid, unit;
char *cname, *dname;

View File

@ -50,8 +50,8 @@ static int atkbdc_isa_attach(device_t dev);
static device_t atkbdc_isa_add_child(device_t bus, u_int order, const char *name,
int unit);
static struct resource *atkbdc_isa_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 atkbdc_isa_release_resource(device_t dev, device_t child,
int type, int rid, struct resource *r);
@ -97,8 +97,8 @@ atkbdc_isa_probe(device_t dev)
{
struct resource *port0;
struct resource *port1;
u_long start;
u_long count;
rman_res_t start;
rman_res_t count;
int error;
int rid;
#if defined(__i386__) || defined(__amd64__)
@ -295,7 +295,7 @@ atkbdc_isa_add_child(device_t bus, u_int order, const char *name, int unit)
struct resource *
atkbdc_isa_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)
{
atkbdc_softc_t *sc;

View File

@ -51,7 +51,7 @@ int
atkbdc_print_child(device_t bus, device_t dev)
{
atkbdc_device_t *kbdcdev;
u_long irq;
rman_res_t irq;
int flags;
int retval = 0;

View File

@ -258,7 +258,7 @@ cs_cs89x0_probe(device_t dev)
{
int i;
int error;
u_long irq, junk;
rman_res_t irq, junk;
struct cs_softc *sc = device_get_softc(dev);
unsigned rev_type = 0;
uint16_t id;

View File

@ -317,8 +317,8 @@ static short porttab [] = {
static char dmatab [] = { 7, 6, 5, 0 };
static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 };
static int ct_is_free_res (device_t dev, int rid, int type, u_long start,
u_long end, u_long count)
static int ct_is_free_res (device_t dev, int rid, int type, rman_res_t start,
rman_res_t end, rman_res_t count)
{
struct resource *res;
@ -332,7 +332,7 @@ static int ct_is_free_res (device_t dev, int rid, int type, u_long start,
static void ct_identify (driver_t *driver, device_t dev)
{
u_long iobase, rescount;
rman_res_t iobase, rescount;
int devcount;
device_t *devices;
device_t child;
@ -440,7 +440,7 @@ static void ct_identify (driver_t *driver, device_t dev)
static int ct_probe (device_t dev)
{
int unit = device_get_unit (dev);
u_long iobase, rescount;
rman_res_t iobase, rescount;
if (!device_get_desc (dev) ||
strcmp (device_get_desc (dev), "Cronyx Tau-ISA"))
@ -529,7 +529,7 @@ ct_bus_dma_mem_free (ct_dma_mem_t *dmem)
static int ct_attach (device_t dev)
{
bdrv_t *bd = device_get_softc (dev);
u_long iobase, drq, irq, rescount;
rman_res_t iobase, drq, irq, rescount;
int unit = device_get_unit (dev);
char *ct_ln = CT_LOCK_NAME;
ct_board_t *b;

View File

@ -405,8 +405,8 @@ static short porttab [] = {
static char dmatab [] = { 7, 6, 5, 0 };
static char irqtab [] = { 5, 10, 11, 7, 3, 15, 12, 0 };
static int cx_is_free_res (device_t dev, int rid, int type, u_long start,
u_long end, u_long count)
static int cx_is_free_res (device_t dev, int rid, int type, rman_res_t start,
rman_res_t end, rman_res_t count)
{
struct resource *res;
@ -420,7 +420,7 @@ static int cx_is_free_res (device_t dev, int rid, int type, u_long start,
static void cx_identify (driver_t *driver, device_t dev)
{
u_long iobase, rescount;
rman_res_t iobase, rescount;
int devcount;
device_t *devices;
device_t child;
@ -530,7 +530,7 @@ static int cx_probe (device_t dev)
{
int unit = device_get_unit (dev);
int i;
u_long iobase, rescount;
rman_res_t iobase, rescount;
if (!device_get_desc (dev) ||
strcmp (device_get_desc (dev), "Cronyx Sigma"))
@ -629,7 +629,7 @@ cx_bus_dma_mem_free (cx_dma_mem_t *dmem)
static int cx_attach (device_t dev)
{
bdrv_t *bd = device_get_softc (dev);
u_long iobase, drq, irq, rescount;
rman_res_t iobase, drq, irq, rescount;
int unit = device_get_unit (dev);
char *cx_ln = CX_LOCK_NAME;
cx_board_t *b;

View File

@ -74,7 +74,7 @@ ed_probe_3Com(device_t dev, int port_rid, int flags)
int i;
u_int memsize;
u_char isa16bit;
u_long conf_maddr, conf_msize, irq, junk, pmem;
rman_res_t conf_maddr, conf_msize, irq, junk, pmem;
error = ed_alloc_port(dev, 0, ED_3COM_IO_PORTS);
if (error)

View File

@ -607,7 +607,7 @@ ed98_alloc_memory(dev, rid)
{
struct ed_softc *sc = device_get_softc(dev);
int error;
u_long conf_maddr, conf_msize;
rman_res_t conf_maddr, conf_msize;
error = bus_get_resource(dev, SYS_RES_MEMORY, 0, &conf_maddr,
&conf_msize);
@ -1001,7 +1001,7 @@ ed_probe_CNET98(device_t dev, int port_rid, int flags)
struct ed_softc *sc = device_get_softc(dev);
int error;
u_char tmp;
u_long conf_irq, junk;
rman_res_t conf_irq, junk;
#ifdef DIAGNOSTIC
u_char tmp_s;
#endif
@ -1157,7 +1157,7 @@ ed_probe_CNET98EL(device_t dev, int port_rid, int flags)
int error;
int i;
u_char romdata[ETHER_ADDR_LEN * 2], tmp;
u_long conf_irq, junk;
rman_res_t conf_irq, junk;
error = ed98_alloc_port(dev, port_rid);
if (error)
@ -1251,7 +1251,7 @@ ed_probe_NEC77(device_t dev, int port_rid, int flags)
struct ed_softc *sc = device_get_softc(dev);
int error;
u_char tmp;
u_long conf_irq, junk;
rman_res_t conf_irq, junk;
error = ed98_probe_Novell(dev, port_rid, flags);
if (error)
@ -1303,7 +1303,7 @@ ed_probe_NW98X(device_t dev, int port_rid, int flags)
struct ed_softc *sc = device_get_softc(dev);
int error;
u_char tmp;
u_long conf_irq, junk;
rman_res_t conf_irq, junk;
error = ed98_probe_Novell(dev, port_rid, flags);
if (error)
@ -1427,7 +1427,7 @@ ed_probe_SB98(device_t dev, int port_rid, int flags)
struct ed_softc *sc = device_get_softc(dev);
int error;
u_char tmp;
u_long conf_irq, junk;
rman_res_t conf_irq, junk;
error = ed98_alloc_port(dev, port_rid);
if (error)

View File

@ -126,7 +126,7 @@ ed_probe_HP_pclanp(device_t dev, int port_rid, int flags)
u_char irq; /* board configured IRQ */
uint8_t test_pattern[ED_HPP_TEST_SIZE]; /* read/write areas for */
uint8_t test_buffer[ED_HPP_TEST_SIZE]; /* probing card */
u_long conf_maddr, conf_msize, conf_irq, junk;
rman_res_t conf_maddr, conf_msize, conf_irq, junk;
error = ed_alloc_port(dev, 0, ED_HPP_IO_PORTS);
if (error)

View File

@ -97,7 +97,7 @@ ed_probe_WD80x3_generic(device_t dev, int flags, uint16_t *intr_vals[])
int i;
u_int memsize;
u_char iptr, isa16bit, sum, totalsum;
u_long irq, junk, pmem;
rman_res_t irq, junk, pmem;
sc->chip_type = ED_CHIP_TYPE_DP8390;

View File

@ -352,7 +352,7 @@ eisa_write_ivar(device_t dev, device_t child, int which, uintptr_t value)
static struct resource *
eisa_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)
{
int isdefault;
struct eisa_device *e_dev = device_get_ivars(child);

View File

@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$");
static int simplebus_probe(device_t dev);
static int simplebus_attach(device_t dev);
static struct resource *simplebus_alloc_resource(device_t, device_t, int,
int *, u_long, u_long, u_long, u_int);
int *, rman_res_t, rman_res_t, rman_res_t, u_int);
static void simplebus_probe_nomatch(device_t bus, device_t child);
static int simplebus_print_child(device_t bus, device_t child);
static device_t simplebus_add_child(device_t dev, u_int order,
@ -322,7 +322,7 @@ simplebus_get_resource_list(device_t bus __unused, device_t child)
static struct resource *
simplebus_alloc_resource(device_t bus, 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 simplebus_softc *sc;
struct simplebus_devinfo *di;

View File

@ -298,7 +298,7 @@ fe_probe_re1000(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
int i, n;
u_long iobase, irq;
rman_res_t iobase, irq;
u_char sum;
static struct fe_simple_probe_struct probe_table [] = {
@ -398,7 +398,7 @@ fe_probe_jli(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
int i, n, xirq, error;
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [JLI_EEPROM_SIZE];
u_short const * irqmap;
@ -524,7 +524,7 @@ static int
fe_probe_cnet9ne (device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
static struct fe_simple_probe_struct probe_table [] = {
{ FE_DLCR2, 0x58, 0x00 },
@ -598,7 +598,7 @@ static int
fe_probe_ssi(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [SSI_EEPROM_SIZE];
static struct fe_simple_probe_struct probe_table [] = {
@ -676,7 +676,7 @@ fe_probe_lnx(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [LNX_EEPROM_SIZE];
static struct fe_simple_probe_struct probe_table [] = {
@ -804,7 +804,7 @@ fe_probe_ubn(device_t dev)
struct fe_softc *sc = device_get_softc(dev);
u_char sum, save7;
u_long iobase, irq;
rman_res_t iobase, irq;
int i;
static struct fe_simple_probe_struct const probe_table [] = {
{ FE_DLCR2, 0x58, 0x00 },
@ -949,7 +949,7 @@ fe_probe_rex(device_t dev)
struct fe_softc *sc = device_get_softc(dev);
int i;
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [REX_EEPROM_SIZE];
static struct fe_simple_probe_struct probe_table [] = {

View File

@ -203,7 +203,7 @@ fe_probe_fmv(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
int n;
u_long iobase, irq;
rman_res_t iobase, irq;
static u_short const irqmap [ 4 ] = { 3, 7, 10, 15 };
@ -698,7 +698,7 @@ fe_probe_jli(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
int i, n, error, xirq;
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [JLI_EEPROM_SIZE];
u_short const * irqmap;
@ -816,7 +816,7 @@ static int
fe_probe_ssi(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [SSI_EEPROM_SIZE];
static struct fe_simple_probe_struct probe_table [] = {
@ -878,7 +878,7 @@ static int
fe_probe_lnx(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
u_char eeprom [LNX_EEPROM_SIZE];
static struct fe_simple_probe_struct probe_table [] = {
@ -946,7 +946,7 @@ static int
fe_probe_gwy(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
static struct fe_simple_probe_struct probe_table [] = {
/* { FE_DLCR2, 0x70, 0x00 }, */
@ -999,7 +999,7 @@ static int
fe_probe_ubn(device_t dev)
{
struct fe_softc *sc = device_get_softc(dev);
u_long iobase, irq;
rman_res_t iobase, irq;
#if 0
u_char sum;
#endif

View File

@ -488,7 +488,7 @@ gpiobus_hinted_child(device_t bus, const char *dname, int dunit)
static int
gpiobus_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct gpiobus_ivar *devi;
struct resource_list_entry *rle;
@ -506,7 +506,7 @@ gpiobus_set_resource(device_t dev, device_t child, int type, int rid,
static struct resource *
gpiobus_alloc_resource(device_t bus, 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 gpiobus_softc *sc;
struct resource *rv;

View File

@ -456,7 +456,7 @@ mca_read_ivar (device_t dev, device_t child, int which, uintptr_t * result)
static struct resource *
mca_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 mca_device * m_dev = device_get_ivars(child);
struct resource_list_entry * rle;

View File

@ -389,7 +389,8 @@ mvs_intr(void *data)
static struct resource *
mvs_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 mvs_controller *ctlr = device_get_softc(dev);
int unit = ((struct mvs_channel *)device_get_softc(child))->unit;

View File

@ -336,7 +336,7 @@ mvs_intr(void *data)
static struct resource *
mvs_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 mvs_controller *ctlr = device_get_softc(dev);
int unit = ((struct mvs_channel *)device_get_softc(child))->unit;

View File

@ -142,7 +142,7 @@ ncv_alloc_resource(device_t dev)
{
struct ncv_softc *sc = device_get_softc(dev);
u_int32_t flags = device_get_flags(dev);
u_long ioaddr, iosize, maddr, msize;
rman_res_t ioaddr, iosize, maddr, msize;
int error;
bus_addr_t offset = 0;

View File

@ -115,7 +115,7 @@ static int
nsp_alloc_resource(device_t dev)
{
struct nsp_softc *sc = device_get_softc(dev);
u_long ioaddr, iosize, maddr, msize;
rman_res_t ioaddr, iosize, maddr, msize;
int error;
error = bus_get_resource(dev, SYS_RES_IOPORT, 0, &ioaddr, &iosize);

View File

@ -178,7 +178,7 @@ ofwbus_attach(device_t dev)
static struct resource *
ofwbus_alloc_resource(device_t bus, 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 ofwbus_softc *sc;
struct rman *rm;
@ -239,7 +239,7 @@ ofwbus_alloc_resource(device_t bus, device_t child, int type, int *rid,
static int
ofwbus_adjust_resource(device_t bus, device_t child __unused, int type,
struct resource *r, u_long start, u_long end)
struct resource *r, rman_res_t start, rman_res_t end)
{
struct ofwbus_softc *sc;
struct rman *rm;

View File

@ -97,9 +97,9 @@ static void pccard_print_resources(struct resource_list *rl,
const char *name, int type, int count, const char *format);
static int pccard_print_child(device_t dev, device_t child);
static int pccard_set_resource(device_t dev, device_t child, int type,
int rid, u_long start, u_long count);
int rid, rman_res_t start, rman_res_t count);
static int pccard_get_resource(device_t dev, device_t child, int type,
int rid, u_long *startp, u_long *countp);
int rid, rman_res_t *startp, rman_res_t *countp);
static void pccard_delete_resource(device_t dev, device_t child, int type,
int rid);
static int pccard_set_res_flags(device_t dev, device_t child, int type,
@ -113,8 +113,8 @@ static int pccard_read_ivar(device_t bus, device_t child, int which,
uintptr_t *result);
static void pccard_driver_added(device_t dev, driver_t *driver);
static struct resource *pccard_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 pccard_release_resource(device_t dev, device_t child, int type,
int rid, struct resource *r);
static void pccard_child_detached(device_t parent, device_t dev);
@ -474,7 +474,7 @@ pccard_function_init(struct pccard_function *pf, int entry)
struct pccard_ce_iospace *ios;
struct pccard_ce_memspace *mems;
device_t bus;
u_long start, end, len;
rman_res_t start, end, len;
int i, rid, spaces;
if (pf->pf_flags & PFF_ENABLED) {
@ -614,8 +614,8 @@ pccard_function_free(struct pccard_function *pf)
}
static void
pccard_mfc_adjust_iobase(struct pccard_function *pf, bus_addr_t addr,
bus_addr_t offset, bus_size_t size)
pccard_mfc_adjust_iobase(struct pccard_function *pf, rman_res_t addr,
rman_res_t offset, rman_res_t size)
{
bus_size_t iosize, tmp;
@ -923,7 +923,7 @@ pccard_print_child(device_t dev, device_t child)
static int
pccard_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct pccard_ivar *devi = PCCARD_IVAR(child);
struct resource_list *rl = &devi->resources;
@ -952,7 +952,7 @@ pccard_set_resource(device_t dev, device_t child, int type, int rid,
static int
pccard_get_resource(device_t dev, device_t child, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
struct pccard_ivar *devi = PCCARD_IVAR(child);
struct resource_list *rl = &devi->resources;
@ -1132,7 +1132,7 @@ pccard_driver_added(device_t dev, driver_t *driver)
static struct resource *
pccard_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 pccard_ivar *dinfo;
struct resource_list_entry *rle = 0;

View File

@ -48,14 +48,14 @@
#define PCCARD_CFE_AUDIO 0x0800
struct pccard_ce_iospace {
u_long length;
u_long start;
rman_res_t length;
rman_res_t start;
};
struct pccard_ce_memspace {
u_long length;
u_long cardaddr;
u_long hostaddr;
rman_res_t length;
rman_res_t cardaddr;
rman_res_t hostaddr;
};
struct pccard_config_entry {

View File

@ -166,8 +166,8 @@ static int cbb_cardbus_activate_resource(device_t brdev, device_t child,
static int cbb_cardbus_deactivate_resource(device_t brdev,
device_t child, int type, int rid, struct resource *res);
static struct resource *cbb_cardbus_alloc_resource(device_t brdev,
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 cbb_cardbus_release_resource(device_t brdev, device_t child,
int type, int rid, struct resource *res);
static int cbb_cardbus_power_enable_socket(device_t brdev,
@ -1230,12 +1230,12 @@ cbb_cardbus_deactivate_resource(device_t brdev, device_t child, int type,
static struct resource *
cbb_cardbus_alloc_resource(device_t brdev, device_t child, 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 cbb_softc *sc = device_get_softc(brdev);
int tmp;
struct resource *res;
u_long align;
rman_res_t align;
switch (type) {
case SYS_RES_IRQ:
@ -1395,7 +1395,7 @@ cbb_pcic_deactivate_resource(device_t brdev, device_t child, int type,
static struct resource *
cbb_pcic_alloc_resource(device_t brdev, 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 resource *res = NULL;
struct cbb_softc *sc = device_get_softc(brdev);
@ -1538,7 +1538,7 @@ cbb_deactivate_resource(device_t brdev, device_t child, int type,
struct resource *
cbb_alloc_resource(device_t brdev, 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 cbb_softc *sc = device_get_softc(brdev);

View File

@ -783,7 +783,7 @@ cbb_pci_filt(void *arg)
#if defined(NEW_PCIB) && defined(PCI_RES_BUS)
static struct resource *
cbb_pci_alloc_resource(device_t bus, 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 cbb_softc *sc;
@ -797,7 +797,7 @@ cbb_pci_alloc_resource(device_t bus, device_t child, int type, int *rid,
static int
cbb_pci_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)
{
struct cbb_softc *sc;

View File

@ -113,7 +113,7 @@ extern devclass_t cbb_devclass;
int cbb_activate_resource(device_t brdev, device_t child,
int type, int rid, struct resource *r);
struct resource *cbb_alloc_resource(device_t brdev, device_t child,
int type, int *rid, u_long start, u_long end, u_long count,
int type, int *rid, rman_res_t start, rman_res_t end, rman_res_t count,
u_int flags);
void cbb_child_detached(device_t brdev, device_t child);
int cbb_child_present(device_t parent, device_t child);

View File

@ -100,7 +100,7 @@ pcf_isa_identify(driver_t *driver, device_t parent)
static int
pcf_isa_probe(device_t dev)
{
u_long start, count;
rman_res_t start, count;
u_int rid = 0, port, error;
/* skip PnP probes */

View File

@ -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));

View File

@ -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;

View File

@ -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 @@ pci_reserve_secbus(device_t bus, device_t dev, pcicfgregs *cfg,
}
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 @@ pci_reserve_map(device_t dev, device_t child, int type, int *rid,
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;

View File

@ -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 @@ generic_pcie_alloc_resource(device_t dev, device_t child, int type, int *rid,
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;

View File

@ -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;

View File

@ -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 @@ pcib_grow_window(struct pcib_softc *sc, struct pcib_window *w, int type,
*/
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;

View File

@ -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_ */

View File

@ -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 @@ pcib_host_res_alloc(struct pcib_host_resources *hr, device_t dev, int type,
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;

View File

@ -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

View File

@ -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);

View File

@ -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;

View File

@ -1674,7 +1674,7 @@ ppc_probe(device_t dev, int rid)
#endif
struct ppc_data *ppc;
int error;
u_long port;
rman_res_t port;
/*
* Allocate the ppc_data structure.
@ -2015,7 +2015,7 @@ ppc_write_ivar(device_t bus, device_t dev, int index, uintptr_t val)
*/
struct resource *
ppc_alloc_resource(device_t bus, 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 ppc_data *ppc = DEVTOSOFTC(bus);

View File

@ -41,7 +41,7 @@ u_char ppc_io(device_t, int, u_char *, int, u_char);
int ppc_exec_microseq(device_t, struct ppb_microseq **);
struct resource *ppc_alloc_resource(device_t bus, device_t child, 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);
int ppc_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
int ppc_reset_epp(device_t);

View File

@ -78,7 +78,7 @@ puc_get_bar(struct puc_softc *sc, int rid)
{
struct puc_bar *bar;
struct rman *rm;
u_long end, start;
rman_res_t end, start;
int error, i;
/* Find the BAR entry with the given RID. */
@ -474,7 +474,7 @@ puc_bfe_probe(device_t dev, const struct puc_cfg *cfg)
struct resource *
puc_bus_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 puc_port *port;
struct resource *res;
@ -567,11 +567,11 @@ puc_bus_release_resource(device_t dev, device_t child, int type, int rid,
int
puc_bus_get_resource(device_t dev, device_t child, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
struct puc_port *port;
struct resource *res;
u_long start;
rman_res_t start;
/* Get our immediate child. */
while (child != NULL && device_get_parent(child) != dev)

View File

@ -85,9 +85,9 @@ int puc_bfe_probe(device_t, const struct puc_cfg *);
int puc_bus_child_location_str(device_t, device_t, char *, size_t);
int puc_bus_child_pnpinfo_str(device_t, device_t, char *, size_t);
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *, u_long,
u_long, u_long, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
struct resource *puc_bus_alloc_resource(device_t, device_t, int, int *,
rman_res_t, rman_res_t, rman_res_t, u_int);
int puc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int puc_bus_print_child(device_t, device_t);
int puc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int puc_bus_release_resource(device_t, device_t, int, int, struct resource *);

View File

@ -61,8 +61,9 @@ int quicc_bfe_detach(device_t);
int quicc_bfe_probe(device_t, u_int);
struct resource *quicc_bus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
int quicc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
rman_res_t, rman_res_t, rman_res_t, u_int);
int quicc_bus_get_resource(device_t, device_t, int, int,
rman_res_t *, rman_res_t *);
int quicc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int quicc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int quicc_bus_setup_intr(device_t, device_t, struct resource *, int,

View File

@ -101,7 +101,7 @@ quicc_bfe_attach(device_t dev)
struct quicc_softc *sc;
struct resource_list_entry *rle;
const char *sep;
u_long size, start;
rman_res_t size, start;
int error;
sc = device_get_softc(dev);
@ -254,7 +254,7 @@ quicc_bfe_probe(device_t dev, u_int clock)
struct resource *
quicc_bus_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 quicc_device *qd;
struct resource_list_entry *rle;
@ -284,7 +284,7 @@ quicc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
int
quicc_bus_get_resource(device_t dev, device_t child, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
struct quicc_device *qd;
struct resource_list_entry *rle;

View File

@ -143,8 +143,8 @@ int scc_bfe_detach(device_t dev);
int scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid);
struct resource *scc_bus_alloc_resource(device_t, device_t, int, int *,
u_long, u_long, u_long, u_int);
int scc_bus_get_resource(device_t, device_t, int, int, u_long *, u_long *);
rman_res_t, rman_res_t, rman_res_t, u_int);
int scc_bus_get_resource(device_t, device_t, int, int, rman_res_t *, rman_res_t *);
int scc_bus_read_ivar(device_t, device_t, int, uintptr_t *);
int scc_bus_release_resource(device_t, device_t, int, int, struct resource *);
int scc_bus_setup_intr(device_t, device_t, struct resource *, int,

View File

@ -103,7 +103,7 @@ scc_bfe_attach(device_t dev, u_int ipc)
struct scc_softc *sc, *sc0;
const char *sep;
bus_space_handle_t bh;
u_long base, size, start, sz;
rman_res_t base, size, start, sz;
int c, error, mode, sysdev;
/*
@ -407,7 +407,7 @@ scc_bfe_probe(device_t dev, u_int regshft, u_int rclk, u_int rid)
struct resource *
scc_bus_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 resource_list_entry *rle;
struct scc_chan *ch;
@ -431,7 +431,7 @@ scc_bus_alloc_resource(device_t dev, device_t child, int type, int *rid,
int
scc_bus_get_resource(device_t dev, device_t child, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
struct resource_list_entry *rle;
struct scc_chan *ch;

View File

@ -92,8 +92,8 @@ static int siba_activate_resource(device_t, device_t, int, int,
struct resource *);
static device_t siba_add_child(device_t, u_int, const char *, int);
static struct resource *
siba_alloc_resource(device_t, device_t, int, int *, u_long,
u_long, u_long, u_int);
siba_alloc_resource(device_t, device_t, int, int *, rman_res_t,
rman_res_t, rman_res_t, u_int);
static int siba_attach(device_t);
#ifdef notyet
static void siba_destroy_devinfo(struct siba_devinfo *);
@ -371,7 +371,7 @@ siba_print_child(device_t bus, device_t child)
static struct resource *
siba_alloc_resource(device_t bus, 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 resource *rv;
struct resource_list *rl;

View File

@ -242,7 +242,7 @@ siba_bwn_resume(device_t dev)
/* proxying to the parent */
static struct resource *
siba_bwn_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(device_get_parent(dev), dev,

View File

@ -92,7 +92,7 @@ static int siba_pcib_activate_resource(device_t, device_t, int,
int, struct resource *);
static struct resource *
siba_pcib_alloc_resource(device_t, device_t, int, int *,
u_long , u_long, u_long, u_int);
rman_res_t , rman_res_t, rman_res_t, u_int);
static int siba_pcib_attach(device_t);
static int siba_pcib_deactivate_resource(device_t, device_t, int,
int, struct resource *);
@ -249,7 +249,7 @@ siba_pcib_teardown_intr(device_t dev, device_t child, struct resource *vec,
static struct resource *
siba_pcib_alloc_resource(device_t bus, 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)
{
#if 1

View File

@ -314,7 +314,7 @@ siis_intr(void *data)
static struct resource *
siis_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 siis_controller *ctlr = device_get_softc(dev);
int unit = ((struct siis_channel *)device_get_softc(child))->unit;

View File

@ -72,7 +72,7 @@ snc_isapnp_reconfig(device_t dev)
{
struct isa_device *idev = DEVTOISA(dev);
struct isa_config config;
u_long start, count;
rman_res_t start, count;
int rid;
bzero(&config, sizeof(config));

View File

@ -91,7 +91,7 @@ static int gusc_attach(device_t dev);
static int gusisa_probe(device_t dev);
static void gusc_intr(void *);
static struct resource *gusc_alloc_resource(device_t bus, 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);
static int gusc_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
@ -350,7 +350,7 @@ gusc_intr(void *arg)
static struct resource *
gusc_alloc_resource(device_t bus, 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)
{
sc_p scp;
int *alloced, rid_max, alloced_max;

View File

@ -80,7 +80,7 @@ static int sbc_attach(device_t dev);
static void sbc_intr(void *p);
static struct resource *sbc_alloc_resource(device_t bus, 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);
static int sbc_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int sbc_setup_intr(device_t dev, device_t child, struct resource *irq,
@ -573,7 +573,7 @@ sbc_teardown_intr(device_t dev, device_t child, struct resource *irq,
static struct resource *
sbc_alloc_resource(device_t bus, 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 sbc_softc *scp;
int *alloced, rid_max, alloced_max;

View File

@ -81,7 +81,8 @@ typedef struct csa_softc *sc_p;
static int csa_probe(device_t dev);
static int csa_attach(device_t dev);
static struct resource *csa_alloc_resource(device_t bus, 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);
static int csa_release_resource(device_t bus, device_t child, int type, int rid,
struct resource *r);
static int csa_setup_intr(device_t bus, device_t child,
@ -396,7 +397,7 @@ csa_resume(device_t dev)
static struct resource *
csa_alloc_resource(device_t bus, 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)
{
sc_p scp;
csa_res *resp;

View File

@ -716,7 +716,8 @@ fm801_pci_probe( device_t dev )
static struct resource *
fm801_alloc_resource(device_t bus, 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 fm801_info *fm801;

View File

@ -721,9 +721,10 @@ sv_probe(device_t dev)
static int
sv_attach(device_t dev) {
struct sc_info *sc;
rman_res_t count, midi_start, games_start;
u_int32_t data;
char status[SND_STATUSLEN];
u_long midi_start, games_start, count, sdmaa, sdmac, ml, mu;
u_long sdmaa, sdmac, ml, mu;
sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK | M_ZERO);
sc->dev = dev;

View File

@ -65,7 +65,7 @@ int
stg_alloc_resource(device_t dev)
{
struct stg_softc * sc = device_get_softc(dev);
u_long maddr, msize;
rman_res_t maddr, msize;
int error;
mtx_init(&sc->sc_sclow.sl_lock, "stg", NULL, MTX_DEF);

View File

@ -388,7 +388,7 @@ wlprobe(device_t device)
struct wl_softc *sc;
char *str = "wl%d: board out of range [0..%d]\n";
u_char inbuf[100];
unsigned long junk, sirq;
rman_res_t junk, sirq;
int error, irq;
error = ISA_PNP_PROBE(device_get_parent(device), device, wl_ids);

View File

@ -928,7 +928,7 @@ isa_driver_added(device_t dev, driver_t *driver)
static int
isa_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct isa_device* idev = DEVTOISA(child);
struct resource_list *rl = &idev->id_resources;

View File

@ -69,7 +69,8 @@ struct isa_device {
*/
extern void isa_init(device_t dev);
extern struct resource *isa_alloc_resource(device_t bus, 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);
extern int isa_release_resource(device_t bus, device_t child,
int type, int rid, struct resource *r);

View File

@ -44,8 +44,8 @@ INTERFACE bus;
CODE {
static struct resource *
null_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)
{
return (0);
}
@ -264,9 +264,9 @@ METHOD struct resource * alloc_resource {
device_t _child;
int _type;
int *_rid;
u_long _start;
u_long _end;
u_long _count;
rman_res_t _start;
rman_res_t _end;
rman_res_t _count;
u_int _flags;
} DEFAULT null_alloc_resource;
@ -332,8 +332,8 @@ METHOD int adjust_resource {
device_t _child;
int _type;
struct resource *_res;
u_long _start;
u_long _end;
rman_res_t _start;
rman_res_t _end;
};
/**
@ -433,8 +433,8 @@ METHOD int set_resource {
device_t _child;
int _type;
int _rid;
u_long _start;
u_long _count;
rman_res_t _start;
rman_res_t _count;
};
/**
@ -457,8 +457,8 @@ METHOD int get_resource {
device_t _child;
int _type;
int _rid;
u_long *_startp;
u_long *_countp;
rman_res_t *_startp;
rman_res_t *_countp;
};
/**

View File

@ -3063,8 +3063,8 @@ resource_list_free(struct resource_list *rl)
* @param count XXX end-start+1
*/
int
resource_list_add_next(struct resource_list *rl, int type, u_long start,
u_long end, u_long count)
resource_list_add_next(struct resource_list *rl, int type, rman_res_t start,
rman_res_t end, rman_res_t count)
{
int rid;
@ -3092,7 +3092,7 @@ resource_list_add_next(struct resource_list *rl, int type, u_long start,
*/
struct resource_list_entry *
resource_list_add(struct resource_list *rl, int type, int rid,
u_long start, u_long end, u_long count)
rman_res_t start, rman_res_t end, rman_res_t count)
{
struct resource_list_entry *rle;
@ -3250,7 +3250,7 @@ resource_list_delete(struct resource_list *rl, int type, int rid)
*/
struct resource *
resource_list_reserve(struct resource_list *rl, device_t bus, 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)
{
struct resource_list_entry *rle = NULL;
int passthrough = (device_get_parent(child) != bus);
@ -3307,7 +3307,7 @@ resource_list_reserve(struct resource_list *rl, device_t bus, device_t child,
*/
struct resource *
resource_list_alloc(struct resource_list *rl, device_t bus, 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)
{
struct resource_list_entry *rle = NULL;
int passthrough = (device_get_parent(child) != bus);
@ -3949,7 +3949,7 @@ bus_generic_teardown_intr(device_t dev, device_t child, struct resource *irq,
*/
int
bus_generic_adjust_resource(device_t dev, 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)
{
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
@ -3966,7 +3966,7 @@ bus_generic_adjust_resource(device_t dev, device_t child, int type,
*/
struct resource *
bus_generic_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)
{
/* Propagate up the bus hierarchy until someone handles it. */
if (dev->parent)
@ -4104,7 +4104,7 @@ bus_generic_get_dma_tag(device_t dev, device_t child)
*/
int
bus_generic_rl_get_resource(device_t dev, device_t child, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
struct resource_list * rl = NULL;
struct resource_list_entry * rle = NULL;
@ -4135,7 +4135,7 @@ bus_generic_rl_get_resource(device_t dev, device_t child, int type, int rid,
*/
int
bus_generic_rl_set_resource(device_t dev, device_t child, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
struct resource_list * rl = NULL;
@ -4203,7 +4203,7 @@ bus_generic_rl_release_resource(device_t dev, device_t child, int type,
*/
struct resource *
bus_generic_rl_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 *rid, rman_res_t start, rman_res_t end, rman_res_t count, u_int flags)
{
struct resource_list * rl = NULL;
@ -4289,8 +4289,8 @@ bus_release_resources(device_t dev, const struct resource_spec *rs,
* parent of @p dev.
*/
struct resource *
bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end,
u_long count, u_int flags)
bus_alloc_resource(device_t dev, int type, int *rid, rman_res_t start, rman_res_t end,
rman_res_t count, u_int flags)
{
if (dev->parent == NULL)
return (NULL);
@ -4305,8 +4305,8 @@ bus_alloc_resource(device_t dev, int type, int *rid, u_long start, u_long end,
* parent of @p dev.
*/
int
bus_adjust_resource(device_t dev, int type, struct resource *r, u_long start,
u_long end)
bus_adjust_resource(device_t dev, int type, struct resource *r, rman_res_t start,
rman_res_t end)
{
if (dev->parent == NULL)
return (EINVAL);
@ -4436,7 +4436,7 @@ bus_describe_intr(device_t dev, struct resource *irq, void *cookie,
*/
int
bus_set_resource(device_t dev, int type, int rid,
u_long start, u_long count)
rman_res_t start, rman_res_t count)
{
return (BUS_SET_RESOURCE(device_get_parent(dev), dev, type, rid,
start, count));
@ -4450,7 +4450,7 @@ bus_set_resource(device_t dev, int type, int rid,
*/
int
bus_get_resource(device_t dev, int type, int rid,
u_long *startp, u_long *countp)
rman_res_t *startp, rman_res_t *countp)
{
return (BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid,
startp, countp));
@ -4462,10 +4462,11 @@ bus_get_resource(device_t dev, int type, int rid,
* This function simply calls the BUS_GET_RESOURCE() method of the
* parent of @p dev and returns the start value.
*/
u_long
rman_res_t
bus_get_resource_start(device_t dev, int type, int rid)
{
u_long start, count;
rman_res_t start;
rman_res_t count;
int error;
error = BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid,
@ -4481,10 +4482,11 @@ bus_get_resource_start(device_t dev, int type, int rid)
* This function simply calls the BUS_GET_RESOURCE() method of the
* parent of @p dev and returns the count value.
*/
u_long
rman_res_t
bus_get_resource_count(device_t dev, int type, int rid)
{
u_long start, count;
rman_res_t start;
rman_res_t count;
int error;
error = BUS_GET_RESOURCE(device_get_parent(dev), dev, type, rid,

Some files were not shown because too many files have changed in this diff Show More