Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/uebayasi-xip]: src/sys/arch/mips xmd(4) glue for mips. Not tested.
details: https://anonhg.NetBSD.org/src/rev/14abe3412139
branches: uebayasi-xip
changeset: 751797:14abe3412139
user: uebayasi <uebayasi%NetBSD.org@localhost>
date: Sat Aug 28 18:24:07 2010 +0000
description:
xmd(4) glue for mips. Not tested.
diffstat:
sys/arch/mips/conf/files.mips | 4 +-
sys/arch/mips/mips/xmd_machdep.c | 68 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 1 deletions(-)
diffs (90 lines):
diff -r 4fed529a3a13 -r 14abe3412139 sys/arch/mips/conf/files.mips
--- a/sys/arch/mips/conf/files.mips Sat Aug 28 16:27:02 2010 +0000
+++ b/sys/arch/mips/conf/files.mips Sat Aug 28 18:24:07 2010 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.mips,v 1.64 2009/12/14 00:46:04 matt Exp $
+# $NetBSD: files.mips,v 1.64.2.1 2010/08/28 18:24:07 uebayasi Exp $
#
defflag opt_cputype.h NOFPU
@@ -67,6 +67,8 @@
file arch/mips/mips/procfs_machdep.c procfs
+file arch/mips/mips/xmd_machdep.c xmd
+
# Binary compatibility with 32bit NetBSD (COMPAT_NETBSD32)
file arch/mips/mips/netbsd32_machdep.c compat_netbsd32
include "compat/netbsd32/files.netbsd32"
diff -r 4fed529a3a13 -r 14abe3412139 sys/arch/mips/mips/xmd_machdep.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/mips/mips/xmd_machdep.c Sat Aug 28 18:24:07 2010 +0000
@@ -0,0 +1,68 @@
+/* $NetBSD: xmd_machdep.c,v 1.1.2.1 2010/08/28 18:24:07 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/28 18:24:07 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 mips_btop(vtophys(addr + off));
+}
+
+void *
+xmd_machdep_physload(vaddr_t addr, size_t size)
+{
+ paddr_t start, end;
+
+ start = mips_btop(vtophys(addr));
+ end = mips_btop(vtophys(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);
+}
Home |
Main Index |
Thread Index |
Old Index