Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Oct 2016 12:17:42 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r307144 - in stable/11: share/man/man4 sys/amd64/cloudabi32 sys/amd64/cloudabi64 sys/amd64/conf sys/arm/cloudabi32 sys/arm64/cloudabi64 sys/compat/cloudabi sys/compat/cloudabi32 sys/com...
Message-ID:  <201610121217.u9CCHgdP075603@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Wed Oct 12 12:17:41 2016
New Revision: 307144
URL: https://svnweb.freebsd.org/changeset/base/307144

Log:
  MFC r303818, r303833, r303941, r304478, r304481, r304483, r304484, r304554,
      r304555, r304556, r304557, r304558, r304559, r304561, r304563, r304564,
      r304565, r304615, r304742, r304743, r304744, r304745, r304748, r304886,
      r304991, r305928, r305938, r305987, r306185:
  
    Bring CloudABI support back in sync with HEAD.
  
    - Add support for running 32-bit executables on amd64, armv6 and i386.
  
    - As these new architectures require the use of the vDSO, merge back
      vDSO support for 64-bit executables running on amd64 and arm64 as
      well. This has the advantage that support for vDSO-less execution
      can be phased out when 11.0 becomes unsupported, as opposed to 11.x.
  
    This change has been tested by running the cloudlibc unit tests on all
    supported architectures, which seems to work fine.

Added:
  stable/11/sys/amd64/cloudabi32/
     - copied from r304744, head/sys/amd64/cloudabi32/
  stable/11/sys/arm/cloudabi32/
     - copied from r305928, head/sys/arm/cloudabi32/
  stable/11/sys/compat/cloudabi/cloudabi_vdso.c
     - copied unchanged from r303941, head/sys/compat/cloudabi/cloudabi_vdso.c
  stable/11/sys/compat/cloudabi/cloudabi_vdso.lds
     - copied unchanged from r304557, head/sys/compat/cloudabi/cloudabi_vdso.lds
  stable/11/sys/compat/cloudabi32/
     - copied from r304564, head/sys/compat/cloudabi32/
  stable/11/sys/compat/cloudabi32/cloudabi32_proto.h
     - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_proto.h
  stable/11/sys/compat/cloudabi32/cloudabi32_syscall.h
     - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_syscall.h
  stable/11/sys/compat/cloudabi32/cloudabi32_syscalls.c
     - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_syscalls.c
  stable/11/sys/compat/cloudabi32/cloudabi32_sysent.c
     - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_sysent.c
  stable/11/sys/compat/cloudabi32/cloudabi32_systrace_args.c
     - copied unchanged from r304565, head/sys/compat/cloudabi32/cloudabi32_systrace_args.c
  stable/11/sys/contrib/cloudabi/cloudabi32_types.h
     - copied unchanged from r304561, head/sys/contrib/cloudabi/cloudabi32_types.h
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
     - copied unchanged from r304554, head/sys/contrib/cloudabi/cloudabi_vdso_aarch64.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
     - copied, changed from r305928, head/sys/contrib/cloudabi/cloudabi_vdso_armv6.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686.S
     - copied, changed from r304615, head/sys/contrib/cloudabi/cloudabi_vdso_i686.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
     - copied unchanged from r304744, head/sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S
  stable/11/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
     - copied unchanged from r304554, head/sys/contrib/cloudabi/cloudabi_vdso_x86_64.S
  stable/11/sys/contrib/cloudabi/syscalls32.master
     - copied, changed from r304561, head/sys/contrib/cloudabi/syscalls32.master
     - copied unchanged from r304478, head/sys/contrib/cloudabi/syscalls64.master
  stable/11/sys/i386/cloudabi32/
     - copied from r304615, head/sys/i386/cloudabi32/
  stable/11/sys/modules/cloudabi32/
     - copied from r304745, head/sys/modules/cloudabi32/
Directory Properties:
  stable/11/sys/contrib/cloudabi/syscalls64.master   (props changed)
Deleted:
  stable/11/sys/contrib/cloudabi/syscalls.master
Modified:
  stable/11/share/man/man4/cloudabi.4
  stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c
  stable/11/sys/amd64/conf/NOTES
  stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c
  stable/11/sys/compat/cloudabi/cloudabi_clock.c
  stable/11/sys/compat/cloudabi/cloudabi_thread.c
  stable/11/sys/compat/cloudabi/cloudabi_util.h
  stable/11/sys/compat/cloudabi64/Makefile
  stable/11/sys/compat/cloudabi64/cloudabi64_fd.c
  stable/11/sys/compat/cloudabi64/cloudabi64_module.c
  stable/11/sys/compat/cloudabi64/cloudabi64_poll.c
  stable/11/sys/compat/cloudabi64/cloudabi64_proto.h
  stable/11/sys/compat/cloudabi64/cloudabi64_sock.c
  stable/11/sys/compat/cloudabi64/cloudabi64_syscall.h
  stable/11/sys/compat/cloudabi64/cloudabi64_syscalls.c
  stable/11/sys/compat/cloudabi64/cloudabi64_sysent.c
  stable/11/sys/compat/cloudabi64/cloudabi64_systrace_args.c
  stable/11/sys/compat/cloudabi64/cloudabi64_util.h
  stable/11/sys/conf/files
  stable/11/sys/conf/files.amd64
  stable/11/sys/conf/files.arm
  stable/11/sys/conf/files.arm64
  stable/11/sys/conf/files.i386
  stable/11/sys/conf/options
  stable/11/sys/contrib/cloudabi/cloudabi64_types.h
  stable/11/sys/contrib/cloudabi/cloudabi_types_common.h
  stable/11/sys/i386/cloudabi32/cloudabi32_sysvec.c
  stable/11/sys/i386/conf/NOTES
  stable/11/sys/modules/Makefile
  stable/11/sys/modules/cloudabi/Makefile
  stable/11/sys/modules/cloudabi32/Makefile
  stable/11/sys/modules/cloudabi64/Makefile
  stable/11/usr.bin/truss/syscalls.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/share/man/man4/cloudabi.4
==============================================================================
--- stable/11/share/man/man4/cloudabi.4	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/share/man/man4/cloudabi.4	Wed Oct 12 12:17:41 2016	(r307144)
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2015 Nuxi, https://nuxi.nl/
+.\" Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
 .\"
 .\" Redistribution and use in source and binary forms, with or without
 .\" modification, are permitted provided that the following conditions
@@ -22,17 +22,25 @@
 .\" SUCH DAMAGE.
 .\"
 .\" $FreeBSD$
-.Dd October 22, 2015
+.Dd September 22, 2016
 .Dt CLOUDABI 4
 .Os
 .Sh NAME
 .Nm cloudabi ,
+.Nm cloudabi32 ,
 .Nm cloudabi64
 .Nd CloudABI support
 .Sh SYNOPSIS
-Support for 64-bit CloudABI executables can be compiled into the kernel
+Support for 32-bit CloudABI executables can be compiled into the kernel
 by adding this line to the kernel configuration file:
 .Bd -ragged -offset indent
+.Cd "options COMPAT_CLOUDABI32"
+.Ed
+.Pp
+Similarly,
+support for 64-bit CloudABI executables can be enabled by adding this
+line:
+.Bd -ragged -offset indent
 .Cd "options COMPAT_CLOUDABI64"
 .Ed
 .Pp
