rump: import rump include files

This commit is contained in:
Jean-Baptiste Boric 2016-11-14 11:28:56 +01:00
parent e2fe8bb5b6
commit 1795f7afcc
63 changed files with 4851 additions and 3 deletions

View File

@ -1518,6 +1518,19 @@
./usr/include/rpcsvc minix-comp
./usr/include/rpcsvc/yp_prot.h minix-comp
./usr/include/rpcsvc/ypclnt.h minix-comp
./usr/include/rump minix-comp rump
./usr/include/rump/rump.h minix-comp rump
./usr/include/rump/rump_namei.h minix-comp rump
./usr/include/rump/rump_syscalls.h minix-comp rump
./usr/include/rump/rump_syscalls_compat.h minix-comp rump
./usr/include/rump/rumpdefs.h minix-comp rump
./usr/include/rump/rumperr.h minix-comp rump
./usr/include/rump/rumperrno2host.h minix-comp rump
./usr/include/rump/rumpkern_if_pub.h minix-comp rump
./usr/include/rump/rumpnet_if_pub.h minix-comp rump
./usr/include/rump/rumpuser.h minix-comp rump
./usr/include/rump/rumpvfs_if_pub.h minix-comp rump
./usr/include/rump/rumpvnode_if.h minix-comp rump
./usr/include/saslc.h minix-comp crypto
./usr/include/sched.h minix-comp
./usr/include/search.h minix-comp

View File

@ -16,11 +16,8 @@ SUBDIR+=modules
#.endif
.endif # !defined(__MINIX)
# LSC FIXME: Remove this test as soon as we have imported RUMP
.if !defined(__MINIX)
.if make(includes) || make(obj) || make(cleandir)
SUBDIR+= rump
.endif
.endif # !defined(__MINIX)
.include <bsd.kinc.mk>

9
sys/rump/Makefile Normal file
View File

@ -0,0 +1,9 @@
# $NetBSD: Makefile,v 1.7 2014/11/09 17:39:37 pooka Exp $
#
SUBDIR= include
#SUBDIR+= librump
#SUBDIR+= dev fs kern net
#SUBDIR+= share
.include <bsd.subdir.mk>

251
sys/rump/Makefile.rump Normal file
View File

