git: cf0ee8738e31 - main - Drop cloudabi

Konstantin Belousov kib at FreeBSD.org
Tue Sep 21 21:19:41 UTC 2021


The branch main has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf0ee8738e31aa9e6fbf4dca4dac56d89226a71a

commit cf0ee8738e31aa9e6fbf4dca4dac56d89226a71a
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-09-12 22:50:39 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-09-21 21:18:44 +0000

    Drop cloudabi
    
    According to https://github.com/NuxiNL/cloudlibc:
    CloudABI is no longer being maintained. It was an awesome experiment,
    but it never got enough traction to be sustainable.
    
    There is no reason to keep it in FreeBSD.
    
    Approved by:    ed (private mail)
    Reviewed by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential revision:  https://reviews.freebsd.org/D31923
---
 Makefile.inc1                                      |    2 -
 ObsoleteFiles.inc                                  |    3 +
 lib/libsysdecode/errno.c                           |   97 --
 lib/libsysdecode/syscallnames.c                    |   13 -
 lib/libsysdecode/sysdecode.h                       |    2 -
 share/man/man4/Makefile                            |    3 -
 share/man/man4/cloudabi.4                          |  123 --
 sys/amd64/cloudabi32/cloudabi32_sysvec.c           |  239 ----
 sys/amd64/cloudabi64/cloudabi64_sysvec.c           |  226 ---
 sys/amd64/conf/NOTES                               |    6 -
 sys/arm/cloudabi32/cloudabi32_sysvec.c             |  199 ---
 sys/arm64/cloudabi32/cloudabi32_sysvec.c           |  207 ---
 sys/arm64/cloudabi64/cloudabi64_sysvec.c           |  191 ---
 sys/compat/cloudabi/cloudabi_clock.c               |  135 --
 sys/compat/cloudabi/cloudabi_errno.c               |  123 --
 sys/compat/cloudabi/cloudabi_fd.c                  |  475 -------
 sys/compat/cloudabi/cloudabi_file.c                |  763 ----------
 sys/compat/cloudabi/cloudabi_futex.c               | 1165 ----------------
 sys/compat/cloudabi/cloudabi_mem.c                 |  167 ---
 sys/compat/cloudabi/cloudabi_proc.c                |  148 --
 sys/compat/cloudabi/cloudabi_proto.h               |   36 -
 sys/compat/cloudabi/cloudabi_random.c              |   53 -
 sys/compat/cloudabi/cloudabi_sock.c                |  186 ---
 sys/compat/cloudabi/cloudabi_thread.c              |   66 -
 sys/compat/cloudabi/cloudabi_util.h                |   87 --
 sys/compat/cloudabi/cloudabi_vdso.c                |   90 --
 sys/compat/cloudabi/cloudabi_vdso.lds              |   51 -
 sys/compat/cloudabi32/Makefile                     |    6 -
 sys/compat/cloudabi32/cloudabi32_fd.c              |  145 --
 sys/compat/cloudabi32/cloudabi32_module.c          |  184 ---
 sys/compat/cloudabi32/cloudabi32_poll.c            |  340 -----
 sys/compat/cloudabi32/cloudabi32_proto.h           |  420 ------
 sys/compat/cloudabi32/cloudabi32_sock.c            |  128 --
 sys/compat/cloudabi32/cloudabi32_syscall.h         |   57 -
 sys/compat/cloudabi32/cloudabi32_syscalls.c        |   58 -
 sys/compat/cloudabi32/cloudabi32_sysent.c          |   66 -
 sys/compat/cloudabi32/cloudabi32_systrace_args.c   | 1458 --------------------
 sys/compat/cloudabi32/cloudabi32_thread.c          |   77 --
 sys/compat/cloudabi32/cloudabi32_util.h            |   51 -
 sys/compat/cloudabi32/syscalls.conf                |   15 -
 sys/compat/cloudabi64/Makefile                     |    6 -
 sys/compat/cloudabi64/cloudabi64_fd.c              |  145 --
 sys/compat/cloudabi64/cloudabi64_module.c          |  184 ---
 sys/compat/cloudabi64/cloudabi64_poll.c            |  340 -----
 sys/compat/cloudabi64/cloudabi64_proto.h           |  420 ------
 sys/compat/cloudabi64/cloudabi64_sock.c            |  128 --
 sys/compat/cloudabi64/cloudabi64_syscall.h         |   57 -
 sys/compat/cloudabi64/cloudabi64_syscalls.c        |   58 -
 sys/compat/cloudabi64/cloudabi64_sysent.c          |   66 -
 sys/compat/cloudabi64/cloudabi64_systrace_args.c   | 1458 --------------------
 sys/compat/cloudabi64/cloudabi64_thread.c          |   77 --
 sys/compat/cloudabi64/cloudabi64_util.h            |   51 -
 sys/compat/cloudabi64/syscalls.conf                |   15 -
 sys/conf/files                                     |   25 -
 sys/conf/files.amd64                               |   26 -
 sys/conf/files.arm                                 |   15 -
 sys/conf/files.arm64                               |   25 -
 sys/conf/files.i386                                |   12 -
 sys/conf/options                                   |    2 -
 sys/contrib/cloudabi/cloudabi32_types.h            |  189 ---
 sys/contrib/cloudabi/cloudabi64_types.h            |  189 ---
 sys/contrib/cloudabi/cloudabi_types_common.h       |  428 ------
 sys/contrib/cloudabi/cloudabi_vdso_aarch64.S       |  431 ------
 sys/contrib/cloudabi/cloudabi_vdso_armv6.S         |  396 ------
 .../cloudabi/cloudabi_vdso_armv6_on_64bit.S        |  732 ----------
 sys/contrib/cloudabi/cloudabi_vdso_i686.S          |  419 ------
 sys/contrib/cloudabi/cloudabi_vdso_i686_on_64bit.S | 1058 --------------
 sys/contrib/cloudabi/cloudabi_vdso_x86_64.S        |  449 ------
 sys/contrib/cloudabi/syscalls32.master             |  274 ----
 sys/contrib/cloudabi/syscalls64.master             |  274 ----
 sys/i386/cloudabi32/cloudabi32_sysvec.c            |  209 ---
 sys/i386/conf/NOTES                                |    3 -
 sys/kern/kern_sig.c                                |   19 -
 sys/modules/Makefile                               |   11 -
 sys/modules/cloudabi/Makefile                      |   10 -
 sys/modules/cloudabi32/Makefile                    |   46 -
 sys/modules/cloudabi64/Makefile                    |   38 -
 sys/sys/sysent.h                                   |    1 -
 sys/tools/makesyscalls.lua                         |    6 +-
 usr.bin/kdump/kdump.c                              |    5 -
 usr.bin/truss/setup.c                              |   18 -
 usr.bin/truss/syscall.h                            |   20 -
 usr.bin/truss/syscalls.c                           |  259 +---
 83 files changed, 6 insertions(+), 16449 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 8134bb93df03..ff5911edc384 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1519,8 +1519,6 @@ makeman: .PHONY
 _sysent_PATH=	${TMPPATH}:/usr/libexec
 _sysent_dirs=	sys/kern
 _sysent_dirs+=	sys/compat/freebsd32
