Module Name: src Committed By: pooka Date: Wed Feb 12 22:28:44 UTC 2014
Modified Files: src/sys/rump/librump/rumpkern: Makefile.rumpkern src/sys/rump/librump/rumpkern/arch/alpha: Makefile.inc src/sys/rump/librump/rumpkern/arch/arm: Makefile.inc src/sys/rump/librump/rumpkern/arch/i386: Makefile.inc src/sys/rump/librump/rumpkern/arch/mips: Makefile.inc src/sys/rump/librump/rumpkern/arch/powerpc: Makefile.inc src/sys/rump/librump/rumpkern/arch/x86_64: Makefile.inc Added Files: src/sys/rump/librump/rumpkern/arch/generic: Makefile.inc rump_generic_cpu.c rump_generic_kobj.c rump_generic_pmap.c src/sys/rump/librump/rumpkern/arch/x86: Makefile.inc rump_x86_cpu.c rump_x86_cpu_counter.c rump_x86_pmap.c rump_x86_spinlock.c rump_x86_spl.c Removed Files: src/sys/rump/librump/rumpkern: kobj_stubs.c pmap_stub.c rumpcpu_generic.c src/sys/rump/librump/rumpkern/arch/i386: cpu_counter.c pmap_x86.c rumpcpu.c rumpspl.c spinlock.c Log Message: 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) To generate a diff of this commit: cvs rdiff -u -r1.135 -r1.136 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.2 -r0 src/sys/rump/librump/rumpkern/kobj_stubs.c cvs rdiff -u -r1.25 -r0 src/sys/rump/librump/rumpkern/pmap_stub.c cvs rdiff -u -r1.4 -r0 src/sys/rump/librump/rumpkern/rumpcpu_generic.c cvs rdiff -u -r1.2 -r1.3 \ src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc cvs rdiff -u -r0 -r1.1 \ src/sys/rump/librump/rumpkern/arch/generic/Makefile.inc \ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c \ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c \ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c cvs rdiff -u -r1.6 -r1.7 src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc cvs rdiff -u -r1.1 -r0 src/sys/rump/librump/rumpkern/arch/i386/cpu_counter.c cvs rdiff -u -r1.3 -r0 src/sys/rump/librump/rumpkern/arch/i386/pmap_x86.c cvs rdiff -u -r1.11 -r0 src/sys/rump/librump/rumpkern/arch/i386/rumpcpu.c cvs rdiff -u -r1.2 -r0 src/sys/rump/librump/rumpkern/arch/i386/rumpspl.c \ src/sys/rump/librump/rumpkern/arch/i386/spinlock.c cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc cvs rdiff -u -r1.2 -r1.3 \ src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc cvs rdiff -u -r0 -r1.1 src/sys/rump/librump/rumpkern/arch/x86/Makefile.inc \ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c \ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu_counter.c \ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_pmap.c \ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spinlock.c \ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spl.c cvs rdiff -u -r1.7 -r1.8 \ src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.135 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.136 --- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.135 Fri Jan 17 01:32:53 2014 +++ src/sys/rump/librump/rumpkern/Makefile.rumpkern Wed Feb 12 22:28:43 2014 @@ -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 @@ vers.c: ${RUMPTOP}/../conf/newvers.sh ${ 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 @@ ARCHDIR= ${RUMPTOP}/librump/rumpkern/arc .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 Index: src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc:1.2 src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc:1.3 --- src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc:1.2 Thu Oct 15 23:42:40 2009 +++ src/sys/rump/librump/rumpkern/arch/alpha/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -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 Index: src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc:1.1 src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc:1.2 --- src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc:1.1 Thu Aug 8 06:50:24 2013 +++ src/sys/rump/librump/rumpkern/arch/arm/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -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 Index: src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc:1.6 src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc:1.7 --- src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc:1.6 Wed Jun 16 11:45:21 2010 +++ src/sys/rump/librump/rumpkern/arch/i386/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -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 $ # -SRCS+= rumpcpu.c rumpspl.c cpu_counter.c spinlock.c pmap_x86.c +.include "${RUMPTOP}/librump/rumpkern/arch/x86/Makefile.inc" .PATH: ${RUMPTOP}/../arch/i386/i386 SRCS+= kobj_machdep.c Index: src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc:1.1 src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc:1.2 --- src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc:1.1 Mon Dec 14 21:19:23 2009 +++ src/sys/rump/librump/rumpkern/arch/mips/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -1,5 +1,6 @@ -# $NetBSD: Makefile.inc,v 1.1 2009/12/14 21:19:23 matt Exp $ +# $NetBSD: Makefile.inc,v 1.2 2014/02/12 22:28:43 pooka Exp $ CPPFLAGS+= -DARCH_ELFSIZE=32 -SRCS+= kobj_stubs.c rumpcpu_generic.c +.PATH: ${RUMPTOP}/librump/rumpkern/arch/generic +SRCS+= rump_generic_cpu.c rump_generic_kobj.c rump_generic_pmap.c Index: src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc:1.2 src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc:1.3 --- src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc:1.2 Sat Nov 24 18:16:15 2012 +++ src/sys/rump/librump/rumpkern/arch/powerpc/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -1,8 +1,10 @@ -# $NetBSD: Makefile.inc,v 1.2 2012/11/24 18:16:15 pgoyette Exp $ +# $NetBSD: Makefile.inc,v 1.3 2014/02/12 22:28:43 pooka Exp $ .if ${MACHINE_ARCH} == "powerpc" CPPFLAGS+= -DARCH_ELFSIZE=32 .else CPPFLAGS+= -DARCH_ELFSIZE=64 .endif -SRCS+= kobj_stubs.c rumpcpu_generic.c + +.PATH: ${RUMPTOP}/librump/rumpkern/arch/generic +SRCS+= rump_generic_cpu.c rump_generic_kobj.c rump_generic_pmap.c Index: src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc diff -u src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc:1.7 src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc:1.8 --- src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc:1.7 Wed Jun 16 11:45:21 2010 +++ src/sys/rump/librump/rumpkern/arch/x86_64/Makefile.inc Wed Feb 12 22:28:44 2014 @@ -1,8 +1,7 @@ -# $NetBSD: Makefile.inc,v 1.7 2010/06/16 11:45:21 pooka Exp $ +# $NetBSD: Makefile.inc,v 1.8 2014/02/12 22:28:44 pooka Exp $ # -.PATH: ${ARCHDIR}/../i386 -SRCS+= rumpcpu.c rumpspl.c cpu_counter.c spinlock.c pmap_x86.c +.include "${RUMPTOP}/librump/rumpkern/arch/x86/Makefile.inc" .PATH: ${RUMPTOP}/../arch/amd64/amd64 SRCS+= kobj_machdep.c Added files: Index: src/sys/rump/librump/rumpkern/arch/generic/Makefile.inc diff -u /dev/null src/sys/rump/librump/rumpkern/arch/generic/Makefile.inc:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/generic/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -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 Index: src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_cpu.c Wed Feb 12 22:28:43 2014 @@ -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)); +} Index: src/sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_kobj.c Wed Feb 12 22:28:43 2014 @@ -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__); +} Index: src/sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/generic/rump_generic_pmap.c Wed Feb 12 22:28:43 2014 @@ -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; +} Index: src/sys/rump/librump/rumpkern/arch/x86/Makefile.inc diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/Makefile.inc:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/Makefile.inc Wed Feb 12 22:28:43 2014 @@ -0,0 +1,7 @@ +# $NetBSD: Makefile.inc,v 1.1 2014/02/12 22:28:43 pooka Exp $ +# + +.PATH: ${RUMPTOP}/librump/rumpkern/arch/x86 + +SRCS+= rump_x86_cpu.c rump_x86_spl.c rump_x86_cpu_counter.c +SRCS+= rump_x86_spinlock.c rump_x86_pmap.c Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu.c Wed Feb 12 22:28:43 2014 @@ -0,0 +1,81 @@ +/* $NetBSD: rump_x86_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $ */ + +/* + * Copyright (c) 2008 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_x86_cpu.c,v 1.1 2014/02/12 22:28:43 pooka Exp $"); + +#include <sys/param.h> + +#include <machine/cpu.h> + +#include "rump_private.h" + +struct cpu_info *cpu_info_list; + +void +rump_cpu_attach(struct cpu_info *ci) +{ + + if (cpu_info_list == NULL) + ci->ci_flags |= CPUF_PRIMARY; + + /* XXX: wrong order, but ... */ + ci->ci_next = cpu_info_list; + cpu_info_list = ci; + + kcpuset_set(kcpuset_attached, cpu_index(ci)); + kcpuset_set(kcpuset_running, cpu_index(ci)); +} + +struct cpu_info * +x86_curcpu() +{ + + return curlwp->l_cpu; +} + +struct lwp * +x86_curlwp() +{ + + return rumpuser_curlwp(); +} + +void +wbinvd(void) +{ + + /* + * Used by kobj_machdep(). + * + * But, we Best not execute this since we're not Ring0 *. + * Honestly, I don't know why it's required even in the kernel. + */ +} Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu_counter.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu_counter.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_cpu_counter.c Wed Feb 12 22:28:43 2014 @@ -0,0 +1,66 @@ +/* $NetBSD: rump_x86_cpu_counter.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. + */ + +/* + * __HAVE_CPU_COUNTER stubs. It would be nice to have this + * MI, but need MD for now because of inline-happy archs. + */ + +#include <sys/cdefs.h> +__KERNEL_RCSID(0, "$NetBSD: rump_x86_cpu_counter.c,v 1.1 2014/02/12 22:28:43 pooka Exp $"); + +#include <sys/param.h> + +#include <x86/cpu_counter.h> + +int +cpu_hascounter(void) +{ + + return 0; +} + +uint64_t +cpu_counter(void) +{ + + return 0; +} + +uint32_t +cpu_counter32(void) +{ + + return 0; +} + +uint64_t +cpu_frequency(struct cpu_info *ci) +{ + + return 0; +} Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_pmap.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/rump_x86_pmap.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_pmap.c Wed Feb 12 22:28:43 2014 @@ -0,0 +1,110 @@ +/* $NetBSD: rump_x86_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_x86_pmap.c,v 1.1 2014/02/12 22:28:43 pooka Exp $"); + +#include <sys/param.h> + +#include <uvm/uvm_extern.h> + +static struct pmap thepmap; +struct pmap *const kernel_pmap_ptr = &thepmap; + +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__); +} + +bool +pmap_clear_attrs(struct vm_page *pg, unsigned what) +{ + + return false; +} + +void +pmap_page_remove(struct vm_page *pg) +{ + +} + +bool +pmap_test_attrs(struct vm_page *pg, unsigned what) +{ + + return true; +} + +paddr_t +vtophys(vaddr_t va) +{ + + return (paddr_t)va; +} + +void +pmap_update(pmap_t pmap) +{ + +} + +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_write_protect(pmap_t pmap, vaddr_t sva, vaddr_t eva, vm_prot_t prot) +{ +} Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spinlock.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spinlock.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spinlock.c Wed Feb 12 22:28:43 2014 @@ -0,0 +1,39 @@ +/* $NetBSD: rump_x86_spinlock.c,v 1.1 2014/02/12 22:28:43 pooka Exp $ */ + +/*- + * Copyright (c) 2000, 2006 The NetBSD Foundation, Inc. + * All rights reserved. + * + * This code is derived from software contributed to The NetBSD Foundation + * by Jason R. Thorpe and Andrew Doran. + * + * 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: rump_x86_spinlock.c,v 1.1 2014/02/12 22:28:43 pooka Exp $"); + +#define _HARDKERNEL /* XXX: non-inline prototypes */ +#define SPINLOCK_BODY +#include <x86/lock.h> +#undef _HARDKERNEL +#undef SPINLOCK_BODY Index: src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spl.c diff -u /dev/null src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spl.c:1.1 --- /dev/null Wed Feb 12 22:28:44 2014 +++ src/sys/rump/librump/rumpkern/arch/x86/rump_x86_spl.c Wed Feb 12 22:28:43 2014 @@ -0,0 +1,51 @@ +/* $NetBSD: rump_x86_spl.c,v 1.1 2014/02/12 22:28:43 pooka Exp $ */ + +/* + * Copyright (c) 2008 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_x86_spl.c,v 1.1 2014/02/12 22:28:43 pooka Exp $"); + +#include <sys/param.h> + +#include <machine/intr.h> + +#include "rump_private.h" + +void +spllower(int s) +{ + +} + +int +splraise(int s) +{ + + return 0; +}