diff options
author | phk <phk@FreeBSD.org> | 2005-10-06 21:49:31 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-10-06 21:49:31 +0000 |
commit | 275062eb87e78dfa2892ce20beacf11c442dc88a (patch) | |
tree | 397608f562af0b29db07161ce58b3783696b4457 /sys/kern/subr_rman.c | |
parent | c7d62bfff4f98260e32ca63e0fe7353849ecf4ba (diff) | |
download | FreeBSD-src-275062eb87e78dfa2892ce20beacf11c442dc88a.zip FreeBSD-src-275062eb87e78dfa2892ce20beacf11c442dc88a.tar.gz |
Eliminate __RMAN_RESOURCE_VISIBLE hack entirely by moving the struct
resource_ to subr_rman.c where it belongs.
Diffstat (limited to 'sys/kern/subr_rman.c')
-rw-r--r-- | sys/kern/subr_rman.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 3083b0e..17d2abc 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -58,7 +58,6 @@ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); -#define __RMAN_RESOURCE_VISIBLE #include <sys/param.h> #include <sys/systm.h> #include <sys/kernel.h> @@ -70,6 +69,31 @@ __FBSDID("$FreeBSD$"); #include <sys/rman.h> #include <sys/sysctl.h> +/* + * We use a linked list rather than a bitmap because we need to be able to + * represent potentially huge objects (like all of a processor's physical + * address space). That is also why the indices are defined to have type + * `unsigned long' -- that being the largest integral type in ISO C (1990). + * The 1999 version of C allows `long long'; we may need to switch to that + * at some point in the future, particularly if we want to support 36-bit + * addresses on IA32 hardware. + */ +struct resource_i { + struct resource r_r; + TAILQ_ENTRY(resource_i) r_link; + LIST_ENTRY(resource_i) r_sharelink; + LIST_HEAD(, resource_i) *r_sharehead; + u_long r_start; /* index of the first entry in this resource */ + u_long r_end; /* index of the last entry (inclusive) */ + u_int r_flags; + void *r_virtual; /* virtual address of this resource */ + struct device *r_dev; /* device which has allocated this resource */ + struct rman *r_rm; /* resource manager from whence this came */ + void *r_spare1; /* Spare pointer 1 */ + void *r_spare2; /* Spare pointer 2 */ + int r_rid; /* optional rid for this resource. */ +}; + int rman_debug = 0; TUNABLE_INT("debug.rman_debug", &rman_debug); SYSCTL_INT(_debug, OID_AUTO, rman_debug, CTLFLAG_RW, |