@ -0,0 +1,251 @@
# $NetBSD: Makefile.rump,v 1.118 2015/08/24 22:52:15 pooka Exp $
#
.if !defined(_RUMP_MK)
_RUMP_MK= #defined
WARNS?= 3 # XXX: src/sys won't compile with -Wsign-compare yet
NOLINT= # kernel code
.include <bsd.own.mk>
# Use NetBSD kernel ABI by default on x86 archs. Performance-related
# compile-time options may override this at a later date.
.if (${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64")
_RUMP_NATIVEABI= yes
.else
_RUMP_NATIVEABI= no
CPPFLAGS:= -I${RUMPTOP}/include ${CPPFLAGS}
CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/librump/rumpkern
.endif
# Define baseline cpu for mips ports, required for
# rumpcomp_sync_icache() hypercall.
.if !empty(MACHINE_ARCH:Mmips*)
.if !empty(MACHINE_ARCH:Mmips64*)
CPPFLAGS+= -DMIPS64=1
.else
CPPFLAGS+= -DMIPS1=1
.endif
.endif
# which NetBSD compat to build
RUMP_NBCOMPAT?=default
.if ${RUMP_NBCOMPAT} == "all" || ${RUMP_NBCOMPAT} == "default"
RUMP_NBCOMPAT= 50 60 70
.endif
.if ${RUMP_NBCOMPAT} == "none"
RUMP_NBCOMPAT=
.endif
RUMP_NBCOMPAT:= ${RUMP_NBCOMPAT:S/,/ /g}
CPPFLAGS+= ${RUMP_NBCOMPAT:C/[1-9]0/-DCOMPAT_&/g}
CPPFLAGS+= -nostdinc
CFLAGS+= -ffreestanding -fno-strict-aliasing
CWARNFLAGS+= -Wno-format-zero-length -Wno-pointer-sign
CPPFLAGS+= -imacros ${RUMPTOP}/include/opt/opt_rumpkernel.h
.ifdef BUILDRUMP_IMACROS
CPPFLAGS+= -imacros ${BUILDRUMP_IMACROS}
.endif
CPPFLAGS+= -I${.CURDIR} -I.
CPPFLAGS+= -I${RUMPTOP}/../../common/include
CPPFLAGS+= -I${RUMPTOP}/include
CPPFLAGS+= -I${RUMPTOP}/include/opt
SHLIB_MAJOR?= 0
SHLIB_MINOR?= 0
.ifdef NEED_ISYSTEM
CPPFLAGS+= -isystem ${RUMPTOP}/../arch
CPPFLAGS+= -isystem ${RUMPTOP}/..
.else
CPPFLAGS+= -I${RUMPTOP}/../arch
CPPFLAGS+= -I${RUMPTOP}/..
.endif
RUMP_LDSCRIPT?= GNU
.if ${RUMP_LDSCRIPT} != "no"
# my ld or yours?
.if ${RUMP_LDSCRIPT} == "sun"
LDFLAGS+= -Wl,-M ${RUMPTOP}/ldscript_sun.rump
SRCS+= linksyms_sun.c
.PATH: ${RUMPTOP}
.elif ${RUMP_LDSCRIPT} == "GNU"
LDFLAGS+= -Wl,-T,${RUMPTOP}/ldscript.rump
.elif ${RUMP_LDSCRIPT} == "ctor"
CPPFLAGS+= -DRUMP_USE_CTOR
.else
.error Unknown ldscript ${RUMP_LDSCRIPT}
.endif
.endif
.if defined(RUMP_CURLWP)
.if ${RUMP_CURLWP} == "hypercall"
CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_HYPERCALL
.elif ${RUMP_CURLWP} == "__thread"
CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP___THREAD
.elif ${RUMP_CURLWP} == "register"
CPPFLAGS+= -DRUMP_CURLWP=RUMP_CURLWP_REGISTER
.else
.error Unsupported curlwp scheme: ${RUMP_CURLWP}
.endif
.endif
RUMP_DIAGNOSTIC?=yes
.if ${RUMP_DIAGNOSTIC} == "yes"
CPPFLAGS+= -DDIAGNOSTIC
.endif
.ifdef RUMP_DEBUG
CPPFLAGS+= -DDEBUG
.endif
.ifdef RUMP_LOCKDEBUG
CPPFLAGS+= -DLOCKDEBUG
.endif
RUMP_KTRACE?=yes
.if ${RUMP_KTRACE} == "yes"
CPPFLAGS+= -DKTRACE
.endif
# kernel libs should not get linked against libc
# XXX: actually, we would like to enable this but cannot, since it
# also leaves out libgcc, it causes problems on some platforms.
# revisit some day.
#LDFLAGS+= -nodefaultlibs
# make sure __NetBSD__ gets defined (for builds on non-NetBSD)
# also, give those builds a way to undef the local compiler's macros
CPPFLAGS+= ${RUMPKERN_UNDEF}
RUMPKERNEL= This is NetBSD and I am the rump. Good evening.
# workaround: evbppc is not a well-defined arch
.if (${MACHINE} == "evbppc")
CPPFLAGS+= -DPPC_OEA
.endif
# If any of these files change, we need a full rebuild
DPSRCS+= ${RUMPTOP}/Makefile.rump
#
# Support for component-specific hypercalls
#
# no easy way to get WARNS out of bsd.sys.mk
RUMPCOMP_USER_WARNFLAGS= -Wall -Wextra -Wno-unused-parameter
RUMPCOMP_USER_WARNFLAGS+= -Wstrict-prototypes -Wmissing-prototypes
.ifdef RUMPCOMP_USER_SRCS && !defined(RUMPKERN_ONLY)
.if empty(DESTDIR)
DESTDIR=/
.endif
BUILDRUMP_CPPFLAGS ?= -isysroot ${DESTDIR}
RUMPCOMP_USER_WERROR = ${${_NOWERROR} == "no" :?-Werror:}
.for rcusrc in ${RUMPCOMP_USER_SRCS:R}
${rcusrc}.d: ${rcusrc}.c
${_MKTARGET_CREATE}
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} ${BUILDRUMP_CPPFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${.ALLSRC:O:u:M*${rcusrc}.c}
${rcusrc}.o: ${rcusrc}.c
${_MKTARGET_COMPILE}
${CC} -o ${.TARGET} ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
${rcusrc}.pico: ${rcusrc}.c
${_MKTARGET_COMPILE}
${CC} -o ${.TARGET} -fPIC -DPIC ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
${rcusrc}.po: ${rcusrc}.c
${_MKTARGET_COMPILE}
${CC} -o ${.TARGET} ${PROFFLAGS} -pg ${DBG} ${CWARNFLAGS} ${RUMPCOMP_USER_WERROR} ${RUMPCOMP_USER_WARNFLAGS} ${BUILDRUMP_CPPFLAGS} ${BUILDRUMP_CFLAGS} ${RUMPCOMP_USER_CPPFLAGS} ${RUMPCOMP_USER_CFLAGS} -c ${.ALLSRC:O:u:M*${rcusrc}.c}
RUMPOBJ_NORENAME+=${rcusrc}.o ${rcusrc}.pico ${rcusrc}.po
SRCS+=${rcusrc}.c
.endfor
.endif
#
# Rename library symbols before use. If a symbol does not already belong
# to a rump namespace ("rump" or "RUMP"), prefix it with "rumpns". This
# avoids accidentally linking any kernel symbol against host platform
# libraries. The only non-renamed symbols are linkset delimiters and
# the GOT, which are more a property of the compiler than the kernel.
#
# Some toolchains generate unresolved symbols which are supposed to be
# satisfied by the toolchain itself when the program is linked.
# Unfortunately, we do not know which of the symbols are generated by
# the toolchain. Worse, they vary from platform to platform and
# toolchain to toolchain. The good news, however, is that this will
# be detected by a compile-time failure, so we can fairly easily manage
# a quirktable here.
#
# We also allow calling ourselves externally with e.g.:
# make -f /sys/rump/Makefile.rump RUMP_SYMREN=ffs.kobj
#
.if ${MACHINE_CPU} == "mips"
_SYMQUIRK='|_gp_disp'
.elif ${MACHINE_CPU} == "hppa"
_SYMQUIRK='|\$$\$$'
.elif ${MACHINE_ARCH} == "powerpc64"
_SYMQUIRK="|PF_funcs"
.endif
#
# Prefix quirks. At least one toolchain generates global
# symbols with prefixes which really need to remain as prefixes
# (i.e. the '.' on the front of some ppc64 globals). The
# way to know if you have the problem is if you get later
# complaints about symbols like 'rumpns_XrumpBLAH' or 'XrumpBLAH';
# the 'X' part was added by the toolchain and will need to
# be mentioned here.
#
.if ${MACHINE_ARCH} == "powerpc64"
_PQ="\.?"
.else
_PQ=
.endif
rump_symren: __archivebuild
.if !defined(RUMP_SYMREN)
@echo "Must supply RUMP_SYMREN for target rump_symren"
@false
.endif
# if we are called from lib build (RUMP_SYMREN is not specified),
# build the arrrrchive. otherwise just rename symbols.
__archivebuild: .USE
.if defined(RUMP_SYMREN) && defined(RUMPTOP)
@echo "ERROR: RUMP_SYMREN can only be used standalone"
@false
.endif
.if defined(RUMP_SYMREN)
${_MKMSG} " symbol rename " ${RUMP_SYMREN}
.else
${_MKTARGET_BUILD}
rm -f ${.TARGET}
.endif
for renameobj in ${RUMP_SYMREN:U${.ALLSRC:C/(${RUMPOBJ_NORENAME:ts|})//g}}; do \
${NM} -go $${renameobj} | ${TOOL_AWK} ' \
$$NF!~/^'${_PQ}'(rump|RUMP|__|_GLOBAL_OFFSET_TABLE'${_SYMQUIRK}'${RUMP_SYM_NORENAME:D|${RUMP_SYM_NORENAME}})/ \
{s=$$NF;sub(/^'${_PQ}'/, "&rumpns_", s); print $$NF, s}'\
| sort | uniq > renametab.$${renameobj}; \
${OBJCOPY} --preserve-dates --redefine-syms \
renametab.$${renameobj} $${renameobj}; \
rm -f renametab.$${renameobj}; \
done
.if !defined(RUMP_SYMREN)
${AR} ${_ARFL} ${.TARGET} \
`NM=${NM} ${LORDER} ${.ALLSRC:M*o} | ${TSORT}`
.endif
_BSD_IOCONF_MK_USER_=1
.include <bsd.ioconf.mk>
.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE_CPU}/include/Makefile.inc"
.-include "${NETBSDSRCDIR}/sys/arch/${MACHINE}/include/Makefile.inc"
.endif # _RUMP_MK

145
sys/rump/README.compileopts Normal file
View File

@ -0,0 +1,145 @@
$NetBSD: README.compileopts,v 1.13 2015/06/17 11:48:06 pooka Exp $
This file describes compile-time options for rump kernels. Additionally,
NetBSD build options will have an effect. See src/share/mk/bsd.README
for a desciption of NetBSD build options.
Note: after changing an option, do a clean build.
Global options:
RUMP_DIAGNOSTIC
values: yes|no
defval: yes
effect: Iff "yes", build with -DDIAGNOSTIC.
RUMP_DEBUG
values: <defined> / <undefined>
defval: <undefined>
effect: Iff defined, build with -DDEBUG.
RUMP_LOCKDEBUG
values: <defined> / <undefined>
defval: <undefined>
effect: Iff defined, build with -DLOCKDEBUG.
RUMP_KTRACE
values: yes|no
defval: yes
effect: Iff "yes", build with -DKTRACE.
RUMP_LOCKS_UP
values: yes|no
defval: no
effect: If "yes", build rump kernel with uniprocess-optimized locking.
An implication of this is that RUMP_NCPU==1 is required at
runtime. If "no", build with multiprocessor-capable locking.
RUMP_VIRTIF
values: yes|no
defval: yes
effect: Iff "yes", build the virt(4) network interface. Turning this
off may be necessary on systems that lack the necessary headers,
e.g. musl libc based Linux.
RUMP_CURLWP
values: hypercall/__thread/register or <undefined>
defval: <undefined>
effect: Control how curlwp is obtained in a rump kernel. This is
a very frequently accessed thread-local variable, and optimizing
access has a significant performance impact. Note that all
options are not available on hosts/machine architectures.
<undefined> - use default implementation (currently "hypercall")
hypercall - use a hypercall to fetch the value
__thread - use the __thread feature to fetch value via TLS
register - use a dedicated register (implies -ffixed)
RUMP_NBCOMPAT
values: comma-separated list of releases; e.g. "60,70";
or "all" or "default" or "none". Currently default == all (but
might not be so in the future)
defval: all
effect: Builds NetBSD COMPAT_nn code for each of the elements in the list.
This option is useful only when building rump kernels for
NetBSD userspace, and an empty value may be supplied elsewhere.
================================================================================
Rumpuser options:
RUMPUSER_THREADS
values: pthread/none/fiber or <undefined>
defval: <undefined>
effect: Define the way threading is implemented in the rumpuser hypercall
implmentation.
<undefined> - use default implementation (currently "pthread")
pthread - use pthreads to implement threading
none - do not support kernel threads at all
fiber - user a fiber interface, cooperatively scheduled contexts
================================================================================
Per-component options:
RUMP_SYM_NORENAME
values: regexp matching symbol names
defval: <undefined>
effect: Causes matching symbols from the component to not be renamed
into the rump kernel symbol namespace (rumpns_). This option
can only be used in embedded environments where there is full
control over the platform's namespace. Conversely, this option
cannot be used in kernel components which are not meant to be
tied to a specific platform. Note: the value is processed by
make and must be appropriately escaped. example:
RUMP_SYM_NORENAME=HYPERVISOR_|block$$
will not rename "^HYPERVISOR_" or "^block$"
================================================================================
The rest of the options described in this file are not intended to be
set by users, but by the package building rump kernels.
RUMP_KERNEL_IS_LIBC
values: defined / not defined
effect: Iff defined, export normal system call symbols from libc.
For example, without this option rump_sys_open() is exported.
With this option, both open() and rump_sys_open() are exported.
This option is meant for building systems where a rump kernel
is the only operating system like component.
RUMP_LDSCRIPT
values: no/GNU/sun/ctor
defval: GNU
effect: Select the linker script to be used for linking rump kernel shared
library components.
no - do not use a linker script
GNU - use a linker script for GNU ld 2.18 and later
sun - use a linker script for the Solaris linker
ctor - do not use a linker script, make the code
generate __attribute__((constructor))

68
sys/rump/README.dirs Normal file
View File

@ -0,0 +1,68 @@
$NetBSD: README.dirs,v 1.12 2013/01/08 13:12:26 pooka Exp $
The following is a quick rundown of the current directory structure.
First, components in the kernel namespace, i.e. compiled with -D_KERNEL
sys/rump/librump - rump kernel base and factions
/rumpkern - kernel core, e.g. syscall, interrupt and lock support
/rumpdev - device support, e.g. autoconf subsystem
/rumpnet - networking support and sockets layer
/rumpvfs - file system support
sys/rump/include
/machine - used for architectures where the rump kernel ABI is not yet the
same as the kernel module ABI. will eventually disappear
completely
/rump - kernel headers installed to userspace
sys/rump/dev - device components, e.g. audio, raidframe, usb drivers
sys/rump/fs - file system components
/lib/lib${fs} - kernel file system code
sys/rump/net - networking components
/lib/libnet - subroutines from sys/net, e.g. route and if_ethersubr
/lib/libnetinet - TCP/IP
/lib/libvirtif - a virtual interface which uses host tap(4) to shovel
packets. This is used by netinet and if_ethersubr.
/lib/libshmif - a virtual interface which uses a memory mapped file
as an ethernet bus. works completely unprivileged.
/lib/libsockin - implements PF_INET using host kernel sockets. This is
mutually exclusive with net, netinet and virtif.
The rest are out-of-kernel components (i.e. no -D_KERNEL).
hypercall interface:
src/lib/librumpuser
The "rumpuser" hypercall interfaces are used by a rump kernel to
access host resources.
remote client interface:
src/lib/librumpclient
The rumpclient library provides remote access to rump kernel servers.
system call hijacking:
src/lib/librumphijack
The rumphijack library allows intercepting system calls and redirecting
them to a rump kernel server instead of the host kernel. In other
words, it allows existing binaries to request indicated services from
a rump kernel instead of from the host kernel.
Users:
src/lib
/libp2k - puffs-to-vfs adaption layer, userspace namespace
/libukfs - user kernel file system, a library to access file system
images (or devices) directly in userspace without going
through a system call and puffs. It provides a slightly
higher interface than syscalls.
src/usr.sbin/puffs
rump_$fs - userspace file system daemons using the kernel fs code
src/share/examples/rump
Various examples detailing use of rump kernels in different scenarios.
These are provided source-only.

19
sys/rump/TODO Normal file
View File

@ -0,0 +1,19 @@
$NetBSD: TODO,v 1.12 2015/09/08 12:14:20 pooka Exp $
* integrate build framework with config(1) to stop the need to
maintain a separate build infrastructure. the remaining step
is to rewrite the Makefiles to use source file lists generated
with config(1) (where possible)
+ this will also benefit kernel modules
+ the patch to config(1) exists but is not in-tree. remaining work is
modifications to files.*
* the .a semantics do not make sense for rump kernel components.
additionally, they cannot be loaded as modules since they are
ar's instead of elf objects. make the build produce and use elf
objects instead of archives
* cleanup remaining uses of __ in the kernel
* rump_syscalls.c in librump should be compiled in the client
namespace, not the rump kernel namespace. while technically trivial,
the build system makes this quite difficult. one option for "cheating"
would be to put it into librumpuser which is always available for
local clients (per definition of local client).

View File

@ -0,0 +1,6 @@
# $NetBSD: Makefile,v 1.1 2008/11/17 08:54:39 pooka Exp $
#
SUBDIR= rump
.include <bsd.subdir.mk>

View File

@ -0,0 +1,95 @@
/* $NetBSD: cpu.h,v 1.22 2015/04/22 17:38:33 pooka Exp $ */
/*
* Copyright (c) 2008-2011 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.
*/
/*
* CPU defitions for a generic arch. Unfortunately there are some
* MD #ifdefs here. They are required because of MD inlines and macros.
*/
#ifndef _SYS_RUMP_CPU_H_
#define _SYS_RUMP_CPU_H_
#ifndef _LOCORE
#include <sys/cpu_data.h>
#include <machine/pcb.h>
#include "rump_curlwp.h"
struct cpu_info {
struct cpu_data ci_data;
cpuid_t ci_cpuid;
struct lwp *ci_curlwp;
struct cpu_info *ci_next;
#ifdef __alpha__
uint64_t ci_pcc_freq;
#endif
#ifdef __vax__
int ci_ipimsgs;
#define IPI_SEND_CNCHAR 0
#define IPI_DDB 0
#endif /* __vax__ */
#ifdef __powerpc__
struct cache_info {
int dcache_size;
int dcache_line_size;
int icache_size;
int icache_line_size;
} ci_ci;
#endif /* __powerpc */
};
#ifdef __vax__
static __inline void cpu_handle_ipi(void) {}
#endif /* __vax__ */
#ifdef __powerpc__
void __syncicache(void *, size_t);
#endif /* __powerpc__ */
#define curlwp rump_curlwp_fast()
#define curcpu() (curlwp->l_cpu)
#define cpu_number() (cpu_index(curcpu))
extern struct cpu_info *rumpcpu_info_list;
#define CPU_INFO_ITERATOR int __unused
#define CPU_INFO_FOREACH(_cii_, _ci_) _cii_ = 0, _ci_ = rumpcpu_info_list; \
_ci_ != NULL; _ci_ = _ci_->ci_next
#define CPU_IS_PRIMARY(_ci_) (_ci_->ci_index == 0)
#define CLKF_USERMODE(framep) 0
#define CLKF_PC(framep) 0
#define CLKF_INTR(framep) 0
#endif /* !_LOCORE */
#endif /* _SYS_RUMP_CPU_H_ */

View File

@ -0,0 +1,43 @@
/* $NetBSD: cpu_counter.h,v 1.3 2014/03/11 20:25:05 pooka Exp $ */
/*-
* Copyright (c) 2014 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.
*/
#ifndef _SYS_RUMP_CPU_COUNTER_H_
#define _SYS_RUMP_CPU_COUNTER_H_
#include <sys/types.h>
#ifdef __HAVE_CPU_COUNTER
/*
* A very simple MI cpu "counter". Could start filling in MD ones ...
*/
#define cpu_hascounter() 0
#define cpu_counter() 0
#define cpu_counter32() 0
#define cpu_frequency(a) 0
#endif /* __HAVE_CPU_COUNTER */
#endif /* _SYS_RUMP_CPU_COUNTER_H_ */

View File

@ -0,0 +1,73 @@
/* $NetBSD: intr.h,v 1.20 2014/01/19 07:01:55 martin Exp $ */
/*
* Copyright (c) 2009, 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.
*/
#ifndef _SYS_RUMP_INTR_H_
#define _SYS_RUMP_INTR_H_
#ifndef _LOCORE
typedef uint8_t ipl_t;
typedef struct {
ipl_t _ipl;
} ipl_cookie_t;
static inline ipl_cookie_t
makeiplcookie(ipl_t ipl)
{
ipl_cookie_t c;
c._ipl = ipl;
return c;
}
#endif /* !_LOCORE */
#define spllower(x) ((void)x)
#define splraise(x) 0
#define splsoftserial() 0
#define splsoftnet() 0
#define splsoftclock() 0
#define splhigh() 0
#define splsched() 0
#define splvm() 0
#define splx(x) ((void)x)
#define spl0() ((void)0)
/*
* IPL_* does not mean anything to a run-to-completition rump kernel,
* but we sometimes assert a "not higher than" condition, so we assign
* different values (following spl(9)).
*/
#define IPL_NONE 0
#define IPL_SOFTCLOCK 1
#define IPL_SOFTBIO 2
#define IPL_SOFTNET 3
#define IPL_SOFTSERIAL 4
#define IPL_VM 5
#define IPL_SCHED 6
#define IPL_HIGH 7
#endif /* _SYS_RUMP_INTR_H_ */

View File

@ -0,0 +1,40 @@
/* $NetBSD: pmap.h,v 1.7 2015/04/17 12:43:15 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.
*/
#ifndef _SYS_RUMP_PMAP_H_
#define _SYS_RUMP_PMAP_H_
struct pmap {
int vac_me_not_at_all;
};
#define pmap_update(v)
#define pmap_is_modified(a) (true)
#define pmap_is_referenced(a) (true)
#define pmap_resident_count(a) (0)
#endif /* _SYS_RUMP_PMAP_H_ */

View File

@ -0,0 +1,3 @@
/* $NetBSD: agr.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
#define NAGR 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: arcnet.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: arp.h,v 1.1 2015/08/24 22:31:33 pooka Exp $ */
#define NARP 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: atapibus.h,v 1.1 2015/08/24 23:21:51 pooka Exp $ */
#define NATAPIBUS 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: bridge.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
#define NBRIDGE 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: carp.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
#define NCARP 1

View File

@ -0,0 +1 @@
/* $NetBSD: config_file.h,v 1.1 2015/08/24 22:52:15 pooka Exp $ */

View File

@ -0,0 +1,3 @@
/* $NetBSD: ether.h,v 1.2 2015/09/01 03:26:09 ozaki-r Exp $ */
#define NETHER 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: etherip.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: faith.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: fddi.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: gif.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: gre.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: ksyms.h,v 1.1 2015/08/24 22:52:15 pooka Exp $ */
#define NKSYMS 0

View File

@ -0,0 +1,28 @@
/* $NetBSD: opt_rumpkernel.h,v 1.3 2015/08/24 22:52:15 pooka Exp $ */
#ifndef __NetBSD__
#define __NetBSD__
#endif
#define _KERNEL 1
#define _MODULE 1
#define MODULAR 1
#define MULTIPROCESSOR 1
#define MAXUSERS 32
#define DEBUGPRINT
#define DEFCORENAME "rumpdump"
#define DUMP_ON_PANIC 0
#define INET 1
#define INET6 1
#define GATEWAY 1
#define MPLS 1
#define SOSEND_NO_LOAN
#undef PIPE_SOCKETPAIR /* would need uipc_usrreq.c */
#define PIPE_NODIRECT

View File

@ -0,0 +1,2 @@
/* $NetBSD: pfsync.h,v 1.1 2015/08/24 22:31:33 pooka Exp $ */

View File

@ -0,0 +1,3 @@
/* $NetBSD: pppoe.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1,3 @@
/* $NetBSD: scsibus.h,v 1.1 2015/08/24 23:21:51 pooka Exp $ */
#define NSCSIBUS 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: sysmon_envsys.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */
#define NSYSMON_ENVSYS 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: sysmon_power.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */
#define NSYSMON_POWER 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: sysmon_wdog.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */
#define NSYSMON_WDOG 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: token.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1 @@
/* $NetBSD: veriexec.h,v 1.1 2015/08/24 22:52:15 pooka Exp $ */

View File

@ -0,0 +1,3 @@
/* $NetBSD: vlan.h,v 1.1 2015/08/24 23:04:42 pooka Exp $ */
/* dummy */

View File

@ -0,0 +1 @@
/* $NetBSD: wd.h,v 1.1 2015/08/24 23:21:51 pooka Exp $ */

View File

@ -0,0 +1 @@
/* $NetBSD: wsdisplay.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */

View File

@ -0,0 +1,3 @@
/* $NetBSD: wskbd.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */
#define NWSKBD 1

View File

@ -0,0 +1,3 @@
/* $NetBSD: wsmouse.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */
#define NWSMOUSE 1

View File

@ -0,0 +1 @@
/* $NetBSD: wsmux.h,v 1.1 2015/08/24 23:01:59 pooka Exp $ */

View File

@ -0,0 +1,14 @@
# $NetBSD: Makefile,v 1.8 2015/09/15 14:57:34 pooka Exp $
.include <bsd.own.mk>
INCSDIR= /usr/include/rump
.if (${MKRUMP} != "no")
INCS= rump.h rump_namei.h rump_syscalls.h rump_syscalls_compat.h
INCS+= rumpdefs.h rumperr.h rumperrno2host.h rumpuser.h rumpvnode_if.h
INCS+= rumpkern_if_pub.h rumpvfs_if_pub.h rumpnet_if_pub.h
.endif
.include <bsd.kinc.mk>

View File

@ -0,0 +1,211 @@
#!/bin/sh
# Generates various defines needed for using rump on non-NetBSD systems.
# Run this occasionally (yes, it's a slightly suboptimal kludge, but
# better than nothing).
echo Generating rumpdefs.h
rm -f rumpdefs.h
exec 3>&1 > rumpdefs.h
printf '/* $NetBSD: makerumpdefs.sh,v 1.28 2015/09/15 14:55:12 pooka Exp $ */\n\n'
printf '/*\n *\tAUTOMATICALLY GENERATED. DO NOT EDIT.\n */\n\n'
printf '#ifndef _RUMP_RUMPDEFS_H_\n'
printf '#define _RUMP_RUMPDEFS_H_\n\n'
printf '#include <rump/rump_namei.h>\n'
fromvers () {
echo
sed -n '1{s/\$//gp;q;}' $1
}
# not perfect, but works well enough for the cases so far
# (also has one struct-specific hack for MAXNAMLEN)
getstruct () {
sed -n '/struct[ ]*'"$2"'[ ]*{/{
a\
struct rump_'"$2"' {
:loop
n
s/^}.*;$/};/p
t
/^#/!{/MAXNAMLEN/!{s/ino_t/uint64_t/;p;}}
b loop
}' < $1
}
# likewise not perfect, but as long as it's KNF, we're peachy (though
# I personally like nectarines more)
getenum () {
sed -n '/enum[ ]*'"$2"'[ ]*{/{
a\
enum rump_'"$2"' {
:loop
n
s/^}.*;$/};/p
t
s/'$3'/RUMP_&/gp
b loop
}' < $1
}
fromvers ../../../sys/fcntl.h
sed -n '/#define O_[A-Z]* *0x/s/O_/RUMP_O_/gp' \
< ../../../sys/fcntl.h
fromvers ../../../sys/vnode.h
sed -n '/enum vtype.*{/{s/vtype/rump_&/;s/ V/ RUMP_V/gp;}' <../../../sys/vnode.h
sed -n '/#define.*LK_[A-Z]/s/LK_/RUMP_LK_/gp' <../../../sys/vnode.h \
| sed 's,/\*.*$,,'
fromvers ../../../sys/errno.h
sed -n '/#define[ ]*E/s/\([ ]\)\(E[A-Z2][A-Z]*\)/\1RUMP_\2/gp' \
< ../../../sys/errno.h
fromvers ../../../sys/reboot.h
sed -n '/#define.*RB_[A-Z]/s/RB_/RUMP_RB_/gp' <../../../sys/reboot.h \
| sed 's,/\*.*$,,'
sed -n '/#define.*AB_[A-Z]/s/AB_/RUMP_AB_/gp' <../../../sys/reboot.h \
| sed 's,/\*.*$,,'
fromvers ../../../sys/socket.h
sed -n '/#define[ ]*SOCK_[A-Z]/s/SOCK_/RUMP_SOCK_/gp' <../../../sys/socket.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*[AP]F_[A-Z]/s/[AP]F_/RUMP_&/gp' <../../../sys/socket.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*SO_[A-Z]/s/SO_/RUMP_&/gp' <../../../sys/socket.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*SOL_[A-Z]/s/SOL_/RUMP_&/gp' <../../../sys/socket.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*MSG_[A-Z]/s/MSG_/RUMP_&/gp' <../../../sys/socket.h \
| sed 's,/\*.*$,,'
fromvers ../../../netinet/in.h
sed -n '/#define[ ]*IP_[A-Z]/s/IP_/RUMP_&/gp' <../../../netinet/in.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*IPPROTO_[A-Z]/s/IPPROTO_/RUMP_&/gp' <../../../netinet/in.h \
| sed 's,/\*.*$,,'
fromvers ../../../netinet/tcp.h
sed -n '/#define[ ]*TCP_[A-Z]/s/TCP_/RUMP_&/gp' <../../../netinet/tcp.h \
| sed 's,/\*.*$,,'
fromvers ../../../sys/mount.h
sed -n '/#define[ ]*MOUNT_[A-Z]/s/MOUNT_/RUMP_MOUNT_/gp' <../../../sys/mount.h | sed 's,/\*.*$,,'
fromvers ../../../sys/fstypes.h
sed -n '/#define[ ]*MNT_[A-Z].*[^\]$/s/MNT_/RUMP_MNT_/gp' <../../../sys/fstypes.h | sed 's,/\*.*$,,'
fromvers ../../../sys/ioccom.h
sed -n '/#define[ ]*IOC[A-Z_].*[^\\]$/s/IOC/RUMP_&/gp' <../../../sys/ioccom.h | sed 's,/\*.*$,,'
sed -n '/#define[ ]*_IO.*\\$/{:t;N;/\\$/bt;s/_IOC/_RUMP_IOC/g;s/IOC[A-Z]/RUMP_&/gp}' <../../../sys/ioccom.h \
| sed 's,/\*.*$,,'
sed -n '/#define[ ]*_IO.*[^\]$/{s/_IO/_RUMP_IO/g;s/IOC_/RUMP_IOC_/gp}' <../../../sys/ioccom.h \
| sed 's,/\*.*$,,'
fromvers ../../../sys/ktrace.h
sed -n '/#define[ ]*KTROP_[A-Z_]/s/KTROP_/RUMP_&/gp' <../../../sys/ktrace.h | sed 's,/\*.*$,,'
sed -n '/#define[ ]*KTR_[A-Z_]/s/KTR_/RUMP_&/gp' <../../../sys/ktrace.h | sed 's,/\*.*$,,'
sed -n '/#define[ ]*KTRFAC_[A-Z_]/{s/KTRFAC_/RUMP_&/g;s/KTR_/RUMP_&/g;p;}' <../../../sys/ktrace.h | sed 's,/\*.*$,,'
sed -n '/#define[ ]*KTRFACv[0-9]/{s/KTRFACv/RUMP_&/g;s/KTRFAC_/RUMP_&/g;p;}' <../../../sys/ktrace.h | sed 's,/\*.*$,,'
fromvers ../../../sys/module.h
getstruct ../../../sys/module.h modctl_load
getenum ../../../sys/module.h modctl MODCTL
fromvers ../../../ufs/ufs/ufsmount.h
getstruct ../../../ufs/ufs/ufsmount.h ufs_args
fromvers ../../../fs/sysvbfs/sysvbfs_args.h
getstruct ../../../fs/sysvbfs/sysvbfs_args.h sysvbfs_args
fromvers ../../../sys/dirent.h
getstruct ../../../sys/dirent.h dirent
printf '\n#endif /* _RUMP_RUMPDEFS_H_ */\n'
exec 1>&3
echo Generating rumperr.h
rm -f rumperr.h
exec > rumperr.h
printf '/* $NetBSD: makerumpdefs.sh,v 1.28 2015/09/15 14:55:12 pooka Exp $ */\n\n'
printf '/*\n *\tAUTOMATICALLY GENERATED. DO NOT EDIT.\n */\n'
fromvers ../../../sys/errno.h
printf "\nstatic inline const char *\nrump_strerror(int error)\n{\n\n"
printf "\tswitch (error) {\n\tcase 0:\n"
printf "\t\t return \"No error: zero, zip, zilch, none!\";\n"
awk '/^#define[ ]*E.*[0-9]/{
ename = $2
evalue = $3
error = 1
if (ename == "ELAST") {
printf "\tdefault:\n"
printf "\t\treturn \"Invalid error!\";\n\t}\n}\n"
error = 0
exit 0
}
if (preverror + 1 != evalue)
exit 1
preverror = evalue
printf "\tcase %d: /* (%s) */\n\t\treturn \"", evalue, ename
sp = ""
for (i = 5; i < NF; i++) {
printf "%s%s", sp, $i
sp = " "
}
printf "\";\n"
}
END {
exit error
}' < ../../../sys/errno.h
if [ $? -ne 0 ]; then
echo 'Parsing errno.h failed!' 1>&3
rm -f rumpdefs.h rumperr.h
exit 1
fi
echo Generating rumperrno2host.h 1>&3
rm -f rumperrno2host.h
exec > rumperrno2host.h
printf '/* $NetBSD: makerumpdefs.sh,v 1.28 2015/09/15 14:55:12 pooka Exp $ */\n\n'
printf '/*\n *\tAUTOMATICALLY GENERATED. DO NOT EDIT.\n */\n'
fromvers ../../../sys/errno.h
printf "\n#ifndef ERANGE\n#error include ISO C style errno.h first\n#endif\n"
printf "\nstatic inline int \nrump_errno2host(int rumperrno)\n{\n\n"
printf "\tswitch (rumperrno) {\n\tcase 0:\n"
printf "\t\t return 0;\n"
awk '/^#define[ ]*E.*[0-9]/{
ename = $2
evalue = $3
error = 1
if (ename == "ELAST") {
printf "\tdefault:\n"
printf "#ifdef EINVAL\n\t\treturn EINVAL;\n"
printf "#else\n\t\treturn ERANGE;\n#endif\n"
printf "\t}\n}\n"
error = 0
exit 0
}
if (preverror + 1 != evalue)
exit 1
preverror = evalue
printf "#ifdef %s\n", ename
printf "\tcase %d:\n\t\treturn %s;\n", evalue, ename
printf "#endif\n"
}
END {
exit error
}' < ../../../sys/errno.h
if [ $? -ne 0 ]; then
echo 'Parsing errno.h failed!' 1>&3
rm -f rumpdefs.h rumperr.h rumperrno2host.h
exit 1
fi
exit 0

View File

