Deleted Added
full compact
bus_if.m (41017) bus_if.m (41153)
1#
2# Copyright (c) 1998 Doug Rabson
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8# 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

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
24# SUCH DAMAGE.
25#
1#
2# Copyright (c) 1998 Doug Rabson
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8# 1. Redistributions of source code must retain the above copyright

--- 9 unchanged lines hidden (view full) ---

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
24# SUCH DAMAGE.
25#
26# $Id: bus_if.m,v 1.3 1998/09/16 08:25:56 dfr Exp $
26# $Id: bus_if.m,v 1.4 1998/11/08 18:51:38 nsouch Exp $
27#
28
29INTERFACE bus;
30
31#
32# This is called from system code which prints out a description of a
33# device. It should describe the attachment that the child has with
34# the parent. For instance the TurboLaser bus prints which node the

--- 17 unchanged lines hidden (view full) ---

52
53#
54# Read an instance variable. Return 0 on success.
55#
56METHOD int read_ivar {
57 device_t dev;
58 device_t child;
59 int index;
27#
28
29INTERFACE bus;
30
31#
32# This is called from system code which prints out a description of a
33# device. It should describe the attachment that the child has with
34# the parent. For instance the TurboLaser bus prints which node the

--- 17 unchanged lines hidden (view full) ---

52
53#
54# Read an instance variable. Return 0 on success.
55#
56METHOD int read_ivar {
57 device_t dev;
58 device_t child;
59 int index;
60 u_long *result;
60 uintptr_t *result;
61};
62
63#
64# Write an instance variable. Return 0 on success.
65#
66METHOD int write_ivar {
67 device_t dev;
68 device_t child;
69 int index;
61};
62
63#
64# Write an instance variable. Return 0 on success.
65#
66METHOD int write_ivar {
67 device_t dev;
68 device_t child;
69 int index;
70 u_long value;
70 uintptr_t value;
71};
72
73#
71};
72
73#
74# Create an interrupt handler for the child device. The handler will
75# be called with the value 'arg' as its only argument. This method
76# does not activate the handler.
74# Allocate a system resource attached to `dev' on behalf of `child'.
75# The types are defined in <machine/resource.h>; the meaning of the
76# resource-ID field varies from bus to bus (but *rid == 0 is always
77# valid if the resource type is). start and end reflect the allowable
78# range, and should be passed as `0UL' and `~0UL', respectively, if
79# the client has no range restriction. count is the number of consecutive
80# indices in the resource required. flags is a set of sharing flags
81# as defined in <sys/rman.h>.
77#
82#
78METHOD void* create_intr {
79 device_t dev;
80 device_t child;
81 int irq;
82 driver_intr_t *intr;
83 void *arg;
83# Returns a resource or a null pointer on failure. The caller is
84# responsible for calling rman_activate_resource() when it actually
85# uses the resource.
86#
87METHOD struct resource * alloc_resource {
88 device_t dev;
89 device_t child;
90 int type;
91 int *rid;
92 u_long start;
93 u_long end;
94 u_long count;
95 u_int flags;
84};
85
96};
97
98METHOD int activate_resource {
99 device_t dev;
100 device_t child;
101 int type;
102 int rid;
103 struct resource *r;
104};
105
106METHOD int deactivate_resource {
107 device_t dev;
108 device_t child;
109 int type;
110 int rid;
111 struct resource *r;
112};
113
86#
114#
87# Activate an interrupt handler previously created with
88# BUS_CREATE_INTR.
115# Free a resource allocated by the preceding method. The `rid' value
116# must be the same as the one returned by BUS_ALLOC_RESOURCE (which
117# is not necessarily the same as the one the client passed).
89#
118#
90METHOD int connect_intr {
91 device_t dev;
92 void *ih;
119METHOD int release_resource {
120 device_t dev;
121 device_t child;
122 int type;
123 int rid;
124 struct resource *res;
93};
125};
126
127METHOD int setup_intr {
128 device_t dev;
129 device_t child;
130 struct resource *irq;
131 driver_intr_t *intr;
132 void *arg;
133 void **cookiep;
134};
135
136METHOD int teardown_intr {
137 device_t dev;
138 device_t child;
139 struct resource *irq;
140 void *cookie;
141};