Deleted Added
full compact
rman.h (88372) rman.h (107296)
1/*
2 * Copyright 1998 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

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

21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Copyright 1998 Massachusetts Institute of Technology
3 *
4 * Permission to use, copy, modify, and distribute this software and
5 * its documentation for any purpose and without fee is hereby
6 * granted, provided that both the above copyright notice and this
7 * permission notice appear in all copies, that both the above
8 * copyright notice and this permission notice appear in all

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

21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
26 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/sys/rman.h 88372 2001-12-21 21:40:55Z tmm $
29 * $FreeBSD: head/sys/sys/rman.h 107296 2002-11-27 03:55:22Z imp $
30 */
31
32#ifndef _SYS_RMAN_H_
33#define _SYS_RMAN_H_ 1
34
35#ifndef _KERNEL
36#include <sys/queue.h>
37#endif

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

98 u_long r_start; /* index of the first entry in this resource */
99 u_long r_end; /* index of the last entry (inclusive) */
100 u_int r_flags;
101 void *r_virtual; /* virtual address of this resource */
102 bus_space_tag_t r_bustag; /* bus_space tag */
103 bus_space_handle_t r_bushandle; /* bus_space handle */
104 struct device *r_dev; /* device which has allocated this resource */
105 struct rman *r_rm; /* resource manager from whence this came */
30 */
31
32#ifndef _SYS_RMAN_H_
33#define _SYS_RMAN_H_ 1
34
35#ifndef _KERNEL
36#include <sys/queue.h>
37#endif

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

98 u_long r_start; /* index of the first entry in this resource */
99 u_long r_end; /* index of the last entry (inclusive) */
100 u_int r_flags;
101 void *r_virtual; /* virtual address of this resource */
102 bus_space_tag_t r_bustag; /* bus_space tag */
103 bus_space_handle_t r_bushandle; /* bus_space handle */
104 struct device *r_dev; /* device which has allocated this resource */
105 struct rman *r_rm; /* resource manager from whence this came */
106 int r_rid; /* optional rid for this resource. */
106};
107
108struct rman {
109 struct resource_head rm_list;
110 struct mtx *rm_mtx; /* mutex used to protect rm_list */
111 TAILQ_ENTRY(rman) rm_link; /* link in list of all rmans */
112 u_long rm_start; /* index of globally first entry */
113 u_long rm_end; /* index of globally last entry */

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

126struct resource *rman_reserve_resource(struct rman *rm, u_long start,
127 u_long end, u_long count,
128 u_int flags, struct device *dev);
129struct resource *rman_reserve_resource_bound(struct rman *rm, u_long start,
130 u_long end, u_long count, u_long bound,
131 u_int flags, struct device *dev);
132uint32_t rman_make_alignment_flags(uint32_t size);
133
107};
108
109struct rman {
110 struct resource_head rm_list;
111 struct mtx *rm_mtx; /* mutex used to protect rm_list */
112 TAILQ_ENTRY(rman) rm_link; /* link in list of all rmans */
113 u_long rm_start; /* index of globally first entry */
114 u_long rm_end; /* index of globally last entry */

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

127struct resource *rman_reserve_resource(struct rman *rm, u_long start,
128 u_long end, u_long count,
129 u_int flags, struct device *dev);
130struct resource *rman_reserve_resource_bound(struct rman *rm, u_long start,
131 u_long end, u_long count, u_long bound,
132 u_int flags, struct device *dev);
133uint32_t rman_make_alignment_flags(uint32_t size);
134
134#define rman_get_start(r) ((r)->r_start)
135#define rman_get_end(r) ((r)->r_end)
136#define rman_get_size(r) (((r)->r_end - (r)->r_start) + 1)
137#define rman_get_flags(r) ((r)->r_flags)
138#define rman_set_virtual(r,v) ((r)->r_virtual = (v))
139#define rman_get_virtual(r) ((r)->r_virtual)
140#define rman_set_bustag(r,t) ((r)->r_bustag = (t))
141#define rman_get_bustag(r) ((r)->r_bustag)
142#define rman_set_bushandle(r,h) ((r)->r_bushandle = (h))
143#define rman_get_bushandle(r) ((r)->r_bushandle)
135u_long rman_get_start(struct resource *_r);
136u_long rman_get_end(struct resource *_r);
137u_long rman_get_size(struct resource *_r);
138u_int rman_get_flags(struct resource *_r);
139void rman_set_virtual(struct resource *_r, void *_v);
140void *rman_get_virtual(struct resource *_r);
141void rman_set_bustag(struct resource *_r, bus_space_tag_t _t);
142bus_space_tag_t rman_get_bustag(struct resource *_r);
143void rman_set_bushandle(struct resource *_r, bus_space_handle_t _h);
144bus_space_handle_t rman_get_bushandle(struct resource *_r);
145void rman_set_rid(struct resource *_r, int _rid);
146int rman_get_rid(struct resource *_r);
144
145extern struct rman_head rman_head;
146#endif /* _KERNEL */
147
148#endif /* !_SYS_RMAN_H_ */
147
148extern struct rman_head rman_head;
149#endif /* _KERNEL */
150
151#endif /* !_SYS_RMAN_H_ */