@ -0,0 +1,223 @@
/* $NetBSD: rump.h,v 1.63 2014/06/13 15:45:02 pooka Exp $ */
/*
* Copyright (c) 2007-2011 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.
*/
#ifndef _RUMP_RUMP_H_
#define _RUMP_RUMP_H_
/*
* NOTE: do not #include anything from <sys> here. Otherwise this
* has no chance of working on non-NetBSD platforms.
*/
struct mount;
struct vnode;
struct vattr;
struct componentname;
struct vfsops;
struct fid;
struct statvfs;
struct stat;
struct kauth_cred;
struct lwp;
struct modinfo;
struct uio;
/* yetch */
#if defined(__NetBSD__)
#include <prop/proplib.h>
#else
#ifndef HAVE_PROP_DICTIONARY_T
#define HAVE_PROP_DICTIONARY_T
struct prop_dictionary;
typedef struct prop_dictionary *prop_dictionary_t;
#endif
#endif /* __NetBSD__ */
#if (!defined(_KERNEL)) && (defined(__sun__) || defined(__ANDROID__)) && !defined(RUMP_REGISTER_T)
#define RUMP_REGISTER_T long
typedef RUMP_REGISTER_T register_t;
#endif
#include <rump/rumpvnode_if.h>
#include <rump/rumpdefs.h>
/* rumpkern */
enum rump_uiorw { RUMPUIO_READ, RUMPUIO_WRITE };
enum rump_sigmodel {
RUMP_SIGMODEL_PANIC,
RUMP_SIGMODEL_IGNORE,
RUMP_SIGMODEL__HOST_NOTANYMORE,
RUMP_SIGMODEL_RAISE,
RUMP_SIGMODEL_RECORD
};
/* flags to rump_lwproc_rfork */
#define RUMP_RFFDG 0x01
#define RUMP_RFCFDG 0x02
/* slightly-easier-to-parse aliases for the above */
#define RUMP_RFFD_SHARE 0x00 /* lossage */
#define RUMP_RFFD_COPY RUMP_RFFDG
#define RUMP_RFFD_CLEAR RUMP_RFCFDG
/* rumpvfs */
#define RUMPCN_FREECRED 0x02
#define RUMP_ETFS_SIZE_ENDOFF ((uint64_t)-1)
enum rump_etfs_type {
RUMP_ETFS_REG,
RUMP_ETFS_BLK,
RUMP_ETFS_CHR,
RUMP_ETFS_DIR, /* only the registered directory */
RUMP_ETFS_DIR_SUBDIRS /* dir + subdirectories (recursive) */
};
/* um, what's the point ?-) */
#ifdef _BEGIN_DECLS
_BEGIN_DECLS
#endif
int rump_getversion(void);
int rump_pub_getversion(void); /* compat */
int rump_nativeabi_p(void);
int rump_boot_gethowto(void);
void rump_boot_sethowto(int);
void rump_boot_setsigmodel(enum rump_sigmodel);
struct rump_boot_etfs {
/* client initializes */
const char *eb_key;
const char *eb_hostpath;
enum rump_etfs_type eb_type;
uint64_t eb_begin;
uint64_t eb_size;
/* rump kernel initializes */
struct rump_boot_etfs *_eb_next;
int eb_status;
};
void rump_boot_etfs_register(struct rump_boot_etfs *);
void rump_schedule(void);
void rump_unschedule(void);
void rump_printevcnts(void);
int rump_daemonize_begin(void);
int rump_init(void);
int rump_init_server(const char *);
int rump_daemonize_done(int);
#define RUMP_DAEMONIZE_SUCCESS 0
#ifndef _KERNEL
#include <rump/rumpkern_if_pub.h>
#include <rump/rumpvfs_if_pub.h>
#include <rump/rumpnet_if_pub.h>
#endif
#ifdef _END_DECLS
_END_DECLS
#endif
/*
* Begin rump syscall conditionals. Yes, something a little better
* is required here.
*/
#ifdef RUMP_SYS_NETWORKING
#define socket(a,b,c) rump_sys_socket(a,b,c)
#define accept(a,b,c) rump_sys_accept(a,b,c)
#define bind(a,b,c) rump_sys_bind(a,b,c)
#define connect(a,b,c) rump_sys_connect(a,b,c)
#define getpeername(a,b,c) rump_sys_getpeername(a,b,c)
#define getsockname(a,b,c) rump_sys_getsockname(a,b,c)
#define listen(a,b) rump_sys_listen(a,b)
#define recvfrom(a,b,c,d,e,f) rump_sys_recvfrom(a,b,c,d,e,f)
#define recvmsg(a,b,c) rump_sys_recvmsg(a,b,c)
#define sendto(a,b,c,d,e,f) rump_sys_sendto(a,b,c,d,e,f)
#define sendmsg(a,b,c) rump_sys_sendmsg(a,b,c)
#define getsockopt(a,b,c,d,e) rump_sys_getsockopt(a,b,c,d,e)
#define setsockopt(a,b,c,d,e) rump_sys_setsockopt(a,b,c,d,e)
#define shutdown(a,b) rump_sys_shutdown(a,b)
#endif /* RUMP_SYS_NETWORKING */
#ifdef RUMP_SYS_IOCTL
#define ioctl(...) rump_sys_ioctl(__VA_ARGS__)
#define fnctl(...) rump_sys_fcntl(__VA_ARGS__)
#endif /* RUMP_SYS_IOCTL */
#ifdef RUMP_SYS_CLOSE
#define close(a) rump_sys_close(a)
#endif /* RUMP_SYS_CLOSE */
#ifdef RUMP_SYS_OPEN
#define open(...) rump_sys_open(__VA_ARGS__)
#endif /* RUMP_SYS_OPEN */
#ifdef RUMP_SYS_READWRITE
#define read(a,b,c) rump_sys_read(a,b,c)
#define readv(a,b,c) rump_sys_readv(a,b,c)
#define pread(a,b,c,d) rump_sys_pread(a,b,c,d)
#define preadv(a,b,c,d) rump_sys_preadv(a,b,c,d)
#define write(a,b,c) rump_sys_write(a,b,c)
#define writev(a,b,c) rump_sys_writev(a,b,c)
#define pwrite(a,b,c,d) rump_sys_pwrite(a,b,c,d)
#define pwritev(a,b,c,d) rump_sys_pwritev(a,b,c,d)
#endif /* RUMP_SYS_READWRITE */
#ifdef RUMP_SYS_FILEOPS
#define mkdir(a,b) rump_sys_mkdir(a,b)
#define rmdir(a) rump_sys_rmdir(a)
#define link(a,b) rump_sys_link(a,b)
#define symlink(a,b) rump_sys_symlink(a,b)
#define unlink(a) rump_sys_unlink(a)
#define readlink(a,b,c) rump_sys_readlink(a,b,c)
#define chdir(a) rump_sys_chdir(a)
#define fsync(a) rump_sys_fsync(a)
#define sync() rump_sys_sync()
#define chown(a,b,c) rump_sys_chown(a,b,c)
#define fchown(a,b,c) rump_sys_fchown(a,b,c)
#define lchown(a,b,c) rump_sys_lchown(a,b,c)
#define lseek(a,b,c) rump_sys_lseek(a,b,c)
#define mknod(a,b,c) rump_sys_mknod(a,b,c)
#define rename(a,b) rump_sys_rename(a,b)
#define truncate(a,b) rump_sys_truncate(a,b)
#define ftruncate(a,b) rump_sys_ftruncate(a,b)
#define umask(a) rump_sys_umask(a)
#define getdents(a,b,c) rump_sys_getdents(a,b,c)
#endif /* RUMP_SYS_FILEOPS */
#ifdef RUMP_SYS_STAT
#define stat(a,b) rump_sys_stat(a,b)
#define fstat(a,b) rump_sys_fstat(a,b)
#define lstat(a,b) rump_sys_lstat(a,b)
#endif /* RUMP_SYS_STAT */
#ifdef RUMP_SYS_PROCOPS
#define getpid() rump_sys_getpid()
#endif /* RUMP_SYS_PROCOPS */
#endif /* _RUMP_RUMP_H_ */

View File

@ -0,0 +1,39 @@
/* $NetBSD: rump_namei.h,v 1.27 2015/04/21 03:19:03 riastradh Exp $ */
/*
* WARNING: GENERATED FILE. DO NOT EDIT
* (edit namei.src and run make namei in src/sys/sys)
* by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp
* from: NetBSD: namei.src,v 1.37 2015/04/21 03:18:21 riastradh Exp
*/
#ifndef _RUMP_RUMP_NAMEI_H_
#define _RUMP_RUMP_NAMEI_H_
#define RUMP_NAMEI_LOOKUP 0
#define RUMP_NAMEI_CREATE 1
#define RUMP_NAMEI_DELETE 2
#define RUMP_NAMEI_RENAME 3
#define RUMP_NAMEI_OPMASK 3
#define RUMP_NAMEI_LOCKLEAF 0x00000004
#define RUMP_NAMEI_LOCKPARENT 0x00000008
#define RUMP_NAMEI_TRYEMULROOT 0x00000010
#define RUMP_NAMEI_NOCACHE 0x00000020
#define RUMP_NAMEI_FOLLOW 0x00000040
#define RUMP_NAMEI_NOFOLLOW 0x00000000
#define RUMP_NAMEI_EMULROOTSET 0x00000080
#define RUMP_NAMEI_NOCHROOT 0x01000000
#define RUMP_NAMEI_MODMASK 0x010000fc
#define RUMP_NAMEI_NOCROSSMOUNT 0x0000100
#define RUMP_NAMEI_RDONLY 0x0000200
#define RUMP_NAMEI_ISDOTDOT 0x0002000
#define RUMP_NAMEI_MAKEENTRY 0x0004000
#define RUMP_NAMEI_ISLASTCN 0x0008000
#define RUMP_NAMEI_ISWHITEOUT 0x0020000
#define RUMP_NAMEI_DOWHITEOUT 0x0040000
#define RUMP_NAMEI_REQUIREDIR 0x0080000
#define RUMP_NAMEI_CREATEDIR 0x0200000
#define RUMP_NAMEI_PARAMASK 0x02ee300
#endif /* _RUMP_RUMP_NAMEI_H_ */

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,80 @@
/* $NetBSD: rump_syscalls_compat.h,v 1.13 2013/08/15 21:29:04 pooka Exp $ */
/*-
* Copyright (c) 2010, 2011 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.
*/
#ifdef _KERNEL
#error rump_syscalls_compat is not for kernel consumers
#endif
#ifndef _RUMP_RUMP_SYSCALLS_COMPAT_H_
#define _RUMP_RUMP_SYSCALLS_COMPAT_H_
/* should have a smaller hammer here */
#ifndef RUMP_HOST_NOT_POSIX
#include <sys/types.h> /* typedefs */
#include <sys/select.h> /* typedefs */
#include <sys/socket.h> /* typedefs */
#include <signal.h> /* typedefs */
#endif
#ifdef __NetBSD__
#include <sys/cdefs.h>
#include <sys/param.h>
/* time_t change */
#if !__NetBSD_Prereq__(5,99,7)
#define RUMP_SYS_RENAME_STAT rump___sysimpl_stat30
#define RUMP_SYS_RENAME_FSTAT rump___sysimpl_fstat30
#define RUMP_SYS_RENAME_LSTAT rump___sysimpl_lstat30
#define RUMP_SYS_RENAME_POLLTS rump___sysimpl_pollts
#define RUMP_SYS_RENAME_SELECT rump___sysimpl_select
#define RUMP_SYS_RENAME_PSELECT rump___sysimpl_pselect
#define RUMP_SYS_RENAME_KEVENT rump___sysimpl_kevent
#define RUMP_SYS_RENAME_UTIMES rump___sysimpl_utimes
#define RUMP_SYS_RENAME_FUTIMES rump___sysimpl_futimes
#define RUMP_SYS_RENAME_LUTIMES rump___sysimpl_lutimes
#define RUMP_SYS_RENAME_MKNOD rump___sysimpl_mknod
#define RUMP_SYS_RENAME_FHSTAT rump___sysimpl_fhstat40
#endif /* __NetBSD_Prereq(5,99,7) */
#else /* !__NetBSD__ */
#ifndef __RENAME
#ifdef __ELF__
#define __RUMPSTRINGIFY(x) #x
#else
#define __RUMPSTRINGIFY(x) "_"#x
#endif /* __ELF__ */
#define __RENAME(x) __asm(__RUMPSTRINGIFY(x))
#endif /* __RENAME */
#endif /* __NetBSD__ */
#endif /* _RUMP_RUMP_SYSCALLS_COMPAT_H_ */

View File