@@ -40,6 +48,7 @@ CloudABI support can also be loaded at b
 .Xr loader.conf 5 :
 .Bd -literal -offset indent
 cloudabi_load="YES"
+cloudabi32_load="YES"
 cloudabi64_load="YES"
 .Ed
 .Sh DESCRIPTION
@@ -52,19 +61,21 @@ and hardened against security exploits.
 .Pp
 Support for CloudABI on
 .Fx
-consists of two separate kernel modules.
+consists of three separate kernel modules.
 The
 .Nm cloudabi
 kernel module implements all of the system calls that do not depend on
-data structures that differ between architectures.
+data structures that differ between hardware architectures.
 .Pp
 The
+.Nm cloudabi32
+and
 .Nm cloudabi64
-kernel module provides implementations of all of the machine-dependent
-system calls.
-It assumes that pointers stored in data structures provided as system
-call arguments are 64 bits in size.
-It also provides the image activator that loads and starts 64-bit ELF
+kernel modules provide implementations of all of the machine-dependent
+system calls,
+assuming that pointers stored in data structures are either 32 bits or
+64 bits in size.
+These modules also provide the image activators that load and start ELF
 executables.
 .Pp
 Though the
@@ -72,8 +83,12 @@ Though the
 module can be loaded on any architecture supported by
 .Fx ,
 the
+.Nm cloudabi32
+module is only available on amd64, armv6 and i386.
+The same holds for the
 .Nm cloudabi64
-module is only available for amd64 and arm64.
+module,
+which is only available for amd64 and arm64.
 .Pp
 A full cross compilation toolchain for CloudABI is available in the
 .Pa devel/cloudabi-toolchain
@@ -93,6 +108,9 @@ restricted set of resources.
 .Xr linux 4 ,
 .Xr elf 5
 .Pp
+CloudABI for FreeBSD:
+.Pa https://nuxi.nl/cloudabi/freebsd/ .
+.Pp
 cloudlibc on GitHub:
 .Pa https://github.com/NuxiNL/cloudlibc .
 .Pp

Modified: stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/amd64/cloudabi64/cloudabi64_sysvec.c	Wed Oct 12 12:17:41 2016	(r307144)
@@ -171,9 +171,9 @@ cloudabi64_thread_setregs(struct thread 
 		return (error);
 
 	/* Perform standard register initialization. */
-	stack.ss_sp = (void *)attr->stack;
+	stack.ss_sp = TO_PTR(attr->stack);
 	stack.ss_size = tcbptr - attr->stack;
-	cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack);
+	cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
 
 	/*
 	 * Pass in the thread ID of the new thread and the argument
@@ -196,7 +196,6 @@ static struct sysentvec cloudabi64_elf_s
 	.sv_pagesize		= PAGE_SIZE,
 	.sv_minuser		= VM_MIN_ADDRESS,
 	.sv_maxuser		= VM_MAXUSER_ADDRESS,
-	.sv_usrstack		= USRSTACK,
 	.sv_stackprot		= VM_PROT_READ | VM_PROT_WRITE,
 	.sv_copyout_strings	= cloudabi64_copyout_strings,
 	.sv_setregs		= cloudabi64_proc_setregs,

Modified: stable/11/sys/amd64/conf/NOTES
==============================================================================
--- stable/11/sys/amd64/conf/NOTES	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/amd64/conf/NOTES	Wed Oct 12 12:17:41 2016	(r307144)
@@ -618,6 +618,9 @@ options 	COMPAT_FREEBSD32
 # Emulate spx device for client side of SVR3 local X interface
 #XXX#options 	SPX_HACK
 
+# Enable 32-bit runtime support for CloudABI binaries.
+options 	COMPAT_CLOUDABI32
+
 # Enable 64-bit runtime support for CloudABI binaries.
 options 	COMPAT_CLOUDABI64
 

Modified: stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c
==============================================================================
--- stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/arm64/cloudabi64/cloudabi64_sysvec.c	Wed Oct 12 12:17:41 2016	(r307144)
@@ -139,9 +139,9 @@ cloudabi64_thread_setregs(struct thread 
 	stack_t stack;
 
 	/* Perform standard register initialization. */
-	stack.ss_sp = (void *)attr->stack;
+	stack.ss_sp = TO_PTR(attr->stack);
 	stack.ss_size = attr->stack_size;
-	cpu_set_upcall(td, (void *)attr->entry_point, NULL, &stack);
+	cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
 
 	/*
 	 * Pass in the thread ID of the new thread and the argument
@@ -165,7 +165,6 @@ static struct sysentvec cloudabi64_elf_s
 	.sv_pagesize		= PAGE_SIZE,
 	.sv_minuser		= VM_MIN_ADDRESS,
 	.sv_maxuser		= VM_MAXUSER_ADDRESS,
-	.sv_usrstack		= USRSTACK,
 	.sv_stackprot		= VM_PROT_READ | VM_PROT_WRITE,
 	.sv_copyout_strings	= cloudabi64_copyout_strings,
 	.sv_setregs		= cloudabi64_proc_setregs,

Modified: stable/11/sys/compat/cloudabi/cloudabi_clock.c
==============================================================================
--- stable/11/sys/compat/cloudabi/cloudabi_clock.c	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/compat/cloudabi/cloudabi_clock.c	Wed Oct 12 12:17:41 2016	(r307144)
@@ -117,7 +117,7 @@ cloudabi_sys_clock_res_get(struct thread
 	error = cloudabi_convert_timespec(&ts, &cts);
 	if (error != 0)
 		return (error);
-	td->td_retval[0] = cts;
+	memcpy(td->td_retval, &cts, sizeof(cts));
 	return (0);
 }
 
@@ -129,6 +129,6 @@ cloudabi_sys_clock_time_get(struct threa
 	int error;
 
 	error = cloudabi_clock_time_get(td, uap->clock_id, &ts);
-	td->td_retval[0] = ts;
+	memcpy(td->td_retval, &ts, sizeof(ts));
 	return (error);
 }

Modified: stable/11/sys/compat/cloudabi/cloudabi_thread.c
==============================================================================
--- stable/11/sys/compat/cloudabi/cloudabi_thread.c	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/compat/cloudabi/cloudabi_thread.c	Wed Oct 12 12:17:41 2016	(r307144)
@@ -60,14 +60,6 @@ cloudabi_sys_thread_exit(struct thread *
 }
 
 int
-cloudabi_sys_thread_tcb_set(struct thread *td,
-    struct cloudabi_sys_thread_tcb_set_args *uap)
-{
-
-	return (cpu_set_user_tls(td, uap->tcb));
-}
-
-int
 cloudabi_sys_thread_yield(struct thread *td,
     struct cloudabi_sys_thread_yield_args *uap)
 {

Modified: stable/11/sys/compat/cloudabi/cloudabi_util.h
==============================================================================
--- stable/11/sys/compat/cloudabi/cloudabi_util.h	Wed Oct 12 11:48:47 2016	(r307143)
+++ stable/11/sys/compat/cloudabi/cloudabi_util.h	Wed Oct 12 12:17:41 2016	(r307144)
@@ -33,6 +33,7 @@
 #include <contrib/cloudabi/cloudabi_types_common.h>
 
 struct file;
+struct sysentvec;
 struct thread;
 struct timespec;
 
@@ -76,4 +77,8 @@ int cloudabi_futex_lock_wrlock(struct th
     cloudabi_scope_t, cloudabi_clockid_t, cloudabi_timestamp_t,
     cloudabi_timestamp_t);
 
+/* vDSO setup and teardown. */
+void cloudabi_vdso_init(struct sysentvec *, char *, char *);
+void cloudabi_vdso_destroy(struct sysentvec *);
+
 #endif

