summaryrefslogtreecommitdiffstats
path: root/sys/sys/rman.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2000-10-17 22:08:03 +0000
committerimp <imp@FreeBSD.org>2000-10-17 22:08:03 +0000
commitecefde96a3ee9cdedcd6cd4f2290cf120b066bdd (patch)
treed40fca688ce64d2a69dd337c2251632ca4d77764 /sys/sys/rman.h
parentd549a1165677897bf761ddba2761ed64d3a2989f (diff)
downloadFreeBSD-src-ecefde96a3ee9cdedcd6cd4f2290cf120b066bdd.zip
FreeBSD-src-ecefde96a3ee9cdedcd6cd4f2290cf120b066bdd.tar.gz
Implement resource alignment as discussed in arch@ a long time ago.
This was implemented by Shigeru YAMAMOTO-san and Jonathan Chen. I've cleaned them up somewhat and they seem to work well enough to boot current (but given current's state it can be hard to tell). Doug Rabson also reviewed the design and signed off on it.
Diffstat (limited to 'sys/sys/rman.h')
-rw-r--r--sys/sys/rman.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/sys/rman.h b/sys/sys/rman.h
index 0e59f75..6561554 100644
--- a/sys/sys/rman.h
+++ b/sys/sys/rman.h
@@ -64,6 +64,12 @@ struct resource {
#define RF_WANTED 0x0010 /* somebody is waiting for this resource */
#define RF_FIRSTSHARE 0x0020 /* first in sharing list */
+#define RF_ALIGNMENT_SHIFT 10 /* alignment size bit starts bit 10 */
+#define RF_ALIGNMENT_MASK (0x003F << RF_ALIGNMENT_SHIFT)
+ /* resource address alignemnt size bit mask */
+#define RF_ALIGNMENT_LOG2(x) ((x) << RF_ALIGNMENT_SHIFT)
+#define RF_ALIGNMENT(x) (((x) & RF_ALIGNMENT_MASK) >> RF_ALIGNMENT_SHIFT)
+
enum rman_type { RMAN_UNINIT = 0, RMAN_GAUGE, RMAN_ARRAY };
struct rman {
@@ -89,6 +95,7 @@ int rman_release_resource(struct resource *r);
struct resource *rman_reserve_resource(struct rman *rm, u_long start,
u_long end, u_long count,
u_int flags, struct device *dev);
+uint32_t rman_make_alignment_flags(uint32_t size);
#define rman_get_start(r) ((r)->r_start)
#define rman_get_end(r) ((r)->r_end)
OpenPOWER on IntegriCloud