@ -0,0 +1,558 @@
/* $NetBSD: rumpdefs.h,v 1.33 2015/09/15 14:55:55 pooka Exp $ */
/*
* AUTOMATICALLY GENERATED. DO NOT EDIT.
*/
#ifndef _RUMP_RUMPDEFS_H_
#define _RUMP_RUMPDEFS_H_
#include <rump/rump_namei.h>
/* NetBSD: fcntl.h,v 1.46 2013/09/15 10:41:20 njoly Exp */
#define RUMP_O_RDONLY 0x00000000 /* open for reading only */
#define RUMP_O_WRONLY 0x00000001 /* open for writing only */
#define RUMP_O_RDWR 0x00000002 /* open for reading and writing */
#define RUMP_O_ACCMODE 0x00000003 /* mask for above modes */
#define RUMP_O_NONBLOCK 0x00000004 /* no delay */
#define RUMP_O_APPEND 0x00000008 /* set append mode */
#define RUMP_O_SHLOCK 0x00000010 /* open with shared file lock */
#define RUMP_O_EXLOCK 0x00000020 /* open with exclusive file lock */
#define RUMP_O_ASYNC 0x00000040 /* signal pgrp when data ready */
#define RUMP_O_SYNC 0x00000080 /* synchronous writes */
#define RUMP_O_NOFOLLOW 0x00000100 /* don't follow symlinks on the last */
#define RUMP_O_CREAT 0x00000200 /* create if nonexistent */
#define RUMP_O_TRUNC 0x00000400 /* truncate to zero length */
#define RUMP_O_EXCL 0x00000800 /* error if already exists */
#define RUMP_O_NOCTTY 0x00008000 /* don't assign controlling terminal */
#define RUMP_O_DSYNC 0x00010000 /* write: I/O data completion */
#define RUMP_O_RSYNC 0x00020000 /* read: I/O completion as for write */
#define RUMP_O_DIRECT 0x00080000 /* direct I/O hint */
#define RUMP_O_DIRECTORY 0x00200000 /* fail if not a directory */
#define RUMP_O_CLOEXEC 0x00400000 /* set close on exec */
#define RUMP_O_SEARCH 0x00800000 /* skip search permission checks */
#define RUMP_O_NOSIGPIPE 0x01000000 /* don't deliver sigpipe */
/* NetBSD: vnode.h,v 1.256 2015/07/12 08:11:28 hannken Exp */
enum rump_vtype { RUMP_VNON, RUMP_VREG, RUMP_VDIR, RUMP_VBLK, RUMP_VCHR, RUMP_VLNK, RUMP_VSOCK, RUMP_VFIFO, RUMP_VBAD };
#define RUMP_LK_SHARED 0x00000001
#define RUMP_LK_EXCLUSIVE 0x00000002
#define RUMP_LK_NOWAIT 0x00000010
#define RUMP_LK_RETRY 0x00020000
/* NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp */
#define RUMP_EPERM 1 /* Operation not permitted */
#define RUMP_ENOENT 2 /* No such file or directory */
#define RUMP_ESRCH 3 /* No such process */
#define RUMP_EINTR 4 /* Interrupted system call */
#define RUMP_EIO 5 /* Input/output error */
#define RUMP_ENXIO 6 /* Device not configured */
#define RUMP_E2BIG 7 /* Argument list too long */
#define RUMP_ENOEXEC 8 /* Exec format error */
#define RUMP_EBADF 9 /* Bad file descriptor */
#define RUMP_ECHILD 10 /* No child processes */
#define RUMP_EDEADLK 11 /* Resource deadlock avoided */
#define RUMP_ENOMEM 12 /* Cannot allocate memory */
#define RUMP_EACCES 13 /* Permission denied */
#define RUMP_EFAULT 14 /* Bad address */
#define RUMP_ENOTBLK 15 /* Block device required */
#define RUMP_EBUSY 16 /* Device busy */
#define RUMP_EEXIST 17 /* File exists */
#define RUMP_EXDEV 18 /* Cross-device link */
#define RUMP_ENODEV 19 /* Operation not supported by device */
#define RUMP_ENOTDIR 20 /* Not a directory */
#define RUMP_EISDIR 21 /* Is a directory */
#define RUMP_EINVAL 22 /* Invalid argument */
#define RUMP_ENFILE 23 /* Too many open files in system */
#define RUMP_EMFILE 24 /* Too many open files */
#define RUMP_ENOTTY 25 /* Inappropriate ioctl for device */
#define RUMP_ETXTBSY 26 /* Text file busy */
#define RUMP_EFBIG 27 /* File too large */
#define RUMP_ENOSPC 28 /* No space left on device */
#define RUMP_ESPIPE 29 /* Illegal seek */
#define RUMP_EROFS 30 /* Read-only file system */
#define RUMP_EMLINK 31 /* Too many links */
#define RUMP_EPIPE 32 /* Broken pipe */
#define RUMP_EDOM 33 /* Numerical argument out of domain */
#define RUMP_ERANGE 34 /* Result too large or too small */
#define RUMP_EAGAIN 35 /* Resource temporarily unavailable */
#define RUMP_EWOULDBLOCK RUMP_EAGAIN /* Operation would block */
#define RUMP_EINPROGRESS 36 /* Operation now in progress */
#define RUMP_EALREADY 37 /* Operation already in progress */
#define RUMP_ENOTSOCK 38 /* Socket operation on non-socket */
#define RUMP_EDESTADDRREQ 39 /* Destination address required */
#define RUMP_EMSGSIZE 40 /* Message too long */
#define RUMP_EPROTOTYPE 41 /* Protocol wrong type for socket */
#define RUMP_ENOPROTOOPT 42 /* Protocol option not available */
#define RUMP_EPROTONOSUPPORT 43 /* Protocol not supported */
#define RUMP_ESOCKTNOSUPPORT 44 /* Socket type not supported */
#define RUMP_EOPNOTSUPP 45 /* Operation not supported */
#define RUMP_EPFNOSUPPORT 46 /* Protocol family not supported */
#define RUMP_EAFNOSUPPORT 47 /* Address family not supported by protocol family */
#define RUMP_EADDRINUSE 48 /* Address already in use */
#define RUMP_EADDRNOTAVAIL 49 /* Can't assign requested address */
#define RUMP_ENETDOWN 50 /* Network is down */
#define RUMP_ENETUNREACH 51 /* Network is unreachable */
#define RUMP_ENETRESET 52 /* Network dropped connection on reset */
#define RUMP_ECONNABORTED 53 /* Software caused connection abort */
#define RUMP_ECONNRESET 54 /* Connection reset by peer */
#define RUMP_ENOBUFS 55 /* No buffer space available */
#define RUMP_EISCONN 56 /* Socket is already connected */
#define RUMP_ENOTCONN 57 /* Socket is not connected */
#define RUMP_ESHUTDOWN 58 /* Can't send after socket shutdown */
#define RUMP_ETOOMANYREFS 59 /* Too many references: can't splice */
#define RUMP_ETIMEDOUT 60 /* Operation timed out */
#define RUMP_ECONNREFUSED 61 /* Connection refused */
#define RUMP_ELOOP 62 /* Too many levels of symbolic links */
#define RUMP_ENAMETOOLONG 63 /* File name too long */
#define RUMP_EHOSTDOWN 64 /* Host is down */
#define RUMP_EHOSTUNREACH 65 /* No route to host */
#define RUMP_ENOTEMPTY 66 /* Directory not empty */
#define RUMP_EPROCLIM 67 /* Too many processes */
#define RUMP_EUSERS 68 /* Too many users */
#define RUMP_EDQUOT 69 /* Disc quota exceeded */
#define RUMP_ESTALE 70 /* Stale NFS file handle */
#define RUMP_EREMOTE 71 /* Too many levels of remote in path */
#define RUMP_EBADRPC 72 /* RPC struct is bad */
#define RUMP_ERPCMISMATCH 73 /* RPC version wrong */
#define RUMP_EPROGUNAVAIL 74 /* RPC prog. not avail */
#define RUMP_EPROGMISMATCH 75 /* Program version wrong */
#define RUMP_EPROCUNAVAIL 76 /* Bad procedure for program */
#define RUMP_ENOLCK 77 /* No locks available */
#define RUMP_ENOSYS 78 /* Function not implemented */
#define RUMP_EFTYPE 79 /* Inappropriate file type or format */
#define RUMP_EAUTH 80 /* Authentication error */
#define RUMP_ENEEDAUTH 81 /* Need authenticator */
#define RUMP_EIDRM 82 /* Identifier removed */
#define RUMP_ENOMSG 83 /* No message of desired type */
#define RUMP_EOVERFLOW 84 /* Value too large to be stored in data type */
#define RUMP_EILSEQ 85 /* Illegal byte sequence */
#define RUMP_ENOTSUP 86 /* Not supported */
#define RUMP_ECANCELED 87 /* Operation canceled */
#define RUMP_EBADMSG 88 /* Bad or Corrupt message */
#define RUMP_ENODATA 89 /* No message available */
#define RUMP_ENOSR 90 /* No STREAM resources */
#define RUMP_ENOSTR 91 /* Not a STREAM */
#define RUMP_ETIME 92 /* STREAM ioctl timeout */
#define RUMP_ENOATTR 93 /* Attribute not found */
#define RUMP_EMULTIHOP 94 /* Multihop attempted */
#define RUMP_ENOLINK 95 /* Link has been severed */
#define RUMP_EPROTO 96 /* Protocol error */
#define RUMP_ELAST 96 /* Must equal largest errno */
#define RUMP_EJUSTRETURN -2 /* don't modify regs, just return */
#define RUMP_ERESTART -3 /* restart syscall */
#define RUMP_EPASSTHROUGH -4 /* ioctl not handled by this layer */
#define RUMP_EDUPFD -5 /* Dup given fd */
#define RUMP_EMOVEFD -6 /* Move given fd */
/* NetBSD: reboot.h,v 1.25 2007/12/25 18:33:48 perry Exp */
#define RUMP_RB_AUTOBOOT 0
#define RUMP_RB_ASKNAME 0x00000001
#define RUMP_RB_SINGLE 0x00000002
#define RUMP_RB_NOSYNC 0x00000004
#define RUMP_RB_HALT 0x00000008
#define RUMP_RB_INITNAME 0x00000010
#define __RUMP_RB_UNUSED1 0x00000020
#define RUMP_RB_KDB 0x00000040
#define RUMP_RB_RDONLY 0x00000080
#define RUMP_RB_DUMP 0x00000100
#define RUMP_RB_MINIROOT 0x00000200
#define RUMP_RB_STRING 0x00000400
#define RUMP_RB_POWERDOWN (RUMP_RB_HALT|0x800)
#define RUMP_RB_USERCONF 0x00001000
#define RUMP_RB_MD1 0x10000000
#define RUMP_RB_MD2 0x20000000
#define RUMP_RB_MD3 0x40000000
#define RUMP_RB_MD4 0x80000000
#define RUMP_AB_NORMAL 0x00000000
#define RUMP_AB_QUIET 0x00010000
#define RUMP_AB_VERBOSE 0x00020000
#define RUMP_AB_SILENT 0x00040000
#define RUMP_AB_DEBUG 0x00080000
/* NetBSD: socket.h,v 1.117 2015/04/03 20:01:08 rtr Exp */
#define RUMP_SOCK_STREAM 1
#define RUMP_SOCK_DGRAM 2
#define RUMP_SOCK_RAW 3
#define RUMP_SOCK_RDM 4
#define RUMP_SOCK_SEQPACKET 5
#define RUMP_SOCK_CONN_DGRAM 6
#define RUMP_SOCK_DCCP RUMP_SOCK_CONN_DGRAM
#define RUMP_SOCK_CLOEXEC 0x10000000
#define RUMP_SOCK_NONBLOCK 0x20000000
#define RUMP_SOCK_NOSIGPIPE 0x40000000
#define RUMP_SOCK_FLAGS_MASK 0xf0000000
#define RUMP_AF_UNSPEC 0
#define RUMP_AF_LOCAL 1
#define RUMP_AF_UNIX RUMP_AF_LOCAL
#define RUMP_AF_INET 2
#define RUMP_AF_IMPLINK 3
#define RUMP_AF_PUP 4
#define RUMP_AF_CHAOS 5
#define RUMP_AF_NS 6
#define RUMP_AF_ISO 7
#define RUMP_AF_OSI RUMP_AF_ISO
#define RUMP_AF_ECMA 8
#define RUMP_AF_DATAKIT 9
#define RUMP_AF_CCITT 10
#define RUMP_AF_SNA 11
#define RUMP_AF_DECnet 12
#define RUMP_AF_DLI 13
#define RUMP_AF_LAT 14
#define RUMP_AF_HYLINK 15
#define RUMP_AF_APPLETALK 16
#define RUMP_AF_OROUTE 17
#define RUMP_AF_LINK 18
#define RUMP_AF_COIP 20
#define RUMP_AF_CNT 21
#define RUMP_AF_IPX 23
#define RUMP_AF_INET6 24
#define RUMP_AF_ISDN 26
#define RUMP_AF_E164 RUMP_AF_ISDN
#define RUMP_AF_NATM 27
#define RUMP_AF_ARP 28
#define RUMP_AF_BLUETOOTH 31
#define RUMP_AF_IEEE80211 32
#define RUMP_AF_MPLS 33
#define RUMP_AF_ROUTE 34
#define RUMP_AF_MAX 35
#define RUMP_PF_UNSPEC RUMP_AF_UNSPEC
#define RUMP_PF_LOCAL RUMP_AF_LOCAL
#define RUMP_PF_UNIX RUMP_PF_LOCAL
#define RUMP_PF_INET RUMP_AF_INET
#define RUMP_PF_IMPLINK RUMP_AF_IMPLINK
#define RUMP_PF_PUP RUMP_AF_PUP
#define RUMP_PF_CHAOS RUMP_AF_CHAOS
#define RUMP_PF_NS RUMP_AF_NS
#define RUMP_PF_ISO RUMP_AF_ISO
#define RUMP_PF_OSI RUMP_AF_ISO
#define RUMP_PF_ECMA RUMP_AF_ECMA
#define RUMP_PF_DATAKIT RUMP_AF_DATAKIT
#define RUMP_PF_CCITT RUMP_AF_CCITT
#define RUMP_PF_SNA RUMP_AF_SNA
#define RUMP_PF_DECnet RUMP_AF_DECnet
#define RUMP_PF_DLI RUMP_AF_DLI
#define RUMP_PF_LAT RUMP_AF_LAT
#define RUMP_PF_HYLINK RUMP_AF_HYLINK
#define RUMP_PF_APPLETALK RUMP_AF_APPLETALK
#define RUMP_PF_OROUTE RUMP_AF_OROUTE
#define RUMP_PF_LINK RUMP_AF_LINK
#define RUMP_PF_XTP pseudo_RUMP_AF_XTP
#define RUMP_PF_COIP RUMP_AF_COIP
#define RUMP_PF_CNT RUMP_AF_CNT
#define RUMP_PF_INET6 RUMP_AF_INET6
#define RUMP_PF_IPX RUMP_AF_IPX
#define RUMP_PF_RTIP pseudo_RUMP_AF_RTIP
#define RUMP_PF_PIP pseudo_RUMP_AF_PIP
#define RUMP_PF_ISDN RUMP_AF_ISDN
#define RUMP_PF_E164 RUMP_AF_E164
#define RUMP_PF_NATM RUMP_AF_NATM
#define RUMP_PF_ARP RUMP_AF_ARP
#define RUMP_PF_KEY pseudo_RUMP_AF_KEY
#define RUMP_PF_BLUETOOTH RUMP_AF_BLUETOOTH
#define RUMP_PF_MPLS RUMP_AF_MPLS
#define RUMP_PF_ROUTE RUMP_AF_ROUTE
#define RUMP_PF_MAX RUMP_AF_MAX
#define RUMP_SO_DEBUG 0x0001
#define RUMP_SO_ACCEPTCONN 0x0002
#define RUMP_SO_REUSEADDR 0x0004
#define RUMP_SO_KEEPALIVE 0x0008
#define RUMP_SO_DONTROUTE 0x0010
#define RUMP_SO_BROADCAST 0x0020
#define RUMP_SO_USELOOPBACK 0x0040
#define RUMP_SO_LINGER 0x0080
#define RUMP_SO_OOBINLINE 0x0100
#define RUMP_SO_REUSEPORT 0x0200
#define RUMP_SO_NOSIGPIPE 0x0800
#define RUMP_SO_ACCEPTFILTER 0x1000
#define RUMP_SO_TIMESTAMP 0x2000
#define RUMP_SO_SNDBUF 0x1001
#define RUMP_SO_RCVBUF 0x1002
#define RUMP_SO_SNDLOWAT 0x1003
#define RUMP_SO_RCVLOWAT 0x1004
#define RUMP_SO_ERROR 0x1007
#define RUMP_SO_TYPE 0x1008
#define RUMP_SO_OVERFLOWED 0x1009
#define RUMP_SO_NOHEADER 0x100a
#define RUMP_SO_SNDTIMEO 0x100b
#define RUMP_SO_RCVTIMEO 0x100c
#define RUMP_SOL_SOCKET 0xffff
#define RUMP_MSG_OOB 0x0001
#define RUMP_MSG_PEEK 0x0002
#define RUMP_MSG_DONTROUTE 0x0004
#define RUMP_MSG_EOR 0x0008
#define RUMP_MSG_TRUNC 0x0010
#define RUMP_MSG_CTRUNC 0x0020
#define RUMP_MSG_WAITALL 0x0040
#define RUMP_MSG_DONTWAIT 0x0080
#define RUMP_MSG_BCAST 0x0100
#define RUMP_MSG_MCAST 0x0200
#define RUMP_MSG_NOSIGNAL 0x0400
#define RUMP_MSG_CRUMP_MSG_CLOEXEC 0x0800
#define RUMP_MSG_NBIO 0x1000
#define RUMP_MSG_WAITFORONE 0x2000
#define RUMP_MSG_USERFLAGS 0x0ffffff
#define RUMP_MSG_NAMEMBUF 0x1000000
#define RUMP_MSG_CONTROLMBUF 0x2000000
#define RUMP_MSG_IOVUSRSPACE 0x4000000
#define RUMP_MSG_LENUSRSPACE 0x8000000
/* NetBSD: in.h,v 1.97 2015/05/02 14:41:32 roy Exp */
#define RUMP_IP_OPTIONS 1
#define RUMP_IP_HDRINCL 2
#define RUMP_IP_TOS 3
#define RUMP_IP_TTL 4
#define RUMP_IP_RECVOPTS 5
#define RUMP_IP_RECVRETOPTS 6
#define RUMP_IP_RECVDSTADDR 7
#define RUMP_IP_RETOPTS 8
#define RUMP_IP_MULTICAST_IF 9
#define RUMP_IP_MULTICAST_TTL 10
#define RUMP_IP_MULTICAST_LOOP 11
#define RUMP_IP_ADD_MEMBERSHIP 12
#define RUMP_IP_DROP_MEMBERSHIP 13
#define RUMP_IP_PORTALGO 18
#define RUMP_IP_PORTRANGE 19
#define RUMP_IP_RECVIF 20
#define RUMP_IP_ERRORMTU 21
#define RUMP_IP_IPSEC_POLICY 22
#define RUMP_IP_RECVTTL 23
#define RUMP_IP_MINTTL 24
#define RUMP_IP_PKTINFO 25
#define RUMP_IP_RECVPKTINFO 26
#define RUMP_IP_DEFAULT_MULTICAST_TTL 1
#define RUMP_IP_DEFAULT_MULTICAST_LOOP 1
#define RUMP_IP_MAX_MEMBERSHIPS 20
#define RUMP_IP_PORTRANGE_DEFAULT 0
#define RUMP_IP_PORTRANGE_HIGH 1
#define RUMP_IP_PORTRANGE_LOW 2
#define RUMP_IPPROTO_IP 0
#define RUMP_IPPROTO_HOPOPTS 0
#define RUMP_IPPROTO_ICMP 1
#define RUMP_IPPROTO_IGMP 2
#define RUMP_IPPROTO_GGP 3
#define RUMP_IPPROTO_IPV4 4
#define RUMP_IPPROTO_IPIP 4
#define RUMP_IPPROTO_TCP 6
#define RUMP_IPPROTO_EGP 8
#define RUMP_IPPROTO_PUP 12
#define RUMP_IPPROTO_UDP 17
#define RUMP_IPPROTO_IDP 22
#define RUMP_IPPROTO_TP 29
#define RUMP_IPPROTO_DCCP 33
#define RUMP_IPPROTO_IPV6 41
#define RUMP_IPPROTO_ROUTING 43
#define RUMP_IPPROTO_FRAGMENT 44
#define RUMP_IPPROTO_RSVP 46
#define RUMP_IPPROTO_GRE 47
#define RUMP_IPPROTO_ESP 50
#define RUMP_IPPROTO_AH 51
#define RUMP_IPPROTO_MOBILE 55
#define RUMP_IPPROTO_IPV6_ICMP 58
#define RUMP_IPPROTO_ICMPV6 58
#define RUMP_IPPROTO_NONE 59
#define RUMP_IPPROTO_DSTOPTS 60
#define RUMP_IPPROTO_EON 80
#define RUMP_IPPROTO_ETHERIP 97
#define RUMP_IPPROTO_ENCAP 98
#define RUMP_IPPROTO_PIM 103
#define RUMP_IPPROTO_IPCOMP 108
#define RUMP_IPPROTO_VRRP 112
#define RUMP_IPPROTO_CARP 112
#define RUMP_IPPROTO_PFSYNC 240
#define RUMP_IPPROTO_RAW 255
#define RUMP_IPPROTO_MAX 256
#define RUMP_IPPROTO_DONE 257
#define RUMP_IPPROTO_MAXID (RUMP_IPPROTO_AH + 1)
/* NetBSD: tcp.h,v 1.31 2015/02/14 12:57:53 he Exp */
#define RUMP_TCP_MSS 536
#define RUMP_TCP_MINMSS 216
#define RUMP_TCP_MAXWIN 65535
#define RUMP_TCP_MAX_WINSHIFT 14
#define RUMP_TCP_MAXBURST 4
#define RUMP_TCP_NODELAY 1
#define RUMP_TCP_MAXSEG 2
#define RUMP_TCP_KEEPIDLE 3
#define RUMP_TCP_NOPUSH 4
#define RUMP_TCP_KEEPINTVL 5
#define RUMP_TCP_KEEPCNT 6
#define RUMP_TCP_KEEPINIT 7
#define RUMP_TCP_NOOPT 8
#define RUMP_TCP_INFO 9
#define RUMP_TCP_MD5SIG 0x10
#define RUMP_TCP_CONGCTL 0x20
/* NetBSD: mount.h,v 1.217 2015/05/06 15:57:08 hannken Exp */
#define RUMP_MOUNT_FFS "ffs"
#define RUMP_MOUNT_UFS RUMP_MOUNT_FFS
#define RUMP_MOUNT_NFS "nfs"
#define RUMP_MOUNT_MFS "mfs"
#define RUMP_MOUNT_MSDOS "msdos"
#define RUMP_MOUNT_LFS "lfs"
#define RUMP_MOUNT_FDESC "fdesc"
#define RUMP_MOUNT_NULL "null"
#define RUMP_MOUNT_OVERLAY "overlay"
#define RUMP_MOUNT_UMAP "umap"
#define RUMP_MOUNT_KERNFS "kernfs"
#define RUMP_MOUNT_PROCFS "procfs"
#define RUMP_MOUNT_AFS "afs"
#define RUMP_MOUNT_CD9660 "cd9660"
#define RUMP_MOUNT_UNION "union"
#define RUMP_MOUNT_ADOSFS "adosfs"
#define RUMP_MOUNT_EXT2FS "ext2fs"
#define RUMP_MOUNT_CFS "coda"
#define RUMP_MOUNT_CODA RUMP_MOUNT_CFS
#define RUMP_MOUNT_FILECORE "filecore"
#define RUMP_MOUNT_NTFS "ntfs"
#define RUMP_MOUNT_SMBFS "smbfs"
#define RUMP_MOUNT_PTYFS "ptyfs"
#define RUMP_MOUNT_TMPFS "tmpfs"
#define RUMP_MOUNT_UDF "udf"
#define RUMP_MOUNT_SYSVBFS "sysvbfs"
#define RUMP_MOUNT_PUFFS "puffs"
#define RUMP_MOUNT_HFS "hfs"
#define RUMP_MOUNT_EFS "efs"
#define RUMP_MOUNT_ZFS "zfs"
#define RUMP_MOUNT_NILFS "nilfs"
#define RUMP_MOUNT_RUMPFS "rumpfs"
#define RUMP_MOUNT_V7FS "v7fs"
/* NetBSD: fstypes.h,v 1.33 2015/05/06 15:57:08 hannken Exp */
#define RUMP_MNT_RDONLY 0x00000001
#define RUMP_MNT_SYNCHRONOUS 0x00000002
#define RUMP_MNT_NOEXEC 0x00000004
#define RUMP_MNT_NOSUID 0x00000008
#define RUMP_MNT_NODEV 0x00000010
#define RUMP_MNT_UNION 0x00000020
#define RUMP_MNT_ASYNC 0x00000040
#define RUMP_MNT_NOCOREDUMP 0x00008000
#define RUMP_MNT_RELATIME 0x00020000
#define RUMP_MNT_IGNORE 0x00100000
#define RUMP_MNT_DISCARD 0x00800000
#define RUMP_MNT_EXTATTR 0x01000000
#define RUMP_MNT_LOG 0x02000000
#define RUMP_MNT_NOATIME 0x04000000
#define RUMP_MNT_SYMPERM 0x20000000
#define RUMP_MNT_NODEVMTIME 0x40000000
#define RUMP_MNT_SOFTDEP 0x80000000
#define RUMP_MNT_EXRDONLY 0x00000080
#define RUMP_MNT_EXPORTED 0x00000100
#define RUMP_MNT_DEFEXPORTED 0x00000200
#define RUMP_MNT_EXPORTANON 0x00000400
#define RUMP_MNT_EXKERB 0x00000800
#define RUMP_MNT_EXNORESPORT 0x08000000
#define RUMP_MNT_EXPUBLIC 0x10000000
#define RUMP_MNT_LOCAL 0x00001000
#define RUMP_MNT_QUOTA 0x00002000
#define RUMP_MNT_ROOTFS 0x00004000
#define RUMP_MNT_UPDATE 0x00010000
#define RUMP_MNT_RELOAD 0x00040000
#define RUMP_MNT_FORCE 0x00080000
#define RUMP_MNT_GETARGS 0x00400000
#define RUMP_MNT_OP_FLAGS (RUMP_MNT_UPDATE|RUMP_MNT_RELOAD|RUMP_MNT_FORCE|RUMP_MNT_GETARGS)
#define RUMP_MNT_WAIT 1
#define RUMP_MNT_NOWAIT 2
#define RUMP_MNT_LAZY 3
/* NetBSD: ioccom.h,v 1.12 2014/12/10 00:16:05 christos Exp */
#define RUMP_IOCPARM_MASK 0x1fff
#define RUMP_IOCPARM_SHIFT 16
#define RUMP_IOCGROUP_SHIFT 8
#define RUMP_IOCPARM_LEN(x) (((x) >> RUMP_IOCPARM_SHIFT) & RUMP_IOCPARM_MASK)
#define RUMP_IOCBASECMD(x) ((x) & ~(RUMP_IOCPARM_MASK << RUMP_IOCPARM_SHIFT))
#define RUMP_IOCGROUP(x) (((x) >> RUMP_IOCGROUP_SHIFT) & 0xff)
#define RUMP_IOCPARM_MAX NBPG
#define RUMP_IOC_VOID (unsigned long)0x20000000
#define RUMP_IOC_OUT (unsigned long)0x40000000
#define RUMP_IOC_IN (unsigned long)0x80000000
#define RUMP_IOC_INOUT (RUMP_IOC_IN|RUMP_IOC_OUT)
#define RUMP_IOC_DIRMASK (unsigned long)0xe0000000
#define _RUMP_IOC(inout, group, num, len) \
((inout) | (((len) & RUMP_IOCPARM_MASK) << RUMP_IOCPARM_SHIFT) | \
((group) << RUMP_IOCGROUP_SHIFT) | (num))
#define _RUMP_IO(g,n) _RUMP_IOC(RUMP_IOC_VOID, (g), (n), 0)
#define _RUMP_IOR(g,n,t) _RUMP_IOC(RUMP_IOC_OUT, (g), (n), sizeof(t))
#define _RUMP_IOW(g,n,t) _RUMP_IOC(RUMP_IOC_IN, (g), (n), sizeof(t))
#define _RUMP_IOWR(g,n,t) _RUMP_IOC(RUMP_IOC_INOUT, (g), (n), sizeof(t))
/* NetBSD: ktrace.h,v 1.61 2013/12/09 17:43:58 pooka Exp */
#define RUMP_KTROP_SET 0
#define RUMP_KTROP_CLEAR 1
#define RUMP_KTROP_CLEARFILE 2
#define RUMP_KTROP_MASK 0x3
#define RUMP_KTR_SHIMLEN offsetof(struct ktr_header, ktr_pid)
#define RUMP_KTR_SYSCALL 1
#define RUMP_KTR_SYSRET 2
#define RUMP_KTR_NAMEI 3
#define RUMP_KTR_GENIO 4
#define RUMP_KTR_PSIG 5
#define RUMP_KTR_CSW 6
#define RUMP_KTR_EMUL 7
#define RUMP_KTR_USER 8
#define RUMP_KTR_USER_MAXIDLEN 20
#define RUMP_KTR_USER_MAXLEN 2048
#define RUMP_KTR_EXEC_ARG 10
#define RUMP_KTR_EXEC_ENV 11
#define RUMP_KTR_SAUPCALL 13
#define RUMP_KTR_MIB 14
#define RUMP_KTR_EXEC_FD 15
#define RUMP_KTRFAC_MASK 0x00ffffff
#define RUMP_KTRFAC_SYSCALL (1<<RUMP_KTR_SYSCALL)
#define RUMP_KTRFAC_SYSRET (1<<RUMP_KTR_SYSRET)
#define RUMP_KTRFAC_NAMEI (1<<RUMP_KTR_NAMEI)
#define RUMP_KTRFAC_GENIO (1<<RUMP_KTR_GENIO)
#define RUMP_KTRFAC_PSIG (1<<RUMP_KTR_PSIG)
#define RUMP_KTRFAC_CSW (1<<RUMP_KTR_CSW)
#define RUMP_KTRFAC_EMUL (1<<RUMP_KTR_EMUL)
#define RUMP_KTRFAC_USER (1<<RUMP_KTR_USER)
#define RUMP_KTRFAC_EXEC_ARG (1<<RUMP_KTR_EXEC_ARG)
#define RUMP_KTRFAC_EXEC_ENV (1<<RUMP_KTR_EXEC_ENV)
#define RUMP_KTRFAC_MIB (1<<RUMP_KTR_MIB)
#define RUMP_KTRFAC_EXEC_FD (1<<RUMP_KTR_EXEC_FD)
#define RUMP_KTRFAC_PERSISTENT 0x80000000
#define RUMP_KTRFAC_INHERIT 0x40000000
#define RUMP_KTRFAC_TRC_EMUL 0x10000000
#define RUMP_KTRFAC_VER_MASK 0x0f000000
#define RUMP_KTRFAC_VER_SHIFT 24
#define RUMP_KTRFAC_VERSION(tf) (((tf) & RUMP_KTRFAC_VER_MASK) >> RUMP_KTRFAC_VER_SHIFT)
#define RUMP_KTRFACv0 (0 << RUMP_KTRFAC_VER_SHIFT)
#define RUMP_KTRFACv1 (1 << RUMP_KTRFAC_VER_SHIFT)
#define RUMP_KTRFACv2 (2 << RUMP_KTRFAC_VER_SHIFT)
/* NetBSD: module.h,v 1.38 2015/06/22 16:35:13 matt Exp */
struct rump_modctl_load {
const char *ml_filename;
int ml_flags;
const char *ml_props;
size_t ml_propslen;
};
enum rump_modctl {
RUMP_MODCTL_LOAD, /* modctl_load_t *ml */
RUMP_MODCTL_UNLOAD, /* char *name */
RUMP_MODCTL_STAT, /* struct iovec *buffer */
RUMP_MODCTL_EXISTS /* enum: 0: load, 1: autoload */
};
/* NetBSD: ufsmount.h,v 1.43 2015/03/27 17:27:56 riastradh Exp */
struct rump_ufs_args {
char *fspec; /* block special device to mount */
};
/* NetBSD: sysvbfs_args.h,v 1.1 2008/09/04 12:07:30 pooka Exp */
struct rump_sysvbfs_args {
char *fspec; /* blocks special holding the fs to mount */
};
/* NetBSD: dirent.h,v 1.29 2015/02/26 02:05:54 dholland Exp */
struct rump_dirent {
uint64_t d_fileno; /* file number of entry */
uint16_t d_reclen; /* length of this record */
uint16_t d_namlen; /* length of string in d_name */
uint8_t d_type; /* file type, see below */
char d_name[511 + 1]; /* name must be no longer than this */
};
#endif /* _RUMP_RUMPDEFS_H_ */