Copied: stable/11/sys/compat/cloudabi/cloudabi_vdso.c (from r303941, head/sys/compat/cloudabi/cloudabi_vdso.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi/cloudabi_vdso.c	Wed Oct 12 12:17:41 2016	(r307144, copy of r303941, head/sys/compat/cloudabi/cloudabi_vdso.c)
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2016 Nuxi, https://nuxi.nl/
+ *
+ * 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#include <sys/types.h>
+#include <sys/lock.h>
+#include <sys/sysent.h>
+#include <sys/rwlock.h>
+
+#include <vm/vm.h>
+#include <vm/pmap.h>
+#include <vm/vm_extern.h>
+#include <vm/vm_object.h>
+#include <vm/vm_page.h>
+#include <vm/vm_pager.h>
+
+#include <compat/cloudabi/cloudabi_util.h>
+
+void
+cloudabi_vdso_init(struct sysentvec *sv, char *begin, char *end)
+{
+	vm_page_t m;
+	vm_object_t obj;
+	vm_offset_t addr;
+	size_t i, pages, pages_length, vdso_length;
+
+	/* Determine the number of pages needed to store the vDSO. */
+	vdso_length = end - begin;
+	pages = howmany(vdso_length, PAGE_SIZE);
+	pages_length = pages * PAGE_SIZE;
+
+	/* Allocate a VM object and fill it with the vDSO. */
+	obj = vm_pager_allocate(OBJT_PHYS, 0, pages_length,
+	    VM_PROT_DEFAULT, 0, NULL);
+	addr = kva_alloc(PAGE_SIZE);
+	for (i = 0; i < pages; ++i) {
+		VM_OBJECT_WLOCK(obj);
+		m = vm_page_grab(obj, i, VM_ALLOC_NOBUSY | VM_ALLOC_ZERO);
+		m->valid = VM_PAGE_BITS_ALL;
+		VM_OBJECT_WUNLOCK(obj);
+
+		pmap_qenter(addr, &m, 1);
+		memcpy((void *)addr, begin + i * PAGE_SIZE,
+		    MIN(vdso_length - i * PAGE_SIZE, PAGE_SIZE));
+		pmap_qremove(addr, 1);
+	}
+	kva_free(addr, PAGE_SIZE);
+
+	/*
+	 * Place the vDSO at the top of the address space. The user
+	 * stack can start right below it.
+	 */
+	sv->sv_shared_page_base = sv->sv_maxuser - pages_length;
+	sv->sv_shared_page_len = pages_length;
+	sv->sv_shared_page_obj = obj;
+	sv->sv_usrstack = sv->sv_shared_page_base;
+}
+
+void
+cloudabi_vdso_destroy(struct sysentvec *sv)
+{
+
+	vm_object_deallocate(sv->sv_shared_page_obj);
+}

Copied: stable/11/sys/compat/cloudabi/cloudabi_vdso.lds (from r304557, head/sys/compat/cloudabi/cloudabi_vdso.lds)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi/cloudabi_vdso.lds	Wed Oct 12 12:17:41 2016	(r307144, copy of r304557, head/sys/compat/cloudabi/cloudabi_vdso.lds)
@@ -0,0 +1,51 @@
+/*
+ * Linker script for the vDSO for CloudABI.
+ * Based on sys/amd64/linux/linux_vdso.lds.s
+ *
+ * $FreeBSD$
+ */
+
+SECTIONS
+{
+	. = . + SIZEOF_HEADERS;
+
+	.hash		: { *(.hash) }			:text
+	.gnu.hash	: { *(.gnu.hash) }
+	.dynsym		: { *(.dynsym) }
+	.dynstr		: { *(.dynstr) }
+	.gnu.version	: { *(.gnu.version) }
+	.gnu.version_d	: { *(.gnu.version_d) }
+	.gnu.version_r	: { *(.gnu.version_r) }
+
+	.note		: { *(.note.*) }		:text	:note
+
+	.eh_frame_hdr	: { *(.eh_frame_hdr) }		:text	:eh_frame_hdr
+	.eh_frame	: { KEEP (*(.eh_frame)) }	:text
+
+	.dynamic	: { *(.dynamic) }		:text	:dynamic
+
+	.rodata		: { *(.rodata*) }		:text
+	.data		: {
+	      *(.data*)
+	      *(.sdata*)
+	      *(.got.plt) *(.got)
+	      *(.gnu.linkonce.d.*)
+	      *(.bss*)
+	      *(.dynbss*)
+	      *(.gnu.linkonce.b.*)
+	}
+
+	.altinstructions	: { *(.altinstructions) }
+	.altinstr_replacement	: { *(.altinstr_replacement) }
+
+	. = ALIGN(0x100);
+	.text		: { *(.test .text*) }			:text	=0x90909090
+}
+
+PHDRS
+{
+	text		PT_LOAD		FLAGS(5) FILEHDR PHDRS; /* PF_R|PF_X */
+	dynamic		PT_DYNAMIC	FLAGS(4);		/* PF_R */
+	note		PT_NOTE		FLAGS(4);		/* PF_R */
+	eh_frame_hdr	PT_GNU_EH_FRAME;
+}

Copied: stable/11/sys/compat/cloudabi32/cloudabi32_proto.h (from r304565, head/sys/compat/cloudabi32/cloudabi32_proto.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi32/cloudabi32_proto.h	Wed Oct 12 12:17:41 2016	(r307144, copy of r304565, head/sys/compat/cloudabi32/cloudabi32_proto.h)
@@ -0,0 +1,465 @@
+/*
+ * System call prototypes.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed 
+ */
+
+#ifndef _CLOUDABI32_SYSPROTO_H_
+#define	_CLOUDABI32_SYSPROTO_H_
+
+#include <sys/signal.h>
+#include <sys/acl.h>
+#include <sys/cpuset.h>
+#include <sys/_ffcounter.h>
+#include <sys/_semaphore.h>
+#include <sys/ucontext.h>
+#include <sys/wait.h>
+
+#include <bsm/audit_kevents.h>
+
+struct proc;
+
+struct thread;
+
+#define	PAD_(t)	(sizeof(register_t) <= sizeof(t) ? \
+		0 : sizeof(register_t) - sizeof(t))
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define	PADL_(t)	0
+#define	PADR_(t)	PAD_(t)
+#else
+#define	PADL_(t)	PAD_(t)
+#define	PADR_(t)	0
+#endif
+
+struct cloudabi_sys_clock_res_get_args {
+	char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)];
+};
+struct cloudabi_sys_clock_time_get_args {
+	char clock_id_l_[PADL_(cloudabi_clockid_t)]; cloudabi_clockid_t clock_id; char clock_id_r_[PADR_(cloudabi_clockid_t)];
+	char precision_l_[PADL_(cloudabi_timestamp_t)]; cloudabi_timestamp_t precision; char precision_r_[PADR_(cloudabi_timestamp_t)];
+};
+struct cloudabi_sys_condvar_signal_args {
+	char condvar_l_[PADL_(cloudabi_condvar_t *)]; cloudabi_condvar_t * condvar; char condvar_r_[PADR_(cloudabi_condvar_t *)];
+	char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)];
+	char nwaiters_l_[PADL_(cloudabi_nthreads_t)]; cloudabi_nthreads_t nwaiters; char nwaiters_r_[PADR_(cloudabi_nthreads_t)];
+};
+struct cloudabi_sys_fd_close_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+};
+struct cloudabi_sys_fd_create1_args {
+	char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)];
+};
+struct cloudabi_sys_fd_create2_args {
+	char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)];
+};
+struct cloudabi_sys_fd_datasync_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+};
+struct cloudabi_sys_fd_dup_args {
+	char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)];
+};
+struct cloudabi32_sys_fd_pread_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)];
+	char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+	char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
+};
+struct cloudabi32_sys_fd_pwrite_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)];
+	char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+	char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
+};
+struct cloudabi32_sys_fd_read_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char iov_l_[PADL_(const cloudabi32_iovec_t *)]; const cloudabi32_iovec_t * iov; char iov_r_[PADR_(const cloudabi32_iovec_t *)];
+	char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_fd_replace_args {
+	char from_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t from; char from_r_[PADR_(cloudabi_fd_t)];
+	char to_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t to; char to_r_[PADR_(cloudabi_fd_t)];
+};
+struct cloudabi_sys_fd_seek_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char offset_l_[PADL_(cloudabi_filedelta_t)]; cloudabi_filedelta_t offset; char offset_r_[PADR_(cloudabi_filedelta_t)];
+	char whence_l_[PADL_(cloudabi_whence_t)]; cloudabi_whence_t whence; char whence_r_[PADR_(cloudabi_whence_t)];
+};
+struct cloudabi_sys_fd_stat_get_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(cloudabi_fdstat_t *)]; cloudabi_fdstat_t * buf; char buf_r_[PADR_(cloudabi_fdstat_t *)];
+};
+struct cloudabi_sys_fd_stat_put_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * buf; char buf_r_[PADR_(const cloudabi_fdstat_t *)];
+	char flags_l_[PADL_(cloudabi_fdsflags_t)]; cloudabi_fdsflags_t flags; char flags_r_[PADR_(cloudabi_fdsflags_t)];
+};
+struct cloudabi_sys_fd_sync_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+};
+struct cloudabi32_sys_fd_write_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char iov_l_[PADL_(const cloudabi32_ciovec_t *)]; const cloudabi32_ciovec_t * iov; char iov_r_[PADR_(const cloudabi32_ciovec_t *)];
+	char iovcnt_l_[PADL_(size_t)]; size_t iovcnt; char iovcnt_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_file_advise_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
+	char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)];
+	char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)];
+};
+struct cloudabi_sys_file_allocate_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char offset_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t offset; char offset_r_[PADR_(cloudabi_filesize_t)];
+	char len_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t len; char len_r_[PADR_(cloudabi_filesize_t)];
+};
+struct cloudabi_sys_file_create_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char type_l_[PADL_(cloudabi_filetype_t)]; cloudabi_filetype_t type; char type_r_[PADR_(cloudabi_filetype_t)];
+};
+struct cloudabi_sys_file_link_args {
+	char fd1_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd1; char fd1_r_[PADR_(cloudabi_lookup_t)];
+	char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
+	char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+	char fd2_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd2; char fd2_r_[PADR_(cloudabi_fd_t)];
+	char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
+	char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_file_open_args {
+	char dirfd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t dirfd; char dirfd_r_[PADR_(cloudabi_lookup_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char oflags_l_[PADL_(cloudabi_oflags_t)]; cloudabi_oflags_t oflags; char oflags_r_[PADR_(cloudabi_oflags_t)];
+	char fds_l_[PADL_(const cloudabi_fdstat_t *)]; const cloudabi_fdstat_t * fds; char fds_r_[PADR_(const cloudabi_fdstat_t *)];
+};
+struct cloudabi_sys_file_readdir_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
+	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+	char cookie_l_[PADL_(cloudabi_dircookie_t)]; cloudabi_dircookie_t cookie; char cookie_r_[PADR_(cloudabi_dircookie_t)];
+};
+struct cloudabi_sys_file_readlink_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
+	char bufsize_l_[PADL_(size_t)]; size_t bufsize; char bufsize_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_file_rename_args {
+	char oldfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t oldfd; char oldfd_r_[PADR_(cloudabi_fd_t)];
+	char old_l_[PADL_(const char *)]; const char * old; char old_r_[PADR_(const char *)];
+	char oldlen_l_[PADL_(size_t)]; size_t oldlen; char oldlen_r_[PADR_(size_t)];
+	char newfd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t newfd; char newfd_r_[PADR_(cloudabi_fd_t)];
+	char new_l_[PADL_(const char *)]; const char * new; char new_r_[PADR_(const char *)];
+	char newlen_l_[PADL_(size_t)]; size_t newlen; char newlen_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_file_stat_fget_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)];
+};
+struct cloudabi_sys_file_stat_fput_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)];
+	char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)];
+};
+struct cloudabi_sys_file_stat_get_args {
+	char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char buf_l_[PADL_(cloudabi_filestat_t *)]; cloudabi_filestat_t * buf; char buf_r_[PADR_(cloudabi_filestat_t *)];
+};
+struct cloudabi_sys_file_stat_put_args {
+	char fd_l_[PADL_(cloudabi_lookup_t)]; cloudabi_lookup_t fd; char fd_r_[PADR_(cloudabi_lookup_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char buf_l_[PADL_(const cloudabi_filestat_t *)]; const cloudabi_filestat_t * buf; char buf_r_[PADR_(const cloudabi_filestat_t *)];
+	char flags_l_[PADL_(cloudabi_fsflags_t)]; cloudabi_fsflags_t flags; char flags_r_[PADR_(cloudabi_fsflags_t)];
+};
+struct cloudabi_sys_file_symlink_args {
+	char path1_l_[PADL_(const char *)]; const char * path1; char path1_r_[PADR_(const char *)];
+	char path1len_l_[PADL_(size_t)]; size_t path1len; char path1len_r_[PADR_(size_t)];
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path2_l_[PADL_(const char *)]; const char * path2; char path2_r_[PADR_(const char *)];
+	char path2len_l_[PADL_(size_t)]; size_t path2len; char path2len_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_file_unlink_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+	char flags_l_[PADL_(cloudabi_ulflags_t)]; cloudabi_ulflags_t flags; char flags_r_[PADR_(cloudabi_ulflags_t)];
+};
+struct cloudabi_sys_lock_unlock_args {
+	char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)];
+	char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)];
+};
+struct cloudabi_sys_mem_advise_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+	char advice_l_[PADL_(cloudabi_advice_t)]; cloudabi_advice_t advice; char advice_r_[PADR_(cloudabi_advice_t)];
+};
+struct cloudabi_sys_mem_lock_args {
+	char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_mem_map_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+	char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)];
+	char flags_l_[PADL_(cloudabi_mflags_t)]; cloudabi_mflags_t flags; char flags_r_[PADR_(cloudabi_mflags_t)];
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char off_l_[PADL_(cloudabi_filesize_t)]; cloudabi_filesize_t off; char off_r_[PADR_(cloudabi_filesize_t)];
+};
+struct cloudabi_sys_mem_protect_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+	char prot_l_[PADL_(cloudabi_mprot_t)]; cloudabi_mprot_t prot; char prot_r_[PADR_(cloudabi_mprot_t)];
+};
+struct cloudabi_sys_mem_sync_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+	char flags_l_[PADL_(cloudabi_msflags_t)]; cloudabi_msflags_t flags; char flags_r_[PADR_(cloudabi_msflags_t)];
+};
+struct cloudabi_sys_mem_unlock_args {
+	char addr_l_[PADL_(const void *)]; const void * addr; char addr_r_[PADR_(const void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_mem_unmap_args {
+	char addr_l_[PADL_(void *)]; void * addr; char addr_r_[PADR_(void *)];
+	char len_l_[PADL_(size_t)]; size_t len; char len_r_[PADR_(size_t)];
+};
+struct cloudabi32_sys_poll_args {
+	char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)];
+	char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)];
+	char nsubscriptions_l_[PADL_(size_t)]; size_t nsubscriptions; char nsubscriptions_r_[PADR_(size_t)];
+};
+struct cloudabi32_sys_poll_fd_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char in_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * in; char in_r_[PADR_(const cloudabi32_subscription_t *)];
+	char nin_l_[PADL_(size_t)]; size_t nin; char nin_r_[PADR_(size_t)];
+	char out_l_[PADL_(cloudabi32_event_t *)]; cloudabi32_event_t * out; char out_r_[PADR_(cloudabi32_event_t *)];
+	char nout_l_[PADL_(size_t)]; size_t nout; char nout_r_[PADR_(size_t)];
+	char timeout_l_[PADL_(const cloudabi32_subscription_t *)]; const cloudabi32_subscription_t * timeout; char timeout_r_[PADR_(const cloudabi32_subscription_t *)];
+};
+struct cloudabi_sys_proc_exec_args {
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char data_l_[PADL_(const void *)]; const void * data; char data_r_[PADR_(const void *)];
+	char datalen_l_[PADL_(size_t)]; size_t datalen; char datalen_r_[PADR_(size_t)];
+	char fds_l_[PADL_(const cloudabi_fd_t *)]; const cloudabi_fd_t * fds; char fds_r_[PADR_(const cloudabi_fd_t *)];
+	char fdslen_l_[PADL_(size_t)]; size_t fdslen; char fdslen_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_proc_exit_args {
+	char rval_l_[PADL_(cloudabi_exitcode_t)]; cloudabi_exitcode_t rval; char rval_r_[PADR_(cloudabi_exitcode_t)];
+};
+struct cloudabi_sys_proc_fork_args {
+	register_t dummy;
+};
+struct cloudabi_sys_proc_raise_args {
+	char sig_l_[PADL_(cloudabi_signal_t)]; cloudabi_signal_t sig; char sig_r_[PADR_(cloudabi_signal_t)];
+};
+struct cloudabi_sys_random_get_args {
+	char buf_l_[PADL_(void *)]; void * buf; char buf_r_[PADR_(void *)];
+	char nbyte_l_[PADL_(size_t)]; size_t nbyte; char nbyte_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_sock_accept_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)];
+};
+struct cloudabi_sys_sock_bind_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_sock_connect_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char fd_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t fd; char fd_r_[PADR_(cloudabi_fd_t)];
+	char path_l_[PADL_(const char *)]; const char * path; char path_r_[PADR_(const char *)];
+	char pathlen_l_[PADL_(size_t)]; size_t pathlen; char pathlen_r_[PADR_(size_t)];
+};
+struct cloudabi_sys_sock_listen_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char backlog_l_[PADL_(cloudabi_backlog_t)]; cloudabi_backlog_t backlog; char backlog_r_[PADR_(cloudabi_backlog_t)];
+};
+struct cloudabi32_sys_sock_recv_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char in_l_[PADL_(const cloudabi32_recv_in_t *)]; const cloudabi32_recv_in_t * in; char in_r_[PADR_(const cloudabi32_recv_in_t *)];
+	char out_l_[PADL_(cloudabi32_recv_out_t *)]; cloudabi32_recv_out_t * out; char out_r_[PADR_(cloudabi32_recv_out_t *)];
+};
+struct cloudabi32_sys_sock_send_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char in_l_[PADL_(const cloudabi32_send_in_t *)]; const cloudabi32_send_in_t * in; char in_r_[PADR_(const cloudabi32_send_in_t *)];
+	char out_l_[PADL_(cloudabi32_send_out_t *)]; cloudabi32_send_out_t * out; char out_r_[PADR_(cloudabi32_send_out_t *)];
+};
+struct cloudabi_sys_sock_shutdown_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char how_l_[PADL_(cloudabi_sdflags_t)]; cloudabi_sdflags_t how; char how_r_[PADR_(cloudabi_sdflags_t)];
+};
+struct cloudabi_sys_sock_stat_get_args {
+	char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
+	char buf_l_[PADL_(cloudabi_sockstat_t *)]; cloudabi_sockstat_t * buf; char buf_r_[PADR_(cloudabi_sockstat_t *)];
+	char flags_l_[PADL_(cloudabi_ssflags_t)]; cloudabi_ssflags_t flags; char flags_r_[PADR_(cloudabi_ssflags_t)];
+};
+struct cloudabi32_sys_thread_create_args {
+	char attr_l_[PADL_(cloudabi32_threadattr_t *)]; cloudabi32_threadattr_t * attr; char attr_r_[PADR_(cloudabi32_threadattr_t *)];
+};
+struct cloudabi_sys_thread_exit_args {
+	char lock_l_[PADL_(cloudabi_lock_t *)]; cloudabi_lock_t * lock; char lock_r_[PADR_(cloudabi_lock_t *)];
+	char scope_l_[PADL_(cloudabi_scope_t)]; cloudabi_scope_t scope; char scope_r_[PADR_(cloudabi_scope_t)];
+};
+struct cloudabi_sys_thread_yield_args {
+	register_t dummy;
+};
+int	cloudabi_sys_clock_res_get(struct thread *, struct cloudabi_sys_clock_res_get_args *);
+int	cloudabi_sys_clock_time_get(struct thread *, struct cloudabi_sys_clock_time_get_args *);
+int	cloudabi_sys_condvar_signal(struct thread *, struct cloudabi_sys_condvar_signal_args *);
+int	cloudabi_sys_fd_close(struct thread *, struct cloudabi_sys_fd_close_args *);
+int	cloudabi_sys_fd_create1(struct thread *, struct cloudabi_sys_fd_create1_args *);
+int	cloudabi_sys_fd_create2(struct thread *, struct cloudabi_sys_fd_create2_args *);
+int	cloudabi_sys_fd_datasync(struct thread *, struct cloudabi_sys_fd_datasync_args *);
+int	cloudabi_sys_fd_dup(struct thread *, struct cloudabi_sys_fd_dup_args *);
+int	cloudabi32_sys_fd_pread(struct thread *, struct cloudabi32_sys_fd_pread_args *);
+int	cloudabi32_sys_fd_pwrite(struct thread *, struct cloudabi32_sys_fd_pwrite_args *);
+int	cloudabi32_sys_fd_read(struct thread *, struct cloudabi32_sys_fd_read_args *);
+int	cloudabi_sys_fd_replace(struct thread *, struct cloudabi_sys_fd_replace_args *);
+int	cloudabi_sys_fd_seek(struct thread *, struct cloudabi_sys_fd_seek_args *);
+int	cloudabi_sys_fd_stat_get(struct thread *, struct cloudabi_sys_fd_stat_get_args *);
+int	cloudabi_sys_fd_stat_put(struct thread *, struct cloudabi_sys_fd_stat_put_args *);
+int	cloudabi_sys_fd_sync(struct thread *, struct cloudabi_sys_fd_sync_args *);
+int	cloudabi32_sys_fd_write(struct thread *, struct cloudabi32_sys_fd_write_args *);
+int	cloudabi_sys_file_advise(struct thread *, struct cloudabi_sys_file_advise_args *);
+int	cloudabi_sys_file_allocate(struct thread *, struct cloudabi_sys_file_allocate_args *);
+int	cloudabi_sys_file_create(struct thread *, struct cloudabi_sys_file_create_args *);
+int	cloudabi_sys_file_link(struct thread *, struct cloudabi_sys_file_link_args *);
+int	cloudabi_sys_file_open(struct thread *, struct cloudabi_sys_file_open_args *);
+int	cloudabi_sys_file_readdir(struct thread *, struct cloudabi_sys_file_readdir_args *);
+int	cloudabi_sys_file_readlink(struct thread *, struct cloudabi_sys_file_readlink_args *);
+int	cloudabi_sys_file_rename(struct thread *, struct cloudabi_sys_file_rename_args *);
+int	cloudabi_sys_file_stat_fget(struct thread *, struct cloudabi_sys_file_stat_fget_args *);
+int	cloudabi_sys_file_stat_fput(struct thread *, struct cloudabi_sys_file_stat_fput_args *);
+int	cloudabi_sys_file_stat_get(struct thread *, struct cloudabi_sys_file_stat_get_args *);
+int	cloudabi_sys_file_stat_put(struct thread *, struct cloudabi_sys_file_stat_put_args *);
+int	cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_args *);
+int	cloudabi_sys_file_unlink(struct thread *, struct cloudabi_sys_file_unlink_args *);
+int	cloudabi_sys_lock_unlock(struct thread *, struct cloudabi_sys_lock_unlock_args *);
+int	cloudabi_sys_mem_advise(struct thread *, struct cloudabi_sys_mem_advise_args *);
+int	cloudabi_sys_mem_lock(struct thread *, struct cloudabi_sys_mem_lock_args *);
+int	cloudabi_sys_mem_map(struct thread *, struct cloudabi_sys_mem_map_args *);
+int	cloudabi_sys_mem_protect(struct thread *, struct cloudabi_sys_mem_protect_args *);
+int	cloudabi_sys_mem_sync(struct thread *, struct cloudabi_sys_mem_sync_args *);
+int	cloudabi_sys_mem_unlock(struct thread *, struct cloudabi_sys_mem_unlock_args *);
+int	cloudabi_sys_mem_unmap(struct thread *, struct cloudabi_sys_mem_unmap_args *);
+int	cloudabi32_sys_poll(struct thread *, struct cloudabi32_sys_poll_args *);
+int	cloudabi32_sys_poll_fd(struct thread *, struct cloudabi32_sys_poll_fd_args *);
+int	cloudabi_sys_proc_exec(struct thread *, struct cloudabi_sys_proc_exec_args *);
+int	cloudabi_sys_proc_exit(struct thread *, struct cloudabi_sys_proc_exit_args *);
+int	cloudabi_sys_proc_fork(struct thread *, struct cloudabi_sys_proc_fork_args *);
+int	cloudabi_sys_proc_raise(struct thread *, struct cloudabi_sys_proc_raise_args *);
+int	cloudabi_sys_random_get(struct thread *, struct cloudabi_sys_random_get_args *);
+int	cloudabi_sys_sock_accept(struct thread *, struct cloudabi_sys_sock_accept_args *);
+int	cloudabi_sys_sock_bind(struct thread *, struct cloudabi_sys_sock_bind_args *);
+int	cloudabi_sys_sock_connect(struct thread *, struct cloudabi_sys_sock_connect_args *);
+int	cloudabi_sys_sock_listen(struct thread *, struct cloudabi_sys_sock_listen_args *);
+int	cloudabi32_sys_sock_recv(struct thread *, struct cloudabi32_sys_sock_recv_args *);
+int	cloudabi32_sys_sock_send(struct thread *, struct cloudabi32_sys_sock_send_args *);
+int	cloudabi_sys_sock_shutdown(struct thread *, struct cloudabi_sys_sock_shutdown_args *);
+int	cloudabi_sys_sock_stat_get(struct thread *, struct cloudabi_sys_sock_stat_get_args *);
+int	cloudabi32_sys_thread_create(struct thread *, struct cloudabi32_sys_thread_create_args *);
+int	cloudabi_sys_thread_exit(struct thread *, struct cloudabi_sys_thread_exit_args *);
+int	cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_args *);
+
+#ifdef COMPAT_43
+
+
+#endif /* COMPAT_43 */
+
+
+#ifdef COMPAT_FREEBSD4
+
+
+#endif /* COMPAT_FREEBSD4 */
+
+
+#ifdef COMPAT_FREEBSD6
+
+
+#endif /* COMPAT_FREEBSD6 */
+
+
+#ifdef COMPAT_FREEBSD7
+
+
+#endif /* COMPAT_FREEBSD7 */
+
+
+#ifdef COMPAT_FREEBSD10
+
+
+#endif /* COMPAT_FREEBSD10 */
+
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_clock_res_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_clock_time_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_condvar_signal	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_close	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create1	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_create2	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_datasync	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_dup	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pread	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_pwrite	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_read	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_replace	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_seek	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_stat_put	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_fd_sync	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_fd_write	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_advise	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_allocate	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_create	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_link	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_open	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_readdir	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_readlink	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_rename	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fget	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_fput	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_stat_put	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_symlink	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_file_unlink	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_lock_unlock	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_advise	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_lock	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_map	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_protect	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_sync	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unlock	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_mem_unmap	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_poll	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_poll_fd	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exec	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_proc_exit	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_proc_fork	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_proc_raise	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_random_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_accept	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_bind	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_connect	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_listen	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_recv	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_sock_send	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_shutdown	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_sock_stat_get	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi32_sys_thread_create	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_thread_exit	AUE_NULL
+#define	CLOUDABI32_SYS_AUE_cloudabi_sys_thread_yield	AUE_NULL
+
+#undef PAD_
+#undef PADL_
+#undef PADR_
+
+#endif /* !_CLOUDABI32_SYSPROTO_H_ */