-_sysent_dirs+=	sys/compat/cloudabi32	\
-		sys/compat/cloudabi64
 _sysent_dirs+=	sys/amd64/linux		\
 		sys/amd64/linux32	\
 		sys/arm/linux		\
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 5879ddfc3185..1a5d235624eb 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -40,6 +40,9 @@
 #   xargs -n1 | sort | uniq -d;
 # done
 
+# 20210921: remove couldabi
+OLD_FILES+=usr/share/man/man4/cloudabi.4.gz
+
 # 20210906: stop installing {llvm,clang,lldb}-tblgen
 OLD_FILES+=usr/bin/llvm-tblgen
 OLD_FILES+=usr/bin/clang-tblgen
diff --git a/lib/libsysdecode/errno.c b/lib/libsysdecode/errno.c
index d66493ad739d..b235e3abf4ed 100644
--- a/lib/libsysdecode/errno.c
+++ b/lib/libsysdecode/errno.c
@@ -40,87 +40,6 @@ __FBSDID("$FreeBSD$");
 #include <compat/linux/linux_errno.inc>
 #endif
 
-#include <contrib/cloudabi/cloudabi_types_common.h>
-
-static const int cloudabi_errno_table[] = {
-	[CLOUDABI_E2BIG]		= E2BIG,
-	[CLOUDABI_EACCES]		= EACCES,
-	[CLOUDABI_EADDRINUSE]		= EADDRINUSE,
-	[CLOUDABI_EADDRNOTAVAIL]	= EADDRNOTAVAIL,
-	[CLOUDABI_EAFNOSUPPORT]		= EAFNOSUPPORT,
-	[CLOUDABI_EAGAIN]		= EAGAIN,
-	[CLOUDABI_EALREADY]		= EALREADY,
-	[CLOUDABI_EBADF]		= EBADF,
-	[CLOUDABI_EBADMSG]		= EBADMSG,
-	[CLOUDABI_EBUSY]		= EBUSY,
-	[CLOUDABI_ECANCELED]		= ECANCELED,
-	[CLOUDABI_ECHILD]		= ECHILD,
-	[CLOUDABI_ECONNABORTED]		= ECONNABORTED,
-	[CLOUDABI_ECONNREFUSED]		= ECONNREFUSED,
-	[CLOUDABI_ECONNRESET]		= ECONNRESET,
-	[CLOUDABI_EDEADLK]		= EDEADLK,
-	[CLOUDABI_EDESTADDRREQ]		= EDESTADDRREQ,
-	[CLOUDABI_EDOM]			= EDOM,
-	[CLOUDABI_EDQUOT]		= EDQUOT,
-	[CLOUDABI_EEXIST]		= EEXIST,
-	[CLOUDABI_EFAULT]		= EFAULT,
-	[CLOUDABI_EFBIG]		= EFBIG,
-	[CLOUDABI_EHOSTUNREACH]		= EHOSTUNREACH,
-	[CLOUDABI_EIDRM]		= EIDRM,
-	[CLOUDABI_EILSEQ]		= EILSEQ,
-	[CLOUDABI_EINPROGRESS]		= EINPROGRESS,
-	[CLOUDABI_EINTR]		= EINTR,
-	[CLOUDABI_EINVAL]		= EINVAL,
-	[CLOUDABI_EIO]			= EIO,
-	[CLOUDABI_EISCONN]		= EISCONN,
-	[CLOUDABI_EISDIR]		= EISDIR,
-	[CLOUDABI_ELOOP]		= ELOOP,
-	[CLOUDABI_EMFILE]		= EMFILE,
-	[CLOUDABI_EMLINK]		= EMLINK,
-	[CLOUDABI_EMSGSIZE]		= EMSGSIZE,
-	[CLOUDABI_EMULTIHOP]		= EMULTIHOP,
-	[CLOUDABI_ENAMETOOLONG]		= ENAMETOOLONG,
-	[CLOUDABI_ENETDOWN]		= ENETDOWN,
-	[CLOUDABI_ENETRESET]		= ENETRESET,
-	[CLOUDABI_ENETUNREACH]		= ENETUNREACH,
-	[CLOUDABI_ENFILE]		= ENFILE,
-	[CLOUDABI_ENOBUFS]		= ENOBUFS,
-	[CLOUDABI_ENODEV]		= ENODEV,
-	[CLOUDABI_ENOENT]		= ENOENT,
-	[CLOUDABI_ENOEXEC]		= ENOEXEC,
-	[CLOUDABI_ENOLCK]		= ENOLCK,
-	[CLOUDABI_ENOLINK]		= ENOLINK,
-	[CLOUDABI_ENOMEM]		= ENOMEM,
-	[CLOUDABI_ENOMSG]		= ENOMSG,
-	[CLOUDABI_ENOPROTOOPT]		= ENOPROTOOPT,
-	[CLOUDABI_ENOSPC]		= ENOSPC,
-	[CLOUDABI_ENOSYS]		= ENOSYS,
-	[CLOUDABI_ENOTCONN]		= ENOTCONN,
-	[CLOUDABI_ENOTDIR]		= ENOTDIR,
-	[CLOUDABI_ENOTEMPTY]		= ENOTEMPTY,
-	[CLOUDABI_ENOTRECOVERABLE]	= ENOTRECOVERABLE,
-	[CLOUDABI_ENOTSOCK]		= ENOTSOCK,
-	[CLOUDABI_ENOTSUP]		= ENOTSUP,
-	[CLOUDABI_ENOTTY]		= ENOTTY,
-	[CLOUDABI_ENXIO]		= ENXIO,
-	[CLOUDABI_EOVERFLOW]		= EOVERFLOW,
-	[CLOUDABI_EOWNERDEAD]		= EOWNERDEAD,
-	[CLOUDABI_EPERM]		= EPERM,
-	[CLOUDABI_EPIPE]		= EPIPE,
-	[CLOUDABI_EPROTO]		= EPROTO,
-	[CLOUDABI_EPROTONOSUPPORT]	= EPROTONOSUPPORT,
-	[CLOUDABI_EPROTOTYPE]		= EPROTOTYPE,
-	[CLOUDABI_ERANGE]		= ERANGE,
-	[CLOUDABI_EROFS]		= EROFS,
-	[CLOUDABI_ESPIPE]		= ESPIPE,
-	[CLOUDABI_ESRCH]		= ESRCH,
-	[CLOUDABI_ESTALE]		= ESTALE,
-	[CLOUDABI_ETIMEDOUT]		= ETIMEDOUT,
-	[CLOUDABI_ETXTBSY]		= ETXTBSY,
-	[CLOUDABI_EXDEV]		= EXDEV,
-	[CLOUDABI_ENOTCAPABLE]		= ENOTCAPABLE,
-};
-
 int
 sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, int error)
 {
@@ -145,12 +64,6 @@ sysdecode_abi_to_freebsd_errno(enum sysdecode_abi abi, int error)
 		break;
 	}
 #endif