View File

@ -0,0 +1,211 @@
/* $NetBSD: rumperr.h,v 1.4 2015/09/15 14:55:55 pooka Exp $ */
/*
* AUTOMATICALLY GENERATED. DO NOT EDIT.
*/
/* NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp */
static inline const char *
rump_strerror(int error)
{
switch (error) {
case 0:
return "No error: zero, zip, zilch, none!";
case 1: /* (EPERM) */
return "Operation not permitted";
case 2: /* (ENOENT) */
return "No such file or directory";
case 3: /* (ESRCH) */
return "No such process";
case 4: /* (EINTR) */
return "Interrupted system call";
case 5: /* (EIO) */
return "Input/output error";
case 6: /* (ENXIO) */
return "Device not configured";
case 7: /* (E2BIG) */
return "Argument list too long";
case 8: /* (ENOEXEC) */
return "Exec format error";
case 9: /* (EBADF) */
return "Bad file descriptor";
case 10: /* (ECHILD) */
return "No child processes";
case 11: /* (EDEADLK) */
return "Resource deadlock avoided";
case 12: /* (ENOMEM) */
return "Cannot allocate memory";
case 13: /* (EACCES) */
return "Permission denied";
case 14: /* (EFAULT) */
return "Bad address";
case 15: /* (ENOTBLK) */
return "Block device required";
case 16: /* (EBUSY) */
return "Device busy";
case 17: /* (EEXIST) */
return "File exists";
case 18: /* (EXDEV) */
return "Cross-device link";
case 19: /* (ENODEV) */
return "Operation not supported by device";
case 20: /* (ENOTDIR) */
return "Not a directory";
case 21: /* (EISDIR) */
return "Is a directory";
case 22: /* (EINVAL) */
return "Invalid argument";
case 23: /* (ENFILE) */
return "Too many open files in system";
case 24: /* (EMFILE) */
return "Too many open files";
case 25: /* (ENOTTY) */
return "Inappropriate ioctl for device";
case 26: /* (ETXTBSY) */
return "Text file busy";
case 27: /* (EFBIG) */
return "File too large";
case 28: /* (ENOSPC) */
return "No space left on device";
case 29: /* (ESPIPE) */
return "Illegal seek";
case 30: /* (EROFS) */
return "Read-only file system";
case 31: /* (EMLINK) */
return "Too many links";
case 32: /* (EPIPE) */
return "Broken pipe";
case 33: /* (EDOM) */
return "Numerical argument out of domain";
case 34: /* (ERANGE) */
return "Result too large or too small";
case 35: /* (EAGAIN) */
return "Resource temporarily unavailable";
case 36: /* (EINPROGRESS) */
return "Operation now in progress";
case 37: /* (EALREADY) */
return "Operation already in progress";
case 38: /* (ENOTSOCK) */
return "Socket operation on non-socket";
case 39: /* (EDESTADDRREQ) */
return "Destination address required";
case 40: /* (EMSGSIZE) */
return "Message too long";
case 41: /* (EPROTOTYPE) */
return "Protocol wrong type for socket";
case 42: /* (ENOPROTOOPT) */
return "Protocol option not available";
case 43: /* (EPROTONOSUPPORT) */
return "Protocol not supported";
case 44: /* (ESOCKTNOSUPPORT) */
return "Socket type not supported";
case 45: /* (EOPNOTSUPP) */
return "Operation not supported";
case 46: /* (EPFNOSUPPORT) */
return "Protocol family not supported";
case 47: /* (EAFNOSUPPORT) */
return "Address family not supported by protocol family";
case 48: /* (EADDRINUSE) */
return "Address already in use";
case 49: /* (EADDRNOTAVAIL) */
return "Can't assign requested address";
case 50: /* (ENETDOWN) */
return "Network is down";
case 51: /* (ENETUNREACH) */
return "Network is unreachable";
case 52: /* (ENETRESET) */
return "Network dropped connection on reset";
case 53: /* (ECONNABORTED) */
return "Software caused connection abort";
case 54: /* (ECONNRESET) */
return "Connection reset by peer";
case 55: /* (ENOBUFS) */
return "No buffer space available";
case 56: /* (EISCONN) */
return "Socket is already connected";
case 57: /* (ENOTCONN) */
return "Socket is not connected";
case 58: /* (ESHUTDOWN) */
return "Can't send after socket shutdown";
case 59: /* (ETOOMANYREFS) */
return "Too many references: can't splice";
case 60: /* (ETIMEDOUT) */
return "Operation timed out";
case 61: /* (ECONNREFUSED) */
return "Connection refused";
case 62: /* (ELOOP) */
return "Too many levels of symbolic links";
case 63: /* (ENAMETOOLONG) */
return "File name too long";
case 64: /* (EHOSTDOWN) */
return "Host is down";
case 65: /* (EHOSTUNREACH) */
return "No route to host";
case 66: /* (ENOTEMPTY) */
return "Directory not empty";
case 67: /* (EPROCLIM) */
return "Too many processes";
case 68: /* (EUSERS) */
return "Too many users";
case 69: /* (EDQUOT) */
return "Disc quota exceeded";
case 70: /* (ESTALE) */
return "Stale NFS file handle";
case 71: /* (EREMOTE) */
return "Too many levels of remote in path";
case 72: /* (EBADRPC) */
return "RPC struct is bad";
case 73: /* (ERPCMISMATCH) */
return "RPC version wrong";
case 74: /* (EPROGUNAVAIL) */
return "RPC prog. not avail";
case 75: /* (EPROGMISMATCH) */
return "Program version wrong";
case 76: /* (EPROCUNAVAIL) */
return "Bad procedure for program";
case 77: /* (ENOLCK) */
return "No locks available";
case 78: /* (ENOSYS) */
return "Function not implemented";
case 79: /* (EFTYPE) */
return "Inappropriate file type or format";
case 80: /* (EAUTH) */
return "Authentication error";
case 81: /* (ENEEDAUTH) */
return "Need authenticator";
case 82: /* (EIDRM) */
return "Identifier removed";
case 83: /* (ENOMSG) */
return "No message of desired type";
case 84: /* (EOVERFLOW) */
return "Value too large to be stored in data type";
case 85: /* (EILSEQ) */
return "Illegal byte sequence";
case 86: /* (ENOTSUP) */
return "Not supported";
case 87: /* (ECANCELED) */
return "Operation canceled";
case 88: /* (EBADMSG) */
return "Bad or Corrupt message";
case 89: /* (ENODATA) */
return "No message available";
case 90: /* (ENOSR) */
return "No STREAM resources";
case 91: /* (ENOSTR) */
return "Not a STREAM";
case 92: /* (ETIME) */
return "STREAM ioctl timeout";
case 93: /* (ENOATTR) */
return "Attribute not found";
case 94: /* (EMULTIHOP) */
return "Multihop attempted";
case 95: /* (ENOLINK) */
return "Link has been severed";
case 96: /* (EPROTO) */
return "Protocol error";
default:
return "Invalid error!";
}
}

View File

@ -0,0 +1,411 @@
/* $NetBSD: rumperrno2host.h,v 1.1 2015/09/15 14:55:55 pooka Exp $ */
/*
* AUTOMATICALLY GENERATED. DO NOT EDIT.
*/
/* NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp */
#ifndef ERANGE
#error include ISO C style errno.h first
#endif
static inline int
rump_errno2host(int rumperrno)
{
switch (rumperrno) {
case 0:
return 0;
#ifdef EPERM
case 1:
return EPERM;
#endif
#ifdef ENOENT
case 2:
return ENOENT;
#endif
#ifdef ESRCH
case 3:
return ESRCH;
#endif
#ifdef EINTR
case 4:
return EINTR;
#endif
#ifdef EIO
case 5:
return EIO;
#endif
#ifdef ENXIO
case 6:
return ENXIO;
#endif
#ifdef E2BIG
case 7:
return E2BIG;
#endif
#ifdef ENOEXEC
case 8:
return ENOEXEC;
#endif
#ifdef EBADF
case 9:
return EBADF;
#endif
#ifdef ECHILD
case 10:
return ECHILD;
#endif
#ifdef EDEADLK
case 11:
return EDEADLK;
#endif
#ifdef ENOMEM
case 12:
return ENOMEM;
#endif
#ifdef EACCES
case 13:
return EACCES;
#endif
#ifdef EFAULT
case 14:
return EFAULT;
#endif
#ifdef ENOTBLK
case 15:
return ENOTBLK;
#endif
#ifdef EBUSY
case 16:
return EBUSY;
#endif
#ifdef EEXIST
case 17:
return EEXIST;
#endif
#ifdef EXDEV
case 18:
return EXDEV;
#endif
#ifdef ENODEV
case 19:
return ENODEV;
#endif
#ifdef ENOTDIR
case 20:
return ENOTDIR;
#endif
#ifdef EISDIR
case 21:
return EISDIR;
#endif
#ifdef EINVAL
case 22:
return EINVAL;
#endif
#ifdef ENFILE
case 23:
return ENFILE;
#endif
#ifdef EMFILE
case 24:
return EMFILE;
#endif
#ifdef ENOTTY
case 25:
return ENOTTY;
#endif
#ifdef ETXTBSY
case 26:
return ETXTBSY;
#endif
#ifdef EFBIG
case 27:
return EFBIG;
#endif
#ifdef ENOSPC
case 28:
return ENOSPC;
#endif
#ifdef ESPIPE
case 29:
return ESPIPE;
#endif
#ifdef EROFS
case 30:
return EROFS;
#endif
#ifdef EMLINK
case 31:
return EMLINK;
#endif
#ifdef EPIPE
case 32:
return EPIPE;
#endif
#ifdef EDOM
case 33:
return EDOM;
#endif
#ifdef ERANGE
case 34:
return ERANGE;
#endif
#ifdef EAGAIN
case 35:
return EAGAIN;
#endif
#ifdef EINPROGRESS
case 36:
return EINPROGRESS;
#endif
#ifdef EALREADY
case 37:
return EALREADY;
#endif
#ifdef ENOTSOCK
case 38:
return ENOTSOCK;
#endif
#ifdef EDESTADDRREQ
case 39:
return EDESTADDRREQ;
#endif
#ifdef EMSGSIZE
case 40:
return EMSGSIZE;
#endif
#ifdef EPROTOTYPE
case 41:
return EPROTOTYPE;
#endif
#ifdef ENOPROTOOPT
case 42:
return ENOPROTOOPT;
#endif
#ifdef EPROTONOSUPPORT
case 43:
return EPROTONOSUPPORT;
#endif
#ifdef ESOCKTNOSUPPORT
case 44:
return ESOCKTNOSUPPORT;
#endif
#ifdef EOPNOTSUPP
case 45:
return EOPNOTSUPP;
#endif
#ifdef EPFNOSUPPORT
case 46:
return EPFNOSUPPORT;
#endif
#ifdef EAFNOSUPPORT
case 47:
return EAFNOSUPPORT;
#endif
#ifdef EADDRINUSE
case 48:
return EADDRINUSE;
#endif
#ifdef EADDRNOTAVAIL
case 49:
return EADDRNOTAVAIL;
#endif
#ifdef ENETDOWN
case 50:
return ENETDOWN;
#endif
#ifdef ENETUNREACH
case 51:
return ENETUNREACH;
#endif
#ifdef ENETRESET
case 52:
return ENETRESET;
#endif
#ifdef ECONNABORTED
case 53:
return ECONNABORTED;
#endif
#ifdef ECONNRESET
case 54:
return ECONNRESET;
#endif
#ifdef ENOBUFS
case 55:
return ENOBUFS;
#endif
#ifdef EISCONN
case 56:
return EISCONN;
#endif
#ifdef ENOTCONN
case 57:
return ENOTCONN;
#endif
#ifdef ESHUTDOWN
case 58:
return ESHUTDOWN;
#endif
#ifdef ETOOMANYREFS
case 59:
return ETOOMANYREFS;
#endif
#ifdef ETIMEDOUT
case 60:
return ETIMEDOUT;
#endif
#ifdef ECONNREFUSED
case 61:
return ECONNREFUSED;
#endif
#ifdef ELOOP
case 62:
return ELOOP;
#endif
#ifdef ENAMETOOLONG
case 63:
return ENAMETOOLONG;
#endif
#ifdef EHOSTDOWN
case 64:
return EHOSTDOWN;
#endif
#ifdef EHOSTUNREACH
case 65:
return EHOSTUNREACH;
#endif
#ifdef ENOTEMPTY
case 66:
return ENOTEMPTY;
#endif
#ifdef EPROCLIM
case 67:
return EPROCLIM;
#endif
#ifdef EUSERS
case 68:
return EUSERS;
#endif
#ifdef EDQUOT
case 69:
return EDQUOT;
#endif
#ifdef ESTALE
case 70:
return ESTALE;
#endif
#ifdef EREMOTE
case 71:
return EREMOTE;
#endif
#ifdef EBADRPC
case 72:
return EBADRPC;
#endif
#ifdef ERPCMISMATCH
case 73:
return ERPCMISMATCH;
#endif
#ifdef EPROGUNAVAIL
case 74:
return EPROGUNAVAIL;
#endif
#ifdef EPROGMISMATCH
case 75:
return EPROGMISMATCH;
#endif
#ifdef EPROCUNAVAIL
case 76:
return EPROCUNAVAIL;
#endif
#ifdef ENOLCK
case 77:
return ENOLCK;
#endif
#ifdef ENOSYS
case 78:
return ENOSYS;
#endif
#ifdef EFTYPE
case 79:
return EFTYPE;
#endif
#ifdef EAUTH
case 80:
return EAUTH;
#endif
#ifdef ENEEDAUTH
case 81:
return ENEEDAUTH;
#endif
#ifdef EIDRM
case 82:
return EIDRM;
#endif
#ifdef ENOMSG
case 83:
return ENOMSG;
#endif
#ifdef EOVERFLOW
case 84:
return EOVERFLOW;
#endif
#ifdef EILSEQ
case 85:
return EILSEQ;
#endif
#ifdef ENOTSUP
case 86:
return ENOTSUP;
#endif
#ifdef ECANCELED
case 87:
return ECANCELED;
#endif
#ifdef EBADMSG
case 88:
return EBADMSG;
#endif
#ifdef ENODATA
case 89:
return ENODATA;
#endif
#ifdef ENOSR
case 90:
return ENOSR;
#endif
#ifdef ENOSTR
case 91:
return ENOSTR;
#endif
#ifdef ETIME
case 92:
return ETIME;
#endif
#ifdef ENOATTR
case 93:
return ENOATTR;
#endif
#ifdef EMULTIHOP
case 94:
return EMULTIHOP;
#endif
#ifdef ENOLINK
case 95:
return ENOLINK;
#endif
#ifdef EPROTO
case 96:
return EPROTO;
#endif
default:
#ifdef EINVAL
return EINVAL;
#else
return ERANGE;
#endif
}
}

