aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuigi Rizzo <luigi@FreeBSD.org>2006-01-31 13:35:30 +0000
committerLuigi Rizzo <luigi@FreeBSD.org>2006-01-31 13:35:30 +0000
commitde64f22aa4eb8bac0b1986d33f67c01451ab5593 (patch)
tree679483a59a5e96bb8e64bd5360e002898aef3277
parentbdbca4ddae718d44dcdb8bda934a42fe680ac223 (diff)
Notes
-rw-r--r--sys/dev/md/md.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index bc961b870867..bc998274ae8d 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -101,9 +101,19 @@ static int md_debug;
SYSCTL_INT(_debug, OID_AUTO, mddebug, CTLFLAG_RW, &md_debug, 0, "");
#if defined(MD_ROOT) && defined(MD_ROOT_SIZE)
-/* Image gets put here: */
-static u_char mfs_root[MD_ROOT_SIZE*1024] = "MFS Filesystem goes here";
-static u_char end_mfs_root[] __unused = "MFS Filesystem had better STOP here";
+/*
+ * Preloaded image gets put here.
+ * Applications that patch the object with the image can determine
+ * the size looking at the start and end markers (strings),
+ * so we want them contiguous.
+ */
+static struct {
+ u_char start[MD_ROOT_SIZE*1024];
+ u_char end[128];
+} mfs_root = {
+ .start = "MFS Filesystem goes here",
+ .end = "MFS Filesystem had better STOP here",
+};
#endif
static g_init_t g_md_init;
@@ -1139,7 +1149,7 @@ g_md_init(struct g_class *mp __unused)
g_topology_unlock();
#ifdef MD_ROOT_SIZE
sx_xlock(&md_sx);
- md_preloaded(mfs_root, MD_ROOT_SIZE * 1024);
+ md_preloaded(mfs_root.start, sizeof(mfs_root.start));
sx_xunlock(&md_sx);
#endif
/* XXX: are preload_* static or do they need Giant ? */