2# Copyright (c) 1998-2004 Doug Rabson
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
8# 1. Redistributions of source code must retain the above copyright
9# notice, this list of conditions and the following disclaimer.
10# 2. Redistributions in binary form must reproduce the above copyright
11# notice, this list of conditions and the following disclaimer in the
12# documentation and/or other materials provided with the distribution.
14# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
42# Default implementations of some methods.
45 static struct resource *
47 int type,
int *rid, rman_res_t
start, rman_res_t end,
58 return (BUS_REMAP_INTR(dev, NULL, irq));
67 panic(
"bus_add_child is not implemented");
362 struct resource_map *
_map;
447 struct resource *
_res;
500 struct resource *
_irq;
520 struct resource *
_irq;
539 struct resource *
_irq;
701 struct resource *
_irq;
735 struct resource *
_irq;
device_property_type_t type
DEFAULT bus_generic_print_child
DEFAULT bus_generic_config_intr
METHOD int child_pnpinfo
Returns the pnp info for this device.
driver_filter_t * _filter
METHOD int map_resource
Map a resource.
METHOD int describe_intr
Allow drivers to associate a description with an active interrupt handler.
METHOD int release_resource
Release a resource.
METHOD int get_cpus
Request a set of CPUs.
DEFAULT null_alloc_resource
METHOD int write_ivar
Write the value of a bus-specific attribute of a device.
METHOD int reset_post
Restores the child operations after the reset.
DEFAULT bus_generic_get_domain
METHOD void child_detached
Notify a bus that a child was detached.
METHOD struct resource_list * get_resource_list
Return a struct resource_list.
METHOD void new_pass
Notify a bus that the bus pass level has been changed.
DEFAULT bus_generic_bind_intr
METHOD int get_resource
Describe a resource.
METHOD bus_space_tag_t get_bus_tag
Returns bus_space_tag_t for use w/ devices on the bus.
METHOD int resume_intr
Resume an interrupt handler.
DEFAULT bus_generic_new_pass
DEFAULT bus_generic_resume_intr
DEFAULT null_reset_prepare
DEFAULT bus_generic_describe_intr
METHOD int activate_resource
Activate a resource.
DEFAULT bus_generic_map_resource
METHOD int child_present
Is the hardware described by _child still attached to the system?
METHOD int print_child
Print a description of a child device.
DEFAULT bus_generic_get_bus_tag
METHOD int reset_child
Performs reset of the child.
METHOD int setup_intr
Install an interrupt handler.
DEFAULT bus_generic_driver_added
METHOD void hinted_child
Notify a (bus) driver about a child that the hints mechanism believes it has discovered.
DEFAULT bus_generic_get_dma_tag
DEFAULT bus_generic_child_pnpinfo
METHOD int child_location
Returns the location for this device.
METHOD int translate_resource
translate a resource value
METHOD int rescan
Rescan the bus.
METHOD void probe_nomatch
Print a notification about an unprobed child device.
METHOD int unmap_resource
Unmap a resource.
METHOD int bind_intr
Allow drivers to request that an interrupt be bound to a specific CPU.
METHOD bus_dma_tag_t get_dma_tag
Returns bus_dma_tag_t for use w/ devices on the bus.
METHOD int read_ivar
Read the value of a bus-specific attribute of a device.
METHOD int deactivate_resource
Deactivate a resource.
DEFAULT bus_generic_child_location
METHOD struct resource * alloc_resource
Allocate a system resource.
struct resource_map_request * _args
DEFAULT bus_generic_get_device_path
METHOD int adjust_resource
Adjust a resource.
METHOD int suspend_intr
Suspend an interrupt handler.
struct resource_map * _map
METHOD int resume_child
Resume a given child.
METHOD void hint_device_unit
Allow the bus to determine the unit number of a device.
DEFAULT bus_generic_get_property
DEFAULT bus_generic_get_resource_list
DEFAULT bus_generic_get_cpus
METHOD void driver_added
Notify a bus that a new driver was added.
METHOD void child_deleted
Notify a bus that a child was deleted.
METHOD int suspend_child
Suspend a given child.
METHOD int reset_prepare
Prepares the given child of the bus for reset.
DEFAULT bus_generic_resume_child
METHOD int get_device_path
Gets a child's full path to the device.
DEFAULT bus_generic_suspend_intr
DEFAULT bus_generic_child_present
METHOD ssize_t get_property
Gets child's specific property.
DEFAULT bus_generic_unmap_resource
METHOD int teardown_intr
Uninstall an interrupt handler.
METHOD int remap_intr
Notify a bus that specified child's IRQ should be remapped.
METHOD device_t add_child
Create a new child device.
DEFAULT bus_generic_translate_resource
METHOD int config_intr
Allow (bus) drivers to specify the trigger mode and polarity of the specified interrupt.
DEFAULT bus_generic_suspend_child
METHOD int get_domain
Get the VM domain handle for the given bus and child.
METHOD int set_resource
Define a resource which can be allocated with BUS_ALLOC_RESOURCE().
METHOD void delete_resource
Delete a resource.
void panic(const char *fmt,...)
#define DEFAULT(foo, bar)