-	case SYSDECODE_ABI_CLOUDABI32:
-	case SYSDECODE_ABI_CLOUDABI64:
-		if (error >= 0 &&
-		    (unsigned int)error < nitems(cloudabi_errno_table))
-			return (cloudabi_errno_table[error]);
-		break;
 	default:
 		break;
 	}
@@ -172,16 +85,6 @@ sysdecode_freebsd_to_abi_errno(enum sysdecode_abi abi, int error)
 			return (linux_errtbl[error]);
 		break;
 #endif
-	case SYSDECODE_ABI_CLOUDABI32:
-	case SYSDECODE_ABI_CLOUDABI64: {
-		unsigned int i;
-
-		for (i = 0; i < nitems(cloudabi_errno_table); i++) {
-			if (error == cloudabi_errno_table[i])
-				return (i);
-		}
-		break;
-	}
 	default:
 		break;
 	}
diff --git a/lib/libsysdecode/syscallnames.c b/lib/libsysdecode/syscallnames.c
index 897f7e0fa53b..4638438964fd 100644
--- a/lib/libsysdecode/syscallnames.c
+++ b/lib/libsysdecode/syscallnames.c
@@ -64,11 +64,6 @@ static
 #include <amd64/linux32/linux32_syscalls.c>
 #endif
 
