Module Name:    src
Committed By:   uebayasi
Date:           Fri Aug 20 07:04:38 UTC 2010

Modified Files:
        src/sys/arch/i386/conf [uebayasi-xip]: majors.i386
        src/sys/arch/x86/conf [uebayasi-xip]: files.x86
Added Files:
        src/sys/arch/i386/conf [uebayasi-xip]: XIP
        src/sys/arch/x86/x86 [uebayasi-xip]: xmd_machdep.c

Log Message:
xmd(4) glue for i386.  XIP mount panics now.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/i386/conf/XIP
cvs rdiff -u -r1.37.6.1 -r1.37.6.2 src/sys/arch/i386/conf/majors.i386
cvs rdiff -u -r1.54.2.1 -r1.54.2.2 src/sys/arch/x86/conf/files.x86
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/x86/x86/xmd_machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/i386/conf/majors.i386
diff -u src/sys/arch/i386/conf/majors.i386:1.37.6.1 src/sys/arch/i386/conf/majors.i386:1.37.6.2
--- src/sys/arch/i386/conf/majors.i386:1.37.6.1	Tue Aug 17 06:44:35 2010
+++ src/sys/arch/i386/conf/majors.i386	Fri Aug 20 07:04:38 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.i386,v 1.37.6.1 2010/08/17 06:44:35 uebayasi Exp $
+#	$NetBSD: majors.i386,v 1.37.6.2 2010/08/20 07:04:38 uebayasi Exp $
 #
 # Device majors for i386
 #
@@ -104,6 +104,7 @@
 device-major	rd		char 105 block 22	rd
 device-major	ct		char 106 block 23	ct
 device-major	mt		char 107 block 24	mt
+device-major	xmd		char 108 block 25	xmd
 
 #
 # Device majors for Xen. These are assigned here so that:

Index: src/sys/arch/x86/conf/files.x86
diff -u src/sys/arch/x86/conf/files.x86:1.54.2.1 src/sys/arch/x86/conf/files.x86:1.54.2.2
--- src/sys/arch/x86/conf/files.x86:1.54.2.1	Tue Aug 17 06:45:30 2010
+++ src/sys/arch/x86/conf/files.x86	Fri Aug 20 07:04:37 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.x86,v 1.54.2.1 2010/08/17 06:45:30 uebayasi Exp $
+#	$NetBSD: files.x86,v 1.54.2.2 2010/08/20 07:04:37 uebayasi Exp $
 
 # options for MP configuration through the MP spec
 defflag opt_mpbios.h MPBIOS MPVERBOSE MPDEBUG MPBIOS_SCANPCI
@@ -121,6 +121,8 @@
 
 file	arch/x86/x86/tprof_pmi.c	tprof	needs-flag
 
+file	arch/x86/x86/xmd_machdep.c	xmd
+
 file	arch/x86/pci/pci_machdep.c	pci
 file	arch/x86/pci/pci_intr_machdep.c	pci
 

Added files:

Index: src/sys/arch/i386/conf/XIP
diff -u /dev/null src/sys/arch/i386/conf/XIP:1.1.2.1
--- /dev/null	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/i386/conf/XIP	Fri Aug 20 07:04:38 2010
@@ -0,0 +1,9 @@
+#	$NetBSD: XIP,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $
+
+include "arch/i386/conf/GENERIC"
+
+file-system 	FFS		# UFS
+options 	XIP
+
+pseudo-device	xmd		1	# XIP memory disk device (ramdisk)
+options 	XMD_ROOT_SIZE=10240	# 5MB

Index: src/sys/arch/x86/x86/xmd_machdep.c
diff -u /dev/null src/sys/arch/x86/x86/xmd_machdep.c:1.1.2.1
--- /dev/null	Fri Aug 20 07:04:38 2010
+++ src/sys/arch/x86/x86/xmd_machdep.c	Fri Aug 20 07:04:38 2010
@@ -0,0 +1,68 @@
+/*	$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $	*/
+
+/*-
+ * Copyright (c) 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * 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.
+ *
+ * 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/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/20 07:04:38 uebayasi Exp $");
+
+#include "opt_xip.h"
+
+#ifndef XIP
+#error xmd(4) needs options XIP
+#endif
+
+#include <sys/param.h>
+#include <sys/mman.h>
+
+#include <uvm/uvm_page.h>
+
+#include <dev/xmdvar.h>
+
+paddr_t
+xmd_machdep_mmap(vaddr_t addr, off_t off, int prot)
+{
+
+	return x86_btop(addr + off);
+}
+
+void *
+xmd_machdep_physload(vaddr_t addr, size_t size)
+{
+	paddr_t start, end;
+
+	start = x86_btop(addr);
+	end = x86_btop(addr + size);
+
+	return uvm_page_physload_device(start, end, start, end, PROT_READ, 0);
+}
+
+void
+xmd_machdep_physunload(void *phys)
+{
+
+	uvm_page_physunload_device(phys);
+}

Reply via email to