View File

@ -0,0 +1,27 @@
/* $NetBSD: rumpkern_if_pub.h,v 1.17 2014/04/25 17:50:28 pooka Exp $ */
/*
* Automatically generated. DO NOT EDIT.
* from: NetBSD: rumpkern.ifspec,v 1.13 2014/04/25 13:10:42 pooka Exp
* by: NetBSD: makerumpif.sh,v 1.8 2014/04/25 17:50:01 pooka Exp
*/
int rump_pub_module_init(const struct modinfo * const *, size_t);
int rump_pub_module_fini(const struct modinfo *);
int rump_pub_kernelfsym_load(void *, uint64_t, char *, uint64_t);
struct uio * rump_pub_uio_setup(void *, size_t, off_t, enum rump_uiorw);
size_t rump_pub_uio_getresid(struct uio *);
off_t rump_pub_uio_getoff(struct uio *);
size_t rump_pub_uio_free(struct uio *);
struct kauth_cred* rump_pub_cred_create(uid_t, gid_t, size_t, gid_t *);
void rump_pub_cred_put(struct kauth_cred *);
int rump_pub_lwproc_rfork(int);
int rump_pub_lwproc_newlwp(pid_t);
void rump_pub_lwproc_switch(struct lwp *);
void rump_pub_lwproc_releaselwp(void);
struct lwp * rump_pub_lwproc_curlwp(void);
void rump_pub_lwproc_sysent_usenative(void);
void rump_pub_allbetsareoff_setid(pid_t, int);
int rump_pub_etfs_register(const char *, const char *, enum rump_etfs_type);
int rump_pub_etfs_register_withsize(const char *, const char *, enum rump_etfs_type, uint64_t, uint64_t);
int rump_pub_etfs_remove(const char *);

View File

@ -0,0 +1,9 @@
/* $NetBSD: rumpnet_if_pub.h,v 1.5 2013/07/03 19:22:21 pooka Exp $ */
/*
* Automatically generated. DO NOT EDIT.
* from: NetBSD: rumpnet.ifspec,v 1.3 2013/07/03 19:21:11 pooka Exp
* by: NetBSD: makerumpif.sh,v 1.6 2013/02/14 10:54:54 pooka Exp
*/
int rump_pub_shmif_create(const char *, int *);

View File

@ -0,0 +1,254 @@
/* $NetBSD: rumpuser.h,v 1.114 2015/01/03 17:24:20 pooka Exp $ */
/*
* Copyright (c) 2007-2013 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.
*/
#ifndef _RUMP_RUMPUSER_H_
#define _RUMP_RUMPUSER_H_
/*
* Do not include any headers here! Implementation must take care of
* having stdint or equivalent included before including this header.
*/
#if !defined(_KERNEL) && !defined(LIBRUMPUSER)
#error The rump/rumpuser.h interface is not for non-kernel consumers
#endif
struct lwp;
/*
* init
*/
/*
* Bumping this causes all kinds of havoc for implementations
* outside of the NetBSD tree, so try to avoid it.
*/
#define RUMPUSER_VERSION 17
/* hypervisor upcall routines */
struct rumpuser_hyperup {
void (*hyp_schedule)(void);
void (*hyp_unschedule)(void);
void (*hyp_backend_unschedule)(int, int *, void *);
void (*hyp_backend_schedule)(int, void *);
void (*hyp_lwproc_switch)(struct lwp *);
void (*hyp_lwproc_release)(void);
int (*hyp_lwproc_rfork)(void *, int, const char *);
int (*hyp_lwproc_newlwp)(pid_t);
struct lwp * (*hyp_lwproc_curlwp)(void);
int (*hyp_syscall)(int, void *, long *);
void (*hyp_lwpexit)(void);
void (*hyp_execnotify)(const char *);
pid_t (*hyp_getpid)(void);
void *hyp__extra[8];
};
int rumpuser_init(int, const struct rumpuser_hyperup *);
/*
* memory allocation
*/
int rumpuser_malloc(size_t, int, void **);
void rumpuser_free(void *, size_t);
int rumpuser_anonmmap(void *, size_t, int, int, void **);
void rumpuser_unmap(void *, size_t);
/*
* files and I/O
*/
#define RUMPUSER_OPEN_RDONLY 0x0000
#define RUMPUSER_OPEN_WRONLY 0x0001
#define RUMPUSER_OPEN_RDWR 0x0002
#define RUMPUSER_OPEN_ACCMODE 0x0003 /* "yay" */
#define RUMPUSER_OPEN_CREATE 0x0004 /* create file if it doesn't exist */
#define RUMPUSER_OPEN_EXCL 0x0008 /* exclusive open */
#define RUMPUSER_OPEN_BIO 0x0010 /* open device for block i/o */
int rumpuser_open(const char *, int, int *);
int rumpuser_close(int);
#define RUMPUSER_FT_OTHER 0
#define RUMPUSER_FT_DIR 1
#define RUMPUSER_FT_REG 2
#define RUMPUSER_FT_BLK 3
#define RUMPUSER_FT_CHR 4
int rumpuser_getfileinfo(const char *, uint64_t *, int *);
#define RUMPUSER_BIO_READ 0x01
#define RUMPUSER_BIO_WRITE 0x02
#define RUMPUSER_BIO_SYNC 0x04
typedef void (*rump_biodone_fn)(void *, size_t, int);
void rumpuser_bio(int, int, void *, size_t, int64_t, rump_biodone_fn, void *);
/* this one "accidentally" matches the NetBSD kernel ... */
struct rumpuser_iovec {
void *iov_base;
size_t iov_len;
};
#define RUMPUSER_IOV_NOSEEK -1
int rumpuser_iovread(int, struct rumpuser_iovec *, size_t, int64_t, size_t *);
int rumpuser_iovwrite(int, const struct rumpuser_iovec *, size_t,
int64_t, size_t *);
#define RUMPUSER_SYNCFD_READ 0x01
#define RUMPUSER_SYNCFD_WRITE 0x02
#define RUMPUSER_SYNCFD_BOTH (RUMPUSER_SYNCFD_READ | RUMPUSER_SYNCFD_WRITE)
#define RUMPUSER_SYNCFD_BARRIER 0x04
#define RUMPUSER_SYNCFD_SYNC 0x08
int rumpuser_syncfd(int, int, uint64_t, uint64_t);
/*
* clock and zzz
*/
enum rumpclock { RUMPUSER_CLOCK_RELWALL, RUMPUSER_CLOCK_ABSMONO };
int rumpuser_clock_gettime(int, int64_t *, long *);
int rumpuser_clock_sleep(int, int64_t, long);
/*
* host information retrieval
*/
#define RUMPUSER_PARAM_NCPU "_RUMPUSER_NCPU"
#define RUMPUSER_PARAM_HOSTNAME "_RUMPUSER_HOSTNAME"
int rumpuser_getparam(const char *, void *, size_t);
/*
* system call emulation, set errno is TLS
*/
void rumpuser_seterrno(int);
/*
* termination
*/
#define RUMPUSER_PID_SELF ((int64_t)-1)
int rumpuser_kill(int64_t, int);
#define RUMPUSER_PANIC (-1)
void rumpuser_exit(int) __dead;
/*
* console output
*/
void rumpuser_putchar(int);
void rumpuser_dprintf(const char *, ...) __printflike(1, 2);
/*
* access to host random pool
*/
/* always succeeds unless NOWAIT is given */
#define RUMPUSER_RANDOM_HARD 0x01
#define RUMPUSER_RANDOM_NOWAIT 0x02
int rumpuser_getrandom(void *, size_t, int, size_t *);
/*
* threads, scheduling (host) and synchronization
*/
int rumpuser_thread_create(void *(*f)(void *), void *, const char *, int,
int, int, void **);
void rumpuser_thread_exit(void) __dead;
int rumpuser_thread_join(void *);
#if defined(LIBRUMPUSER) || defined(RUMP__CURLWP_PRIVATE)
enum rumplwpop {
RUMPUSER_LWP_CREATE, RUMPUSER_LWP_DESTROY,
RUMPUSER_LWP_SET, RUMPUSER_LWP_CLEAR
};
void rumpuser_curlwpop(int, struct lwp *);
struct lwp *rumpuser_curlwp(void);
#endif /* LIBRUMPUSER || RUMP__CURLWP_PRIVATE */
struct rumpuser_mtx;
#define RUMPUSER_MTX_SPIN 0x01
#define RUMPUSER_MTX_KMUTEX 0x02
void rumpuser_mutex_init(struct rumpuser_mtx **, int);
void rumpuser_mutex_enter(struct rumpuser_mtx *);
void rumpuser_mutex_enter_nowrap(struct rumpuser_mtx *);
int rumpuser_mutex_tryenter(struct rumpuser_mtx *);
void rumpuser_mutex_exit(struct rumpuser_mtx *);
void rumpuser_mutex_destroy(struct rumpuser_mtx *);
void rumpuser_mutex_owner(struct rumpuser_mtx *, struct lwp **);
struct rumpuser_rw;
enum rumprwlock { RUMPUSER_RW_READER, RUMPUSER_RW_WRITER };
void rumpuser_rw_init(struct rumpuser_rw **);
void rumpuser_rw_enter(int, struct rumpuser_rw *);
int rumpuser_rw_tryenter(int, struct rumpuser_rw *);
int rumpuser_rw_tryupgrade(struct rumpuser_rw *);
void rumpuser_rw_downgrade(struct rumpuser_rw *);
void rumpuser_rw_exit(struct rumpuser_rw *);
void rumpuser_rw_destroy(struct rumpuser_rw *);
void rumpuser_rw_held(int, struct rumpuser_rw *, int *);
struct rumpuser_cv;
void rumpuser_cv_init(struct rumpuser_cv **);
void rumpuser_cv_destroy(struct rumpuser_cv *);
void rumpuser_cv_wait(struct rumpuser_cv *, struct rumpuser_mtx *);
void rumpuser_cv_wait_nowrap(struct rumpuser_cv *, struct rumpuser_mtx *);
int rumpuser_cv_timedwait(struct rumpuser_cv *, struct rumpuser_mtx *,
int64_t, int64_t);
void rumpuser_cv_signal(struct rumpuser_cv *);
void rumpuser_cv_broadcast(struct rumpuser_cv *);
void rumpuser_cv_has_waiters(struct rumpuser_cv *, int *);
/*
* dynloader
*/
struct modinfo;
struct rump_component;
typedef void (*rump_modinit_fn)(const struct modinfo *const *, size_t);
typedef int (*rump_symload_fn)(void *, uint64_t, char *, uint64_t);
typedef void (*rump_compload_fn)(const struct rump_component *);
void rumpuser_dl_bootstrap(rump_modinit_fn, rump_symload_fn, rump_compload_fn);
/*
* misc management
*/
int rumpuser_daemonize_begin(void);
int rumpuser_daemonize_done(int);
#if defined(_RUMP_SYSPROXY) || defined(LIBRUMPUSER)
/*
* syscall proxy
*/
int rumpuser_sp_init(const char *,
const char *, const char *, const char *);
int rumpuser_sp_copyin(void *, const void *, void *, size_t);
int rumpuser_sp_copyinstr(void *, const void *, void *, size_t *);
int rumpuser_sp_copyout(void *, const void *, void *, size_t);
int rumpuser_sp_copyoutstr(void *, const void *, void *, size_t *);
int rumpuser_sp_anonmmap(void *, size_t, void **);
int rumpuser_sp_raise(void *, int);
void rumpuser_sp_fini(void *);
#endif /* _RUMP_SYSPROXY || LIBRUMPUSER */
#endif /* _RUMP_RUMPUSER_H_ */

View File

@ -0,0 +1,36 @@
/* $NetBSD: rumpvfs_if_pub.h,v 1.13 2015/04/23 10:51:20 pooka Exp $ */
/*
* Automatically generated. DO NOT EDIT.
* from: NetBSD: rumpvfs.ifspec,v 1.10 2015/04/23 10:50:29 pooka Exp
* by: NetBSD: makerumpif.sh,v 1.9 2015/04/23 10:50:00 pooka Exp
*/
void rump_pub_getvninfo(struct vnode *, enum rump_vtype *, off_t *, dev_t *);
struct vfsops * rump_pub_vfslist_iterate(struct vfsops *);
struct vfsops * rump_pub_vfs_getopsbyname(const char *);
struct vattr * rump_pub_vattr_init(void);
void rump_pub_vattr_settype(struct vattr *, enum rump_vtype);
void rump_pub_vattr_setmode(struct vattr *, mode_t);
void rump_pub_vattr_setrdev(struct vattr *, dev_t);
void rump_pub_vattr_free(struct vattr *);
void rump_pub_vp_incref(struct vnode *);
int rump_pub_vp_getref(struct vnode *);
void rump_pub_vp_rele(struct vnode *);
void rump_pub_vp_interlock(struct vnode *);
void rump_pub_freecn(struct componentname *, int);
int rump_pub_namei(uint32_t, uint32_t, const char *, struct vnode **, struct vnode **, struct componentname **);
struct componentname * rump_pub_makecn(u_long, u_long, const char *, size_t, struct kauth_cred *, struct lwp *);
int rump_pub_vfs_unmount(struct mount *, int);
int rump_pub_vfs_root(struct mount *, struct vnode **, int);
int rump_pub_vfs_statvfs(struct mount *, struct statvfs *);
int rump_pub_vfs_sync(struct mount *, int, struct kauth_cred *);
int rump_pub_vfs_fhtovp(struct mount *, struct fid *, struct vnode **);
int rump_pub_vfs_vptofh(struct vnode *, struct fid *, size_t *);
int rump_pub_vfs_extattrctl(struct mount *, int, struct vnode *, int, const char *);
void rump_pub_vfs_syncwait(struct mount *);
int rump_pub_vfs_getmp(const char *, struct mount **);
void rump_pub_vfs_mount_print(const char *, int);
int rump_pub_syspuffs_glueinit(int, int *);
void rump_pub_vattr50_to_vattr(const struct vattr *, struct vattr *);
void rump_pub_vattr_to_vattr50(const struct vattr *, struct vattr *);

View File

