aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/bus_if.m
diff options
context:
space:
mode:
authorDoug Rabson <dfr@FreeBSD.org>1999-05-10 17:06:14 +0000
committerDoug Rabson <dfr@FreeBSD.org>1999-05-10 17:06:14 +0000
commit8b2970bbe602d9d5d3d044789658114080d4da76 (patch)
tree14ead61bf98c8cad8f893577c140df6570421a8f /sys/kern/bus_if.m
parent276794a4a47e8251b07d7b1c7132dc75a9b428eb (diff)
downloadsrc-8b2970bbe602d9d5d3d044789658114080d4da76.tar.gz
src-8b2970bbe602d9d5d3d044789658114080d4da76.zip
* Augment the interface language to allow arbitrary C code to be 'passed
through' to the C compiler. * Allow the interface to specify a default implementation for methods. * Allow 'static' methods which are not device specific. * Add a simple scheme for probe routines to return a priority value. To make life simple, priority values are negative numbers (positive numbers are standard errno codes) with zero being the highest priority. The driver which returns the highest priority will be chosen for the device.
Notes
Notes: svn path=/head/; revision=46913
Diffstat (limited to 'sys/kern/bus_if.m')
-rw-r--r--sys/kern/bus_if.m18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/kern/bus_if.m b/sys/kern/bus_if.m
index d7c9cd4a8501..33383ff6c2bd 100644
--- a/sys/kern/bus_if.m
+++ b/sys/kern/bus_if.m
@@ -23,12 +23,26 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: bus_if.m,v 1.7 1999/04/16 21:22:37 peter Exp $
+# $Id: bus_if.m,v 1.8 1999/05/08 21:59:34 dfr Exp $
#
INTERFACE bus;
#
+# Default implementations of some methods.
+#
+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)
+ {
+ return 0;
+ }
+};
+
+#
# This is called from system code which prints out a description of a
# device. It should describe the attachment that the child has with
# the parent. For instance the TurboLaser bus prints which node the
@@ -112,7 +126,7 @@ METHOD struct resource * alloc_resource {
u_long end;
u_long count;
u_int flags;
-};
+} DEFAULT null_alloc_resource;
METHOD int activate_resource {
device_t dev;