Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/hpcsh use MI md_root.c



details:   https://anonhg.NetBSD.org/src/rev/b969a2bae84c
branches:  trunk
changeset: 512004:b969a2bae84c
user:      uch <uch%NetBSD.org@localhost>
date:      Mon Jul 02 17:19:09 2001 +0000

description:
use MI md_root.c

diffstat:

 sys/arch/hpcsh/conf/files.hpcsh |    4 +-
 sys/arch/hpcsh/hpcsh/machdep.c  |   10 +-
 sys/arch/hpcsh/hpcsh/md_root.c  |  105 ----------------------------------------
 3 files changed, 7 insertions(+), 112 deletions(-)

diffs (172 lines):

diff -r 6507707de150 -r b969a2bae84c sys/arch/hpcsh/conf/files.hpcsh
--- a/sys/arch/hpcsh/conf/files.hpcsh   Mon Jul 02 17:17:23 2001 +0000
+++ b/sys/arch/hpcsh/conf/files.hpcsh   Mon Jul 02 17:19:09 2001 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.hpcsh,v 1.13 2001/06/28 17:03:47 uch Exp $
+#      $NetBSD: files.hpcsh,v 1.14 2001/07/02 17:19:09 uch Exp $
 #
 maxpartitions 8
 
@@ -39,7 +39,7 @@
 major  {wd = 1}
 
 # Memory Disk for install floppy
-file arch/hpcsh/hpcsh/md_root.c                        memory_disk_hooks
+file dev/md_root.c                             memory_disk_hooks
 major  {md = 6}
 
 #
diff -r 6507707de150 -r b969a2bae84c sys/arch/hpcsh/hpcsh/machdep.c
--- a/sys/arch/hpcsh/hpcsh/machdep.c    Mon Jul 02 17:17:23 2001 +0000
+++ b/sys/arch/hpcsh/hpcsh/machdep.c    Mon Jul 02 17:19:09 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.9 2001/04/23 11:22:19 uch Exp $  */
+/*     $NetBSD: machdep.c,v 1.10 2001/07/02 17:19:09 uch Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -33,6 +33,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #undef LOAD_ALL_MEMORY
+
+#include "opt_md.h"
 #include "opt_ddb.h"
 #include "opt_syscall_debug.h"
 #include "fs_mfs.h"
@@ -64,6 +66,7 @@
 #endif
 
 #include <dev/cons.h> /* consdev */
+#include <dev/md.h>
 
 #include <machine/bootinfo.h>
 #include <machine/platid.h>
@@ -104,9 +107,6 @@
 extern int nfs_mountroot(void);
 extern int (*mountroot)(void);
 #endif
-#ifdef MEMORY_DISK_DYNAMIC
-void md_root_setconf(caddr_t, size_t);
-#endif
 
 extern char edata[], end[];
 /* curpcb is defined in locore.s */
@@ -237,7 +237,7 @@
        if (boothowto & RB_MINIROOT) {
                size_t fssz;
                fssz = round_page(mfs_initminiroot((void *)kernend));
-#ifdef MEMORY_DISK_DYNAMIC
+#if MEMORY_DISK_DYNAMIC
                md_root_setconf((caddr_t)kernend, fssz);
 #endif
                kernend += fssz;
diff -r 6507707de150 -r b969a2bae84c sys/arch/hpcsh/hpcsh/md_root.c
--- a/sys/arch/hpcsh/hpcsh/md_root.c    Mon Jul 02 17:17:23 2001 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*     $NetBSD: md_root.c,v 1.2 2001/02/07 15:29:22 uch Exp $  */
-
-/*-
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Gordon W. Ross.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/reboot.h>
-
-#include <dev/md.h>
-
-#include "opt_mdsize.h"
-
-extern int boothowto;
-
-#ifdef MEMORY_DISK_DYNAMIC
-size_t md_root_size;
-caddr_t md_root_image;
-#else /* MEMORY_DISK_DYNAMIC */
-#ifndef MINIROOTSIZE
-#define MINIROOTSIZE 512
-#endif
-#define ROOTBYTES (MINIROOTSIZE << DEV_BSHIFT)
-u_int32_t md_root_size = ROOTBYTES;
-/*
- * This array will be patched to contain a file-system image.
- * See the program mdsetimage(8) for details.
- */
-char md_root_image[ROOTBYTES] = "|This is the root ramdisk!\n";
-#endif /* MEMORY_DISK_DYNAMIC */
-
-#ifdef MEMORY_DISK_DYNAMIC
-void md_root_setconf(caddr_t, size_t);
-
-void
-md_root_setconf(caddr_t addr, size_t size)
-{
-       md_root_image = addr;
-       md_root_size = size;
-}
-#endif /* MEMORY_DISK_DYNAMIC */
-
-/*
- * This is called during pseudo-device attachment.
- */
-void
-md_attach_hook(int unit, struct md_conf *md)
-{
-       char pbuf[9];
-
-       if (unit == 0) {
-               /* Setup root ramdisk */
-               md->md_addr = (caddr_t)md_root_image;
-               md->md_size = (size_t)md_root_size;
-               md->md_type = MD_KMEM_FIXED;
-               format_bytes(pbuf, sizeof(pbuf), md->md_size);
-               printf("md%d: internal %s image area\n", unit, pbuf);
-       }
-}
-
-/*
- * This is called during open (i.e. mountroot)
- */
-void
-md_open_hook(int unit, struct md_conf *md)
-{
-
-       if (unit == 0) {
-               /* The root ramdisk only works single-user. */
-               boothowto |= RB_SINGLE;
-       }
-}



Home | Main Index | Thread Index | Old Index