Eliminate __RMAN_RESOURCE_VISIBLE hack entirely by moving the struct

resource_ to subr_rman.c where it belongs.
This commit is contained in:
phk 2005-10-06 21:49:31 +00:00
parent c7d62bfff4
commit 275062eb87
2 changed files with 27 additions and 29 deletions

View File

@ -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,

View File

@ -100,35 +100,9 @@ struct resource {
bus_space_handle_t r_bushandle; /* bus_space handle */
};
/*
* 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;
TAILQ_HEAD(resource_head, resource_i);
#ifdef __RMAN_RESOURCE_VISIBLE
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. */
};
#else
struct device;
#endif
struct rman {
struct resource_head rm_list;