-static
-#include <compat/cloudabi32/cloudabi32_syscalls.c>
-static
-#include <compat/cloudabi64/cloudabi64_syscalls.c>
-
 const char *
 sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code)
 {
@@ -96,14 +91,6 @@ sysdecode_syscallname(enum sysdecode_abi abi, unsigned int code)
 			return (linux32_syscallnames[code]);
 		break;
 #endif
-	case SYSDECODE_ABI_CLOUDABI32:
-		if (code < nitems(cloudabi32_syscallnames))
-			return (cloudabi32_syscallnames[code]);
-		break;
-	case SYSDECODE_ABI_CLOUDABI64:
-		if (code < nitems(cloudabi64_syscallnames))
-			return (cloudabi64_syscallnames[code]);
-		break;
 	default:
 		break;
 	}
diff --git a/lib/libsysdecode/sysdecode.h b/lib/libsysdecode/sysdecode.h
index cdb9205f3da1..1a35d0c9d685 100644
--- a/lib/libsysdecode/sysdecode.h
+++ b/lib/libsysdecode/sysdecode.h
@@ -34,8 +34,6 @@ enum sysdecode_abi {
 	SYSDECODE_ABI_FREEBSD32,
 	SYSDECODE_ABI_LINUX,
 	SYSDECODE_ABI_LINUX32,
-	SYSDECODE_ABI_CLOUDABI64,
-	SYSDECODE_ABI_CLOUDABI32
 };
 
 int	sysdecode_abi_to_freebsd_errno(enum sysdecode_abi _abi, int _error);
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 7146cfe7ac8f..d83f4d03d9db 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -110,7 +110,6 @@ MAN=	aac.4 \
 	chromebook_platform.4 \
 	${_chvgpio.4} \
 	ciss.4 \
-	cloudabi.4 \
 	${_coretemp.4} \
 	cp2112.4 \
 	${_cpuctl.4} \
@@ -631,8 +630,6 @@ MLINKS+=${_bxe.4} ${_if_bxe.4}
 MLINKS+=cas.4 if_cas.4
 MLINKS+=cdce.4 if_cdce.4
 MLINKS+=cfi.4 cfid.4
-MLINKS+=cloudabi.4 cloudabi32.4 \
-	cloudabi.4 cloudabi64.4
 MLINKS+=crypto.4 cryptodev.4
 MLINKS+=cue.4 if_cue.4
 MLINKS+=cxgb.4 if_cxgb.4
