Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpkern Rototill a bit, and attempt to dis...



details:   https://anonhg.NetBSD.org/src/rev/174bcf537706
branches:  trunk
changeset: 793422:174bcf537706
user:      pooka <pooka%NetBSD.org@localhost>
date:      Wed Feb 12 22:28:43 2014 +0000

description:
Rototill a bit, and attempt to disguise it as non-gratuitous.

Add arch/generic and move non-x86 files from rumpkern/ there.  Also,
move files from arch/i386 to arch/x86, and make both i386 and x86_64
use those.

This clarifies the situation with what is MD vs. MI code.

renames:
  rumpcpu_generic,kobj_stubs,pmap_stubs => arch/generic/rump_generic_$x
  arch/i386/* => arch/x86/rump_x86_$x

(for those who forget, x86 requires MD code because rump kernels
use the same ABI as kernel modules)

diffstat:

 sys/rump/librump/rumpkern/Makefile.rumpkern                |   16 +-
 sys/rump/librump/rumpkern/arch/alpha/Makefile.inc          |    7 +-
 sys/rump/librump/rumpkern/arch/arm/Makefile.inc            |    6 +-
 sys/rump/librump/rumpkern/arch/generic/Makefile.inc        |    4 +
 sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c  |   53 ++++++
 sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c |   49 +++++
 sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c |   92 ++++++++++
 sys/rump/librump/rumpkern/arch/i386/Makefile.inc           |    4 +-
 sys/rump/librump/rumpkern/arch/i386/cpu_counter.c          |   66 -------
 sys/rump/librump/rumpkern/arch/i386/pmap_x86.c             |  110 -------------
 sys/rump/librump/rumpkern/arch/i386/rumpcpu.c              |   81 ---------
 sys/rump/librump/rumpkern/arch/i386/rumpspl.c              |   51 ------
 sys/rump/librump/rumpkern/arch/i386/spinlock.c             |   39 ----
 sys/rump/librump/rumpkern/arch/mips/Makefile.inc           |    5 +-
 sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc        |    6 +-
 sys/rump/librump/rumpkern/arch/x86/Makefile.inc            |    7 +
 sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c          |   81 +++++++++
 sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu_counter.c  |   66 +++++++
 sys/rump/librump/rumpkern/arch/x86/rump_x86_pmap.c         |  110 +++++++++++++
 sys/rump/librump/rumpkern/arch/x86/rump_x86_spinlock.c     |   39 ++++
 sys/rump/librump/rumpkern/arch/x86/rump_x86_spl.c          |   51 ++++++
 sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc         |    5 +-
 sys/rump/librump/rumpkern/kobj_stubs.c                     |   49 -----
 sys/rump/librump/rumpkern/pmap_stub.c                      |   92 ----------
 sys/rump/librump/rumpkern/rumpcpu_generic.c                |   53 ------
 25 files changed, 578 insertions(+), 564 deletions(-)

diffs (truncated from 1298 to 300 lines):

diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/Makefile.rumpkern
--- a/sys/rump/librump/rumpkern/Makefile.rumpkern       Wed Feb 12 20:20:15 2014 +0000
+++ b/sys/rump/librump/rumpkern/Makefile.rumpkern       Wed Feb 12 22:28:43 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.rumpkern,v 1.135 2014/01/17 01:32:53 pooka Exp $
+#      $NetBSD: Makefile.rumpkern,v 1.136 2014/02/12 22:28:43 pooka Exp $
 #
 
 .include "${RUMPTOP}/Makefile.rump"
@@ -8,6 +8,7 @@
 LIB=           rump
 
 .PATH: ${RUMPTOP}/librump/rumpkern                             \
+       ${RUMPTOP}/librump/rumpkern/arch/generic                \
        ${RUMPTOP}/../kern                                      \
        ${RUMPTOP}/../uvm                                       \
        ${RUMPTOP}/../conf                                      \
@@ -55,11 +56,6 @@
 SRCS+=         vers.c
 CLEANFILES+=   vers.c version
 
-# use MI pmap for archs not conforming to kernel ABI
-.ifndef RUMPKMOD
-SRCS+= pmap_stub.c
-.endif
-
 # autogenerated
 #
 SRCS+= rump_syscalls.c rumpkern_if_wrappers.c
@@ -202,12 +198,12 @@
 .else
 ARCHDIR=       ${RUMPTOP}/librump/rumpkern/arch/${MACHINE_ARCH}
 .endif
-.if exists(${ARCHDIR})
+.if !exists(${ARCHDIR})
+ARCHDIR=       ${RUMPTOP}/librump/rumpkern/arch/generic
+.endif
+
 .include "${ARCHDIR}/Makefile.inc"
 .PATH: ${ARCHDIR}
-.else
-SRCS+= kobj_stubs.c rumpcpu_generic.c
-.endif
 
 .if ${MACHINE} == "sun3"
 CPPFLAGS+=     -Dsun3
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/alpha/Makefile.inc
--- a/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc Wed Feb 12 20:20:15 2014 +0000
+++ b/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc Wed Feb 12 22:28:43 2014 +0000
@@ -1,8 +1,11 @@
-#      $NetBSD: Makefile.inc,v 1.2 2009/10/15 23:42:40 pooka Exp $
+#      $NetBSD: Makefile.inc,v 1.3 2014/02/12 22:28:43 pooka Exp $
 #
 
 # some stubs
 SRCS+= rumpcrud.c
 
 .PATH:  ${RUMPTOP}/../arch/alpha/alpha
-SRCS+=  kobj_machdep.c rumpcpu_generic.c
+SRCS+=  kobj_machdep.c
+
+.PATH: ${RUMPTOP}/librump/rumpkern/arch/generic
+SRCS+= rump_generic_cpu.c rump_generic_pmap.c
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/arm/Makefile.inc
--- a/sys/rump/librump/rumpkern/arch/arm/Makefile.inc   Wed Feb 12 20:20:15 2014 +0000
+++ b/sys/rump/librump/rumpkern/arch/arm/Makefile.inc   Wed Feb 12 22:28:43 2014 +0000
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile.inc,v 1.1 2013/08/08 06:50:24 matt Exp $
+# $NetBSD: Makefile.inc,v 1.2 2014/02/12 22:28:43 pooka Exp $
 
 CPPFLAGS+=     -DARCH_ELFSIZE=32
 
 .PATH:  ${RUMPTOP}/../arch/arm/arm32
 SRCS+=         kobj_machdep.c
-SRCS+=         rumpcpu_generic.c
+
+.PATH: ${RUMPTOP}/librump/rumpkern/arch/generic
+SRCS+=         rump_generic_cpu.c rump_generic_pmap.c
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/generic/Makefile.inc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/arch/generic/Makefile.inc       Wed Feb 12 22:28:43 2014 +0000
@@ -0,0 +1,4 @@
+#      $NetBSD: Makefile.inc,v 1.1 2014/02/12 22:28:43 pooka Exp $
+#
+
+SRCS+= rump_generic_cpu.c rump_generic_kobj.c rump_generic_pmap.c
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c Wed Feb 12 22:28:43 2014 +0000
@@ -0,0 +1,53 @@
+/*     $NetBSD: rump_generic_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $       */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by the
+ * Finnish Cultural Foundation
+ *
+ * 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 AUTHOR ``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 AUTHOR 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: rump_generic_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $");
+
+#include <sys/param.h>
+
+#include "rump_private.h"
+
+struct cpu_info *rumpcpu_info_list;
+
+void
+rump_cpu_attach(struct cpu_info *ci)
+{
+       static int nattached;
+
+       /* XXX: wrong order, but ... */
+       ci->ci_next = rumpcpu_info_list;
+       rumpcpu_info_list = ci;
+
+       ci->ci_index = nattached++;
+
+       kcpuset_set(kcpuset_attached, cpu_index(ci));
+       kcpuset_set(kcpuset_running, cpu_index(ci));
+}
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c        Wed Feb 12 22:28:43 2014 +0000
@@ -0,0 +1,49 @@
+/*     $NetBSD: rump_generic_kobj.c,v 1.1 2014/02/12 22:28:43 pooka Exp $      */
+
+/*
+ * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
+ *
+ * Development of this software was supported by the
+ * Finnish Cultural Foundation
+ *
+ * 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 AUTHOR ``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 AUTHOR 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: rump_generic_kobj.c,v 1.1 2014/02/12 22:28:43 pooka Exp $");
+
+#include <sys/param.h>
+#include <sys/kobj.h>
+
+int
+kobj_machdep(kobj_t ko, void *v, size_t s, bool b)
+{
+
+       panic("%s: not supported on this architecture", __func__);
+}
+
+int
+kobj_reloc(kobj_t ko, uintptr_t p, const void *v, bool b1, bool b2)
+{
+
+       panic("%s: not supported on this architecture", __func__);
+}
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c        Wed Feb 12 22:28:43 2014 +0000
@@ -0,0 +1,92 @@
+/*     $NetBSD: rump_generic_pmap.c,v 1.1 2014/02/12 22:28:43 pooka Exp $      */
+
+/*
+ * Copyright (c) 2010 Antti Kantee.  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 AUTHOR ``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 AUTHOR 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: rump_generic_pmap.c,v 1.1 2014/02/12 22:28:43 pooka Exp $");
+
+#include <sys/param.h>
+
+#include <uvm/uvm_extern.h>
+
+/*
+ * This is the MI pmap implementation for rump.  It's used only by
+ * architectures which do not conform to the kernel ABI.  The kernel
+ * ABI conformant architectures provide their own pmap under librump/arch
+ * (due to various messiness with macros in the pmap "interface").
+ */
+
+struct pmap *const kernel_pmap_ptr = (struct pmap *const)-1;
+
+void
+pmap_kenter_pa(vaddr_t va, paddr_t pa, vm_prot_t prot, u_int fl)
+{
+
+       panic("%s: unavailable", __func__);
+}
+
+void
+pmap_kremove(vaddr_t va, vsize_t size)
+{
+
+       panic("%s: unavailable", __func__);
+}
+
+int
+pmap_enter(pmap_t pmap, vaddr_t va, paddr_t pa, vm_prot_t prot, u_int flags)
+{
+
+       panic("%s: unavailable", __func__);
+}
+
+void
+pmap_remove(pmap_t pmap, vaddr_t sva, vaddr_t eva)
+{
+
+       panic("%s: unavailable", __func__);
+}
+
+bool
+pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pap)
+{
+
+       *pap = va;
+       return true;
+}
+
+void
+pmap_page_protect(struct vm_page *pg, vm_prot_t prot)
+{
+
+       /* nada */
+}
+
+bool
+pmap_clear_modify(struct vm_page *pg)
+{
+
+       return false;
+}
diff -r f8f030c4eafb -r 174bcf537706 sys/rump/librump/rumpkern/arch/i386/Makefile.inc
--- a/sys/rump/librump/rumpkern/arch/i386/Makefile.inc  Wed Feb 12 20:20:15 2014 +0000
+++ b/sys/rump/librump/rumpkern/arch/i386/Makefile.inc  Wed Feb 12 22:28:43 2014 +0000
@@ -1,7 +1,7 @@
-#      $NetBSD: Makefile.inc,v 1.6 2010/06/16 11:45:21 pooka Exp $
+#      $NetBSD: Makefile.inc,v 1.7 2014/02/12 22:28:43 pooka Exp $
 #
 



Home | Main Index | Thread Index | Old Index