aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/md
diff options
context:
space:
mode:
authorBreno Leitao <leitao@FreeBSD.org>2018-06-07 13:57:34 +0000
committerBreno Leitao <leitao@FreeBSD.org>2018-06-07 13:57:34 +0000
commit7b2c7b92befda002f51e7cc4d02bd0853be88d9e (patch)
tree952a809ef6ae3938b74c2d0dd02dc0683a3aad7e /sys/dev/md
parent16e05b3275550e5af61007a4b0205eaef4e6781e (diff)
Notes
Diffstat (limited to 'sys/dev/md')
-rw-r--r--sys/dev/md/md.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index be661b2703c7..2209c6680be5 100644
--- a/sys/dev/md/md.c
+++ b/sys/dev/md/md.c
@@ -180,6 +180,10 @@ SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, &md_malloc_wait, 0,
*/
u_char mfs_root[MD_ROOT_SIZE*1024] __attribute__ ((section ("oldmfs")));
const int mfs_root_size = sizeof(mfs_root);
+#elif defined(MD_ROOT_MEM)
+/* MD region already mapped in the memory */
+u_char *mfs_root;
+int mfs_root_size;
#else
extern volatile u_char __weak_symbol mfs_root;
extern volatile u_char __weak_symbol mfs_root_end;
@@ -2074,8 +2078,12 @@ g_md_init(struct g_class *mp __unused)
#ifdef MD_ROOT
if (mfs_root_size != 0) {
sx_xlock(&md_sx);
+#ifdef MD_ROOT_MEM
+ md_preloaded(mfs_root, mfs_root_size, NULL);
+#else
md_preloaded(__DEVOLATILE(u_char *, &mfs_root), mfs_root_size,
NULL);
+#endif
sx_xunlock(&md_sx);
}
#endif