@ -0,0 +1,115 @@
/* $NetBSD: rumpvnode_if.h,v 1.19 2015/04/20 23:11:27 riastradh Exp $ */
/*
* Warning: DO NOT EDIT! This file is automatically generated!
* (Modifications made here may easily be lost!)
*
* Created from the file:
* NetBSD: vnode_if.src,v 1.69 2015/04/20 23:08:07 riastradh Exp
* by the script:
* NetBSD: vnode_if.sh,v 1.60 2014/01/13 12:07:55 hannken Exp
*/
/*
* Copyright (c) 1992, 1993, 1994, 1995
* The Regents of the University of California. 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.
* 3. Neither the name of the University 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 REGENTS 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 REGENTS 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.
*/
#ifndef _RUMP_RUMPVNODE_IF_H_
#define _RUMP_RUMPVNODE_IF_H_
struct buf;
struct flock;
struct knote;
struct vm_page;
#ifndef _KERNEL
#include <stdbool.h>
#endif
int RUMP_VOP_BWRITE(struct vnode *, struct buf *);
int RUMP_VOP_LOOKUP(struct vnode *, struct vnode **, struct componentname *);
int RUMP_VOP_CREATE(struct vnode *, struct vnode **, struct componentname *,
struct vattr *);
int RUMP_VOP_MKNOD(struct vnode *, struct vnode **, struct componentname *,
struct vattr *);
int RUMP_VOP_OPEN(struct vnode *, int, struct kauth_cred *);
int RUMP_VOP_CLOSE(struct vnode *, int, struct kauth_cred *);
int RUMP_VOP_ACCESS(struct vnode *, int, struct kauth_cred *);
int RUMP_VOP_GETATTR(struct vnode *, struct vattr *, struct kauth_cred *);
int RUMP_VOP_SETATTR(struct vnode *, struct vattr *, struct kauth_cred *);
int RUMP_VOP_READ(struct vnode *, struct uio *, int, struct kauth_cred *);
int RUMP_VOP_WRITE(struct vnode *, struct uio *, int, struct kauth_cred *);
int RUMP_VOP_FALLOCATE(struct vnode *, off_t, off_t);
int RUMP_VOP_FDISCARD(struct vnode *, off_t, off_t);
int RUMP_VOP_IOCTL(struct vnode *, u_long, void *, int, struct kauth_cred *);
int RUMP_VOP_FCNTL(struct vnode *, u_int, void *, int, struct kauth_cred *);
int RUMP_VOP_POLL(struct vnode *, int);
int RUMP_VOP_KQFILTER(struct vnode *, struct knote *);
int RUMP_VOP_REVOKE(struct vnode *, int);
int RUMP_VOP_MMAP(struct vnode *, int, struct kauth_cred *);
int RUMP_VOP_FSYNC(struct vnode *, struct kauth_cred *, int, off_t, off_t);
int RUMP_VOP_SEEK(struct vnode *, off_t, off_t, struct kauth_cred *);
int RUMP_VOP_REMOVE(struct vnode *, struct vnode *, struct componentname *);
int RUMP_VOP_LINK(struct vnode *, struct vnode *, struct componentname *);
int RUMP_VOP_RENAME(struct vnode *, struct vnode *, struct componentname *,
struct vnode *, struct vnode *, struct componentname *);
int RUMP_VOP_MKDIR(struct vnode *, struct vnode **, struct componentname *,
struct vattr *);
int RUMP_VOP_RMDIR(struct vnode *, struct vnode *, struct componentname *);
int RUMP_VOP_SYMLINK(struct vnode *, struct vnode **,
struct componentname *, struct vattr *, char *);
int RUMP_VOP_READDIR(struct vnode *, struct uio *, struct kauth_cred *,
int *, off_t **, int *);
int RUMP_VOP_READLINK(struct vnode *, struct uio *, struct kauth_cred *);
int RUMP_VOP_ABORTOP(struct vnode *, struct componentname *);
int RUMP_VOP_INACTIVE(struct vnode *, bool *);
int RUMP_VOP_RECLAIM(struct vnode *);
int RUMP_VOP_LOCK(struct vnode *, int);
int RUMP_VOP_UNLOCK(struct vnode *);
int RUMP_VOP_BMAP(struct vnode *, int64_t, struct vnode **, int64_t *, int *);
int RUMP_VOP_STRATEGY(struct vnode *, struct buf *);
int RUMP_VOP_PRINT(struct vnode *);
int RUMP_VOP_ISLOCKED(struct vnode *);
int RUMP_VOP_PATHCONF(struct vnode *, int, register_t *);
int RUMP_VOP_ADVLOCK(struct vnode *, void *, int, struct flock *, int);
int RUMP_VOP_WHITEOUT(struct vnode *, struct componentname *, int);
int RUMP_VOP_GETPAGES(struct vnode *, off_t, struct vm_page **, int *, int,
int, int, int);
int RUMP_VOP_PUTPAGES(struct vnode *, off_t, off_t, int);
int RUMP_VOP_CLOSEEXTATTR(struct vnode *, int, struct kauth_cred *);
int RUMP_VOP_GETEXTATTR(struct vnode *, int, const char *, struct uio *,
size_t *, struct kauth_cred *);
int RUMP_VOP_LISTEXTATTR(struct vnode *, int, struct uio *, size_t *, int,
struct kauth_cred *);
int RUMP_VOP_OPENEXTATTR(struct vnode *, struct kauth_cred *);
int RUMP_VOP_DELETEEXTATTR(struct vnode *, int, const char *,
struct kauth_cred *);
int RUMP_VOP_SETEXTATTR(struct vnode *, int, const char *, struct uio *,
struct kauth_cred *);
#endif /* !_RUMP_RUMPVNODE_IF_H_ */

View File

@ -0,0 +1,71 @@
/* $NetBSD: bus.h,v 1.6 2015/06/03 13:55:42 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.
*/
#ifndef _SYS_RUMP_BUS_H_
#define _SYS_RUMP_BUS_H_
/*
* This is a blanket header since archs are inline/macro-happy.
*
* XXX: this file should NOT exist here
*/
/* bus space defs */
typedef unsigned long bus_addr_t;
typedef unsigned long bus_size_t;
typedef unsigned long bus_space_tag_t;
typedef unsigned long bus_space_handle_t;
/* bus dma defs */
typedef void *bus_dma_tag_t;
#define BUS_DMA_TAG_VALID(_tag_) ((_tag_) != NULL)
typedef struct {
bus_addr_t ds_addr;
bus_size_t ds_len;
vaddr_t _ds_vacookie;
bus_size_t _ds_sizecookie;
} bus_dma_segment_t;
typedef struct {
bus_size_t _dm_size;
int _dm_segcnt;
bus_size_t _dm_maxmaxsegsz;
bus_size_t _dm_boundary;
bus_addr_t _dm_bounce_thresh;
int _dm_flags;
void *_dm_cookie;
bus_size_t dm_maxsegsz;
bus_size_t dm_mapsize;
int dm_nsegs;
bus_dma_segment_t dm_segs[1];
} *bus_dmamap_t;
#include <sys/bus_proto.h>
#endif /* _SYS_RUMP_BUS_H_ */

28
sys/rump/ldscript.rump Normal file
View File

@ -0,0 +1,28 @@
/* $NetBSD: ldscript.rump,v 1.3 2014/04/23 17:05:18 pooka Exp $ */
/*
* From binutils 2.19 onwards (in NetBSD) binutils ld PROVIDEs
* __start/__stop for orphaned sections. This means that
* __start_link_set_modules/__stop_link_set_modules will no
* longer automatically be present in shared libraries. This
* ldscript forces those symbols to be present for all rump
* shared lib components.
*/
SECTIONS
{
link_set_modules :
{
__start_link_set_modules = .;
*(link_set_modules);
__stop_link_set_modules = .;
}
link_set_rump_components :
{
__start_link_set_rump_components = .;
*(link_set_rump_components);
__stop_link_set_rump_components = .;
}
}
INSERT AFTER .data;

View File

@ -0,0 +1,67 @@
# $NetBSD: ldscript_sun.rump,v 1.1 2013/03/15 12:13:07 pooka Exp $
$mapfile_version 2
LOAD_SEGMENT rumpkern_linksets {
ASSIGN_SECTION { IS_NAME= link_set_start_rump_components };
ASSIGN_SECTION { IS_NAME= link_set_rump_components };
ASSIGN_SECTION { IS_NAME= link_set_stop_rump_components };
OS_ORDER+= link_set_start_rump_components
link_set_rump_components
link_set_stop_rump_components;
ASSIGN_SECTION { IS_NAME= link_set_start_evcnts };
ASSIGN_SECTION { IS_NAME= link_set_evcnts };
ASSIGN_SECTION { IS_NAME= link_set_stop_evcnts };
OS_ORDER+= link_set_start_evcnts
link_set_evcnts
link_set_stop_evcnts;
ASSIGN_SECTION { IS_NAME= link_set_start_prop_linkpools };
ASSIGN_SECTION { IS_NAME= link_set_prop_linkpools };
ASSIGN_SECTION { IS_NAME= link_set_stop_prop_linkpools };
OS_ORDER+= link_set_start_prop_linkpools
link_set_prop_linkpools
link_set_stop_prop_linkpools;
ASSIGN_SECTION { IS_NAME= link_set_start_modules };
ASSIGN_SECTION { IS_NAME= link_set_modules };
ASSIGN_SECTION { IS_NAME= link_set_stop_modules };
OS_ORDER+= link_set_start_modules
link_set_modules
link_set_stop_modules;
ASSIGN_SECTION { IS_NAME= link_set_start_sysctl_funcs };
ASSIGN_SECTION { IS_NAME= link_set_sysctl_funcs };
ASSIGN_SECTION { IS_NAME= link_set_stop_sysctl_funcs };
OS_ORDER+= link_set_start_sysctl_funcs
link_set_sysctl_funcs
link_set_stop_sysctl_funcs;
ASSIGN_SECTION { IS_NAME= link_set_start_bufq_strats };
ASSIGN_SECTION { IS_NAME= link_set_bufq_strats };
ASSIGN_SECTION { IS_NAME= link_set_stop_bufq_strats };
OS_ORDER+= link_set_start_bufq_strats
link_set_bufq_strats
link_set_stop_bufq_strats;
ASSIGN_SECTION { IS_NAME= link_set_start_domains };
ASSIGN_SECTION { IS_NAME= link_set_domains };
ASSIGN_SECTION { IS_NAME= link_set_stop_domains };
OS_ORDER+= link_set_start_domains
link_set_domains
link_set_stop_domains;
ASSIGN_SECTION { IS_NAME= link_set_start_dkwedge_methods };
ASSIGN_SECTION { IS_NAME= link_set_dkwedge_methods };
ASSIGN_SECTION { IS_NAME= link_set_stop_dkwedge_methods };
OS_ORDER+= link_set_start_dkwedge_methods
link_set_dkwedge_methods
link_set_stop_dkwedge_methods;
ASSIGN_SECTION { IS_NAME= link_set_start_ieee80211_funcs };
ASSIGN_SECTION { IS_NAME= link_set_ieee80211_funcs };
ASSIGN_SECTION { IS_NAME= link_set_stop_ieee80211_funcs };
OS_ORDER+= link_set_start_ieee80211_funcs
link_set_ieee80211_funcs
link_set_stop_ieee80211_funcs;
};

65
sys/rump/linksyms_sun.c Normal file
View File

@ -0,0 +1,65 @@
/* $NetBSD: linksyms_sun.c,v 1.1 2013/03/15 12:13:07 pooka Exp $ */
int __start_link_set_rump_components[0]
__attribute__((__section__("link_set_start_rump_components")));
int __link_set_dummy_rump_components[0]
__attribute__((__section__("link_set_rump_components")));
int __stop_link_set_rump_components[0]
__attribute__((__section__("link_set_stop_rump_components")));
int __start_link_set_evcnts[0]
__attribute__((__section__("link_set_start_evcnts")));
int __link_set_dummy_evcnts[0]
__attribute__((__section__("link_set_evcnts")));
int __stop_link_set_evcnts[0]
__attribute__((__section__("link_set_stop_evcnts")));
int __start_link_set_prop_linkpools[0]
__attribute__((__section__("link_set_start_prop_linkpools")));
int __link_set_dummy_prop_linkpools[0]
__attribute__((__section__("link_set_prop_linkpools")));
int __stop_link_set_prop_linkpools[0]
__attribute__((__section__("link_set_stop_prop_linkpools")));
int __start_link_set_modules[0]
__attribute__((__section__("link_set_start_modules")));
int __link_set_dummy_modules[0]
__attribute__((__section__("link_set_modules")));
int __stop_link_set_modules[0]
__attribute__((__section__("link_set_stop_modules")));
int __start_link_set_sysctl_funcs[0]
__attribute__((__section__("link_set_start_sysctl_funcs")));
int __link_set_dummy_sysctl_funcs[0]
__attribute__((__section__("link_set_sysctl_funcs")));
int __stop_link_set_sysctl_funcs[0]
__attribute__((__section__("link_set_stop_sysctl_funcs")));
int __start_link_set_bufq_strats[0]
__attribute__((__section__("link_set_start_bufq_strats")));
int __link_set_dummy_bufq_strats[0]
__attribute__((__section__("link_set_bufq_strats")));
int __stop_link_set_bufq_strats[0]
__attribute__((__section__("link_set_stop_bufq_strats")));
int __start_link_set_domains[0]
__attribute__((__section__("link_set_start_domains")));
int __link_set_dummy_domains[0]
__attribute__((__section__("link_set_domains")));
int __stop_link_set_domains[0]
__attribute__((__section__("link_set_stop_domains")));
int __start_link_set_dkwedge_methods[0]
__attribute__((__section__("link_set_start_dkwedge_methods")));
int __link_set_dummy_dkwedge_methods[0]
__attribute__((__section__("link_set_dkwedge_methods")));
int __stop_link_set_dkwedge_methods[0]
__attribute__((__section__("link_set_stop_dkwedge_methods")));
int __start_link_set_ieee80211_funcs[0]
__attribute__((__section__("link_set_start_ieee80211_funcs")));
int __link_set_dummy_ieee80211_funcs[0]
__attribute__((__section__("link_set_ieee80211_funcs")));
int __stop_link_set_ieee80211_funcs[0]
__attribute__((__section__("link_set_stop_ieee80211_funcs")));

138
sys/rump/listsrcdirs Normal file
View File

@ -0,0 +1,138 @@
#!/bin/sh
#
# $NetBSD: listsrcdirs,v 1.34 2015/07/07 12:40:13 justin Exp $
#
#
# This script echoes the NetBSD source directories useful for
# rump kernels.
# Feed the output to whichever method you use to obtain NetBSD sources, e.g.
#
# ./listsrcdirs | xargs cvs -d anoncvs@anoncvs.netbsd.org:/cvsroot -z3 co -P
#
# Check that the intersection between all branches is the null set
if [ "${LISTSRCDIRS_INSANITY}" != 'y' ]; then
if [ ! -z "$(LISTSRCDIRS_INSANITY=y sh $0 all | sort | uniq -d)" ]; then
echo $0: INTERNAL ERROR
exit 1
fi
fi
# default echomode (for compat)
em='sys posix'
# everything we support
all='sys posix usr'
# mini-getopt (so that we don't have to with getopt vs. getopts
cvsmode=false
if [ "${1}" = "-c" ]; then
cvsmode=true
shift
fi
[ ! -z "${*}" ] && em="${*}"
[ "$em" = all ] && em="${all}"
for x in ${em}; do
for y in ${all}; do
[ $x = $y ] && continue 2
done
echo invalid specifier $x
exit 1
done
iswanted ()
{
for x in ${em}; do
if [ "$x" = "$1" ]; then
return 0
fi
done
return 1
}
lsrc ()
{
what=$1
pfx=$2
shift 2
iswanted ${what} && for arg in $* ; do echo src${pfx}${arg} ; done
}
ARCHS="amd64 i386 x86 arm evbarm sparc sparc64 powerpc evbppc mips evbmips aarch64 evbarm64 riscv"
ARCHS_EXTRA="arm/arm32 Makefile"
# sources necessary for building rump kernel components. This list
# depends on TOOLS_BUILDRUMP=yes.
lsrc sys / build.sh Makefile Makefile.inc
lsrc sys / tools common include share/mk
lsrc sys /etc/ Makefile.params master.passwd group
lsrc sys /lib/lib c util
lsrc sys /external/bsd/ flex mdocml byacc
lsrc sys /external/cddl/ osnet
lsrc sys /external/historical/ nawk
lsrc sys /bin/ cat
lsrc sys /usr.bin/ make xinstall config mktemp sed tsort
lsrc sys /usr.bin/ lorder join cksum m4 mkdep Makefile.inc
lsrc sys /usr.bin/ rpcgen rump_wmd
lsrc sys /usr.bin/ genassym stat uname
lsrc sys /usr.sbin/ mtree
# sources hosted in the NetBSD tree that are required/useful
# when targeting POSIX-y platforms
lsrc posix /lib/lib rump rumpdev rumpnet rumpvfs
lsrc posix /lib/lib rumpuser rumpclient rumphijack
lsrc posix /usr.bin/ rump_server rump_allserver shmif_dumpbus
# assorted userspace sources, mostly for configuration & diagnostics
# NOTE! libc++ is handled below as a special case due to the NetBSD
# dist directory consisting ~90% (50+MB) of tests unnecessary to us
lsrc usr /lib/ i18n_module
lsrc usr /lib/lib crypt ipsec kvm m npf pci prop
lsrc usr /lib/lib pthread rmt y z
lsrc usr /libexec/ ld.elf_so
lsrc usr /bin/ chmod cp dd df ed ln ls mkdir mv pax
lsrc usr /bin/ rm rmdir
lsrc usr /sbin/ brconfig cgdconfig chown
lsrc usr /sbin/ disklabel dump fdisk
lsrc usr /sbin/ fsck fsck_ext2fs fsck_ffs fsck_msdos
lsrc usr /sbin/ ifconfig mknod
lsrc usr /sbin/ modstat mount
lsrc usr /sbin/ mount_ext2fs mount_ffs mount_msdos mount_tmpfs
lsrc usr /sbin/ newfs newfs_ext2fs newfs_msdos
lsrc usr /sbin/ ping ping6 raidctl reboot
lsrc usr /sbin/ rndctl route setkey sysctl umount
lsrc usr /usr.bin/ kdump ktrace mixerctl sockstat
lsrc usr /usr.sbin/ arp dumpfs mdconfig ndp npf pcictl
lsrc usr /usr.sbin/ rtadvd vnconfig wlanctl
lsrc usr /external/bsd/ libelf libpcap tcpdump wpa
lsrc usr /crypto/ Makefile.openssl
lsrc usr /crypto/dist/ ipsec-tools
lsrc usr /crypto/external/bsd/ openssl
# If -c is given, use CVS syntax to exclude large subdirectories
# of sys. Otherwise just do it wholesale.
if ${cvsmode}; then
iswanted sys && echo \!src/sys/arch src/sys
iswanted usr && \
echo \!src/external/bsd/libc++/dist/libcxx/test \
src/external/bsd/libc++
# pick a few useful archs, namely those mentioned in buildrump.sh
for arch in ${ARCHS}; do
lsrc sys /sys/arch/${arch}/ include ${arch} Makefile
done
for extra in ${ARCHS_EXTRA}; do
lsrc sys /sys/arch/ ${extra}
done
else
lsrc sys / sys
lsrc usr /external /bsd/libc++
fi

View File