Copied: stable/11/sys/compat/cloudabi32/cloudabi32_syscall.h (from r304565, head/sys/compat/cloudabi32/cloudabi32_syscall.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi32/cloudabi32_syscall.h	Wed Oct 12 12:17:41 2016	(r307144, copy of r304565, head/sys/compat/cloudabi32/cloudabi32_syscall.h)
@@ -0,0 +1,66 @@
+/*
+ * System call numbers.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed 
+ */
+
+#define	CLOUDABI32_SYS_cloudabi_sys_clock_res_get	0
+#define	CLOUDABI32_SYS_cloudabi_sys_clock_time_get	1
+#define	CLOUDABI32_SYS_cloudabi_sys_condvar_signal	2
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_close	3
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_create1	4
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_create2	5
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_datasync	6
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_dup	7
+#define	CLOUDABI32_SYS_cloudabi32_sys_fd_pread	8
+#define	CLOUDABI32_SYS_cloudabi32_sys_fd_pwrite	9
+#define	CLOUDABI32_SYS_cloudabi32_sys_fd_read	10
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_replace	11
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_seek	12
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_stat_get	13
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_stat_put	14
+#define	CLOUDABI32_SYS_cloudabi_sys_fd_sync	15
+#define	CLOUDABI32_SYS_cloudabi32_sys_fd_write	16
+#define	CLOUDABI32_SYS_cloudabi_sys_file_advise	17
+#define	CLOUDABI32_SYS_cloudabi_sys_file_allocate	18
+#define	CLOUDABI32_SYS_cloudabi_sys_file_create	19
+#define	CLOUDABI32_SYS_cloudabi_sys_file_link	20
+#define	CLOUDABI32_SYS_cloudabi_sys_file_open	21
+#define	CLOUDABI32_SYS_cloudabi_sys_file_readdir	22
+#define	CLOUDABI32_SYS_cloudabi_sys_file_readlink	23
+#define	CLOUDABI32_SYS_cloudabi_sys_file_rename	24
+#define	CLOUDABI32_SYS_cloudabi_sys_file_stat_fget	25
+#define	CLOUDABI32_SYS_cloudabi_sys_file_stat_fput	26
+#define	CLOUDABI32_SYS_cloudabi_sys_file_stat_get	27
+#define	CLOUDABI32_SYS_cloudabi_sys_file_stat_put	28
+#define	CLOUDABI32_SYS_cloudabi_sys_file_symlink	29
+#define	CLOUDABI32_SYS_cloudabi_sys_file_unlink	30
+#define	CLOUDABI32_SYS_cloudabi_sys_lock_unlock	31
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_advise	32
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_lock	33
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_map	34
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_protect	35
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_sync	36
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_unlock	37
+#define	CLOUDABI32_SYS_cloudabi_sys_mem_unmap	38
+#define	CLOUDABI32_SYS_cloudabi32_sys_poll	39
+#define	CLOUDABI32_SYS_cloudabi32_sys_poll_fd	40
+#define	CLOUDABI32_SYS_cloudabi_sys_proc_exec	41
+#define	CLOUDABI32_SYS_cloudabi_sys_proc_exit	42
+#define	CLOUDABI32_SYS_cloudabi_sys_proc_fork	43
+#define	CLOUDABI32_SYS_cloudabi_sys_proc_raise	44
+#define	CLOUDABI32_SYS_cloudabi_sys_random_get	45
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_accept	46
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_bind	47
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_connect	48
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_listen	49
+#define	CLOUDABI32_SYS_cloudabi32_sys_sock_recv	50
+#define	CLOUDABI32_SYS_cloudabi32_sys_sock_send	51
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_shutdown	52
+#define	CLOUDABI32_SYS_cloudabi_sys_sock_stat_get	53
+#define	CLOUDABI32_SYS_cloudabi32_sys_thread_create	54
+#define	CLOUDABI32_SYS_cloudabi_sys_thread_exit	55
+#define	CLOUDABI32_SYS_cloudabi_sys_thread_yield	56
+#define	CLOUDABI32_SYS_MAXSYSCALL	57

Copied: stable/11/sys/compat/cloudabi32/cloudabi32_syscalls.c (from r304565, head/sys/compat/cloudabi32/cloudabi32_syscalls.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi32/cloudabi32_syscalls.c	Wed Oct 12 12:17:41 2016	(r307144, copy of r304565, head/sys/compat/cloudabi32/cloudabi32_syscalls.c)
@@ -0,0 +1,67 @@
+/*
+ * System call names.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed 
+ */
+
+const char *cloudabi32_syscallnames[] = {
+	"cloudabi_sys_clock_res_get",			/* 0 = cloudabi_sys_clock_res_get */
+	"cloudabi_sys_clock_time_get",			/* 1 = cloudabi_sys_clock_time_get */
+	"cloudabi_sys_condvar_signal",			/* 2 = cloudabi_sys_condvar_signal */
+	"cloudabi_sys_fd_close",			/* 3 = cloudabi_sys_fd_close */
+	"cloudabi_sys_fd_create1",			/* 4 = cloudabi_sys_fd_create1 */
+	"cloudabi_sys_fd_create2",			/* 5 = cloudabi_sys_fd_create2 */
+	"cloudabi_sys_fd_datasync",			/* 6 = cloudabi_sys_fd_datasync */
+	"cloudabi_sys_fd_dup",			/* 7 = cloudabi_sys_fd_dup */
+	"cloudabi32_sys_fd_pread",			/* 8 = cloudabi32_sys_fd_pread */
+	"cloudabi32_sys_fd_pwrite",			/* 9 = cloudabi32_sys_fd_pwrite */
+	"cloudabi32_sys_fd_read",			/* 10 = cloudabi32_sys_fd_read */
+	"cloudabi_sys_fd_replace",			/* 11 = cloudabi_sys_fd_replace */
+	"cloudabi_sys_fd_seek",			/* 12 = cloudabi_sys_fd_seek */
+	"cloudabi_sys_fd_stat_get",			/* 13 = cloudabi_sys_fd_stat_get */
+	"cloudabi_sys_fd_stat_put",			/* 14 = cloudabi_sys_fd_stat_put */
+	"cloudabi_sys_fd_sync",			/* 15 = cloudabi_sys_fd_sync */
+	"cloudabi32_sys_fd_write",			/* 16 = cloudabi32_sys_fd_write */
+	"cloudabi_sys_file_advise",			/* 17 = cloudabi_sys_file_advise */
+	"cloudabi_sys_file_allocate",			/* 18 = cloudabi_sys_file_allocate */
+	"cloudabi_sys_file_create",			/* 19 = cloudabi_sys_file_create */
+	"cloudabi_sys_file_link",			/* 20 = cloudabi_sys_file_link */
+	"cloudabi_sys_file_open",			/* 21 = cloudabi_sys_file_open */
+	"cloudabi_sys_file_readdir",			/* 22 = cloudabi_sys_file_readdir */
+	"cloudabi_sys_file_readlink",			/* 23 = cloudabi_sys_file_readlink */
+	"cloudabi_sys_file_rename",			/* 24 = cloudabi_sys_file_rename */
+	"cloudabi_sys_file_stat_fget",			/* 25 = cloudabi_sys_file_stat_fget */
+	"cloudabi_sys_file_stat_fput",			/* 26 = cloudabi_sys_file_stat_fput */
+	"cloudabi_sys_file_stat_get",			/* 27 = cloudabi_sys_file_stat_get */
+	"cloudabi_sys_file_stat_put",			/* 28 = cloudabi_sys_file_stat_put */
+	"cloudabi_sys_file_symlink",			/* 29 = cloudabi_sys_file_symlink */
+	"cloudabi_sys_file_unlink",			/* 30 = cloudabi_sys_file_unlink */
+	"cloudabi_sys_lock_unlock",			/* 31 = cloudabi_sys_lock_unlock */
+	"cloudabi_sys_mem_advise",			/* 32 = cloudabi_sys_mem_advise */
+	"cloudabi_sys_mem_lock",			/* 33 = cloudabi_sys_mem_lock */
+	"cloudabi_sys_mem_map",			/* 34 = cloudabi_sys_mem_map */
+	"cloudabi_sys_mem_protect",			/* 35 = cloudabi_sys_mem_protect */
+	"cloudabi_sys_mem_sync",			/* 36 = cloudabi_sys_mem_sync */
+	"cloudabi_sys_mem_unlock",			/* 37 = cloudabi_sys_mem_unlock */
+	"cloudabi_sys_mem_unmap",			/* 38 = cloudabi_sys_mem_unmap */
+	"cloudabi32_sys_poll",			/* 39 = cloudabi32_sys_poll */
+	"cloudabi32_sys_poll_fd",			/* 40 = cloudabi32_sys_poll_fd */
+	"cloudabi_sys_proc_exec",			/* 41 = cloudabi_sys_proc_exec */
+	"cloudabi_sys_proc_exit",			/* 42 = cloudabi_sys_proc_exit */
+	"cloudabi_sys_proc_fork",			/* 43 = cloudabi_sys_proc_fork */
+	"cloudabi_sys_proc_raise",			/* 44 = cloudabi_sys_proc_raise */
+	"cloudabi_sys_random_get",			/* 45 = cloudabi_sys_random_get */
+	"cloudabi_sys_sock_accept",			/* 46 = cloudabi_sys_sock_accept */
+	"cloudabi_sys_sock_bind",			/* 47 = cloudabi_sys_sock_bind */
+	"cloudabi_sys_sock_connect",			/* 48 = cloudabi_sys_sock_connect */
+	"cloudabi_sys_sock_listen",			/* 49 = cloudabi_sys_sock_listen */
+	"cloudabi32_sys_sock_recv",			/* 50 = cloudabi32_sys_sock_recv */
+	"cloudabi32_sys_sock_send",			/* 51 = cloudabi32_sys_sock_send */
+	"cloudabi_sys_sock_shutdown",			/* 52 = cloudabi_sys_sock_shutdown */
+	"cloudabi_sys_sock_stat_get",			/* 53 = cloudabi_sys_sock_stat_get */
+	"cloudabi32_sys_thread_create",			/* 54 = cloudabi32_sys_thread_create */
+	"cloudabi_sys_thread_exit",			/* 55 = cloudabi_sys_thread_exit */
+	"cloudabi_sys_thread_yield",			/* 56 = cloudabi_sys_thread_yield */
+};

Copied: stable/11/sys/compat/cloudabi32/cloudabi32_sysent.c (from r304565, head/sys/compat/cloudabi32/cloudabi32_sysent.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/11/sys/compat/cloudabi32/cloudabi32_sysent.c	Wed Oct 12 12:17:41 2016	(r307144, copy of r304565, head/sys/compat/cloudabi32/cloudabi32_sysent.c)
@@ -0,0 +1,75 @@
+/*
+ * System call switch table.
+ *
+ * DO NOT EDIT-- this file is automatically generated.
+ * $FreeBSD$
+ * created from FreeBSD: head/sys/contrib/cloudabi/syscalls32.master 304563 2016-08-21 15:56:19Z ed 
+ */
+
+#include <sys/sysent.h>
+#include <sys/sysproto.h>
+#include <contrib/cloudabi/cloudabi32_types.h>
+#include <compat/cloudabi32/cloudabi32_proto.h>
+
+#define AS(name) (sizeof(struct name) / sizeof(register_t))
+
+/* The casts are bogus but will do for now. */
+struct sysent cloudabi32_sysent[] = {
+	{ AS(cloudabi_sys_clock_res_get_args), (sy_call_t *)cloudabi_sys_clock_res_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 0 = cloudabi_sys_clock_res_get */
+	{ AS(cloudabi_sys_clock_time_get_args), (sy_call_t *)cloudabi_sys_clock_time_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 1 = cloudabi_sys_clock_time_get */
+	{ AS(cloudabi_sys_condvar_signal_args), (sy_call_t *)cloudabi_sys_condvar_signal, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 2 = cloudabi_sys_condvar_signal */
+	{ AS(cloudabi_sys_fd_close_args), (sy_call_t *)cloudabi_sys_fd_close, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 3 = cloudabi_sys_fd_close */
+	{ AS(cloudabi_sys_fd_create1_args), (sy_call_t *)cloudabi_sys_fd_create1, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 4 = cloudabi_sys_fd_create1 */
+	{ AS(cloudabi_sys_fd_create2_args), (sy_call_t *)cloudabi_sys_fd_create2, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 5 = cloudabi_sys_fd_create2 */
+	{ AS(cloudabi_sys_fd_datasync_args), (sy_call_t *)cloudabi_sys_fd_datasync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 6 = cloudabi_sys_fd_datasync */
+	{ AS(cloudabi_sys_fd_dup_args), (sy_call_t *)cloudabi_sys_fd_dup, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 7 = cloudabi_sys_fd_dup */
+	{ AS(cloudabi32_sys_fd_pread_args), (sy_call_t *)cloudabi32_sys_fd_pread, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 8 = cloudabi32_sys_fd_pread */
+	{ AS(cloudabi32_sys_fd_pwrite_args), (sy_call_t *)cloudabi32_sys_fd_pwrite, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 9 = cloudabi32_sys_fd_pwrite */
+	{ AS(cloudabi32_sys_fd_read_args), (sy_call_t *)cloudabi32_sys_fd_read, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 10 = cloudabi32_sys_fd_read */
+	{ AS(cloudabi_sys_fd_replace_args), (sy_call_t *)cloudabi_sys_fd_replace, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 11 = cloudabi_sys_fd_replace */
+	{ AS(cloudabi_sys_fd_seek_args), (sy_call_t *)cloudabi_sys_fd_seek, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 12 = cloudabi_sys_fd_seek */
+	{ AS(cloudabi_sys_fd_stat_get_args), (sy_call_t *)cloudabi_sys_fd_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 13 = cloudabi_sys_fd_stat_get */
+	{ AS(cloudabi_sys_fd_stat_put_args), (sy_call_t *)cloudabi_sys_fd_stat_put, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 14 = cloudabi_sys_fd_stat_put */
+	{ AS(cloudabi_sys_fd_sync_args), (sy_call_t *)cloudabi_sys_fd_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 15 = cloudabi_sys_fd_sync */
+	{ AS(cloudabi32_sys_fd_write_args), (sy_call_t *)cloudabi32_sys_fd_write, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 16 = cloudabi32_sys_fd_write */
+	{ AS(cloudabi_sys_file_advise_args), (sy_call_t *)cloudabi_sys_file_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 17 = cloudabi_sys_file_advise */
+	{ AS(cloudabi_sys_file_allocate_args), (sy_call_t *)cloudabi_sys_file_allocate, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 18 = cloudabi_sys_file_allocate */
+	{ AS(cloudabi_sys_file_create_args), (sy_call_t *)cloudabi_sys_file_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC },	/* 19 = cloudabi_sys_file_create */

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201610121217.u9CCHgdP075603>