diff --git a/share/man/man4/cloudabi.4 b/share/man/man4/cloudabi.4
deleted file mode 100644
index 3e3f988da4d0..000000000000
--- a/share/man/man4/cloudabi.4
+++ /dev/null
@@ -1,123 +0,0 @@
-.\" Copyright (c) 2015-2017 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.
-.\"
-.\" $FreeBSD$
-.Dd November 30, 2017
-.Dt CLOUDABI 4
-.Os
-.Sh NAME
-.Nm cloudabi ,
-.Nm cloudabi32 ,
-.Nm cloudabi64
-.Nd CloudABI support
-.Sh SYNOPSIS
-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
-CloudABI support can also be loaded at boot time from
-.Xr loader.conf 5 :
-.Bd -literal -offset indent
-cloudabi_load="YES"
-cloudabi32_load="YES"
-cloudabi64_load="YES"
-.Ed
-.Sh DESCRIPTION
-CloudABI is a POSIX-like pure capability-based runtime environment,
-similar to
-.Xr capsicum 4 .
-It can be used to develop applications that are cross-platform,
-easier to test,
-and hardened against security exploits.
-.Pp
-Support for CloudABI on
-.Fx
-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 hardware architectures.
-.Pp
-The
-.Nm cloudabi32
-and
-.Nm cloudabi64
-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
-.Nm cloudabi
-module can be loaded on any architecture supported by
-.Fx ,
-the
-.Nm cloudabi32
-module is only available on amd64, arm64, armv6, armv7 and i386.
-The same holds for the
-.Nm cloudabi64
-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
-port.
-.Pp
-The
-.Pa sysutils/cloudabi-utils
-port provides the
-.Xr cloudabi-run 1
-utility.
-.Xr cloudabi-run 1
-can be used to safely execute CloudABI processes with access to a
-restricted set of resources.
-.Sh SEE ALSO
-.Xr cloudabi-run 1 ,
-.Xr capsicum 4 ,
-.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
-The CloudABI Ports Collection on GitHub:
-.Pa https://github.com/NuxiNL/cloudabi-ports .
-.Sh HISTORY
-CloudABI support first appeared in
-.Fx 11.0 .
-.Sh AUTHORS
-.An Nuxi : Pa https://nuxi.nl/ .
diff --git a/sys/amd64/cloudabi32/cloudabi32_sysvec.c b/sys/amd64/cloudabi32/cloudabi32_sysvec.c
deleted file mode 100644
index 5bb4803ac715..000000000000
--- a/sys/amd64/cloudabi32/cloudabi32_sysvec.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*-
- * 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
- * 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/param.h>
-#include <sys/imgact.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/sysent.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/frame.h>
-#include <machine/md_var.h>
-#include <machine/pcb.h>
-#include <machine/vmparam.h>
-
-#include <compat/cloudabi/cloudabi_util.h>
-
-#include <compat/cloudabi32/cloudabi32_syscall.h>
-#include <compat/cloudabi32/cloudabi32_util.h>
-
-#include <compat/ia32/ia32_signal.h>
-#include <compat/ia32/ia32_util.h>
-
-extern const char *cloudabi32_syscallnames[];
-extern struct sysent cloudabi32_sysent[];
-
-extern unsigned long ia32_maxssiz;
-
-static int
-cloudabi32_fixup_tcb(uintptr_t *stack_base, struct image_params *imgp)
-{
-	int error;
-	uint32_t args[2];
-
-	/* Place auxiliary vector and TCB on the stack. */
-	error = cloudabi32_fixup(stack_base, imgp);
-	if (error != 0)
-		return (error);
-
-	/*
-	 * On i386, the TCB is referred to by %gs:0. Reuse the empty
-	 * space normally used by the return address (args[0]) to store
-	 * a single element array, containing a pointer to the TCB. %gs
-	 * base will point to this.
-	 *
-	 * Also let the first argument of the entry point (args[1])
-	 * refer to the auxiliary vector, which is stored right after
-	 * the TCB.
-	 */
-	args[0] = *stack_base;
-	args[1] = *stack_base +
-	    roundup(sizeof(cloudabi32_tcb_t), sizeof(register_t));
-	*stack_base -= roundup2(sizeof(args), sizeof(register_t));
-	return (copyout(args, (void *)*stack_base, sizeof(args)));
-}
-
-static void
-cloudabi32_proc_setregs(struct thread *td, struct image_params *imgp,
-    uintptr_t stack)
-{
-
-	ia32_setregs(td, imgp, stack);
-	(void)cpu_set_user_tls(td, TO_PTR(stack));
-}
-
-static int
-cloudabi32_fetch_syscall_args(struct thread *td)
-{
-	struct trapframe *frame;
-	struct syscall_args *sa;
-	int error;
-
-	frame = td->td_frame;
-	sa = &td->td_sa;
-
-	/* Obtain system call number. */
-	sa->code = frame->tf_rax;
-	sa->original_code = sa->code;
-	if (sa->code >= CLOUDABI32_SYS_MAXSYSCALL)
-		return (ENOSYS);
-	sa->callp = &cloudabi32_sysent[sa->code];
-
-	/*
-	 * Fetch system call arguments.
-	 *
-	 * The vDSO has already made sure that the arguments are
-	 * eight-byte aligned. Pointers and size_t parameters are
-	 * zero-extended. This makes it possible to copy in the
-	 * arguments directly. As long as the call doesn't use 32-bit
-	 * data structures, we can just invoke the same system call
-	 * implementation used by 64-bit processes.
-	 */
-	error = copyin((void *)frame->tf_rcx, sa->args,
-	    sa->callp->sy_narg * sizeof(sa->args[0]));
-	if (error != 0)
-		return (error);
-
-	/* Default system call return values. */
-	td->td_retval[0] = 0;
-	td->td_retval[1] = 0;
-	return (0);
-}
-
-static void
-cloudabi32_set_syscall_retval(struct thread *td, int error)
-{
-	struct trapframe *frame = td->td_frame;
-
-	switch (error) {
-	case 0:
-		/*
-		 * System call succeeded.
-		 *
-		 * Simply copy out the 64-bit return values into the
-		 * same buffer provided for system call arguments. The
-		 * vDSO will copy them to the right spot, truncating
-		 * pointers and size_t values to 32 bits.
-		 */
-		frame->tf_rax = copyout(td->td_retval, (void *)frame->tf_rcx,
-		    sizeof(td->td_retval)) == 0 ? 0 : CLOUDABI_EFAULT;
-		break;
-	case ERESTART:
-		/* Restart system call. */
-		frame->tf_rip -= frame->tf_err;
-		frame->tf_r10 = frame->tf_rcx;
-		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
-		break;
-	case EJUSTRETURN:
-		break;
-	default:
-		/* System call returned an error. */
-		frame->tf_rax = cloudabi_convert_errno(error);
-		break;
-	}
-}
-
-static void
-cloudabi32_schedtail(struct thread *td)
-{
-	struct trapframe *frame = td->td_frame;
-	register_t retval[2];
-
-	/* Return values for processes returning from fork. */
-	if ((td->td_pflags & TDP_FORKING) != 0) {
-		retval[0] = CLOUDABI_PROCESS_CHILD;
-		retval[1] = td->td_tid;
-		copyout(retval, (void *)frame->tf_rcx, sizeof(retval));
-	}
-}
-
-int
-cloudabi32_thread_setregs(struct thread *td,
-    const cloudabi32_threadattr_t *attr, uint32_t tcb)
-{
-	stack_t stack;
-	uint32_t args[3];
-	void *frameptr;
-	int error;
-
-	/* Perform standard register initialization. */
-	stack.ss_sp = TO_PTR(attr->stack);
-	stack.ss_size = attr->stack_len - sizeof(args);
-	cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
-
-	/*
-	 * Copy the arguments for the thread entry point onto the stack
-	 * (args[1] and args[2]). Similar to process startup, use the
-	 * otherwise unused return address (args[0]) for TLS.
-	 */
-	args[0] = tcb;
-	args[1] = td->td_tid;
-	args[2] = attr->argument;
-	frameptr = (void *)td->td_frame->tf_rsp;
-	error = copyout(args, frameptr, sizeof(args));
-	if (error != 0)
-		return (error);
-
-	return (cpu_set_user_tls(td, frameptr));
-}
-
-static struct sysentvec cloudabi32_elf_sysvec = {
-	.sv_size		= CLOUDABI32_SYS_MAXSYSCALL,
-	.sv_table		= cloudabi32_sysent,
-	.sv_fixup		= cloudabi32_fixup_tcb,
-	.sv_name		= "CloudABI ELF32",
-	.sv_coredump		= elf32_coredump,
-	.sv_elf_core_osabi	= ELFOSABI_FREEBSD,
-	.sv_elf_core_abi_vendor	= FREEBSD_ABI_VENDOR,
-	.sv_elf_core_prepare_notes = elf32_prepare_notes,
-	.sv_minuser		= FREEBSD32_MINUSER,
-	.sv_maxuser		= FREEBSD32_MAXUSER,
-	.sv_stackprot		= VM_PROT_READ | VM_PROT_WRITE,
-	.sv_copyout_strings	= cloudabi32_copyout_strings,
-	.sv_setregs		= cloudabi32_proc_setregs,
-	.sv_fixlimit		= ia32_fixlimit,
-	.sv_maxssiz		= &ia32_maxssiz,
-	.sv_flags		= SV_ABI_CLOUDABI | SV_CAPSICUM | SV_IA32 | SV_ILP32,
-	.sv_set_syscall_retval	= cloudabi32_set_syscall_retval,
-	.sv_fetch_syscall_args	= cloudabi32_fetch_syscall_args,
-	.sv_syscallnames	= cloudabi32_syscallnames,
-	.sv_schedtail		= cloudabi32_schedtail,
-	.sv_set_fork_retval	= x86_set_fork_retval,
-};
-
-INIT_SYSENTVEC(elf_sysvec, &cloudabi32_elf_sysvec);
-
-Elf32_Brandinfo cloudabi32_brand = {
-	.brand		= ELFOSABI_CLOUDABI,
-	.machine	= EM_386,
-	.sysvec		= &cloudabi32_elf_sysvec,
-	.flags		= BI_BRAND_ONLY_STATIC,
-};
diff --git a/sys/amd64/cloudabi64/cloudabi64_sysvec.c b/sys/amd64/cloudabi64/cloudabi64_sysvec.c
deleted file mode 100644
index 82c971212087..000000000000
--- a/sys/amd64/cloudabi64/cloudabi64_sysvec.c
+++ /dev/null
@@ -1,226 +0,0 @@
-/*-
- * Copyright (c) 2015 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/param.h>
-#include <sys/imgact.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/sysent.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
-
-#include <machine/frame.h>
-#include <machine/md_var.h>
-#include <machine/pcb.h>
-#include <machine/vmparam.h>
-
-#include <compat/cloudabi/cloudabi_util.h>
-
-#include <compat/cloudabi64/cloudabi64_syscall.h>
-#include <compat/cloudabi64/cloudabi64_util.h>
-
-extern const char *cloudabi64_syscallnames[];
-extern struct sysent cloudabi64_sysent[];
-
-static int
-cloudabi64_fixup_tcb(uintptr_t *stack_base, struct image_params *imgp)
-{
-	int error;
-	register_t tcbptr;
-
-	/* Place auxiliary vector and TCB on the stack. */
-	error = cloudabi64_fixup(stack_base, imgp);
-	if (error != 0)
-		return (error);
-
-	/*
-	 * On x86-64, the TCB is referred to by %fs:0. Take some space
-	 * from the top of the stack to store a single element array,
-	 * containing a pointer to the TCB. %fs base will point to this.
-	 */
-	tcbptr = (register_t)*stack_base;
-	*stack_base -= sizeof(tcbptr);
-	return (copyout(&tcbptr, (void *)*stack_base, sizeof(tcbptr)));
-}
-
-static void
-cloudabi64_proc_setregs(struct thread *td, struct image_params *imgp,
-    uintptr_t stack)
-{
-	struct trapframe *regs;
-
-	exec_setregs(td, imgp, stack);
-
-	/*
-	 * The stack now contains a pointer to the TCB, the TCB itself,
-	 * and the auxiliary vector. Let %rdx point to the auxiliary
-	 * vector, and set %fs base to the address of the TCB.
-	 */
-	regs = td->td_frame;
-	regs->tf_rdi = stack + sizeof(register_t) +
-	    roundup(sizeof(cloudabi64_tcb_t), sizeof(register_t));
-	(void)cpu_set_user_tls(td, TO_PTR(stack));
-}
-
-static int
-cloudabi64_fetch_syscall_args(struct thread *td)
-{
-	struct trapframe *frame;
-	struct syscall_args *sa;
-
-	frame = td->td_frame;
-	sa = &td->td_sa;
-
-	/* Obtain system call number. */
-	sa->code = frame->tf_rax;
-	sa->original_code = sa->code;
-	if (sa->code >= CLOUDABI64_SYS_MAXSYSCALL)
-		return (ENOSYS);
-	sa->callp = &cloudabi64_sysent[sa->code];
-
-	/* Fetch system call arguments. */
-	sa->args[0] = frame->tf_rdi;
-	sa->args[1] = frame->tf_rsi;
-	sa->args[2] = frame->tf_rdx;
-	sa->args[3] = frame->tf_rcx; /* Actually %r10. */
-	sa->args[4] = frame->tf_r8;
-	sa->args[5] = frame->tf_r9;
-
-	/* Default system call return values. */
-	td->td_retval[0] = 0;
-	td->td_retval[1] = frame->tf_rdx;
-	return (0);
-}
-
-static void
-cloudabi64_set_syscall_retval(struct thread *td, int error)
-{
-	struct trapframe *frame = td->td_frame;
-
-	switch (error) {
-	case 0:
-		/* System call succeeded. */
-		frame->tf_rax = td->td_retval[0];
-		frame->tf_rdx = td->td_retval[1];
-		frame->tf_rflags &= ~PSL_C;
-		break;
-	case ERESTART:
-		/* Restart system call. */
-		frame->tf_rip -= frame->tf_err;
-		frame->tf_r10 = frame->tf_rcx;
-		set_pcb_flags(td->td_pcb, PCB_FULL_IRET);
-		break;
-	case EJUSTRETURN:
-		break;
-	default:
-		/* System call returned an error. */
-		frame->tf_rax = cloudabi_convert_errno(error);
-		frame->tf_rflags |= PSL_C;
-		break;
-	}
-}
-
-static void
-cloudabi64_schedtail(struct thread *td)
-{
-	struct trapframe *frame = td->td_frame;
-
-	/* Initial register values for processes returning from fork. */
-	frame->tf_rax = CLOUDABI_PROCESS_CHILD;
-	frame->tf_rdx = td->td_tid;
-}
-
-int
-cloudabi64_thread_setregs(struct thread *td,
-    const cloudabi64_threadattr_t *attr, uint64_t tcb)
-{
-	struct trapframe *frame;
-	stack_t stack;
-	uint64_t tcbptr;
-	int error;
-
-	/*
-	 * On x86-64, the TCB is referred to by %fs:0. Take some space
-	 * from the top of the stack to store a single element array,
-	 * containing a pointer to the TCB. %fs base will point to this.
-	 */
-	tcbptr = rounddown(attr->stack + attr->stack_len - sizeof(tcbptr),
-	    _Alignof(tcbptr));
-	error = copyout(&tcb, (void *)tcbptr, sizeof(tcb));
-	if (error != 0)
-		return (error);
-
-	/* Perform standard register initialization. */
-	stack.ss_sp = TO_PTR(attr->stack);
-	stack.ss_size = tcbptr - attr->stack;
-	cpu_set_upcall(td, TO_PTR(attr->entry_point), NULL, &stack);
-
-	/*
-	 * Pass in the thread ID of the new thread and the argument
-	 * pointer provided by the parent thread in as arguments to the
-	 * entry point.
-	 */
-	frame = td->td_frame;
-	frame->tf_rdi = td->td_tid;
-	frame->tf_rsi = attr->argument;
-
-	return (cpu_set_user_tls(td, TO_PTR(tcbptr)));
-}
-
-static struct sysentvec cloudabi64_elf_sysvec = {
-	.sv_size		= CLOUDABI64_SYS_MAXSYSCALL,
-	.sv_table		= cloudabi64_sysent,
-	.sv_fixup		= cloudabi64_fixup_tcb,
-	.sv_name		= "CloudABI ELF64",
-	.sv_coredump		= elf64_coredump,
-	.sv_elf_core_osabi	= ELFOSABI_FREEBSD,
-	.sv_elf_core_abi_vendor	= FREEBSD_ABI_VENDOR,
-	.sv_elf_core_prepare_notes = elf64_prepare_notes,
-	.sv_minuser		= VM_MIN_ADDRESS,
-	/* Keep top page reserved to work around AMD Ryzen stability issues. */
-	.sv_maxuser		= VM_MAXUSER_ADDRESS - PAGE_SIZE,
-	.sv_stackprot		= VM_PROT_READ | VM_PROT_WRITE,
-	.sv_copyout_strings	= cloudabi64_copyout_strings,
-	.sv_setregs		= cloudabi64_proc_setregs,
-	.sv_flags		= SV_ABI_CLOUDABI | SV_CAPSICUM | SV_LP64,
-	.sv_set_syscall_retval	= cloudabi64_set_syscall_retval,
-	.sv_fetch_syscall_args	= cloudabi64_fetch_syscall_args,
-	.sv_syscallnames	= cloudabi64_syscallnames,
-	.sv_schedtail		= cloudabi64_schedtail,
-	.sv_set_fork_retval	= x86_set_fork_retval,
-};
-
-INIT_SYSENTVEC(elf_sysvec, &cloudabi64_elf_sysvec);
-
-Elf64_Brandinfo cloudabi64_brand = {
-	.brand		= ELFOSABI_CLOUDABI,
-	.machine	= EM_X86_64,
-	.sysvec		= &cloudabi64_elf_sysvec,
-	.flags		= BI_CAN_EXEC_DYN | BI_BRAND_ONLY_STATIC,
-};
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index ce0a5ed3c975..ce1cf6bb76ce 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -626,12 +626,6 @@ options 	COMPAT_FREEBSD32
 # Enable (32-bit) a.out binary support
 options 	COMPAT_AOUT
 
-# Enable 32-bit runtime support for CloudABI binaries.
-options 	COMPAT_CLOUDABI32
-
-# Enable 64-bit runtime support for CloudABI binaries.
-options 	COMPAT_CLOUDABI64
-
 #####################################################################
 # ZFS support
 
diff --git a/sys/arm/cloudabi32/cloudabi32_sysvec.c b/sys/arm/cloudabi32/cloudabi32_sysvec.c
deleted file mode 100644
index 4df57b22e13d..000000000000
--- a/sys/arm/cloudabi32/cloudabi32_sysvec.c
+++ /dev/null
@@ -1,199 +0,0 @@
-/*-
- * 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
- * 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/param.h>
-#include <sys/imgact.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/sysent.h>
-
-#include <vm/vm.h>
-#include <vm/pmap.h>
*** 16294 LINES SKIPPED ***


More information about the dev-commits-src-all mailing list