@ -0,0 +1,112 @@
#!/bin/sh
#
# $NetBSD: makerumpsyscalls.sh,v 1.2 2014/04/27 16:28:21 pooka Exp $
#
#
# This utility generates component-specific initializers for the
# rump kernel syscall vector.
#
# Procedure is:
# 1) edit syscalls.master
# 2) run makesyscalls.sh
# 3) do a build in sys/rump
# 4) run this script
# 5) commit results
#
# default, override by giving argument
LIBDIR=/usr/lib
SYSCOMPONENT_librump=librump/rumpkern/rumpkern_syscalls.c
SYSCOMPONENT_librumpnet=librump/rumpnet/rumpnet_syscalls.c
SYSCOMPONENT_librumpvfs=librump/rumpvfs/rumpvfs_syscalls.c
die ()
{
echo '>> ERROR:' $*
exit 1
}
[ -f "./rump.sysmap" ] || die rump.sysmap not found
[ -f "./Makefile.rump" ] || die run script in src/sys/rump
[ -z "${1}" ] || LIBDIR=$1
#
# BEGIN
#
IFS=' '
AWKPROG='BEGIN {
while ((getline < "rump.sysmap") == 1) {
if ($2 != "sys_nomodule")
syscalls[$2] = $1
}
}
$5 == "GLOBAL" && $7 != "UND" {
sub("rumpns_", "", $8)
if (syscalls[$8] != 0)
results[$8] = 1
}
END {
for (res in results) {
printf "%d %s\n", syscalls[res], res | "sort -n"
}
}
'
SYSCOMP_HDR='/* $NetBSD: makerumpsyscalls.sh,v 1.2 2014/04/27 16:28:21 pooka Exp $ */
/* AUTOMATICALLY GENERATED BY makerumpsyscalls.sh */
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: makerumpsyscalls.sh,v 1.2 2014/04/27 16:28:21 pooka Exp $");
#include <sys/param.h>
#include "rump_private.h"
'
SYSCOMP_BODY='
RUMP_COMPONENT(RUMP_COMPONENT_SYSCALL)
{
rump_syscall_boot_establish(mysys, __arraycount(mysys));
}'
makesyscomponent ()
{
echo Generating $1
exec 3>&1 >${1}
echo "${SYSCOMP_HDR}"
echo ${2} | awk '{printf "extern sy_call_t %s;\n", $2}'
printf '\nstatic const struct rump_onesyscall mysys[] = {\n'
echo ${2} | awk '{printf "\t{ %d,\t%s },\n", $1, $2}'
printf '};\n'
echo "${SYSCOMP_BODY}"
exec 1>&3
}
sawlibrump=false
for file in ${LIBDIR}/librump*.so ; do
b=$(basename ${file})
b=${b%%.*}
res=$(readelf -W --syms ${file} | awk "${AWKPROG}")
if [ ! -z "${res}" ]; then
eval outname=\${SYSCOMPONENT_${b}}
[ -z "${outname}" ] && die Unknown syscall provider $b
makesyscomponent $outname "$res"
[ $b = "librump" ] && sawlibrump=true
fi
done
${sawlibrump} || die Did not see librump. Wrong directory?

218
sys/rump/rump.sysmap Normal file
View File

@ -0,0 +1,218 @@
3 sys_read read rump___sysimpl_read
4 sys_write write rump___sysimpl_write
5 sys_open open rump___sysimpl_open
6 sys_close close rump___sysimpl_close
9 sys_link link rump___sysimpl_link
10 sys_unlink unlink rump___sysimpl_unlink
12 sys_chdir chdir rump___sysimpl_chdir
13 sys_fchdir fchdir rump___sysimpl_fchdir
14 sys_nomodule mknod rump___sysimpl_mknod
15 sys_chmod chmod rump___sysimpl_chmod
16 sys_chown chown rump___sysimpl_chown
20 sys_getpid_with_ppid getpid rump___sysimpl_getpid
22 sys_unmount unmount rump___sysimpl_unmount
23 sys_setuid setuid rump___sysimpl_setuid
24 sys_getuid_with_euid getuid rump___sysimpl_getuid
25 sys_geteuid geteuid rump___sysimpl_geteuid
27 sys_recvmsg recvmsg rump___sysimpl_recvmsg
28 sys_sendmsg sendmsg rump___sysimpl_sendmsg
29 sys_recvfrom recvfrom rump___sysimpl_recvfrom
30 sys_accept accept rump___sysimpl_accept
31 sys_getpeername getpeername rump___sysimpl_getpeername
32 sys_getsockname getsockname rump___sysimpl_getsockname
33 sys_access access rump___sysimpl_access
34 sys_chflags chflags rump___sysimpl_chflags
35 sys_fchflags fchflags rump___sysimpl_fchflags
36 sys_sync sync rump___sysimpl_sync
39 sys_getppid getppid rump___sysimpl_getppid
41 sys_dup dup rump___sysimpl_dup
42 sys_pipe pipe rump_sys_pipe
43 sys_getegid getegid rump___sysimpl_getegid
45 sys_ktrace ktrace rump___sysimpl_ktrace
47 sys_getgid_with_egid getgid rump___sysimpl_getgid
49 sys___getlogin __getlogin rump___sysimpl___getlogin
50 sys___setlogin __setlogin rump___sysimpl___setlogin
54 sys_ioctl ioctl rump___sysimpl_ioctl
56 sys_revoke revoke rump___sysimpl_revoke
57 sys_symlink symlink rump___sysimpl_symlink
58 sys_readlink readlink rump___sysimpl_readlink
60 sys_umask umask rump___sysimpl_umask
61 sys_chroot chroot rump___sysimpl_chroot
79 sys_getgroups getgroups rump___sysimpl_getgroups
80 sys_setgroups setgroups rump___sysimpl_setgroups
81 sys_getpgrp getpgrp rump___sysimpl_getpgrp
82 sys_setpgid setpgid rump___sysimpl_setpgid
90 sys_dup2 dup2 rump___sysimpl_dup2
92 sys_fcntl fcntl rump___sysimpl_fcntl
93 sys_nomodule select rump___sysimpl_select
95 sys_fsync fsync rump___sysimpl_fsync
98 sys_connect connect rump___sysimpl_connect
104 sys_bind bind rump___sysimpl_bind
105 sys_setsockopt setsockopt rump___sysimpl_setsockopt
106 sys_listen listen rump___sysimpl_listen
118 sys_getsockopt getsockopt rump___sysimpl_getsockopt
120 sys_readv readv rump___sysimpl_readv
121 sys_writev writev rump___sysimpl_writev
123 sys_fchown fchown rump___sysimpl_fchown
124 sys_fchmod fchmod rump___sysimpl_fchmod
126 sys_setreuid setreuid rump___sysimpl_setreuid
127 sys_setregid setregid rump___sysimpl_setregid
128 sys_rename rename rump___sysimpl_rename
131 sys_flock flock rump___sysimpl_flock
132 sys_mkfifo mkfifo rump___sysimpl_mkfifo
133 sys_sendto sendto rump___sysimpl_sendto
134 sys_shutdown shutdown rump___sysimpl_shutdown
135 sys_socketpair socketpair rump___sysimpl_socketpair
136 sys_mkdir mkdir rump___sysimpl_mkdir
137 sys_rmdir rmdir rump___sysimpl_rmdir
138 sys_nomodule utimes rump___sysimpl_utimes
147 sys_setsid setsid rump___sysimpl_setsid
155 sys_nomodule nfssvc rump___sysimpl_nfssvc
173 sys_pread pread rump___sysimpl_pread
174 sys_pwrite pwrite rump___sysimpl_pwrite
181 sys_setgid setgid rump___sysimpl_setgid
182 sys_setegid setegid rump___sysimpl_setegid
183 sys_seteuid seteuid rump___sysimpl_seteuid
191 sys_pathconf pathconf rump___sysimpl_pathconf
192 sys_fpathconf fpathconf rump___sysimpl_fpathconf
194 sys_getrlimit getrlimit rump___sysimpl_getrlimit
195 sys_setrlimit setrlimit rump___sysimpl_setrlimit
199 sys_lseek lseek rump___sysimpl_lseek
200 sys_truncate truncate rump___sysimpl_truncate
201 sys_ftruncate ftruncate rump___sysimpl_ftruncate
202 sys___sysctl __sysctl rump___sysimpl___sysctl
206 sys_nomodule futimes rump___sysimpl_futimes
207 sys_getpgid getpgid rump___sysimpl_getpgid
208 sys_reboot reboot rump___sysimpl_reboot
209 sys_poll poll rump___sysimpl_poll
235 sys_timer_create timer_create rump___sysimpl_timer_create
236 sys_timer_delete timer_delete rump___sysimpl_timer_delete
239 sys_timer_getoverrun timer_getoverrun rump___sysimpl_timer_getoverrun
241 sys_fdatasync fdatasync rump___sysimpl_fdatasync
246 sys_modctl modctl rump___sysimpl_modctl
247 sys_nomodule _ksem_init rump___sysimpl__ksem_init
248 sys_nomodule _ksem_open rump___sysimpl__ksem_open
249 sys_nomodule _ksem_unlink rump___sysimpl__ksem_unlink
250 sys_nomodule _ksem_close rump___sysimpl__ksem_close
251 sys_nomodule _ksem_post rump___sysimpl__ksem_post
252 sys_nomodule _ksem_wait rump___sysimpl__ksem_wait
253 sys_nomodule _ksem_trywait rump___sysimpl__ksem_trywait
254 sys_nomodule _ksem_getvalue rump___sysimpl__ksem_getvalue
255 sys_nomodule _ksem_destroy rump___sysimpl__ksem_destroy
256 sys_nomodule _ksem_timedwait rump___sysimpl__ksem_timedwait
270 sys___posix_rename __posix_rename rump___sysimpl___posix_rename
274 sys_lchmod lchmod rump___sysimpl_lchmod
275 sys_lchown lchown rump___sysimpl_lchown
276 sys_nomodule lutimes rump___sysimpl_lutimes
283 sys___posix_chown __posix_chown rump___sysimpl___posix_chown
284 sys___posix_fchown __posix_fchown rump___sysimpl___posix_fchown
285 sys___posix_lchown __posix_lchown rump___sysimpl___posix_lchown
286 sys_getsid getsid rump___sysimpl_getsid
288 sys_fktrace fktrace rump___sysimpl_fktrace
289 sys_preadv preadv rump___sysimpl_preadv
290 sys_pwritev pwritev rump___sysimpl_pwritev
296 sys___getcwd __getcwd rump___sysimpl___getcwd
297 sys_fchroot fchroot rump___sysimpl_fchroot
304 sys_lchflags lchflags rump___sysimpl_lchflags
305 sys_issetugid issetugid rump___sysimpl_issetugid
306 sys_utrace utrace rump___sysimpl_utrace
344 sys_kqueue kqueue rump___sysimpl_kqueue
345 sys_nomodule kevent rump___sysimpl_kevent
354 sys_fsync_range fsync_range rump___sysimpl_fsync_range
356 sys_getvfsstat getvfsstat rump___sysimpl_getvfsstat
357 sys_statvfs1 statvfs1 rump___sysimpl_statvfs1
358 sys_fstatvfs1 fstatvfs1 rump___sysimpl_fstatvfs1
360 sys_extattrctl extattrctl rump___sysimpl_extattrctl
361 sys_extattr_set_file extattr_set_file rump___sysimpl_extattr_set_file
362 sys_extattr_get_file extattr_get_file rump___sysimpl_extattr_get_file
363 sys_extattr_delete_file extattr_delete_file rump___sysimpl_extattr_delete_file
364 sys_extattr_set_fd extattr_set_fd rump___sysimpl_extattr_set_fd
365 sys_extattr_get_fd extattr_get_fd rump___sysimpl_extattr_get_fd
366 sys_extattr_delete_fd extattr_delete_fd rump___sysimpl_extattr_delete_fd
367 sys_extattr_set_link extattr_set_link rump___sysimpl_extattr_set_link
368 sys_extattr_get_link extattr_get_link rump___sysimpl_extattr_get_link
369 sys_extattr_delete_link extattr_delete_link rump___sysimpl_extattr_delete_link
370 sys_extattr_list_fd extattr_list_fd rump___sysimpl_extattr_list_fd
371 sys_extattr_list_file extattr_list_file rump___sysimpl_extattr_list_file
372 sys_extattr_list_link extattr_list_link rump___sysimpl_extattr_list_link
373 sys_nomodule pselect rump___sysimpl_pselect
374 sys_nomodule pollts rump___sysimpl_pollts
375 sys_setxattr setxattr rump___sysimpl_setxattr
376 sys_lsetxattr lsetxattr rump___sysimpl_lsetxattr
377 sys_fsetxattr fsetxattr rump___sysimpl_fsetxattr
378 sys_getxattr getxattr rump___sysimpl_getxattr
379 sys_lgetxattr lgetxattr rump___sysimpl_lgetxattr
380 sys_fgetxattr fgetxattr rump___sysimpl_fgetxattr
381 sys_listxattr listxattr rump___sysimpl_listxattr
382 sys_llistxattr llistxattr rump___sysimpl_llistxattr
383 sys_flistxattr flistxattr rump___sysimpl_flistxattr
384 sys_removexattr removexattr rump___sysimpl_removexattr
385 sys_lremovexattr lremovexattr rump___sysimpl_lremovexattr
386 sys_fremovexattr fremovexattr rump___sysimpl_fremovexattr
387 sys_nomodule __stat30 rump___sysimpl_stat30
388 sys_nomodule __fstat30 rump___sysimpl_fstat30
389 sys_nomodule __lstat30 rump___sysimpl_lstat30
390 sys___getdents30 __getdents30 rump___sysimpl_getdents30
394 sys___socket30 __socket30 rump___sysimpl_socket30
395 sys___getfh30 __getfh30 rump___sysimpl_getfh30
396 sys___fhopen40 __fhopen40 rump___sysimpl_fhopen40
397 sys___fhstatvfs140 __fhstatvfs140 rump___sysimpl_fhstatvfs140
398 sys_nomodule __fhstat40 rump___sysimpl_fhstat40
399 sys_nomodule aio_cancel rump___sysimpl_aio_cancel
400 sys_nomodule aio_error rump___sysimpl_aio_error
401 sys_nomodule aio_fsync rump___sysimpl_aio_fsync
402 sys_nomodule aio_read rump___sysimpl_aio_read
403 sys_nomodule aio_return rump___sysimpl_aio_return
405 sys_nomodule aio_write rump___sysimpl_aio_write
406 sys_nomodule lio_listio rump___sysimpl_lio_listio
410 sys___mount50 __mount50 rump___sysimpl_mount50
416 sys___posix_fadvise50 __posix_fadvise50 rump___sysimpl_posix_fadvise50
417 sys___select50 __select50 rump___sysimpl_select50
418 sys___gettimeofday50 __gettimeofday50 rump___sysimpl_gettimeofday50
419 sys___settimeofday50 __settimeofday50 rump___sysimpl_settimeofday50
420 sys___utimes50 __utimes50 rump___sysimpl_utimes50
421 sys___adjtime50 __adjtime50 rump___sysimpl_adjtime50
423 sys___futimes50 __futimes50 rump___sysimpl_futimes50
424 sys___lutimes50 __lutimes50 rump___sysimpl_lutimes50
425 sys___setitimer50 __setitimer50 rump___sysimpl_setitimer50
426 sys___getitimer50 __getitimer50 rump___sysimpl_getitimer50
427 sys___clock_gettime50 __clock_gettime50 rump___sysimpl_clock_gettime50
428 sys___clock_settime50 __clock_settime50 rump___sysimpl_clock_settime50
429 sys___clock_getres50 __clock_getres50 rump___sysimpl_clock_getres50
430 sys___nanosleep50 __nanosleep50 rump___sysimpl_nanosleep50
435 sys___kevent50 __kevent50 rump___sysimpl_kevent50
436 sys___pselect50 __pselect50 rump___sysimpl_pselect50
437 sys___pollts50 __pollts50 rump___sysimpl_pollts50
438 sys_nomodule __aio_suspend50 rump___sysimpl_aio_suspend50
439 sys___stat50 __stat50 rump___sysimpl_stat50
440 sys___fstat50 __fstat50 rump___sysimpl_fstat50
441 sys___lstat50 __lstat50 rump___sysimpl_lstat50
446 sys___timer_settime50 __timer_settime50 rump___sysimpl_timer_settime50
447 sys___timer_gettime50 __timer_gettime50 rump___sysimpl_timer_gettime50
450 sys___mknod50 __mknod50 rump___sysimpl_mknod50
451 sys___fhstat50 __fhstat50 rump___sysimpl_fhstat50
453 sys_pipe2 pipe2 rump___sysimpl_pipe2
454 sys_dup3 dup3 rump___sysimpl_dup3
455 sys_kqueue1 kqueue1 rump___sysimpl_kqueue1
456 sys_paccept paccept rump___sysimpl_paccept
457 sys_linkat linkat rump___sysimpl_linkat
458 sys_renameat renameat rump___sysimpl_renameat
459 sys_mkfifoat mkfifoat rump___sysimpl_mkfifoat
460 sys_mknodat mknodat rump___sysimpl_mknodat
461 sys_mkdirat mkdirat rump___sysimpl_mkdirat
462 sys_faccessat faccessat rump___sysimpl_faccessat
463 sys_fchmodat fchmodat rump___sysimpl_fchmodat
464 sys_fchownat fchownat rump___sysimpl_fchownat
466 sys_fstatat fstatat rump___sysimpl_fstatat
467 sys_utimensat utimensat rump___sysimpl_utimensat
468 sys_openat openat rump___sysimpl_openat
469 sys_readlinkat readlinkat rump___sysimpl_readlinkat
470 sys_symlinkat symlinkat rump___sysimpl_symlinkat
471 sys_unlinkat unlinkat rump___sysimpl_unlinkat
472 sys_futimens futimens rump___sysimpl_futimens
473 sys___quotactl __quotactl rump___sysimpl___quotactl
475 sys_recvmmsg recvmmsg rump___sysimpl_recvmmsg
476 sys_sendmmsg sendmmsg rump___sysimpl_sendmmsg
477 sys_clock_nanosleep clock_nanosleep rump___sysimpl_clock_nanosleep
479 sys_posix_fallocate posix_fallocate rump___sysimpl_posix_fallocate
480 sys_fdiscard fdiscard rump___sysimpl_fdiscard

38
sys/rump/sunldgen.sh Normal file
View File

@ -0,0 +1,38 @@
#!/bin/sh
#
# $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $
#
# To support the Sun linker we need to make it behave like the GNU linker
# for orphaned sections. That means generating __start/__stop symbols
# for them and that means some nopoly-atheist-withoutfood level trickery.
# We enumerate all the section names we wish to generate symbols for.
# The good news is that it's unlikely for NetBSD to grow any more
# link sets, and even if it does, it'll be a build-time failure
# on Sun platforms so it's easy to catch and mend the list below.
LINKSETS='rump_components evcnts prop_linkpools modules sysctl_funcs
bufq_strats domains dkwedge_methods ieee80211_funcs'
exec 1> ldscript_sun.rump
printf '# $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $\n\n$mapfile_version 2\nLOAD_SEGMENT rumpkern_linksets {'
for lset in ${LINKSETS}; do
printf '\n\tASSIGN_SECTION { IS_NAME= link_set_start_%s };\n' $lset
printf '\tASSIGN_SECTION { IS_NAME= link_set_%s };\n' $lset
printf '\tASSIGN_SECTION { IS_NAME= link_set_stop_%s };\n' $lset
printf '\tOS_ORDER+= link_set_start_%s\n' $lset
printf '\t link_set_%s\n' $lset
printf '\t link_set_stop_%s;\n' $lset
done
echo '};'
exec 1> linksyms_sun.c
printf '/* $NetBSD: sunldgen.sh,v 1.1 2013/03/15 12:12:16 pooka Exp $ */\n\n'
for lset in ${LINKSETS}; do
printf 'int __start_link_set_%s[0]\n' $lset
printf '\t__attribute__((__section__("link_set_start_%s")));\n' $lset
printf 'int __link_set_dummy_%s[0]\n' $lset
printf '\t__attribute__((__section__("link_set_%s")));\n' $lset
printf 'int __stop_link_set_%s[0]\n' $lset
printf '\t__attribute__((__section__("link_set_stop_%s")));\n\n' $lset
done