1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00

MFhead@r321584

This commit is contained in:
Enji Cooper 2017-07-26 21:09:10 +00:00
commit 07188cf19e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/runtime-coverage/; revision=321585
96 changed files with 1916 additions and 1493 deletions

View File

@ -761,12 +761,13 @@ _worldtmp: .PHONY
rm -rf ${LIBCOMPATTMP}
.endif
.else
@echo ">>> Deleting stale files in build tree..."
${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
delete-old delete-old-libs
delete-old delete-old-libs >/dev/null
.if defined(LIBCOMPAT)
${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \
DESTDIR=${LIBCOMPATTMP} \
delete-old delete-old-libs
delete-old delete-old-libs >/dev/null
.endif
rm -rf ${WORLDTMP}/legacy/usr/include
.if ${USING_SYSTEM_COMPILER} == "yes"
@ -2336,11 +2337,12 @@ _cddl_lib_libumem= cddl/lib/libumem
_cddl_lib_libnvpair= cddl/lib/libnvpair
_cddl_lib_libavl= cddl/lib/libavl
_cddl_lib_libuutil= cddl/lib/libuutil
.if ${MK_ZFS} != "no"
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
.endif
_cddl_lib_libctf= cddl/lib/libctf
_cddl_lib= cddl/lib
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
cddl/lib/libzfs__L: lib/libgeom__L
cddl/lib/libctf__L: lib/libz__L
.endif
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built

View File

@ -38,6 +38,14 @@
##
reader()
{
while true
do
sleep 0.1
cat /etc/motd > /dev/null
done
}
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
@ -46,6 +54,9 @@ fi
dtrace=$1
reader &
child=$!
$dtrace -qwf read'{chill(15); printf("Done chilling"); exit(0);}'
status=$?
@ -53,4 +64,6 @@ if [ "$status" -ne 0 ]; then
echo $tst: dtrace failed
fi
kill $child
exit $status

View File

@ -39,6 +39,15 @@
##
reader()
{
while true
do
sleep 0.1
cat /etc/motd > /dev/null
done
}
if [ $# != 1 ]; then
echo expected one argument: '<'dtrace-path'>'
exit 2
@ -46,6 +55,9 @@ fi
dtrace=$1
reader &
child=$!
$dtrace -qZf wassup'{printf("Iamkool");}' \
-qf read'{printf("I am done"); exit(0);}'
@ -55,4 +67,6 @@ if [ "$status" -ne 0 ]; then
echo $tst: dtrace failed
fi
kill $child
exit $status

View File

@ -27,6 +27,7 @@
#pragma ident "%Z%%M% %I% %E% SMI"
#pragma D option quiet
#pragma D option dynvarsize=2m
/*
* This test verifies that the basename() and dirname() functions are working
@ -54,12 +55,16 @@ BEGIN
dir[i++] = "f";
dir[i++] = "f/";
dir[i++] = "/////";
/*
* basename(3) and basename(1) return different results for the empty
* string on FreeBSD, so we need special handling.
dir[i++] = "";
*/
end = i;
i = 0;
printf("#!/usr/bin/ksh\n\n");
printf("#!/usr/bin/env ksh\n\n");
}
tick-1ms
@ -83,5 +88,19 @@ tick-1ms
tick-1ms
/i == end/
{
dir[i] = "";
printf("if [ \"`basename \"%s\"`\" != \"%s\" -a \".\" != \"%s\" ]; then\n",
dir[i], basename(dir[i]), basename(dir[i]));
printf(" echo \"basename(\\\"%s\\\") is \\\"%s\\\"; ",
dir[i], basename(dir[i]));
printf("expected \\\"`basename \"%s\"`\\\" or \\\".\\\"\"\n", dir[i]);
printf("fi\n\n");
printf("if [ `dirname \"%s\"` != \"%s\" ]; then\n",
dir[i], dirname(dir[i]));
printf(" echo \"dirname(\\\"%s\\\") is \\\"%s\\\"; ",
dir[i], dirname(dir[i]));
printf("expected \\\"`dirname \"%s\"`\"\\\"\n", dir[i]);
printf("fi\n\n");
exit(0);
}

View File

@ -1,4 +1,4 @@
#!/usr/bin/ksh
#!/usr/bin/env ksh
if [ `basename "/foo/bar/baz"` != "baz" ]; then
echo "basename(\"/foo/bar/baz\") is \"baz\"; expected \"`basename "/foo/bar/baz"`"\"
@ -152,8 +152,8 @@ if [ `dirname "/////"` != "/" ]; then
echo "dirname(\"/////\") is \"/\"; expected \"`dirname "/////"`"\"
fi
if [ `basename ""` != "." ]; then
echo "basename(\"\") is \".\"; expected \"`basename ""`"\"
if [ "`basename ""`" != "." -a "." != "." ]; then
echo "basename(\"\") is \".\"; expected \"`basename ""`\" or \".\""
fi
if [ `dirname ""` != "." ]; then

View File

@ -27,6 +27,7 @@
#pragma ident "%Z%%M% %I% %E% SMI"
#pragma D option quiet
#pragma D option dynvarsize=2m
BEGIN
{

View File

@ -31,11 +31,12 @@ fi
dtrace=$1
$dtrace -ln 'syscall::*$1:entry' read | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall::$1*:entry' read | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall::re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall::$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall::p$1[0-9][0-9]:entry' read | awk '{print $(NF-1),$NF}' | \
sort
$dtrace -ln 'syscall:freebsd:*$1:entry' read | \
awk '{print $(NF-1),$NF}' | grep -v -E 'compat.\.' | sort
$dtrace -ln 'syscall:freebsd:$1*:entry' read | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall:freebsd:re$1*:entry' ad | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall:freebsd:$1l*:entry' read | awk '{print $(NF-1),$NF}' | sort
$dtrace -ln 'syscall:freebsd:w$1[0-9]:entry' ait | \
awk '{print $(NF-1),$NF}' | sort
exit $status

View File

@ -1,15 +1,22 @@
FUNCTION NAME
aio_read entry
obs_vread entry
pread entry
read entry
rtprio_thread entry
FUNCTION NAME
read entry
readlink entry
readlinkat entry
readv entry
FUNCTION NAME
read entry
readlink entry
readlinkat entry
readv entry
FUNCTION NAME
readlink entry
readlinkat entry
FUNCTION NAME
pread64 entry
wait4 entry
wait6 entry

View File

@ -0,0 +1,47 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* or http://www.opensolaris.org/os/licensing.
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2017 Li-Wen Hsu <lwhsu@FreeBSD.org>
*/
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
int
main(void)
{
sigset_t set;
siginfo_t info;
struct timespec timeout;
(void)sigemptyset(&set);
(void)sigaddset(&set, SIGHUP);
timeout.tv_sec = 1;
timeout.tv_nsec = 0;
for (;;)
(void)sigtimedwait(&set, &info, &timeout);
return (0);
}

View File

@ -45,6 +45,7 @@ BEGIN
}
syscall::*wait*:entry
/pid == $1/
{
exit(0);
}

View File

@ -39,6 +39,7 @@
BEGIN
{
i = 0;
notused = $1;
}
syscall::open:entry

View File

@ -0,0 +1,30 @@
#!/usr/bin/env ksh
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# or http://www.opensolaris.org/os/licensing.
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2017 Li-Wen Hsu <lwhsu@FreeBSD.org>
while true
do
sleep 0.1
cat /etc/motd > /dev/null
done

View File

@ -32,6 +32,7 @@ TESTEXES= \
CFILES= \
tst.probestar.c \

View File

@ -68,6 +68,7 @@ ${PACKAGE}FILES= \
tst.zerosize.d \
TESTEXES= \
tst.NoSpecBuffer.exe \
CFILES= \

View File

@ -1,3 +1,5 @@
#!/bin/sh
# $FreeBSD$
usage()
@ -84,6 +86,12 @@ runtest()
;;
esac
if [ $retval -eq 0 ] && \
head -n 1 $STDOUT | grep -q -E '^#!/.*ksh$'; then
ksh $STDOUT
retval=$?
fi
return $retval
}

View File

@ -26,7 +26,7 @@ SRCS= afssys.c afskrb5.c common.c krb5_err.h
CFLAGS+= -I${KRB5DIR}/lib/kafs \
-I${KRB5DIR}/lib/krb5 \
-I${.OBJDIR:H}/libkrb5/ \
-I${.OBJDIR:H}/libkrb5 \
-I${KRB5DIR}/lib/roken
CLEANFILES= kafs5.3

View File

@ -158,7 +158,7 @@ __vdso_init_hpet(uint32_t u)
if (atomic_cmpset_rel_ptr((volatile uintptr_t *)&hpet_dev_map[u],
(uintptr_t)old_map, (uintptr_t)new_map) == 0 &&
new_map != MAP_FAILED)
munmap((void *)new_map, PAGE_SIZE);
munmap((void *)new_map, PAGE_SIZE);
return;
fail:

View File

@ -84,6 +84,10 @@ SRCS.ilogb2_test= ilogb_test.c
LIBADD+= m
.if ${MACHINE_CPUARCH} == "i386"
# XXX: __fldcw macro mismatch between fenv.h and ieeefp.h .
CWARNFLAGS.clang+= -Wno-error=macro-redefined
.endif
WARNS?= 1
# Copied from lib/msun/Makefile

View File

@ -156,10 +156,6 @@ ATF_TC_BODY(reduction, tc)
9.8477555741888350649e+4314L,
1.6061597222105160737e+4326L,
};
#elif LDBL_MANT_DIG == 113
static const long double ld_pi_odd[] = {
/* XXX */
};
#endif
#if defined(__clang__) && \
@ -205,7 +201,7 @@ ATF_TC_BODY(reduction, tc)
ATF_CHECK(fabs(tan(-d_pi_odd[i] * 2)) < 2 * DBL_EPSILON);
}
#if LDBL_MANT_DIG > 53
#if LDBL_MANT_DIG == 64 /* XXX: || LDBL_MANT_DIG == 113 */
for (i = 0; i < nitems(ld_pi_odd); i++) {
ATF_CHECK(fabsl(sinl(ld_pi_odd[i])) < LDBL_EPSILON);
ATF_CHECK(cosl(ld_pi_odd[i]) == -1.0);

View File

@ -88,7 +88,7 @@ _meta_filemon= 1
# Also skip generating or including .depend.* files if in meta+filemon mode
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used
# for _meta_filemon but not for _SKIP_DEPEND.
.if defined(_SKIP_BUILD)
.if !defined(NO_SKIP_DEPEND) && defined(_SKIP_BUILD)
_SKIP_DEPEND= 1
.endif
.if ${MK_DIRDEPS_BUILD} == "no"

View File

@ -21,6 +21,9 @@ CFLAGS+= -fPIC -mno-red-zone
.if ${MACHINE_CPUARCH} == "aarch64"
CFLAGS+= -fPIC -mgeneral-regs-only
.endif
.if ${MACHINE_CPUARCH} == "arm"
CFLAGS+= -fPIC
.endif
.if ${MACHINE_CPUARCH} == "mips"
CFLAGS+= -G0 -fno-pic -mno-abicalls
.endif

View File

@ -78,7 +78,7 @@ typedef struct {
* Originally, rest of this structure was named __fpu, 35 * 4 bytes
* long, never accessed from kernel.
*/
size_t mc_vfp_size;
__size_t mc_vfp_size;
void *mc_vfp_ptr;
unsigned int mc_spare[33];
} mcontext_t;

View File

@ -265,6 +265,7 @@ print_registers(struct trapframe *frame)
void
do_el1h_sync(struct thread *td, struct trapframe *frame)
{
struct trapframe *oframe;
uint32_t exception;
uint64_t esr, far;
@ -281,6 +282,18 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
"do_el1_sync: curthread: %p, esr %lx, elr: %lx, frame: %p", td,
esr, frame->tf_elr, frame);
oframe = td->td_frame;
switch (exception) {
case EXCP_BRK:
case EXCP_WATCHPT_EL1:
case EXCP_SOFTSTP_EL1:
break;
default:
td->td_frame = frame;
break;
}
switch(exception) {
case EXCP_FP_SIMD:
case EXCP_TRAP_FP:
@ -313,7 +326,8 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
case EXCP_WATCHPT_EL1:
case EXCP_SOFTSTP_EL1:
#ifdef KDB
kdb_trap(exception, 0, frame);
kdb_trap(exception, 0,
(td->td_frame != NULL) ? td->td_frame : frame);
#else
panic("No debugger in kernel.\n");
#endif
@ -323,6 +337,8 @@ do_el1h_sync(struct thread *td, struct trapframe *frame)
panic("Unknown kernel exception %x esr_el1 %lx\n", exception,
esr);
}
td->td_frame = oframe;
}
/*

View File

@ -4269,6 +4269,16 @@ spa_import_rootpool(const char *name)
== 0);
if ((spa = spa_lookup(pname)) != NULL) {
/*
* The pool could already be imported,
* e.g., after reboot -r.
*/
if (spa->spa_state == POOL_STATE_ACTIVE) {
mutex_exit(&spa_namespace_lock);
nvlist_free(config);
return (0);
}
/*
* Remove the existing root pool from the namespace so
* that we can replace it with the correct config

View File

@ -111,8 +111,6 @@ cloudabi_sys_fd_create1(struct thread *td,
return (kern_shm_open(td, SHM_ANON, O_RDWR, 0, &fcaps));
case CLOUDABI_FILETYPE_SOCKET_DGRAM:
return (kern_socket(td, AF_UNIX, SOCK_DGRAM, 0));
case CLOUDABI_FILETYPE_SOCKET_SEQPACKET:
return (kern_socket(td, AF_UNIX, SOCK_SEQPACKET, 0));
case CLOUDABI_FILETYPE_SOCKET_STREAM:
return (kern_socket(td, AF_UNIX, SOCK_STREAM, 0));
default:
@ -145,9 +143,6 @@ cloudabi_sys_fd_create2(struct thread *td,
case CLOUDABI_FILETYPE_SOCKET_DGRAM:
error = kern_socketpair(td, AF_UNIX, SOCK_DGRAM, 0, fds);
break;
case CLOUDABI_FILETYPE_SOCKET_SEQPACKET:
error = kern_socketpair(td, AF_UNIX, SOCK_SEQPACKET, 0, fds);
break;
case CLOUDABI_FILETYPE_SOCKET_STREAM:
error = kern_socketpair(td, AF_UNIX, SOCK_STREAM, 0, fds);
break;
@ -245,8 +240,6 @@ cloudabi_convert_filetype(const struct file *fp)
switch (so->so_type) {
case SOCK_DGRAM:
return (CLOUDABI_FILETYPE_SOCKET_DGRAM);
case SOCK_SEQPACKET:
return (CLOUDABI_FILETYPE_SOCKET_SEQPACKET);
case SOCK_STREAM:
return (CLOUDABI_FILETYPE_SOCKET_STREAM);
default:
@ -400,7 +393,6 @@ cloudabi_remove_conflicting_rights(cloudabi_filetype_t filetype,
*inheriting = 0;
break;
case CLOUDABI_FILETYPE_SOCKET_DGRAM:
case CLOUDABI_FILETYPE_SOCKET_SEQPACKET:
case CLOUDABI_FILETYPE_SOCKET_STREAM:
*base &= CLOUDABI_RIGHT_FD_READ |
CLOUDABI_RIGHT_FD_STAT_PUT_FLAGS |

View File

@ -89,14 +89,6 @@ cloudabi_sys_mem_advise(struct thread *td,
behav));
}
int
cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap)
{
return (kern_mlock(td->td_proc, td->td_ucred,
__DECONST(uintptr_t, uap->mapping), uap->mapping_len));
}
int
cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap)
{
@ -160,15 +152,6 @@ cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap)
flags));
}
int
cloudabi_sys_mem_unlock(struct thread *td,
struct cloudabi_sys_mem_unlock_args *uap)
{
return (kern_munlock(td, __DECONST(uintptr_t, uap->mapping),
uap->mapping_len));
}
int
cloudabi_sys_mem_unmap(struct thread *td,
struct cloudabi_sys_mem_unmap_args *uap)

View File

@ -49,43 +49,6 @@ __FBSDID("$FreeBSD$");
#include <compat/cloudabi/cloudabi_proto.h>
#include <compat/cloudabi/cloudabi_util.h>
/* Converts FreeBSD's struct sockaddr to CloudABI's cloudabi_sockaddr_t. */
static void
cloudabi_convert_sockaddr(const struct sockaddr *sa, socklen_t sal,
cloudabi_sockaddr_t *rsa)
{
const struct sockaddr_in *sin;
const struct sockaddr_in6 *sin6;
/* Zero-sized socket address. */
if (sal < offsetof(struct sockaddr, sa_family) + sizeof(sa->sa_family))
return;
switch (sa->sa_family) {
case AF_INET:
if (sal < sizeof(struct sockaddr_in))
return;
sin = (const struct sockaddr_in *)sa;
rsa->sa_family = CLOUDABI_AF_INET;
memcpy(&rsa->sa_inet.addr, &sin->sin_addr,
sizeof(rsa->sa_inet.addr));
rsa->sa_inet.port = ntohs(sin->sin_port);
return;
case AF_INET6:
if (sal < sizeof(struct sockaddr_in6))
return;
sin6 = (const struct sockaddr_in6 *)sa;
rsa->sa_family = CLOUDABI_AF_INET6;
memcpy(&rsa->sa_inet6.addr, &sin6->sin6_addr,
sizeof(rsa->sa_inet6.addr));
rsa->sa_inet6.port = ntohs(sin6->sin6_port);
return;
case AF_UNIX:
rsa->sa_family = CLOUDABI_AF_UNIX;
return;
}
}
/* Copies a pathname into a UNIX socket address structure. */
static int
copyin_sockaddr_un(const char *path, size_t pathlen, struct sockaddr_un *sun)
@ -112,27 +75,8 @@ int
cloudabi_sys_sock_accept(struct thread *td,
struct cloudabi_sys_sock_accept_args *uap)
{
struct sockaddr *sa;
cloudabi_sockstat_t ss = {};
socklen_t sal;
int error;
if (uap->buf == NULL) {
/* Only return the new file descriptor number. */
return (kern_accept(td, uap->sock, NULL, NULL, NULL));
} else {
/* Also return properties of the new socket descriptor. */
sal = MAX(sizeof(struct sockaddr_in),
sizeof(struct sockaddr_in6));
error = kern_accept(td, uap->sock, (void *)&sa, &sal, NULL);
if (error != 0)
return (error);
/* TODO(ed): Fill the other members of cloudabi_sockstat_t. */
cloudabi_convert_sockaddr(sa, sal, &ss.ss_peername);
free(sa, M_SONAME);
return (copyout(&ss, uap->buf, sizeof(ss)));
}
return (kern_accept(td, uap->sock, NULL, NULL, NULL));
}
int
@ -200,7 +144,6 @@ cloudabi_sys_sock_stat_get(struct thread *td,
cloudabi_sockstat_t ss = {};
cap_rights_t rights;
struct file *fp;
struct sockaddr *sa;
struct socket *so;
int error;
@ -210,27 +153,6 @@ cloudabi_sys_sock_stat_get(struct thread *td,
return (error);
so = fp->f_data;
CURVNET_SET(so->so_vnet);
/* Set ss_sockname. */
error = so->so_proto->pr_usrreqs->pru_sockaddr(so, &sa);
if (error == 0) {
cloudabi_convert_sockaddr(sa, sa->sa_len, &ss.ss_sockname);
free(sa, M_SONAME);
}
/* Set ss_peername. */
if ((so->so_state & (SS_ISCONNECTED | SS_ISCONFIRMING)) != 0) {
error = so->so_proto->pr_usrreqs->pru_peeraddr(so, &sa);
if (error == 0) {
cloudabi_convert_sockaddr(sa, sa->sa_len,
&ss.ss_peername);
free(sa, M_SONAME);
}
}
CURVNET_RESTORE();
/* Set ss_error. */
SOCK_LOCK(so);
ss.ss_error = cloudabi_convert_errno(so->so_error);
@ -249,8 +171,8 @@ cloudabi_sys_sock_stat_get(struct thread *td,
int
cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
size_t datalen, cloudabi_fd_t *fds, size_t fdslen,
cloudabi_msgflags_t flags, size_t *rdatalen, size_t *rfdslen,
cloudabi_sockaddr_t *peername, cloudabi_msgflags_t *rflags)
cloudabi_riflags_t flags, size_t *rdatalen, size_t *rfdslen,
cloudabi_roflags_t *rflags)
{
struct sockaddr_storage ss;
struct msghdr hdr = {
@ -263,9 +185,9 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
int error;
/* Convert flags. */
if (flags & CLOUDABI_MSG_PEEK)
if (flags & CLOUDABI_SOCK_RECV_PEEK)
hdr.msg_flags |= MSG_PEEK;
if (flags & CLOUDABI_MSG_WAITALL)
if (flags & CLOUDABI_SOCK_RECV_WAITALL)
hdr.msg_flags |= MSG_WAITALL;
control = NULL;
@ -278,13 +200,9 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
*rdatalen = td->td_retval[0];
td->td_retval[0] = 0;
*rfdslen = 0;
cloudabi_convert_sockaddr((struct sockaddr *)&ss,
MIN(hdr.msg_namelen, sizeof(ss)), peername);
*rflags = 0;
if (hdr.msg_flags & MSG_EOR)
*rflags |= CLOUDABI_MSG_EOR;
if (hdr.msg_flags & MSG_TRUNC)
*rflags |= CLOUDABI_MSG_TRUNC;
*rflags |= CLOUDABI_SOCK_RECV_DATA_TRUNCATED;
/* Extract file descriptors from SCM_RIGHTS messages. */
if (control != NULL) {
@ -303,7 +221,8 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
if (nfds > fdslen) {
/* Unable to store file descriptors. */
nfds = fdslen;
*rflags |= CLOUDABI_MSG_CTRUNC;
*rflags |=
CLOUDABI_SOCK_RECV_FDS_TRUNCATED;
}
error = copyout(CMSG_DATA(chdr), fds,
nfds * sizeof(int));
@ -323,20 +242,14 @@ cloudabi_sock_recv(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
int
cloudabi_sock_send(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
size_t datalen, const cloudabi_fd_t *fds, size_t fdslen,
cloudabi_msgflags_t flags, size_t *rdatalen)
size_t datalen, const cloudabi_fd_t *fds, size_t fdslen, size_t *rdatalen)
{
struct msghdr hdr = {
.msg_iov = data,
.msg_iovlen = datalen,
};
struct mbuf *control;
int error, mflags;
/* Convert flags. */
mflags = MSG_NOSIGNAL;
if (flags & CLOUDABI_MSG_EOR)
mflags |= MSG_EOR;
int error;
/* Convert file descriptor array to an SCM_RIGHTS message. */
if (fdslen > MCLBYTES || CMSG_SPACE(fdslen * sizeof(int)) > MCLBYTES) {
@ -361,7 +274,7 @@ cloudabi_sock_send(struct thread *td, cloudabi_fd_t fd, struct iovec *data,
control = NULL;
}
error = kern_sendit(td, fd, &hdr, mflags, control, UIO_USERSPACE);
error = kern_sendit(td, fd, &hdr, MSG_NOSIGNAL, control, UIO_USERSPACE);
if (error != 0)
return (error);
*rdatalen = td->td_retval[0];

View File

@ -75,10 +75,10 @@ int cloudabi_futex_lock_wrlock(struct thread *, cloudabi_lock_t *,
/* Socket operations. */
int cloudabi_sock_recv(struct thread *, cloudabi_fd_t, struct iovec *, size_t,
cloudabi_fd_t *, size_t, cloudabi_msgflags_t, size_t *, size_t *,
cloudabi_sockaddr_t *, cloudabi_msgflags_t *);
cloudabi_fd_t *, size_t, cloudabi_riflags_t, size_t *, size_t *,
cloudabi_roflags_t *);
int cloudabi_sock_send(struct thread *, cloudabi_fd_t, struct iovec *, size_t,
const cloudabi_fd_t *, size_t, cloudabi_msgflags_t, size_t *);
const cloudabi_fd_t *, size_t, size_t *);
/* vDSO setup and teardown. */
void cloudabi_vdso_init(struct sysentvec *, char *, char *);

View File

@ -200,10 +200,6 @@ struct cloudabi_sys_mem_advise_args {
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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 mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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)];
@ -222,10 +218,6 @@ struct cloudabi_sys_mem_sync_args {
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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 mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_unmap_args {
char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
@ -265,7 +257,7 @@ struct cloudabi_sys_random_get_args {
};
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 *)];
char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)];
};
struct cloudabi_sys_sock_bind_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
@ -345,11 +337,9 @@ int cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_
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 *);
@ -399,6 +389,12 @@ int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_
#endif /* COMPAT_FREEBSD10 */
#ifdef COMPAT_FREEBSD11
#endif /* COMPAT_FREEBSD11 */
#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
@ -432,11 +428,9 @@ int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_
#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

View File

@ -75,7 +75,7 @@ cloudabi32_sys_sock_recv(struct thread *td,
error = cloudabi_sock_recv(td, uap->sock, iov, ri.ri_data_len,
TO_PTR(ri.ri_fds), ri.ri_fds_len, ri.ri_flags, &rdatalen,
&rfdslen, &ro.ro_peername, &ro.ro_flags);
&rfdslen, &ro.ro_flags);
free(iov, M_SOCKET);
if (error != 0)
return (error);
@ -118,7 +118,7 @@ cloudabi32_sys_sock_send(struct thread *td,
}
error = cloudabi_sock_send(td, uap->sock, iov, si.si_data_len,
TO_PTR(si.si_fds), si.si_fds_len, si.si_flags, &datalen);
TO_PTR(si.si_fds), si.si_fds_len, &datalen);
free(iov, M_SOCKET);
if (error != 0)
return (error);

View File

@ -38,28 +38,26 @@
#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
#define CLOUDABI32_SYS_cloudabi_sys_mem_map 33
#define CLOUDABI32_SYS_cloudabi_sys_mem_protect 34
#define CLOUDABI32_SYS_cloudabi_sys_mem_sync 35
#define CLOUDABI32_SYS_cloudabi_sys_mem_unmap 36
#define CLOUDABI32_SYS_cloudabi32_sys_poll 37
#define CLOUDABI32_SYS_cloudabi32_sys_poll_fd 38
#define CLOUDABI32_SYS_cloudabi_sys_proc_exec 39
#define CLOUDABI32_SYS_cloudabi_sys_proc_exit 40
#define CLOUDABI32_SYS_cloudabi_sys_proc_fork 41
#define CLOUDABI32_SYS_cloudabi_sys_proc_raise 42
#define CLOUDABI32_SYS_cloudabi_sys_random_get 43
#define CLOUDABI32_SYS_cloudabi_sys_sock_accept 44
#define CLOUDABI32_SYS_cloudabi_sys_sock_bind 45
#define CLOUDABI32_SYS_cloudabi_sys_sock_connect 46
#define CLOUDABI32_SYS_cloudabi_sys_sock_listen 47
#define CLOUDABI32_SYS_cloudabi32_sys_sock_recv 48
#define CLOUDABI32_SYS_cloudabi32_sys_sock_send 49
#define CLOUDABI32_SYS_cloudabi_sys_sock_shutdown 50
#define CLOUDABI32_SYS_cloudabi_sys_sock_stat_get 51
#define CLOUDABI32_SYS_cloudabi32_sys_thread_create 52
#define CLOUDABI32_SYS_cloudabi_sys_thread_exit 53
#define CLOUDABI32_SYS_cloudabi_sys_thread_yield 54
#define CLOUDABI32_SYS_MAXSYSCALL 55

View File

@ -39,28 +39,26 @@ const char *cloudabi32_syscallnames[] = {
"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 */
"cloudabi_sys_mem_map", /* 33 = cloudabi_sys_mem_map */
"cloudabi_sys_mem_protect", /* 34 = cloudabi_sys_mem_protect */
"cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */
"cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */
"cloudabi32_sys_poll", /* 37 = cloudabi32_sys_poll */
"cloudabi32_sys_poll_fd", /* 38 = cloudabi32_sys_poll_fd */
"cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */
"cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */
"cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */
"cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */
"cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */
"cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */
"cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */
"cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */
"cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */
"cloudabi32_sys_sock_recv", /* 48 = cloudabi32_sys_sock_recv */
"cloudabi32_sys_sock_send", /* 49 = cloudabi32_sys_sock_send */
"cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */
"cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */
"cloudabi32_sys_thread_create", /* 52 = cloudabi32_sys_thread_create */
"cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */
"cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */
};

View File

@ -47,28 +47,26 @@ struct sysent cloudabi32_sysent[] = {
{ AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */
{ AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */
{ AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */
{ AS(cloudabi_sys_mem_lock_args), (sy_call_t *)cloudabi_sys_mem_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_lock */
{ AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_map */
{ AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_protect */
{ AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_sync */
{ AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */
{ AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */
{ AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi32_sys_poll */
{ AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi32_sys_poll_fd */
{ AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */
{ AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */
{ AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */
{ AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */
{ AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */
{ AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */
{ AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */
{ AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */
{ AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi32_sys_sock_recv */
{ AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi32_sys_sock_send */
{ AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */
{ AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */
{ AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi32_sys_thread_create */
{ AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */
{ 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */
{ AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_map */
{ AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_protect */
{ AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */
{ AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */
{ AS(cloudabi32_sys_poll_args), (sy_call_t *)cloudabi32_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi32_sys_poll */
{ AS(cloudabi32_sys_poll_fd_args), (sy_call_t *)cloudabi32_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi32_sys_poll_fd */
{ AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */
{ AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */
{ AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */
{ AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */
{ AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */
{ AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */
{ AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */
{ AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */
{ AS(cloudabi32_sys_sock_recv_args), (sy_call_t *)cloudabi32_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi32_sys_sock_recv */
{ AS(cloudabi32_sys_sock_send_args), (sy_call_t *)cloudabi32_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi32_sys_sock_send */
{ AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */
{ AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */
{ AS(cloudabi32_sys_thread_create_args), (sy_call_t *)cloudabi32_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi32_sys_thread_create */
{ AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */
{ 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */
};

View File

@ -310,16 +310,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
/* cloudabi_sys_mem_lock */
case 33: {
struct cloudabi_sys_mem_lock_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* const void * */
uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_map */
case 34: {
case 33: {
struct cloudabi_sys_mem_map_args *p = params;
uarg[0] = (intptr_t) p->addr; /* void * */
uarg[1] = p->len; /* size_t */
@ -331,7 +323,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_mem_protect */
case 35: {
case 34: {
struct cloudabi_sys_mem_protect_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -340,7 +332,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_mem_sync */
case 36: {
case 35: {
struct cloudabi_sys_mem_sync_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -348,16 +340,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
/* cloudabi_sys_mem_unlock */
case 37: {
struct cloudabi_sys_mem_unlock_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* const void * */
uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_unmap */
case 38: {
case 36: {
struct cloudabi_sys_mem_unmap_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -365,7 +349,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi32_sys_poll */
case 39: {
case 37: {
struct cloudabi32_sys_poll_args *p = params;
uarg[0] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */
uarg[1] = (intptr_t) p->out; /* cloudabi32_event_t * */
@ -374,7 +358,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi32_sys_poll_fd */
case 40: {
case 38: {
struct cloudabi32_sys_poll_fd_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi32_subscription_t * */
@ -386,7 +370,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_proc_exec */
case 41: {
case 39: {
struct cloudabi_sys_proc_exec_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->data; /* const void * */
@ -397,26 +381,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_proc_exit */
case 42: {
case 40: {
struct cloudabi_sys_proc_exit_args *p = params;
iarg[0] = p->rval; /* cloudabi_exitcode_t */
*n_args = 1;
break;
}
/* cloudabi_sys_proc_fork */
case 43: {
case 41: {
*n_args = 0;
break;
}
/* cloudabi_sys_proc_raise */
case 44: {
case 42: {
struct cloudabi_sys_proc_raise_args *p = params;
iarg[0] = p->sig; /* cloudabi_signal_t */
*n_args = 1;
break;
}
/* cloudabi_sys_random_get */
case 45: {
case 43: {
struct cloudabi_sys_random_get_args *p = params;
uarg[0] = (intptr_t) p->buf; /* void * */
uarg[1] = p->buf_len; /* size_t */
@ -424,15 +408,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_accept */
case 46: {
case 44: {
struct cloudabi_sys_sock_accept_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */
uarg[1] = (intptr_t) p->unused; /* void * */
*n_args = 2;
break;
}
/* cloudabi_sys_sock_bind */
case 47: {
case 45: {
struct cloudabi_sys_sock_bind_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -442,7 +426,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_connect */
case 48: {
case 46: {
struct cloudabi_sys_sock_connect_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -452,7 +436,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_listen */
case 49: {
case 47: {
struct cloudabi_sys_sock_listen_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->backlog; /* cloudabi_backlog_t */
@ -460,7 +444,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi32_sys_sock_recv */
case 50: {
case 48: {
struct cloudabi32_sys_sock_recv_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi32_recv_in_t * */
@ -469,7 +453,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi32_sys_sock_send */
case 51: {
case 49: {
struct cloudabi32_sys_sock_send_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi32_send_in_t * */
@ -478,7 +462,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_shutdown */
case 52: {
case 50: {
struct cloudabi_sys_sock_shutdown_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->how; /* cloudabi_sdflags_t */
@ -486,7 +470,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_stat_get */
case 53: {
case 51: {
struct cloudabi_sys_sock_stat_get_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */
@ -495,14 +479,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi32_sys_thread_create */
case 54: {
case 52: {
struct cloudabi32_sys_thread_create_args *p = params;
uarg[0] = (intptr_t) p->attr; /* cloudabi32_threadattr_t * */
*n_args = 1;
break;
}
/* cloudabi_sys_thread_exit */
case 55: {
case 53: {
struct cloudabi_sys_thread_exit_args *p = params;
uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */
iarg[1] = p->scope; /* cloudabi_scope_t */
@ -510,7 +494,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_thread_yield */
case 56: {
case 54: {
*n_args = 0;
break;
}
@ -1058,21 +1042,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_mem_lock */
case 33:
switch(ndx) {
case 0:
p = "userland const void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_mem_map */
case 34:
case 33:
switch(ndx) {
case 0:
p = "userland void *";
@ -1097,7 +1068,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_mem_protect */
case 35:
case 34:
switch(ndx) {
case 0:
p = "userland void *";
@ -1113,7 +1084,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_mem_sync */
case 36:
case 35:
switch(ndx) {
case 0:
p = "userland void *";
@ -1128,21 +1099,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_mem_unlock */
case 37:
switch(ndx) {
case 0:
p = "userland const void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_mem_unmap */
case 38:
case 36:
switch(ndx) {
case 0:
p = "userland void *";
@ -1155,7 +1113,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi32_sys_poll */
case 39:
case 37:
switch(ndx) {
case 0:
p = "userland const cloudabi32_subscription_t *";
@ -1171,7 +1129,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi32_sys_poll_fd */
case 40:
case 38:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1196,7 +1154,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_exec */
case 41:
case 39:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1218,7 +1176,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_exit */
case 42:
case 40:
switch(ndx) {
case 0:
p = "cloudabi_exitcode_t";
@ -1228,10 +1186,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_fork */
case 43:
case 41:
break;
/* cloudabi_sys_proc_raise */
case 44:
case 42:
switch(ndx) {
case 0:
p = "cloudabi_signal_t";
@ -1241,7 +1199,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_random_get */
case 45:
case 43:
switch(ndx) {
case 0:
p = "userland void *";
@ -1254,20 +1212,20 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_accept */
case 46:
case 44:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "userland cloudabi_sockstat_t *";
p = "userland void *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_bind */
case 47:
case 45:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1286,7 +1244,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_connect */
case 48:
case 46:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1305,7 +1263,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_listen */
case 49:
case 47:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1318,7 +1276,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi32_sys_sock_recv */
case 50:
case 48:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1334,7 +1292,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi32_sys_sock_send */
case 51:
case 49:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1350,7 +1308,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_shutdown */
case 52:
case 50:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1363,7 +1321,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_stat_get */
case 53:
case 51:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1379,7 +1337,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi32_sys_thread_create */
case 54:
case 52:
switch(ndx) {
case 0:
p = "userland cloudabi32_threadattr_t *";
@ -1389,7 +1347,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_thread_exit */
case 55:
case 53:
switch(ndx) {
case 0:
p = "userland cloudabi_lock_t *";
@ -1402,7 +1360,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_thread_yield */
case 56:
case 54:
break;
default:
break;
@ -1580,120 +1538,110 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_lock */
/* cloudabi_sys_mem_map */
case 33:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_map */
/* cloudabi_sys_mem_protect */
case 34:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_protect */
/* cloudabi_sys_mem_sync */
case 35:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_sync */
/* cloudabi_sys_mem_unmap */
case 36:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_unlock */
case 37:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_unmap */
case 38:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi32_sys_poll */
case 39:
case 37:
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
/* cloudabi32_sys_poll_fd */
case 40:
case 38:
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
/* cloudabi_sys_proc_exec */
case 41:
case 39:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_proc_exit */
case 42:
case 40:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_proc_fork */
case 43:
case 41:
/* cloudabi_sys_proc_raise */
case 44:
case 42:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_random_get */
case 45:
case 43:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_accept */
case 46:
case 44:
if (ndx == 0 || ndx == 1)
p = "cloudabi_fd_t";
break;
/* cloudabi_sys_sock_bind */
case 47:
case 45:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_connect */
case 48:
case 46:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_listen */
case 49:
case 47:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi32_sys_sock_recv */
case 50:
case 48:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi32_sys_sock_send */
case 51:
case 49:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_shutdown */
case 52:
case 50:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_stat_get */
case 53:
case 51:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi32_sys_thread_create */
case 54:
case 52:
if (ndx == 0 || ndx == 1)
p = "cloudabi_tid_t";
break;
/* cloudabi_sys_thread_exit */
case 55:
case 53:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_thread_yield */
case 56:
case 54:
default:
break;
};

View File

@ -200,10 +200,6 @@ struct cloudabi_sys_mem_advise_args {
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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 mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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)];
@ -222,10 +218,6 @@ struct cloudabi_sys_mem_sync_args {
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_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 mapping_l_[PADL_(const void *)]; const void * mapping; char mapping_r_[PADR_(const void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
};
struct cloudabi_sys_mem_unmap_args {
char mapping_l_[PADL_(void *)]; void * mapping; char mapping_r_[PADR_(void *)];
char mapping_len_l_[PADL_(size_t)]; size_t mapping_len; char mapping_len_r_[PADR_(size_t)];
@ -265,7 +257,7 @@ struct cloudabi_sys_random_get_args {
};
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 *)];
char unused_l_[PADL_(void *)]; void * unused; char unused_r_[PADR_(void *)];
};
struct cloudabi_sys_sock_bind_args {
char sock_l_[PADL_(cloudabi_fd_t)]; cloudabi_fd_t sock; char sock_r_[PADR_(cloudabi_fd_t)];
@ -345,11 +337,9 @@ int cloudabi_sys_file_symlink(struct thread *, struct cloudabi_sys_file_symlink_
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 cloudabi64_sys_poll(struct thread *, struct cloudabi64_sys_poll_args *);
int cloudabi64_sys_poll_fd(struct thread *, struct cloudabi64_sys_poll_fd_args *);
@ -399,6 +389,12 @@ int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_
#endif /* COMPAT_FREEBSD10 */
#ifdef COMPAT_FREEBSD11
#endif /* COMPAT_FREEBSD11 */
#define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_res_get AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_clock_time_get AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_condvar_signal AUE_NULL
@ -432,11 +428,9 @@ int cloudabi_sys_thread_yield(struct thread *, struct cloudabi_sys_thread_yield_
#define CLOUDABI64_SYS_AUE_cloudabi_sys_file_unlink AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_lock_unlock AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_advise AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_lock AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_map AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_protect AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_sync AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unlock AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi_sys_mem_unmap AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll AUE_NULL
#define CLOUDABI64_SYS_AUE_cloudabi64_sys_poll_fd AUE_NULL

View File

@ -75,7 +75,7 @@ cloudabi64_sys_sock_recv(struct thread *td,
error = cloudabi_sock_recv(td, uap->sock, iov, ri.ri_data_len,
TO_PTR(ri.ri_fds), ri.ri_fds_len, ri.ri_flags, &rdatalen,
&rfdslen, &ro.ro_peername, &ro.ro_flags);
&rfdslen, &ro.ro_flags);
free(iov, M_SOCKET);
if (error != 0)
return (error);
@ -118,7 +118,7 @@ cloudabi64_sys_sock_send(struct thread *td,
}
error = cloudabi_sock_send(td, uap->sock, iov, si.si_data_len,
TO_PTR(si.si_fds), si.si_fds_len, si.si_flags, &datalen);
TO_PTR(si.si_fds), si.si_fds_len, &datalen);
free(iov, M_SOCKET);
if (error != 0)
return (error);

View File

@ -38,28 +38,26 @@
#define CLOUDABI64_SYS_cloudabi_sys_file_unlink 30
#define CLOUDABI64_SYS_cloudabi_sys_lock_unlock 31
#define CLOUDABI64_SYS_cloudabi_sys_mem_advise 32
#define CLOUDABI64_SYS_cloudabi_sys_mem_lock 33
#define CLOUDABI64_SYS_cloudabi_sys_mem_map 34
#define CLOUDABI64_SYS_cloudabi_sys_mem_protect 35
#define CLOUDABI64_SYS_cloudabi_sys_mem_sync 36
#define CLOUDABI64_SYS_cloudabi_sys_mem_unlock 37
#define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 38
#define CLOUDABI64_SYS_cloudabi64_sys_poll 39
#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 40
#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 41
#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 42
#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 43
#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 44
#define CLOUDABI64_SYS_cloudabi_sys_random_get 45
#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 46
#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 47
#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 48
#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 49
#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 50
#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 51
#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 52
#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 53
#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 54
#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 55
#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 56
#define CLOUDABI64_SYS_MAXSYSCALL 57
#define CLOUDABI64_SYS_cloudabi_sys_mem_map 33
#define CLOUDABI64_SYS_cloudabi_sys_mem_protect 34
#define CLOUDABI64_SYS_cloudabi_sys_mem_sync 35
#define CLOUDABI64_SYS_cloudabi_sys_mem_unmap 36
#define CLOUDABI64_SYS_cloudabi64_sys_poll 37
#define CLOUDABI64_SYS_cloudabi64_sys_poll_fd 38
#define CLOUDABI64_SYS_cloudabi_sys_proc_exec 39
#define CLOUDABI64_SYS_cloudabi_sys_proc_exit 40
#define CLOUDABI64_SYS_cloudabi_sys_proc_fork 41
#define CLOUDABI64_SYS_cloudabi_sys_proc_raise 42
#define CLOUDABI64_SYS_cloudabi_sys_random_get 43
#define CLOUDABI64_SYS_cloudabi_sys_sock_accept 44
#define CLOUDABI64_SYS_cloudabi_sys_sock_bind 45
#define CLOUDABI64_SYS_cloudabi_sys_sock_connect 46
#define CLOUDABI64_SYS_cloudabi_sys_sock_listen 47
#define CLOUDABI64_SYS_cloudabi64_sys_sock_recv 48
#define CLOUDABI64_SYS_cloudabi64_sys_sock_send 49
#define CLOUDABI64_SYS_cloudabi_sys_sock_shutdown 50
#define CLOUDABI64_SYS_cloudabi_sys_sock_stat_get 51
#define CLOUDABI64_SYS_cloudabi64_sys_thread_create 52
#define CLOUDABI64_SYS_cloudabi_sys_thread_exit 53
#define CLOUDABI64_SYS_cloudabi_sys_thread_yield 54
#define CLOUDABI64_SYS_MAXSYSCALL 55

View File

@ -39,28 +39,26 @@ const char *cloudabi64_syscallnames[] = {
"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 */
"cloudabi64_sys_poll", /* 39 = cloudabi64_sys_poll */
"cloudabi64_sys_poll_fd", /* 40 = cloudabi64_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 */
"cloudabi64_sys_sock_recv", /* 50 = cloudabi64_sys_sock_recv */
"cloudabi64_sys_sock_send", /* 51 = cloudabi64_sys_sock_send */
"cloudabi_sys_sock_shutdown", /* 52 = cloudabi_sys_sock_shutdown */
"cloudabi_sys_sock_stat_get", /* 53 = cloudabi_sys_sock_stat_get */
"cloudabi64_sys_thread_create", /* 54 = cloudabi64_sys_thread_create */
"cloudabi_sys_thread_exit", /* 55 = cloudabi_sys_thread_exit */
"cloudabi_sys_thread_yield", /* 56 = cloudabi_sys_thread_yield */
"cloudabi_sys_mem_map", /* 33 = cloudabi_sys_mem_map */
"cloudabi_sys_mem_protect", /* 34 = cloudabi_sys_mem_protect */
"cloudabi_sys_mem_sync", /* 35 = cloudabi_sys_mem_sync */
"cloudabi_sys_mem_unmap", /* 36 = cloudabi_sys_mem_unmap */
"cloudabi64_sys_poll", /* 37 = cloudabi64_sys_poll */
"cloudabi64_sys_poll_fd", /* 38 = cloudabi64_sys_poll_fd */
"cloudabi_sys_proc_exec", /* 39 = cloudabi_sys_proc_exec */
"cloudabi_sys_proc_exit", /* 40 = cloudabi_sys_proc_exit */
"cloudabi_sys_proc_fork", /* 41 = cloudabi_sys_proc_fork */
"cloudabi_sys_proc_raise", /* 42 = cloudabi_sys_proc_raise */
"cloudabi_sys_random_get", /* 43 = cloudabi_sys_random_get */
"cloudabi_sys_sock_accept", /* 44 = cloudabi_sys_sock_accept */
"cloudabi_sys_sock_bind", /* 45 = cloudabi_sys_sock_bind */
"cloudabi_sys_sock_connect", /* 46 = cloudabi_sys_sock_connect */
"cloudabi_sys_sock_listen", /* 47 = cloudabi_sys_sock_listen */
"cloudabi64_sys_sock_recv", /* 48 = cloudabi64_sys_sock_recv */
"cloudabi64_sys_sock_send", /* 49 = cloudabi64_sys_sock_send */
"cloudabi_sys_sock_shutdown", /* 50 = cloudabi_sys_sock_shutdown */
"cloudabi_sys_sock_stat_get", /* 51 = cloudabi_sys_sock_stat_get */
"cloudabi64_sys_thread_create", /* 52 = cloudabi64_sys_thread_create */
"cloudabi_sys_thread_exit", /* 53 = cloudabi_sys_thread_exit */
"cloudabi_sys_thread_yield", /* 54 = cloudabi_sys_thread_yield */
};

View File

@ -47,28 +47,26 @@ struct sysent cloudabi64_sysent[] = {
{ AS(cloudabi_sys_file_unlink_args), (sy_call_t *)cloudabi_sys_file_unlink, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 30 = cloudabi_sys_file_unlink */
{ AS(cloudabi_sys_lock_unlock_args), (sy_call_t *)cloudabi_sys_lock_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 31 = cloudabi_sys_lock_unlock */
{ AS(cloudabi_sys_mem_advise_args), (sy_call_t *)cloudabi_sys_mem_advise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 32 = cloudabi_sys_mem_advise */
{ AS(cloudabi_sys_mem_lock_args), (sy_call_t *)cloudabi_sys_mem_lock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_lock */
{ AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_map */
{ AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_protect */
{ AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_sync */
{ AS(cloudabi_sys_mem_unlock_args), (sy_call_t *)cloudabi_sys_mem_unlock, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi_sys_mem_unlock */
{ AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi_sys_mem_unmap */
{ AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi64_sys_poll */
{ AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi64_sys_poll_fd */
{ AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_exec */
{ AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_proc_fork */
{ AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_proc_raise */
{ AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_random_get */
{ AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_accept */
{ AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_bind */
{ AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi_sys_sock_connect */
{ AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi_sys_sock_listen */
{ AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi64_sys_sock_recv */
{ AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi64_sys_sock_send */
{ AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi_sys_sock_shutdown */
{ AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_sock_stat_get */
{ AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi64_sys_thread_create */
{ AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 55 = cloudabi_sys_thread_exit */
{ 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 56 = cloudabi_sys_thread_yield */
{ AS(cloudabi_sys_mem_map_args), (sy_call_t *)cloudabi_sys_mem_map, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 33 = cloudabi_sys_mem_map */
{ AS(cloudabi_sys_mem_protect_args), (sy_call_t *)cloudabi_sys_mem_protect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 34 = cloudabi_sys_mem_protect */
{ AS(cloudabi_sys_mem_sync_args), (sy_call_t *)cloudabi_sys_mem_sync, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 35 = cloudabi_sys_mem_sync */
{ AS(cloudabi_sys_mem_unmap_args), (sy_call_t *)cloudabi_sys_mem_unmap, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 36 = cloudabi_sys_mem_unmap */
{ AS(cloudabi64_sys_poll_args), (sy_call_t *)cloudabi64_sys_poll, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 37 = cloudabi64_sys_poll */
{ AS(cloudabi64_sys_poll_fd_args), (sy_call_t *)cloudabi64_sys_poll_fd, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 38 = cloudabi64_sys_poll_fd */
{ AS(cloudabi_sys_proc_exec_args), (sy_call_t *)cloudabi_sys_proc_exec, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = cloudabi_sys_proc_exec */
{ AS(cloudabi_sys_proc_exit_args), (sy_call_t *)cloudabi_sys_proc_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 40 = cloudabi_sys_proc_exit */
{ 0, (sy_call_t *)cloudabi_sys_proc_fork, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = cloudabi_sys_proc_fork */
{ AS(cloudabi_sys_proc_raise_args), (sy_call_t *)cloudabi_sys_proc_raise, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = cloudabi_sys_proc_raise */
{ AS(cloudabi_sys_random_get_args), (sy_call_t *)cloudabi_sys_random_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = cloudabi_sys_random_get */
{ AS(cloudabi_sys_sock_accept_args), (sy_call_t *)cloudabi_sys_sock_accept, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = cloudabi_sys_sock_accept */
{ AS(cloudabi_sys_sock_bind_args), (sy_call_t *)cloudabi_sys_sock_bind, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 45 = cloudabi_sys_sock_bind */
{ AS(cloudabi_sys_sock_connect_args), (sy_call_t *)cloudabi_sys_sock_connect, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 46 = cloudabi_sys_sock_connect */
{ AS(cloudabi_sys_sock_listen_args), (sy_call_t *)cloudabi_sys_sock_listen, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 47 = cloudabi_sys_sock_listen */
{ AS(cloudabi64_sys_sock_recv_args), (sy_call_t *)cloudabi64_sys_sock_recv, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 48 = cloudabi64_sys_sock_recv */
{ AS(cloudabi64_sys_sock_send_args), (sy_call_t *)cloudabi64_sys_sock_send, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 49 = cloudabi64_sys_sock_send */
{ AS(cloudabi_sys_sock_shutdown_args), (sy_call_t *)cloudabi_sys_sock_shutdown, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 50 = cloudabi_sys_sock_shutdown */
{ AS(cloudabi_sys_sock_stat_get_args), (sy_call_t *)cloudabi_sys_sock_stat_get, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 51 = cloudabi_sys_sock_stat_get */
{ AS(cloudabi64_sys_thread_create_args), (sy_call_t *)cloudabi64_sys_thread_create, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 52 = cloudabi64_sys_thread_create */
{ AS(cloudabi_sys_thread_exit_args), (sy_call_t *)cloudabi_sys_thread_exit, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 53 = cloudabi_sys_thread_exit */
{ 0, (sy_call_t *)cloudabi_sys_thread_yield, AUE_NULL, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 54 = cloudabi_sys_thread_yield */
};

View File

@ -310,16 +310,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
/* cloudabi_sys_mem_lock */
case 33: {
struct cloudabi_sys_mem_lock_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* const void * */
uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_map */
case 34: {
case 33: {
struct cloudabi_sys_mem_map_args *p = params;
uarg[0] = (intptr_t) p->addr; /* void * */
uarg[1] = p->len; /* size_t */
@ -331,7 +323,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_mem_protect */
case 35: {
case 34: {
struct cloudabi_sys_mem_protect_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -340,7 +332,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_mem_sync */
case 36: {
case 35: {
struct cloudabi_sys_mem_sync_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -348,16 +340,8 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
*n_args = 3;
break;
}
/* cloudabi_sys_mem_unlock */
case 37: {
struct cloudabi_sys_mem_unlock_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* const void * */
uarg[1] = p->mapping_len; /* size_t */
*n_args = 2;
break;
}
/* cloudabi_sys_mem_unmap */
case 38: {
case 36: {
struct cloudabi_sys_mem_unmap_args *p = params;
uarg[0] = (intptr_t) p->mapping; /* void * */
uarg[1] = p->mapping_len; /* size_t */
@ -365,7 +349,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_poll */
case 39: {
case 37: {
struct cloudabi64_sys_poll_args *p = params;
uarg[0] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */
uarg[1] = (intptr_t) p->out; /* cloudabi64_event_t * */
@ -374,7 +358,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_poll_fd */
case 40: {
case 38: {
struct cloudabi64_sys_poll_fd_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi64_subscription_t * */
@ -386,7 +370,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_proc_exec */
case 41: {
case 39: {
struct cloudabi_sys_proc_exec_args *p = params;
iarg[0] = p->fd; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->data; /* const void * */
@ -397,26 +381,26 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_proc_exit */
case 42: {
case 40: {
struct cloudabi_sys_proc_exit_args *p = params;
iarg[0] = p->rval; /* cloudabi_exitcode_t */
*n_args = 1;
break;
}
/* cloudabi_sys_proc_fork */
case 43: {
case 41: {
*n_args = 0;
break;
}
/* cloudabi_sys_proc_raise */
case 44: {
case 42: {
struct cloudabi_sys_proc_raise_args *p = params;
iarg[0] = p->sig; /* cloudabi_signal_t */
*n_args = 1;
break;
}
/* cloudabi_sys_random_get */
case 45: {
case 43: {
struct cloudabi_sys_random_get_args *p = params;
uarg[0] = (intptr_t) p->buf; /* void * */
uarg[1] = p->buf_len; /* size_t */
@ -424,15 +408,15 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_accept */
case 46: {
case 44: {
struct cloudabi_sys_sock_accept_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */
uarg[1] = (intptr_t) p->unused; /* void * */
*n_args = 2;
break;
}
/* cloudabi_sys_sock_bind */
case 47: {
case 45: {
struct cloudabi_sys_sock_bind_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -442,7 +426,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_connect */
case 48: {
case 46: {
struct cloudabi_sys_sock_connect_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->fd; /* cloudabi_fd_t */
@ -452,7 +436,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_listen */
case 49: {
case 47: {
struct cloudabi_sys_sock_listen_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->backlog; /* cloudabi_backlog_t */
@ -460,7 +444,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_sock_recv */
case 50: {
case 48: {
struct cloudabi64_sys_sock_recv_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi64_recv_in_t * */
@ -469,7 +453,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_sock_send */
case 51: {
case 49: {
struct cloudabi64_sys_sock_send_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->in; /* const cloudabi64_send_in_t * */
@ -478,7 +462,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_shutdown */
case 52: {
case 50: {
struct cloudabi_sys_sock_shutdown_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
iarg[1] = p->how; /* cloudabi_sdflags_t */
@ -486,7 +470,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_sock_stat_get */
case 53: {
case 51: {
struct cloudabi_sys_sock_stat_get_args *p = params;
iarg[0] = p->sock; /* cloudabi_fd_t */
uarg[1] = (intptr_t) p->buf; /* cloudabi_sockstat_t * */
@ -495,14 +479,14 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi64_sys_thread_create */
case 54: {
case 52: {
struct cloudabi64_sys_thread_create_args *p = params;
uarg[0] = (intptr_t) p->attr; /* cloudabi64_threadattr_t * */
*n_args = 1;
break;
}
/* cloudabi_sys_thread_exit */
case 55: {
case 53: {
struct cloudabi_sys_thread_exit_args *p = params;
uarg[0] = (intptr_t) p->lock; /* cloudabi_lock_t * */
iarg[1] = p->scope; /* cloudabi_scope_t */
@ -510,7 +494,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
break;
}
/* cloudabi_sys_thread_yield */
case 56: {
case 54: {
*n_args = 0;
break;
}
@ -1058,21 +1042,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_mem_lock */
case 33:
switch(ndx) {
case 0:
p = "userland const void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_mem_map */
case 34:
case 33:
switch(ndx) {
case 0:
p = "userland void *";
@ -1097,7 +1068,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_mem_protect */
case 35:
case 34:
switch(ndx) {
case 0:
p = "userland void *";
@ -1113,7 +1084,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_mem_sync */
case 36:
case 35:
switch(ndx) {
case 0:
p = "userland void *";
@ -1128,21 +1099,8 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
break;
};
break;
/* cloudabi_sys_mem_unlock */
case 37:
switch(ndx) {
case 0:
p = "userland const void *";
break;
case 1:
p = "size_t";
break;
default:
break;
};
break;
/* cloudabi_sys_mem_unmap */
case 38:
case 36:
switch(ndx) {
case 0:
p = "userland void *";
@ -1155,7 +1113,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi64_sys_poll */
case 39:
case 37:
switch(ndx) {
case 0:
p = "userland const cloudabi64_subscription_t *";
@ -1171,7 +1129,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi64_sys_poll_fd */
case 40:
case 38:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1196,7 +1154,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_exec */
case 41:
case 39:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1218,7 +1176,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_exit */
case 42:
case 40:
switch(ndx) {
case 0:
p = "cloudabi_exitcode_t";
@ -1228,10 +1186,10 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_proc_fork */
case 43:
case 41:
break;
/* cloudabi_sys_proc_raise */
case 44:
case 42:
switch(ndx) {
case 0:
p = "cloudabi_signal_t";
@ -1241,7 +1199,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_random_get */
case 45:
case 43:
switch(ndx) {
case 0:
p = "userland void *";
@ -1254,20 +1212,20 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_accept */
case 46:
case 44:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
break;
case 1:
p = "userland cloudabi_sockstat_t *";
p = "userland void *";
break;
default:
break;
};
break;
/* cloudabi_sys_sock_bind */
case 47:
case 45:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1286,7 +1244,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_connect */
case 48:
case 46:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1305,7 +1263,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_listen */
case 49:
case 47:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1318,7 +1276,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi64_sys_sock_recv */
case 50:
case 48:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1334,7 +1292,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi64_sys_sock_send */
case 51:
case 49:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1350,7 +1308,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_shutdown */
case 52:
case 50:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1363,7 +1321,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_sock_stat_get */
case 53:
case 51:
switch(ndx) {
case 0:
p = "cloudabi_fd_t";
@ -1379,7 +1337,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi64_sys_thread_create */
case 54:
case 52:
switch(ndx) {
case 0:
p = "userland cloudabi64_threadattr_t *";
@ -1389,7 +1347,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_thread_exit */
case 55:
case 53:
switch(ndx) {
case 0:
p = "userland cloudabi_lock_t *";
@ -1402,7 +1360,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
};
break;
/* cloudabi_sys_thread_yield */
case 56:
case 54:
break;
default:
break;
@ -1580,120 +1538,110 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_lock */
/* cloudabi_sys_mem_map */
case 33:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_map */
/* cloudabi_sys_mem_protect */
case 34:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_protect */
/* cloudabi_sys_mem_sync */
case 35:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_sync */
/* cloudabi_sys_mem_unmap */
case 36:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_unlock */
case 37:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_mem_unmap */
case 38:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_poll */
case 39:
case 37:
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
/* cloudabi64_sys_poll_fd */
case 40:
case 38:
if (ndx == 0 || ndx == 1)
p = "size_t";
break;
/* cloudabi_sys_proc_exec */
case 41:
case 39:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_proc_exit */
case 42:
case 40:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_proc_fork */
case 43:
case 41:
/* cloudabi_sys_proc_raise */
case 44:
case 42:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_random_get */
case 45:
case 43:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_accept */
case 46:
case 44:
if (ndx == 0 || ndx == 1)
p = "cloudabi_fd_t";
break;
/* cloudabi_sys_sock_bind */
case 47:
case 45:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_connect */
case 48:
case 46:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_listen */
case 49:
case 47:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_sock_recv */
case 50:
case 48:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_sock_send */
case 51:
case 49:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_shutdown */
case 52:
case 50:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_sock_stat_get */
case 53:
case 51:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi64_sys_thread_create */
case 54:
case 52:
if (ndx == 0 || ndx == 1)
p = "cloudabi_tid_t";
break;
/* cloudabi_sys_thread_exit */
case 55:
case 53:
if (ndx == 0 || ndx == 1)
p = "void";
break;
/* cloudabi_sys_thread_yield */
case 56:
case 54:
default:
break;
};

View File

@ -201,9 +201,9 @@ _meta_filemon= 1
# Also skip generating or including .depend.* files if in meta+filemon mode
# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used
# for _meta_filemon but not for _SKIP_DEPEND.
.if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(*obj) || \
.if !defined(NO_SKIP_DEPEND) && (make(*obj) || \
${.TARGETS:M*clean*} == ${.TARGETS} || \
${.TARGETS:M*install*} == ${.TARGETS}
${.TARGETS:M*install*} == ${.TARGETS})
_SKIP_DEPEND= 1
.endif
.if defined(_SKIP_DEPEND) || defined(_meta_filemon)

View File

@ -109,7 +109,7 @@ typedef struct {
_Alignas(4) uint32_t ri_data_len;
_Alignas(4) uint32_t ri_fds;
_Alignas(4) uint32_t ri_fds_len;
_Alignas(2) cloudabi_msgflags_t ri_flags;
_Alignas(2) cloudabi_riflags_t ri_flags;
} cloudabi32_recv_in_t;
_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_in_t, ri_data_len) == 4, "Incorrect layout");
@ -119,12 +119,25 @@ _Static_assert(offsetof(cloudabi32_recv_in_t, ri_flags) == 16, "Incorrect layout
_Static_assert(sizeof(cloudabi32_recv_in_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_recv_in_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(4) uint32_t ro_datalen;
_Alignas(4) uint32_t ro_fdslen;
_Alignas(1) char ro_unused[40];
_Alignas(2) cloudabi_roflags_t ro_flags;
} cloudabi32_recv_out_t;
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_fdslen) == 4, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_unused) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_flags) == 48, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_recv_out_t) == 52, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_recv_out_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(4) uint32_t si_data;
_Alignas(4) uint32_t si_data_len;
_Alignas(4) uint32_t si_fds;
_Alignas(4) uint32_t si_fds_len;
_Alignas(2) cloudabi_msgflags_t si_flags;
_Alignas(2) cloudabi_siflags_t si_flags;
} cloudabi32_send_in_t;
_Static_assert(offsetof(cloudabi32_send_in_t, si_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_send_in_t, si_data_len) == 4, "Incorrect layout");
@ -201,21 +214,6 @@ _Static_assert(_Alignof(cloudabi32_tcb_t) == 4, "Incorrect layout");
typedef void cloudabi32_threadentry_t(cloudabi_tid_t tid, uint32_t aux);
typedef struct {
_Alignas(4) uint32_t ro_datalen;
_Alignas(4) uint32_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
} cloudabi32_recv_out_t;
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_fdslen) == 4, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_sockname) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_peername) == 28, "Incorrect layout");
_Static_assert(offsetof(cloudabi32_recv_out_t, ro_flags) == 48, "Incorrect layout");
_Static_assert(sizeof(cloudabi32_recv_out_t) == 52, "Incorrect layout");
_Static_assert(_Alignof(cloudabi32_recv_out_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(4) uint32_t entry_point;
_Alignas(4) uint32_t stack;

View File

@ -109,7 +109,7 @@ typedef struct {
_Alignas(8) uint64_t ri_data_len;
_Alignas(8) uint64_t ri_fds;
_Alignas(8) uint64_t ri_fds_len;
_Alignas(2) cloudabi_msgflags_t ri_flags;
_Alignas(2) cloudabi_riflags_t ri_flags;
} cloudabi64_recv_in_t;
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_in_t, ri_data_len) == 8, "Incorrect layout");
@ -119,12 +119,25 @@ _Static_assert(offsetof(cloudabi64_recv_in_t, ri_flags) == 32, "Incorrect layout
_Static_assert(sizeof(cloudabi64_recv_in_t) == 40, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_in_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t ro_datalen;
_Alignas(8) uint64_t ro_fdslen;
_Alignas(1) char ro_unused[40];
_Alignas(2) cloudabi_roflags_t ro_flags;
} cloudabi64_recv_out_t;
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_unused) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t si_data;
_Alignas(8) uint64_t si_data_len;
_Alignas(8) uint64_t si_fds;
_Alignas(8) uint64_t si_fds_len;
_Alignas(2) cloudabi_msgflags_t si_flags;
_Alignas(2) cloudabi_siflags_t si_flags;
} cloudabi64_send_in_t;
_Static_assert(offsetof(cloudabi64_send_in_t, si_data) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_send_in_t, si_data_len) == 8, "Incorrect layout");
@ -201,21 +214,6 @@ _Static_assert(_Alignof(cloudabi64_tcb_t) == 8, "Incorrect layout");
typedef void cloudabi64_threadentry_t(cloudabi_tid_t tid, uint64_t aux);
typedef struct {
_Alignas(8) uint64_t ro_datalen;
_Alignas(8) uint64_t ro_fdslen;
_Alignas(2) cloudabi_sockaddr_t ro_sockname;
_Alignas(2) cloudabi_sockaddr_t ro_peername;
_Alignas(2) cloudabi_msgflags_t ro_flags;
} cloudabi64_recv_out_t;
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_datalen) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_fdslen) == 8, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_sockname) == 16, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_peername) == 36, "Incorrect layout");
_Static_assert(offsetof(cloudabi64_recv_out_t, ro_flags) == 56, "Incorrect layout");
_Static_assert(sizeof(cloudabi64_recv_out_t) == 64, "Incorrect layout");
_Static_assert(_Alignof(cloudabi64_recv_out_t) == 8, "Incorrect layout");
typedef struct {
_Alignas(8) uint64_t entry_point;
_Alignas(8) uint64_t stack;

View File

@ -197,7 +197,6 @@ typedef uint8_t cloudabi_filetype_t;
#define CLOUDABI_FILETYPE_REGULAR_FILE 96
#define CLOUDABI_FILETYPE_SHARED_MEMORY 112
#define CLOUDABI_FILETYPE_SOCKET_DGRAM 128
#define CLOUDABI_FILETYPE_SOCKET_SEQPACKET 129
#define CLOUDABI_FILETYPE_SOCKET_STREAM 130
#define CLOUDABI_FILETYPE_SYMBOLIC_LINK 144
@ -237,13 +236,6 @@ typedef uint8_t cloudabi_msflags_t;
#define CLOUDABI_MS_INVALIDATE 0x02
#define CLOUDABI_MS_SYNC 0x04
typedef uint16_t cloudabi_msgflags_t;
#define CLOUDABI_MSG_CTRUNC 0x0001
#define CLOUDABI_MSG_EOR 0x0002
#define CLOUDABI_MSG_PEEK 0x0004
#define CLOUDABI_MSG_TRUNC 0x0008
#define CLOUDABI_MSG_WAITALL 0x0010
typedef uint32_t cloudabi_nthreads_t;
typedef uint16_t cloudabi_oflags_t;
@ -252,6 +244,10 @@ typedef uint16_t cloudabi_oflags_t;
#define CLOUDABI_O_EXCL 0x0004
#define CLOUDABI_O_TRUNC 0x0008
typedef uint16_t cloudabi_riflags_t;
#define CLOUDABI_SOCK_RECV_PEEK 0x0004
#define CLOUDABI_SOCK_RECV_WAITALL 0x0010
typedef uint64_t cloudabi_rights_t;
#define CLOUDABI_RIGHT_FD_DATASYNC 0x0000000000000001
#define CLOUDABI_RIGHT_FD_READ 0x0000000000000002
@ -295,11 +291,9 @@ typedef uint64_t cloudabi_rights_t;
#define CLOUDABI_RIGHT_SOCK_SHUTDOWN 0x0000008000000000
#define CLOUDABI_RIGHT_SOCK_STAT_GET 0x0000010000000000
typedef uint8_t cloudabi_sa_family_t;
#define CLOUDABI_AF_UNSPEC 0
#define CLOUDABI_AF_INET 1
#define CLOUDABI_AF_INET6 2
#define CLOUDABI_AF_UNIX 3
typedef uint16_t cloudabi_roflags_t;
#define CLOUDABI_SOCK_RECV_FDS_TRUNCATED 0x0001
#define CLOUDABI_SOCK_RECV_DATA_TRUNCATED 0x0008
typedef uint8_t cloudabi_scope_t;
#define CLOUDABI_SCOPE_PRIVATE 4
@ -309,6 +303,8 @@ typedef uint8_t cloudabi_sdflags_t;
#define CLOUDABI_SHUT_RD 0x01
#define CLOUDABI_SHUT_WR 0x02
typedef uint16_t cloudabi_siflags_t;
typedef uint8_t cloudabi_signal_t;
#define CLOUDABI_SIGABRT 1
#define CLOUDABI_SIGALRM 2
@ -428,34 +424,11 @@ _Static_assert(sizeof(cloudabi_lookup_t) == 8, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_lookup_t) == 4, "Incorrect layout");
typedef struct {
_Alignas(1) cloudabi_sa_family_t sa_family;
union {
struct {
_Alignas(1) uint8_t addr[4];
_Alignas(2) uint16_t port;
} sa_inet;
struct {
_Alignas(1) uint8_t addr[16];
_Alignas(2) uint16_t port;
} sa_inet6;
};
} cloudabi_sockaddr_t;
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_family) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.addr) == 2, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet.port) == 6, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.addr) == 2, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockaddr_t, sa_inet6.port) == 18, "Incorrect layout");
_Static_assert(sizeof(cloudabi_sockaddr_t) == 20, "Incorrect layout");
_Static_assert(_Alignof(cloudabi_sockaddr_t) == 2, "Incorrect layout");
typedef struct {
_Alignas(2) cloudabi_sockaddr_t ss_sockname;
_Alignas(2) cloudabi_sockaddr_t ss_peername;
_Alignas(1) char ss_unused[40];
_Alignas(2) cloudabi_errno_t ss_error;
_Alignas(4) cloudabi_sstate_t ss_state;
} cloudabi_sockstat_t;
_Static_assert(offsetof(cloudabi_sockstat_t, ss_sockname) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_peername) == 20, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_unused) == 0, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_error) == 40, "Incorrect layout");
_Static_assert(offsetof(cloudabi_sockstat_t, ss_state) == 44, "Incorrect layout");
_Static_assert(sizeof(cloudabi_sockstat_t) == 48, "Incorrect layout");

View File

@ -311,15 +311,9 @@ ENTRY(cloudabi_sys_mem_advise)
ret
END(cloudabi_sys_mem_advise)
ENTRY(cloudabi_sys_mem_lock)
mov w8, #33
svc #0
ret
END(cloudabi_sys_mem_lock)
ENTRY(cloudabi_sys_mem_map)
str x6, [sp, #-8]
mov w8, #34
mov w8, #33
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@ -330,32 +324,26 @@ ENTRY(cloudabi_sys_mem_map)
END(cloudabi_sys_mem_map)
ENTRY(cloudabi_sys_mem_protect)
mov w8, #35
mov w8, #34
svc #0
ret
END(cloudabi_sys_mem_protect)
ENTRY(cloudabi_sys_mem_sync)
mov w8, #36
mov w8, #35
svc #0
ret
END(cloudabi_sys_mem_sync)
ENTRY(cloudabi_sys_mem_unlock)
mov w8, #37
svc #0
ret
END(cloudabi_sys_mem_unlock)
ENTRY(cloudabi_sys_mem_unmap)
mov w8, #38
mov w8, #36
svc #0
ret
END(cloudabi_sys_mem_unmap)
ENTRY(cloudabi_sys_poll)
str x3, [sp, #-8]
mov w8, #39
mov w8, #37
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@ -367,7 +355,7 @@ END(cloudabi_sys_poll)
ENTRY(cloudabi_sys_poll_fd)
str x6, [sp, #-8]
mov w8, #40
mov w8, #38
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@ -378,19 +366,19 @@ ENTRY(cloudabi_sys_poll_fd)
END(cloudabi_sys_poll_fd)
ENTRY(cloudabi_sys_proc_exec)
mov w8, #41
mov w8, #39
svc #0
ret
END(cloudabi_sys_proc_exec)
ENTRY(cloudabi_sys_proc_exit)
mov w8, #42
mov w8, #40
svc #0
END(cloudabi_sys_proc_exit)
ENTRY(cloudabi_sys_proc_fork)
stp x0, x1, [sp, #-16]
mov w8, #43
mov w8, #41
svc #0
ldp x2, x3, [sp, #-16]
b.cs 1f
@ -402,20 +390,20 @@ ENTRY(cloudabi_sys_proc_fork)
END(cloudabi_sys_proc_fork)
ENTRY(cloudabi_sys_proc_raise)
mov w8, #44
mov w8, #42
svc #0
ret
END(cloudabi_sys_proc_raise)
ENTRY(cloudabi_sys_random_get)
mov w8, #45
mov w8, #43
svc #0
ret
END(cloudabi_sys_random_get)
ENTRY(cloudabi_sys_sock_accept)
str x2, [sp, #-8]
mov w8, #46
mov w8, #44
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@ -426,50 +414,50 @@ ENTRY(cloudabi_sys_sock_accept)
END(cloudabi_sys_sock_accept)
ENTRY(cloudabi_sys_sock_bind)
mov w8, #47
mov w8, #45
svc #0
ret
END(cloudabi_sys_sock_bind)
ENTRY(cloudabi_sys_sock_connect)
mov w8, #48
mov w8, #46
svc #0
ret
END(cloudabi_sys_sock_connect)
ENTRY(cloudabi_sys_sock_listen)
mov w8, #49
mov w8, #47
svc #0
ret
END(cloudabi_sys_sock_listen)
ENTRY(cloudabi_sys_sock_recv)
mov w8, #50
mov w8, #48
svc #0
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
mov w8, #51
mov w8, #49
svc #0
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
mov w8, #52
mov w8, #50
svc #0
ret
END(cloudabi_sys_sock_shutdown)
ENTRY(cloudabi_sys_sock_stat_get)
mov w8, #53
mov w8, #51
svc #0
ret
END(cloudabi_sys_sock_stat_get)
ENTRY(cloudabi_sys_thread_create)
str x1, [sp, #-8]
mov w8, #54
mov w8, #52
svc #0
ldr x2, [sp, #-8]
b.cs 1f
@ -480,12 +468,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
mov w8, #55
mov w8, #53
svc #0
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
mov w8, #56
mov w8, #54
svc #0
ret
END(cloudabi_sys_thread_yield)

View File

@ -283,14 +283,8 @@ ENTRY(cloudabi_sys_mem_advise)
bx lr
END(cloudabi_sys_mem_advise)
ENTRY(cloudabi_sys_mem_lock)
mov ip, #33
swi 0
bx lr
END(cloudabi_sys_mem_lock)
ENTRY(cloudabi_sys_mem_map)
mov ip, #34
mov ip, #33
swi 0
ldrcc r2, [sp, #16]
strcc r0, [r2]
@ -299,32 +293,26 @@ ENTRY(cloudabi_sys_mem_map)
END(cloudabi_sys_mem_map)
ENTRY(cloudabi_sys_mem_protect)
mov ip, #35
mov ip, #34
swi 0
bx lr
END(cloudabi_sys_mem_protect)
ENTRY(cloudabi_sys_mem_sync)
mov ip, #36
mov ip, #35
swi 0
bx lr
END(cloudabi_sys_mem_sync)
ENTRY(cloudabi_sys_mem_unlock)
mov ip, #37
swi 0
bx lr
END(cloudabi_sys_mem_unlock)
ENTRY(cloudabi_sys_mem_unmap)
mov ip, #38
mov ip, #36
swi 0
bx lr
END(cloudabi_sys_mem_unmap)
ENTRY(cloudabi_sys_poll)
str r3, [sp, #-4]
mov ip, #39
mov ip, #37
swi 0
ldrcc r2, [sp, #-4]
strcc r0, [r2]
@ -333,7 +321,7 @@ ENTRY(cloudabi_sys_poll)
END(cloudabi_sys_poll)
ENTRY(cloudabi_sys_poll_fd)
mov ip, #40
mov ip, #38
swi 0
ldrcc r2, [sp, #8]
strcc r0, [r2]
@ -342,20 +330,20 @@ ENTRY(cloudabi_sys_poll_fd)
END(cloudabi_sys_poll_fd)
ENTRY(cloudabi_sys_proc_exec)
mov ip, #41
mov ip, #39
swi 0
bx lr
END(cloudabi_sys_proc_exec)
ENTRY(cloudabi_sys_proc_exit)
mov ip, #42
mov ip, #40
swi 0
END(cloudabi_sys_proc_exit)
ENTRY(cloudabi_sys_proc_fork)
str r0, [sp, #-4]
str r1, [sp, #-8]
mov ip, #43
mov ip, #41
swi 0
ldrcc r2, [sp, #-4]
ldrcc r3, [sp, #-8]
@ -366,20 +354,20 @@ ENTRY(cloudabi_sys_proc_fork)
END(cloudabi_sys_proc_fork)
ENTRY(cloudabi_sys_proc_raise)
mov ip, #44
mov ip, #42
swi 0
bx lr
END(cloudabi_sys_proc_raise)
ENTRY(cloudabi_sys_random_get)
mov ip, #45
mov ip, #43
swi 0
bx lr
END(cloudabi_sys_random_get)
ENTRY(cloudabi_sys_sock_accept)
str r2, [sp, #-4]
mov ip, #46
mov ip, #44
swi 0
ldrcc r2, [sp, #-4]
strcc r0, [r2]
@ -388,50 +376,50 @@ ENTRY(cloudabi_sys_sock_accept)
END(cloudabi_sys_sock_accept)
ENTRY(cloudabi_sys_sock_bind)
mov ip, #47
mov ip, #45
swi 0
bx lr
END(cloudabi_sys_sock_bind)
ENTRY(cloudabi_sys_sock_connect)
mov ip, #48
mov ip, #46
swi 0
bx lr
END(cloudabi_sys_sock_connect)
ENTRY(cloudabi_sys_sock_listen)
mov ip, #49
mov ip, #47
swi 0
bx lr
END(cloudabi_sys_sock_listen)
ENTRY(cloudabi_sys_sock_recv)
mov ip, #50
mov ip, #48
swi 0
bx lr
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
mov ip, #51
mov ip, #49
swi 0
bx lr
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
mov ip, #52
mov ip, #50
swi 0
bx lr
END(cloudabi_sys_sock_shutdown)
ENTRY(cloudabi_sys_sock_stat_get)
mov ip, #53
mov ip, #51
swi 0
bx lr
END(cloudabi_sys_sock_stat_get)
ENTRY(cloudabi_sys_thread_create)
str r1, [sp, #-4]
mov ip, #54
mov ip, #52
swi 0
ldrcc r2, [sp, #-4]
strcc r0, [r2]
@ -440,12 +428,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
mov ip, #55
mov ip, #53
swi 0
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
mov ip, #56
mov ip, #54
swi 0
bx lr
END(cloudabi_sys_thread_yield)

View File

@ -302,14 +302,8 @@ ENTRY(cloudabi_sys_mem_advise)
ret
END(cloudabi_sys_mem_advise)
ENTRY(cloudabi_sys_mem_lock)
mov $33, %eax
int $0x80
ret
END(cloudabi_sys_mem_lock)
ENTRY(cloudabi_sys_mem_map)
mov $34, %eax
mov $33, %eax
int $0x80
jc 1f
mov 32(%esp), %ecx
@ -320,31 +314,25 @@ ENTRY(cloudabi_sys_mem_map)
END(cloudabi_sys_mem_map)
ENTRY(cloudabi_sys_mem_protect)
mov $35, %eax
mov $34, %eax
int $0x80
ret
END(cloudabi_sys_mem_protect)
ENTRY(cloudabi_sys_mem_sync)
mov $36, %eax
mov $35, %eax
int $0x80
ret
END(cloudabi_sys_mem_sync)
ENTRY(cloudabi_sys_mem_unlock)
mov $37, %eax
int $0x80
ret
END(cloudabi_sys_mem_unlock)
ENTRY(cloudabi_sys_mem_unmap)
mov $38, %eax
mov $36, %eax
int $0x80
ret
END(cloudabi_sys_mem_unmap)
ENTRY(cloudabi_sys_poll)
mov $39, %eax
mov $37, %eax
int $0x80
jc 1f
mov 16(%esp), %ecx
@ -355,7 +343,7 @@ ENTRY(cloudabi_sys_poll)
END(cloudabi_sys_poll)
ENTRY(cloudabi_sys_poll_fd)
mov $40, %eax
mov $38, %eax
int $0x80
jc 1f
mov 28(%esp), %ecx
@ -366,18 +354,18 @@ ENTRY(cloudabi_sys_poll_fd)
END(cloudabi_sys_poll_fd)
ENTRY(cloudabi_sys_proc_exec)
mov $41, %eax
mov $39, %eax
int $0x80
ret
END(cloudabi_sys_proc_exec)
ENTRY(cloudabi_sys_proc_exit)
mov $42, %eax
mov $40, %eax
int $0x80
END(cloudabi_sys_proc_exit)
ENTRY(cloudabi_sys_proc_fork)
mov $43, %eax
mov $41, %eax
int $0x80
jc 1f
mov 4(%esp), %ecx
@ -390,19 +378,19 @@ ENTRY(cloudabi_sys_proc_fork)
END(cloudabi_sys_proc_fork)
ENTRY(cloudabi_sys_proc_raise)
mov $44, %eax
mov $42, %eax
int $0x80
ret
END(cloudabi_sys_proc_raise)
ENTRY(cloudabi_sys_random_get)
mov $45, %eax
mov $43, %eax
int $0x80
ret
END(cloudabi_sys_random_get)
ENTRY(cloudabi_sys_sock_accept)
mov $46, %eax
mov $44, %eax
int $0x80
jc 1f
mov 12(%esp), %ecx
@ -413,49 +401,49 @@ ENTRY(cloudabi_sys_sock_accept)
END(cloudabi_sys_sock_accept)
ENTRY(cloudabi_sys_sock_bind)
mov $47, %eax
mov $45, %eax
int $0x80
ret
END(cloudabi_sys_sock_bind)
ENTRY(cloudabi_sys_sock_connect)
mov $48, %eax
mov $46, %eax
int $0x80
ret
END(cloudabi_sys_sock_connect)
ENTRY(cloudabi_sys_sock_listen)
mov $49, %eax
mov $47, %eax
int $0x80
ret
END(cloudabi_sys_sock_listen)
ENTRY(cloudabi_sys_sock_recv)
mov $50, %eax
mov $48, %eax
int $0x80
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
mov $51, %eax
mov $49, %eax
int $0x80
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
mov $52, %eax
mov $50, %eax
int $0x80
ret
END(cloudabi_sys_sock_shutdown)
ENTRY(cloudabi_sys_sock_stat_get)
mov $53, %eax
mov $51, %eax
int $0x80
ret
END(cloudabi_sys_sock_stat_get)
ENTRY(cloudabi_sys_thread_create)
mov $54, %eax
mov $52, %eax
int $0x80
jc 1f
mov 8(%esp), %ecx
@ -466,12 +454,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
mov $55, %eax
mov $53, %eax
int $0x80
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
mov $56, %eax
mov $54, %eax
int $0x80
ret
END(cloudabi_sys_thread_yield)

View File

@ -759,23 +759,6 @@ ENTRY(cloudabi_sys_mem_advise)
ret
END(cloudabi_sys_mem_advise)
ENTRY(cloudabi_sys_mem_lock)
push %ebp
mov %esp, %ebp
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
movl $0, -12(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $33, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
pop %ebp
ret
END(cloudabi_sys_mem_lock)
ENTRY(cloudabi_sys_mem_map)
push %ebp
mov %esp, %ebp
@ -795,7 +778,7 @@ ENTRY(cloudabi_sys_mem_map)
mov %ecx, -8(%ebp)
mov 32(%ebp), %ecx
mov %ecx, -4(%ebp)
mov $34, %eax
mov $33, %eax
mov %ebp, %ecx
sub $48, %ecx
int $0x80
@ -820,7 +803,7 @@ ENTRY(cloudabi_sys_mem_protect)
movl $0, -12(%ebp)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $35, %eax
mov $34, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -839,7 +822,7 @@ ENTRY(cloudabi_sys_mem_sync)
movl $0, -12(%ebp)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $36, %eax
mov $35, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -847,23 +830,6 @@ ENTRY(cloudabi_sys_mem_sync)
ret
END(cloudabi_sys_mem_sync)
ENTRY(cloudabi_sys_mem_unlock)
push %ebp
mov %esp, %ebp
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
movl $0, -12(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $37, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
pop %ebp
ret
END(cloudabi_sys_mem_unlock)
ENTRY(cloudabi_sys_mem_unmap)
push %ebp
mov %esp, %ebp
@ -873,7 +839,7 @@ ENTRY(cloudabi_sys_mem_unmap)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $38, %eax
mov $36, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -893,7 +859,7 @@ ENTRY(cloudabi_sys_poll)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $39, %eax
mov $37, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -927,7 +893,7 @@ ENTRY(cloudabi_sys_poll_fd)
mov 28(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $40, %eax
mov $38, %eax
mov %ebp, %ecx
sub $48, %ecx
int $0x80
@ -958,7 +924,7 @@ ENTRY(cloudabi_sys_proc_exec)
mov 24(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $41, %eax
mov $39, %eax
mov %ebp, %ecx
sub $40, %ecx
int $0x80
@ -971,7 +937,7 @@ ENTRY(cloudabi_sys_proc_exit)
mov %esp, %ebp
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
mov $42, %eax
mov $40, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -980,7 +946,7 @@ END(cloudabi_sys_proc_exit)
ENTRY(cloudabi_sys_proc_fork)
push %ebp
mov %esp, %ebp
mov $43, %eax
mov $41, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1002,7 +968,7 @@ ENTRY(cloudabi_sys_proc_raise)
mov %esp, %ebp
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
mov $44, %eax
mov $42, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1019,7 +985,7 @@ ENTRY(cloudabi_sys_random_get)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $45, %eax
mov $43, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1035,7 +1001,7 @@ ENTRY(cloudabi_sys_sock_accept)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $46, %eax
mov $44, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1062,7 +1028,7 @@ ENTRY(cloudabi_sys_sock_bind)
mov 20(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $47, %eax
mov $45, %eax
mov %ebp, %ecx
sub $32, %ecx
int $0x80
@ -1083,7 +1049,7 @@ ENTRY(cloudabi_sys_sock_connect)
mov 20(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $48, %eax
mov $46, %eax
mov %ebp, %ecx
sub $32, %ecx
int $0x80
@ -1098,7 +1064,7 @@ ENTRY(cloudabi_sys_sock_listen)
mov %ecx, -16(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $49, %eax
mov $47, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1117,7 +1083,7 @@ ENTRY(cloudabi_sys_sock_recv)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $50, %eax
mov $48, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -1136,7 +1102,7 @@ ENTRY(cloudabi_sys_sock_send)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
movl $0, -4(%ebp)
mov $51, %eax
mov $49, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -1151,7 +1117,7 @@ ENTRY(cloudabi_sys_sock_shutdown)
mov %ecx, -16(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $52, %eax
mov $50, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1169,7 +1135,7 @@ ENTRY(cloudabi_sys_sock_stat_get)
movl $0, -12(%ebp)
mov 16(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $53, %eax
mov $51, %eax
mov %ebp, %ecx
sub $24, %ecx
int $0x80
@ -1183,7 +1149,7 @@ ENTRY(cloudabi_sys_thread_create)
mov 8(%ebp), %ecx
mov %ecx, -16(%ebp)
movl $0, -12(%ebp)
mov $54, %eax
mov $52, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1205,7 +1171,7 @@ ENTRY(cloudabi_sys_thread_exit)
movl $0, -12(%ebp)
mov 12(%ebp), %ecx
mov %ecx, -8(%ebp)
mov $55, %eax
mov $53, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80
@ -1214,7 +1180,7 @@ END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
push %ebp
mov %esp, %ebp
mov $56, %eax
mov $54, %eax
mov %ebp, %ecx
sub $16, %ecx
int $0x80

View File

@ -326,15 +326,9 @@ ENTRY(cloudabi_sys_mem_advise)
ret
END(cloudabi_sys_mem_advise)
ENTRY(cloudabi_sys_mem_lock)
mov $33, %eax
syscall
ret
END(cloudabi_sys_mem_lock)
ENTRY(cloudabi_sys_mem_map)
mov %rcx, %r10
mov $34, %eax
mov $33, %eax
syscall
jc 1f
mov 8(%rsp), %rcx
@ -345,32 +339,26 @@ ENTRY(cloudabi_sys_mem_map)
END(cloudabi_sys_mem_map)
ENTRY(cloudabi_sys_mem_protect)
mov $35, %eax
mov $34, %eax
syscall
ret
END(cloudabi_sys_mem_protect)
ENTRY(cloudabi_sys_mem_sync)
mov $36, %eax
mov $35, %eax
syscall
ret
END(cloudabi_sys_mem_sync)
ENTRY(cloudabi_sys_mem_unlock)
mov $37, %eax
syscall
ret
END(cloudabi_sys_mem_unlock)
ENTRY(cloudabi_sys_mem_unmap)
mov $38, %eax
mov $36, %eax
syscall
ret
END(cloudabi_sys_mem_unmap)
ENTRY(cloudabi_sys_poll)
push %rcx
mov $39, %eax
mov $37, %eax
syscall
pop %rcx
jc 1f
@ -382,7 +370,7 @@ END(cloudabi_sys_poll)
ENTRY(cloudabi_sys_poll_fd)
mov %rcx, %r10
mov $40, %eax
mov $38, %eax
syscall
jc 1f
mov 8(%rsp), %rcx
@ -394,20 +382,20 @@ END(cloudabi_sys_poll_fd)
ENTRY(cloudabi_sys_proc_exec)
mov %rcx, %r10
mov $41, %eax
mov $39, %eax
syscall
ret
END(cloudabi_sys_proc_exec)
ENTRY(cloudabi_sys_proc_exit)
mov $42, %eax
mov $40, %eax
syscall
END(cloudabi_sys_proc_exit)
ENTRY(cloudabi_sys_proc_fork)
push %rdi
push %rsi
mov $43, %eax
mov $41, %eax
syscall
pop %rsi
pop %rcx
@ -420,20 +408,20 @@ ENTRY(cloudabi_sys_proc_fork)
END(cloudabi_sys_proc_fork)
ENTRY(cloudabi_sys_proc_raise)
mov $44, %eax
mov $42, %eax
syscall
ret
END(cloudabi_sys_proc_raise)
ENTRY(cloudabi_sys_random_get)
mov $45, %eax
mov $43, %eax
syscall
ret
END(cloudabi_sys_random_get)
ENTRY(cloudabi_sys_sock_accept)
push %rdx
mov $46, %eax
mov $44, %eax
syscall
pop %rcx
jc 1f
@ -445,51 +433,51 @@ END(cloudabi_sys_sock_accept)
ENTRY(cloudabi_sys_sock_bind)
mov %rcx, %r10
mov $47, %eax
mov $45, %eax
syscall
ret
END(cloudabi_sys_sock_bind)
ENTRY(cloudabi_sys_sock_connect)
mov %rcx, %r10
mov $48, %eax
mov $46, %eax
syscall
ret
END(cloudabi_sys_sock_connect)
ENTRY(cloudabi_sys_sock_listen)
mov $49, %eax
mov $47, %eax
syscall
ret
END(cloudabi_sys_sock_listen)
ENTRY(cloudabi_sys_sock_recv)
mov $50, %eax
mov $48, %eax
syscall
ret
END(cloudabi_sys_sock_recv)
ENTRY(cloudabi_sys_sock_send)
mov $51, %eax
mov $49, %eax
syscall
ret
END(cloudabi_sys_sock_send)
ENTRY(cloudabi_sys_sock_shutdown)
mov $52, %eax
mov $50, %eax
syscall
ret
END(cloudabi_sys_sock_shutdown)
ENTRY(cloudabi_sys_sock_stat_get)
mov $53, %eax
mov $51, %eax
syscall
ret
END(cloudabi_sys_sock_stat_get)
ENTRY(cloudabi_sys_thread_create)
push %rsi
mov $54, %eax
mov $52, %eax
syscall
pop %rcx
jc 1f
@ -500,12 +488,12 @@ ENTRY(cloudabi_sys_thread_create)
END(cloudabi_sys_thread_create)
ENTRY(cloudabi_sys_thread_exit)
mov $55, %eax
mov $53, %eax
syscall
END(cloudabi_sys_thread_exit)
ENTRY(cloudabi_sys_thread_yield)
mov $56, %eax
mov $54, %eax
syscall
ret
END(cloudabi_sys_thread_yield)

View File

@ -204,11 +204,7 @@
size_t mapping_len, \
cloudabi_advice_t advice); }
33 AUE_NULL STD { void cloudabi_sys_mem_lock( \
const void *mapping, \
size_t mapping_len); }
34 AUE_NULL STD { void cloudabi_sys_mem_map( \
33 AUE_NULL STD { void cloudabi_sys_mem_map( \
void *addr, \
size_t len, \
cloudabi_mprot_t prot, \
@ -216,30 +212,26 @@
cloudabi_fd_t fd, \
cloudabi_filesize_t off); }
35 AUE_NULL STD { void cloudabi_sys_mem_protect( \
34 AUE_NULL STD { void cloudabi_sys_mem_protect( \
void *mapping, \
size_t mapping_len, \
cloudabi_mprot_t prot); }
36 AUE_NULL STD { void cloudabi_sys_mem_sync( \
35 AUE_NULL STD { void cloudabi_sys_mem_sync( \
void *mapping, \
size_t mapping_len, \
cloudabi_msflags_t flags); }
37 AUE_NULL STD { void cloudabi_sys_mem_unlock( \
const void *mapping, \
size_t mapping_len); }
38 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
36 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
void *mapping, \
size_t mapping_len); }
39 AUE_NULL STD { size_t cloudabi32_sys_poll( \
37 AUE_NULL STD { size_t cloudabi32_sys_poll( \
const cloudabi32_subscription_t *in, \
cloudabi32_event_t *out, \
size_t nsubscriptions); }
40 AUE_NULL STD { size_t cloudabi32_sys_poll_fd( \
38 AUE_NULL STD { size_t cloudabi32_sys_poll_fd( \
cloudabi_fd_t fd, \
const cloudabi32_subscription_t *in, \
size_t in_len, \
@ -247,69 +239,69 @@
size_t out_len, \
const cloudabi32_subscription_t *timeout); }
41 AUE_NULL STD { void cloudabi_sys_proc_exec( \
39 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
size_t data_len, \
const cloudabi_fd_t *fds, \
size_t fds_len); }
42 AUE_NULL STD { void cloudabi_sys_proc_exit( \
40 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
43 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
41 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
44 AUE_NULL STD { void cloudabi_sys_proc_raise( \
42 AUE_NULL STD { void cloudabi_sys_proc_raise( \
cloudabi_signal_t sig); }
45 AUE_NULL STD { void cloudabi_sys_random_get( \
43 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
size_t buf_len); }
46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf); }
void *unused); }
47 AUE_NULL STD { void cloudabi_sys_sock_bind( \
45 AUE_NULL STD { void cloudabi_sys_sock_bind( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t path_len); }
48 AUE_NULL STD { void cloudabi_sys_sock_connect( \
46 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t path_len); }
49 AUE_NULL STD { void cloudabi_sys_sock_listen( \
47 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
cloudabi_backlog_t backlog); }
50 AUE_NULL STD { void cloudabi32_sys_sock_recv( \
48 AUE_NULL STD { void cloudabi32_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi32_recv_in_t *in, \
cloudabi32_recv_out_t *out); }
51 AUE_NULL STD { void cloudabi32_sys_sock_send( \
49 AUE_NULL STD { void cloudabi32_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi32_send_in_t *in, \
cloudabi32_send_out_t *out); }
52 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
50 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
53 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
51 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf, \
cloudabi_ssflags_t flags); }
54 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \
52 AUE_NULL STD { cloudabi_tid_t cloudabi32_sys_thread_create( \
cloudabi32_threadattr_t *attr); }
55 AUE_NULL STD { void cloudabi_sys_thread_exit( \
53 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
56 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
54 AUE_NULL STD { void cloudabi_sys_thread_yield(); }

View File

@ -204,11 +204,7 @@
size_t mapping_len, \
cloudabi_advice_t advice); }
33 AUE_NULL STD { void cloudabi_sys_mem_lock( \
const void *mapping, \
size_t mapping_len); }
34 AUE_NULL STD { void cloudabi_sys_mem_map( \
33 AUE_NULL STD { void cloudabi_sys_mem_map( \
void *addr, \
size_t len, \
cloudabi_mprot_t prot, \
@ -216,30 +212,26 @@
cloudabi_fd_t fd, \
cloudabi_filesize_t off); }
35 AUE_NULL STD { void cloudabi_sys_mem_protect( \
34 AUE_NULL STD { void cloudabi_sys_mem_protect( \
void *mapping, \
size_t mapping_len, \
cloudabi_mprot_t prot); }
36 AUE_NULL STD { void cloudabi_sys_mem_sync( \
35 AUE_NULL STD { void cloudabi_sys_mem_sync( \
void *mapping, \
size_t mapping_len, \
cloudabi_msflags_t flags); }
37 AUE_NULL STD { void cloudabi_sys_mem_unlock( \
const void *mapping, \
size_t mapping_len); }
38 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
36 AUE_NULL STD { void cloudabi_sys_mem_unmap( \
void *mapping, \
size_t mapping_len); }
39 AUE_NULL STD { size_t cloudabi64_sys_poll( \
37 AUE_NULL STD { size_t cloudabi64_sys_poll( \
const cloudabi64_subscription_t *in, \
cloudabi64_event_t *out, \
size_t nsubscriptions); }
40 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \
38 AUE_NULL STD { size_t cloudabi64_sys_poll_fd( \
cloudabi_fd_t fd, \
const cloudabi64_subscription_t *in, \
size_t in_len, \
@ -247,69 +239,69 @@
size_t out_len, \
const cloudabi64_subscription_t *timeout); }
41 AUE_NULL STD { void cloudabi_sys_proc_exec( \
39 AUE_NULL STD { void cloudabi_sys_proc_exec( \
cloudabi_fd_t fd, \
const void *data, \
size_t data_len, \
const cloudabi_fd_t *fds, \
size_t fds_len); }
42 AUE_NULL STD { void cloudabi_sys_proc_exit( \
40 AUE_NULL STD { void cloudabi_sys_proc_exit( \
cloudabi_exitcode_t rval); }
43 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
41 AUE_NULL STD { void cloudabi_sys_proc_fork(); }
44 AUE_NULL STD { void cloudabi_sys_proc_raise( \
42 AUE_NULL STD { void cloudabi_sys_proc_raise( \
cloudabi_signal_t sig); }
45 AUE_NULL STD { void cloudabi_sys_random_get( \
43 AUE_NULL STD { void cloudabi_sys_random_get( \
void *buf, \
size_t buf_len); }
46 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
44 AUE_NULL STD { cloudabi_fd_t cloudabi_sys_sock_accept( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf); }
void *unused); }
47 AUE_NULL STD { void cloudabi_sys_sock_bind( \
45 AUE_NULL STD { void cloudabi_sys_sock_bind( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t path_len); }
48 AUE_NULL STD { void cloudabi_sys_sock_connect( \
46 AUE_NULL STD { void cloudabi_sys_sock_connect( \
cloudabi_fd_t sock, \
cloudabi_fd_t fd, \
const char *path, \
size_t path_len); }
49 AUE_NULL STD { void cloudabi_sys_sock_listen( \
47 AUE_NULL STD { void cloudabi_sys_sock_listen( \
cloudabi_fd_t sock, \
cloudabi_backlog_t backlog); }
50 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
48 AUE_NULL STD { void cloudabi64_sys_sock_recv( \
cloudabi_fd_t sock, \
const cloudabi64_recv_in_t *in, \
cloudabi64_recv_out_t *out); }
51 AUE_NULL STD { void cloudabi64_sys_sock_send( \
49 AUE_NULL STD { void cloudabi64_sys_sock_send( \
cloudabi_fd_t sock, \
const cloudabi64_send_in_t *in, \
cloudabi64_send_out_t *out); }
52 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
50 AUE_NULL STD { void cloudabi_sys_sock_shutdown( \
cloudabi_fd_t sock, \
cloudabi_sdflags_t how); }
53 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
51 AUE_NULL STD { void cloudabi_sys_sock_stat_get( \
cloudabi_fd_t sock, \
cloudabi_sockstat_t *buf, \
cloudabi_ssflags_t flags); }
54 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
52 AUE_NULL STD { cloudabi_tid_t cloudabi64_sys_thread_create( \
cloudabi64_threadattr_t *attr); }
55 AUE_NULL STD { void cloudabi_sys_thread_exit( \
53 AUE_NULL STD { void cloudabi_sys_thread_exit( \
cloudabi_lock_t *lock, \
cloudabi_scope_t scope); }
56 AUE_NULL STD { void cloudabi_sys_thread_yield(); }
54 AUE_NULL STD { void cloudabi_sys_thread_yield(); }

View File

@ -214,6 +214,18 @@ __FBSDID("$FreeBSD$");
/* Chip info */
#define BNXT_TSO_SIZE UINT16_MAX
#define min_t(type, x, y) ({ \
type __min1 = (x); \
type __min2 = (y); \
__min1 < __min2 ? __min1 : __min2; })
#define max_t(type, x, y) ({ \
type __max1 = (x); \
type __max2 = (y); \
__max1 > __max2 ? __max1 : __max2; })
#define clamp_t(type, _x, min, max) min_t(type, max_t(type, _x, min), max)
/* NVRAM access */
enum bnxt_nvm_directory_type {
BNX_DIR_TYPE_UNUSED = 0,
@ -569,6 +581,20 @@ struct bnxt_softc {
struct bnxt_nvram_info *nvm_info;
bool wol;
uint8_t wol_filter_id;
uint16_t rx_coal_usecs;
uint16_t rx_coal_usecs_irq;
uint16_t rx_coal_frames;
uint16_t rx_coal_frames_irq;
uint16_t tx_coal_usecs;
uint16_t tx_coal_usecs_irq;
uint16_t tx_coal_frames;
uint16_t tx_coal_frames_irq;
#define BNXT_USEC_TO_COAL_TIMER(x) ((x) * 25 / 2)
#define BNXT_DEF_STATS_COAL_TICKS 1000000
#define BNXT_MIN_STATS_COAL_TICKS 250000
#define BNXT_MAX_STATS_COAL_TICKS 1000000
};
struct bnxt_filter_info {

View File

@ -30,6 +30,7 @@
__FBSDID("$FreeBSD$");
#include <sys/endian.h>
#include <sys/bitstring.h>
#include "bnxt.h"
#include "bnxt_hwrm.h"
@ -1547,3 +1548,131 @@ bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc)
req.wol_filter_id = softc->wol_filter_id;
return hwrm_send_message(softc, &req, sizeof(req));
}
static void bnxt_hwrm_set_coal_params(struct bnxt_softc *softc, uint32_t max_frames,
uint32_t buf_tmrs, uint16_t flags,
struct hwrm_ring_cmpl_ring_cfg_aggint_params_input *req)
{
req->flags = htole16(flags);
req->num_cmpl_dma_aggr = htole16((uint16_t)max_frames);
req->num_cmpl_dma_aggr_during_int = htole16(max_frames >> 16);
req->cmpl_aggr_dma_tmr = htole16((uint16_t)buf_tmrs);
req->cmpl_aggr_dma_tmr_during_int = htole16(buf_tmrs >> 16);
/* Minimum time between 2 interrupts set to buf_tmr x 2 */
req->int_lat_tmr_min = htole16((uint16_t)buf_tmrs * 2);
req->int_lat_tmr_max = htole16((uint16_t)buf_tmrs * 4);
req->num_cmpl_aggr_int = htole16((uint16_t)max_frames * 4);
}
int bnxt_hwrm_set_coal(struct bnxt_softc *softc)
{
int i, rc = 0;
struct hwrm_ring_cmpl_ring_cfg_aggint_params_input req_rx = {0},
req_tx = {0}, *req;
uint16_t max_buf, max_buf_irq;
uint16_t buf_tmr, buf_tmr_irq;
uint32_t flags;
bnxt_hwrm_cmd_hdr_init(softc, &req_rx,
HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
bnxt_hwrm_cmd_hdr_init(softc, &req_tx,
HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS);
/* Each rx completion (2 records) should be DMAed immediately.
* DMA 1/4 of the completion buffers at a time.
*/
max_buf = min_t(uint16_t, softc->rx_coal_frames / 4, 2);
/* max_buf must not be zero */
max_buf = clamp_t(uint16_t, max_buf, 1, 63);
max_buf_irq = clamp_t(uint16_t, softc->rx_coal_frames_irq, 1, 63);
buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs);
/* buf timer set to 1/4 of interrupt timer */
buf_tmr = max_t(uint16_t, buf_tmr / 4, 1);
buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->rx_coal_usecs_irq);
buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1);
flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET;
/* RING_IDLE generates more IRQs for lower latency. Enable it only
* if coal_usecs is less than 25 us.
*/
if (softc->rx_coal_usecs < 25)
flags |= HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_RING_IDLE;
bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
buf_tmr_irq << 16 | buf_tmr, flags, &req_rx);
/* max_buf must not be zero */
max_buf = clamp_t(uint16_t, softc->tx_coal_frames, 1, 63);
max_buf_irq = clamp_t(uint16_t, softc->tx_coal_frames_irq, 1, 63);
buf_tmr = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs);
/* buf timer set to 1/4 of interrupt timer */
buf_tmr = max_t(uint16_t, buf_tmr / 4, 1);
buf_tmr_irq = BNXT_USEC_TO_COAL_TIMER(softc->tx_coal_usecs_irq);
buf_tmr_irq = max_t(uint16_t, buf_tmr_irq, 1);
flags = HWRM_RING_CMPL_RING_CFG_AGGINT_PARAMS_INPUT_FLAGS_TIMER_RESET;
bnxt_hwrm_set_coal_params(softc, max_buf_irq << 16 | max_buf,
buf_tmr_irq << 16 | buf_tmr, flags, &req_tx);
for (i = 0; i < softc->nrxqsets; i++) {
req = &req_rx;
/*
* TBD:
* Check if Tx also needs to be done
* So far, Tx processing has been done in softirq contest
*
* req = &req_tx;
*/
req->ring_id = htole16(softc->grp_info[i].cp_ring_id);
rc = hwrm_send_message(softc, req, sizeof(*req));
if (rc)
break;
}
return rc;
}
int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
int bmap_size)
{
struct hwrm_func_drv_rgtr_input req = {0};
bitstr_t *async_events_bmap;
uint32_t *events;
int i;
async_events_bmap = bit_alloc(256, M_DEVBUF, M_WAITOK|M_ZERO);
events = (uint32_t *)async_events_bmap;
bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_DRV_RGTR);
req.enables =
htole32(HWRM_FUNC_DRV_RGTR_INPUT_ENABLES_ASYNC_EVENT_FWD);
memset(async_events_bmap, 0, sizeof(256 / 8));
bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE);
bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PF_DRVR_UNLOAD);
bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_PORT_CONN_NOT_ALLOWED);
bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_VF_CFG_CHANGE);
bit_set(async_events_bmap, HWRM_ASYNC_EVENT_CMPL_EVENT_ID_LINK_SPEED_CFG_CHANGE);
if (bmap && bmap_size) {
for (i = 0; i < bmap_size; i++) {
if (bit_test(bmap, i))
bit_set(async_events_bmap, i);
}
}
for (i = 0; i < 8; i++)
req.async_event_fwd[i] |= htole32(events[i]);
free(async_events_bmap, M_DEVBUF);
return hwrm_send_message(softc, &req, sizeof(req));
}

View File

@ -101,5 +101,7 @@ int bnxt_hwrm_port_phy_qcfg(struct bnxt_softc *softc);
uint16_t bnxt_hwrm_get_wol_fltrs(struct bnxt_softc *softc, uint16_t handle);
int bnxt_hwrm_alloc_wol_fltr(struct bnxt_softc *softc);
int bnxt_hwrm_free_wol_fltr(struct bnxt_softc *softc);
int bnxt_hwrm_set_coal(struct bnxt_softc *softc);
int bnxt_hwrm_func_rgtr_async_events(struct bnxt_softc *softc, unsigned long *bmap,
int bmap_size);
#endif

View File

@ -549,6 +549,166 @@ bnxt_vlan_strip_sysctl(SYSCTL_HANDLER_ARGS) {
return rc;
}
static int
bnxt_set_coal_rx_usecs(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->rx_coal_usecs;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->rx_coal_usecs = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_rx_frames(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->rx_coal_frames;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->rx_coal_frames = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_rx_usecs_irq(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->rx_coal_usecs_irq;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->rx_coal_usecs_irq = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_rx_frames_irq(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->rx_coal_frames_irq;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->rx_coal_frames_irq = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_tx_usecs(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->tx_coal_usecs;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->tx_coal_usecs = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_tx_frames(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->tx_coal_frames;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->tx_coal_frames = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_tx_usecs_irq(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->tx_coal_usecs_irq;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->tx_coal_usecs_irq = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
static int
bnxt_set_coal_tx_frames_irq(SYSCTL_HANDLER_ARGS) {
struct bnxt_softc *softc = arg1;
int rc;
int val;
if (softc == NULL)
return EBUSY;
val = softc->tx_coal_frames_irq;
rc = sysctl_handle_int(oidp, &val, 0, req);
if (rc || !req->newptr)
return rc;
softc->tx_coal_frames_irq = val;
rc = bnxt_hwrm_set_coal(softc);
return rc;
}
int
bnxt_create_config_sysctls_pre(struct bnxt_softc *softc)
{
@ -572,6 +732,31 @@ bnxt_create_config_sysctls_pre(struct bnxt_softc *softc)
SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "if_name", CTLFLAG_RD,
iflib_get_ifp(softc->ctx)->if_xname, 0, "interface name");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs,
"I", "interrupt coalescing Rx Usecs");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames,
"I", "interrupt coalescing Rx Frames");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_usecs_irq",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_usecs_irq,
"I", "interrupt coalescing Rx Usecs IRQ");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_rx_frames_irq",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_rx_frames_irq,
"I", "interrupt coalescing Rx Frames IRQ");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs,
"I", "interrupt coalescing Tx Usces");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames,
"I", "interrupt coalescing Tx Frames");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_usecs_irq",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_usecs_irq,
"I", "interrupt coalescing Tx Usecs IRQ");
SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "intr_coal_tx_frames_irq",
CTLTYPE_INT|CTLFLAG_RWTUN, softc, 0, bnxt_set_coal_tx_frames_irq,
"I", "interrupt coalescing Tx Frames IRQ");
return 0;
}

View File

@ -691,6 +691,12 @@ bnxt_attach_pre(if_ctx_t ctx)
goto drv_rgtr_fail;
}
rc = bnxt_hwrm_func_rgtr_async_events(softc, NULL, 0);
if (rc) {
device_printf(softc->dev, "attach: hwrm rgtr async evts failed\n");
goto drv_rgtr_fail;
}
/* Get the HW capabilities */
rc = bnxt_hwrm_func_qcaps(softc);
if (rc)
@ -2286,11 +2292,11 @@ bnxt_report_link(struct bnxt_softc *softc)
HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX)
flow_ctrl = "FC - receive";
else
flow_ctrl = "none";
flow_ctrl = "FC - none";
iflib_link_state_change(softc->ctx, LINK_STATE_UP,
IF_Gbps(100));
device_printf(softc->dev, "Link is UP %s, %s\n", duplex,
flow_ctrl);
device_printf(softc->dev, "Link is UP %s, %s - %d Mbps \n", duplex,
flow_ctrl, (softc->link_info.link_speed * 100));
} else {
iflib_link_state_change(softc->ctx, LINK_STATE_DOWN,
bnxt_get_baudrate(&softc->link_info));

View File

@ -587,7 +587,7 @@ int t4_prep_adapter(struct adapter *adapter, u8 *buf);
int t4_shutdown_adapter(struct adapter *adapter);
int t4_init_devlog_params(struct adapter *adapter, int fw_attach);
int t4_init_sge_params(struct adapter *adapter);
int t4_init_tp_params(struct adapter *adap);
int t4_init_tp_params(struct adapter *adap, bool sleep_ok);
int t4_filter_field_shift(const struct adapter *adap, int filter_sel);
int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id);
void t4_fatal_err(struct adapter *adapter);
@ -605,20 +605,21 @@ int t4_config_vi_rss(struct adapter *adapter, int mbox, unsigned int viid,
unsigned int flags, unsigned int defq, unsigned int skeyidx,
unsigned int skey);
int t4_read_rss(struct adapter *adapter, u16 *entries);
void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs,
unsigned int start_index, unsigned int rw);
void t4_read_rss_key(struct adapter *adapter, u32 *key);
void t4_write_rss_key(struct adapter *adap, u32 *key, int idx);
void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, u32 *valp);
void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, u32 val);
void t4_read_rss_key(struct adapter *adapter, u32 *key, bool sleep_ok);
void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx,
bool sleep_ok);
void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index,
u32 *valp, bool sleep_ok);
void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index,
u32 val, bool sleep_ok);
void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index,
u32 *vfl, u32 *vfh);
u32 *vfl, u32 *vfh, bool sleep_ok);
void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index,
u32 vfl, u32 vfh);
u32 t4_read_rss_pf_map(struct adapter *adapter);
void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap);
u32 t4_read_rss_pf_mask(struct adapter *adapter);
void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask);
u32 vfl, u32 vfh, bool sleep_ok);
u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok);
void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok);
u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok);
void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok);
int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask);
void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]);
@ -664,19 +665,24 @@ void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, u8 *mtu_log);
void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]);
void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]);
void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps,
unsigned int *ipg);
unsigned int *ipg, bool sleep_ok);
void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr,
unsigned int mask, unsigned int val);
void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr);
void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st);
void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st);
void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st);
void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st);
void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st);
void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st,
bool sleep_ok);
void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st,
bool sleep_ok);
void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st,
bool sleep_ok);
void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st,
bool sleep_ok);
void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st,
bool sleep_ok);
void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4,
struct tp_tcp_stats *v6);
struct tp_tcp_stats *v6, bool sleep_ok);
void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx,
struct tp_fcoe_stats *st);
struct tp_fcoe_stats *st, bool sleep_ok);
void t4_load_mtus(struct adapter *adap, const unsigned short *mtus,
const unsigned short *alpha, const unsigned short *beta);
@ -687,7 +693,8 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, unsigned int ipg);
int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals,
unsigned int start, unsigned int n);
void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate);
int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map);
int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map,
bool sleep_ok);
void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid);
void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr);
@ -802,6 +809,15 @@ int t4_get_devlog_level(struct adapter *adapter, unsigned int *level);
int t4_set_devlog_level(struct adapter *adapter, unsigned int level);
void t4_sge_decode_idma_state(struct adapter *adapter, int state);
void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
u32 start_index, bool sleep_ok);
void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs,
u32 start_index, bool sleep_ok);
void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs,
u32 start_index, bool sleep_ok);
void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs,
u32 start_index, bool sleep_ok);
static inline int t4vf_query_params(struct adapter *adapter,
unsigned int nparams, const u32 *params,
u32 *vals)

File diff suppressed because it is too large Load Diff

View File

@ -4450,7 +4450,7 @@ adapter_full_init(struct adapter *sc)
for (i = 0; i < nitems(rss_key); i++) {
rss_key[i] = htobe32(raw_rss_key[nitems(rss_key) - 1 - i]);
}
t4_write_rss_key(sc, &rss_key[0], -1);
t4_write_rss_key(sc, &rss_key[0], -1, 1);
#endif
if (!(sc->flags & IS_VF))
@ -6528,7 +6528,7 @@ sysctl_cpl_stats(SYSCTL_HANDLER_ARGS)
return (ENOMEM);
mtx_lock(&sc->reg_lock);
t4_tp_get_cpl_stats(sc, &stats);
t4_tp_get_cpl_stats(sc, &stats, 0);
mtx_unlock(&sc->reg_lock);
if (sc->chip_params->nchan > 2) {
@ -6568,7 +6568,7 @@ sysctl_ddp_stats(SYSCTL_HANDLER_ARGS)
if (sb == NULL)
return (ENOMEM);
t4_get_usm_stats(sc, &stats);
t4_get_usm_stats(sc, &stats, 1);
sbuf_printf(sb, "Frames: %u\n", stats.frames);
sbuf_printf(sb, "Octets: %ju\n", stats.octets);
@ -6716,7 +6716,7 @@ sysctl_fcoe_stats(SYSCTL_HANDLER_ARGS)
return (ENOMEM);
for (i = 0; i < nchan; i++)
t4_get_fcoe_stats(sc, i, &stats[i]);
t4_get_fcoe_stats(sc, i, &stats[i], 1);
if (nchan > 2) {
sbuf_printf(sb, " channel 0 channel 1"
@ -6771,7 +6771,7 @@ sysctl_hw_sched(SYSCTL_HANDLER_ARGS)
"Class IPG (0.1 ns) Flow IPG (us)");
for (i = 0; i < NTX_SCHED; ++i, map >>= 2) {
t4_get_tx_sched(sc, i, &kbps, &ipg);
t4_get_tx_sched(sc, i, &kbps, &ipg, 1);
sbuf_printf(sb, "\n %u %-5s %u ", i,
(mode & (1 << i)) ? "flow" : "class", map & 3);
if (kbps)
@ -7505,7 +7505,7 @@ sysctl_rdma_stats(SYSCTL_HANDLER_ARGS)
return (ENOMEM);
mtx_lock(&sc->reg_lock);
t4_tp_get_rdma_stats(sc, &stats);
t4_tp_get_rdma_stats(sc, &stats, 0);
mtx_unlock(&sc->reg_lock);
sbuf_printf(sb, "NoRQEModDefferals: %u\n", stats.rqe_dfr_mod);
@ -7534,7 +7534,7 @@ sysctl_tcp_stats(SYSCTL_HANDLER_ARGS)
return (ENOMEM);
mtx_lock(&sc->reg_lock);
t4_tp_get_tcp_stats(sc, &v4, &v6);
t4_tp_get_tcp_stats(sc, &v4, &v6, 0);
mtx_unlock(&sc->reg_lock);
sbuf_printf(sb,
@ -7639,7 +7639,7 @@ sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS)
return (ENOMEM);
mtx_lock(&sc->reg_lock);
t4_tp_get_err_stats(sc, &stats);
t4_tp_get_err_stats(sc, &stats, 0);
mtx_unlock(&sc->reg_lock);
if (sc->chip_params->nchan > 2) {
@ -8459,7 +8459,7 @@ set_filter_mode(struct adapter *sc, uint32_t mode)
}
#endif
rc = -t4_set_filter_mode(sc, fconf);
rc = -t4_set_filter_mode(sc, fconf, true);
done:
end_synchronized_op(sc, LOCK_HELD);
return (rc);

View File

@ -827,7 +827,7 @@ t4_read_chip_settings(struct adapter *sc)
rc = EINVAL;
}
t4_init_tp_params(sc);
t4_init_tp_params(sc, 1);
t4_read_mtu_tbl(sc, sc->params.mtus, NULL);
t4_load_mtus(sc, sc->params.mtus, sc->params.a_wnd, sc->params.b_wnd);

View File

@ -39,6 +39,7 @@ struct iicbus_softc
{
device_t dev; /* Myself */
device_t owner; /* iicbus owner device structure */
u_int owncount; /* iicbus ownership nesting count */
u_char started; /* address of the 'started' slave
* 0 if no start condition succeeded */
u_char strict; /* deny operations that violate the

View File

@ -113,26 +113,30 @@ iicbus_request_bus(device_t bus, device_t dev, int how)
IICBUS_LOCK(sc);
while ((error == 0) && (sc->owner != NULL))
while (error == 0 && sc->owner != NULL && sc->owner != dev)
error = iicbus_poll(sc, how);
if (error == 0) {
sc->owner = dev;
/*
* Drop the lock around the call to the bus driver.
* This call should be allowed to sleep in the IIC_WAIT case.
* Drivers might also need to grab locks that would cause LOR
* if our lock is held.
*/
IICBUS_UNLOCK(sc);
/* Ask the underlying layers if the request is ok */
error = IICBUS_CALLBACK(device_get_parent(bus),
IIC_REQUEST_BUS, (caddr_t)&how);
IICBUS_LOCK(sc);
if (error != 0) {
sc->owner = NULL;
wakeup_one(sc);
++sc->owncount;
if (sc->owner == NULL) {
sc->owner = dev;
/*
* Drop the lock around the call to the bus driver, it
* should be allowed to sleep in the IIC_WAIT case.
* Drivers might also need to grab locks that would
* cause a LOR if our lock is held.
*/
IICBUS_UNLOCK(sc);
/* Ask the underlying layers if the request is ok */
error = IICBUS_CALLBACK(device_get_parent(bus),
IIC_REQUEST_BUS, (caddr_t)&how);
IICBUS_LOCK(sc);
if (error != 0) {
sc->owner = NULL;
sc->owncount = 0;
wakeup_one(sc);
}
}
}
@ -150,7 +154,6 @@ int
iicbus_release_bus(device_t bus, device_t dev)
{
struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
int error;
IICBUS_LOCK(sc);
@ -159,26 +162,16 @@ iicbus_release_bus(device_t bus, device_t dev)
return (IIC_EBUSBSY);
}
/*
* Drop the lock around the call to the bus driver.
* This call should be allowed to sleep in the IIC_WAIT case.
* Drivers might also need to grab locks that would cause LOR
* if our lock is held.
*/
IICBUS_UNLOCK(sc);
/* Ask the underlying layers if the release is ok */
error = IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL);
if (error == 0) {
if (--sc->owncount == 0) {
/* Drop the lock while informing the low-level driver. */
IICBUS_UNLOCK(sc);
IICBUS_CALLBACK(device_get_parent(bus), IIC_RELEASE_BUS, NULL);
IICBUS_LOCK(sc);
sc->owner = NULL;
/* wakeup a waiting thread */
wakeup_one(sc);
IICBUS_UNLOCK(sc);
}
return (error);
IICBUS_UNLOCK(sc);
return (0);
}
/*
@ -470,3 +463,55 @@ iicbus_transfer_gen(device_t dev, struct iic_msg *msgs, uint32_t nmsgs)
iicbus_stop(bus);
return (error);
}
int
iicdev_readfrom(device_t slavedev, uint8_t regaddr, void *buffer,
uint16_t buflen, int waithow)
{
struct iic_msg msgs[2];
uint8_t slaveaddr;
/*
* Two transfers back to back with a repeat-start between them; first we
* write the address-within-device, then we read from the device.
*/
slaveaddr = iicbus_get_addr(slavedev);
msgs[0].slave = slaveaddr;
msgs[0].flags = IIC_M_WR | IIC_M_NOSTOP;
msgs[0].len = 1;
msgs[0].buf = &regaddr;
msgs[1].slave = slaveaddr;
msgs[1].flags = IIC_M_RD;
msgs[1].len = buflen;
msgs[1].buf = buffer;
return (iicbus_transfer_excl(slavedev, msgs, nitems(msgs), waithow));
}
int iicdev_writeto(device_t slavedev, uint8_t regaddr, void *buffer,
uint16_t buflen, int waithow)
{
struct iic_msg msgs[2];
uint8_t slaveaddr;
/*
* Two transfers back to back with no stop or start between them; first
* we write the address then we write the data to that address, all in a
* single transfer from two scattered buffers.
*/
slaveaddr = iicbus_get_addr(slavedev);
msgs[0].slave = slaveaddr;
msgs[0].flags = IIC_M_WR | IIC_M_NOSTOP;
msgs[0].len = 1;
msgs[0].buf = &regaddr;
msgs[1].slave = slaveaddr;
msgs[1].flags = IIC_M_WR | IIC_M_NOSTART;
msgs[1].len = buflen;
msgs[1].buf = buffer;
return (iicbus_transfer_excl(slavedev, msgs, nitems(msgs), waithow));
}

View File

@ -133,6 +133,16 @@ int iicbus_transfer_excl(device_t bus, struct iic_msg *msgs, uint32_t nmsgs,
int how);
int iicbus_transfer_gen(device_t bus, struct iic_msg *msgs, uint32_t nmsgs);
/*
* Simple register read/write routines, but the "register" can be any size.
* The transfers are done with iicbus_transfer_excl(). Reads use a repeat-start
* between sending the address and reading; writes use a single start/stop.
*/
int iicdev_readfrom(device_t _slavedev, uint8_t _regaddr, void *_buffer,
uint16_t _buflen, int _waithow);
int iicdev_writeto(device_t _slavedev, uint8_t _regaddr, void *_buffer,
uint16_t _buflen, int _waithow);
#define IICBUS_MODVER 1
#define IICBUS_MINVER 1
#define IICBUS_MAXVER 1

View File

@ -325,8 +325,10 @@ static int iwm_mvm_get_signal_strength(struct iwm_softc *,
struct iwm_rx_phy_info *);
static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *,
struct iwm_rx_packet *);
static int iwm_get_noise(struct iwm_softc *sc,
static int iwm_get_noise(struct iwm_softc *,
const struct iwm_mvm_statistics_rx_non_phy *);
static void iwm_mvm_handle_rx_statistics(struct iwm_softc *,
struct iwm_rx_packet *);
static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *,
uint32_t, boolean_t);
static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *,
@ -388,6 +390,7 @@ static struct ieee80211vap *
const uint8_t [IEEE80211_ADDR_LEN],
const uint8_t [IEEE80211_ADDR_LEN]);
static void iwm_vap_delete(struct ieee80211vap *);
static void iwm_xmit_queue_drain(struct iwm_softc *);
static void iwm_scan_start(struct ieee80211com *);
static void iwm_scan_end(struct ieee80211com *);
static void iwm_update_mcast(struct ieee80211com *);
@ -3158,6 +3161,15 @@ iwm_get_noise(struct iwm_softc *sc,
#endif
}
static void
iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt)
{
struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data;
memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats));
sc->sc_noise = iwm_get_noise(sc, &stats->rx.general);
}
/*
* iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler
*
@ -4103,7 +4115,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in)
* get here from RUN state.
*/
tfd_msk = 0xf;
mbufq_drain(&sc->sc_snd);
iwm_xmit_queue_drain(sc);
iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC);
/*
* We seem to get away with just synchronously sending the
@ -4439,13 +4451,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
break;
case IEEE80211_S_RUN:
{
struct iwm_host_cmd cmd = {
.id = IWM_LQ_CMD,
.len = { sizeof(in->in_lq), },
.flags = IWM_CMD_SYNC,
};
in = IWM_NODE(vap->iv_bss);
/* Update the association state, now we have it all */
/* (eg associd comes in at this point */
@ -4470,15 +4475,13 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
iwm_mvm_update_quotas(sc, ivp);
iwm_setrates(sc, in);
cmd.data[0] = &in->in_lq;
if ((error = iwm_send_cmd(sc, &cmd)) != 0) {
if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) {
device_printf(sc->sc_dev,
"%s: IWM_LQ_CMD failed\n", __func__);
"%s: IWM_LQ_CMD failed: %d\n", __func__, error);
}
iwm_mvm_led_enable(sc);
break;
}
default:
break;
@ -5291,13 +5294,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m)
case IWM_CALIB_RES_NOTIF_PHY_DB:
break;
case IWM_STATISTICS_NOTIFICATION: {
struct iwm_notif_statistics *stats;
stats = (void *)pkt->data;
memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats));
sc->sc_noise = iwm_get_noise(sc, &stats->rx.general);
case IWM_STATISTICS_NOTIFICATION:
iwm_mvm_handle_rx_statistics(sc, pkt);
break;
}
case IWM_NVM_ACCESS_CMD:
case IWM_MCC_UPDATE_CMD:
@ -6213,6 +6212,19 @@ iwm_vap_delete(struct ieee80211vap *vap)
free(ivp, M_80211_VAP);
}
static void
iwm_xmit_queue_drain(struct iwm_softc *sc)
{
struct mbuf *m;
struct ieee80211_node *ni;
while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) {
ni = (struct ieee80211_node *)m->m_pkthdr.rcvif;
ieee80211_free_node(ni);
m_freem(m);
}
}
static void
iwm_scan_start(struct ieee80211com *ic)
{
@ -6372,6 +6384,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211)
callout_drain(&sc->sc_watchdog_to);
iwm_stop_device(sc);
if (do_net80211) {
IWM_LOCK(sc);
iwm_xmit_queue_drain(sc);
IWM_UNLOCK(sc);
ieee80211_ifdetach(&sc->sc_ic);
}
@ -6405,7 +6420,6 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211)
sc->sc_notif_wait = NULL;
}
mbufq_drain(&sc->sc_snd);
IWM_LOCK_DESTROY(sc);
return (0);

View File

@ -307,15 +307,13 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc,
int j;
for (nchan = j = 0;
j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) {
c = &ic->ic_channels[j];
/* For 2GHz, only populate 11b channels */
/* For 5GHz, only populate 11a channels */
j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) {
c = ss->ss_chans[j];
/*
* Catch other channels, in case we have 900MHz channels or
* something in the chanlist.
*/
if (iwm_mvm_scan_skip_channel(c)) {
if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) {
IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM,
"%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n",
__func__, c->ic_freq, c->ic_ieee, c->ic_flags);
@ -346,20 +344,19 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc,
struct iwm_scan_channel_cfg_umac *chan, int n_ssids)
{
struct ieee80211com *ic = &sc->sc_ic;
struct ieee80211_scan_state *ss = ic->ic_scan;
struct ieee80211_channel *c;
uint8_t nchan;
int j;
for (nchan = j = 0;
j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) {
c = &ic->ic_channels[j];
/* For 2GHz, only populate 11b channels */
/* For 5GHz, only populate 11a channels */
j < ss->ss_last && nchan < sc->ucode_capa.n_scan_channels; j++) {
c = ss->ss_chans[j];
/*
* Catch other channels, in case we have 900MHz channels or
* something in the chanlist.
*/
if (iwm_mvm_scan_skip_channel(c)) {
if (!IEEE80211_IS_CHAN_2GHZ(c) && !IEEE80211_IS_CHAN_5GHZ(c)) {
IWM_DPRINTF(sc, IWM_DEBUG_RESET | IWM_DEBUG_EEPROM,
"%s: skipping channel (freq=%d, ieee=%d, flags=0x%08x)\n",
__func__, c->ic_freq, c->ic_ieee, c->ic_flags);
@ -726,7 +723,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc)
if (iwm_mvm_rrm_scan_needed(sc))
req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED);
req->flags = iwm_mvm_scan_rxon_flags(&sc->sc_ic.ic_channels[0]);
req->flags = iwm_mvm_scan_rxon_flags(sc->sc_ic.ic_scan->ss_chans[0]);
req->filter_flags =
htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON);

View File

@ -283,7 +283,6 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap,
ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE);
if (ret)
return ret;
mbufq_drain(&sc->sc_snd); /* XXX needed ? */
for (ac = 0; ac < WME_NUM_AC; ac++) {
tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]);
}

View File

@ -489,6 +489,32 @@ iwm_dma_contig_free(struct iwm_dma_info *dma)
}
}
/**
* iwm_mvm_send_lq_cmd() - Send link quality command
* @init: This command is sent as part of station initialization right
* after station has been added.
*
* The link quality command is sent as the last step of station creation.
* This is the special case in which init is set and we call a callback in
* this case to clear the state indicating that station creation is in
* progress.
*/
int
iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, boolean_t init)
{
struct iwm_host_cmd cmd = {
.id = IWM_LQ_CMD,
.len = { sizeof(struct iwm_lq_cmd), },
.flags = init ? 0 : IWM_CMD_ASYNC,
.data = { lq, },
};
if (lq->sta_id == IWM_MVM_STATION_COUNT)
return EINVAL;
return iwm_send_cmd(sc, &cmd);
}
boolean_t
iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc)
{

View File

@ -120,6 +120,9 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma,
bus_size_t size, bus_size_t alignment);
extern void iwm_dma_contig_free(struct iwm_dma_info *);
extern int iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq,
boolean_t init);
extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc);
extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx);

View File

@ -2898,6 +2898,18 @@ struct iwm_mcast_filter_cmd {
uint8_t addr_list[0];
} __packed; /* IWM_MCAST_FILTERING_CMD_API_S_VER_1 */
/*
* The first MAC indices (starting from 0)
* are available to the driver, AUX follows
*/
#define IWM_MAC_INDEX_AUX 4
#define IWM_MAC_INDEX_MIN_DRIVER 0
#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX
#define IWM_NUM_MAC_INDEX (IWM_MAC_INDEX_AUX + 1)
/***********************************
* Statistics API
***********************************/
struct iwm_mvm_statistics_dbg {
uint32_t burst_check;
uint32_t burst_count;
@ -2914,24 +2926,6 @@ struct iwm_mvm_statistics_div {
uint32_t reserved2;
} __packed; /* IWM_STATISTICS_SLOW_DIV_API_S_VER_2 */
struct iwm_mvm_statistics_general_common {
uint32_t temperature; /* radio temperature */
uint32_t temperature_m; /* radio voltage */
struct iwm_mvm_statistics_dbg dbg;
uint32_t sleep_time;
uint32_t slots_out;
uint32_t slots_idle;
uint32_t ttl_timestamp;
struct iwm_mvm_statistics_div div;
uint32_t rx_enable_counter;
/*
* num_of_sos_states:
* count the number of times we have to re-tune
* in order to get out of bad PHY status
*/
uint32_t num_of_sos_states;
} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */
struct iwm_mvm_statistics_rx_non_phy {
uint32_t bogus_cts; /* CTS received when not expecting CTS */
uint32_t bogus_ack; /* ACK received when not expecting ACK */
@ -3002,6 +2996,23 @@ struct iwm_mvm_statistics_rx_ht_phy {
uint32_t unsupport_mcs;
} __packed; /* IWM_STATISTICS_HT_RX_PHY_API_S_VER_1 */
struct iwm_mvm_statistics_tx_non_phy {
uint32_t preamble_cnt;
uint32_t rx_detected_cnt;
uint32_t bt_prio_defer_cnt;
uint32_t bt_prio_kill_cnt;
uint32_t few_bytes_cnt;
uint32_t cts_timeout;
uint32_t ack_timeout;
uint32_t expected_ack_cnt;
uint32_t actual_ack_cnt;
uint32_t dump_msdu_cnt;
uint32_t burst_abort_next_frame_mismatch_cnt;
uint32_t burst_abort_missing_next_frame_cnt;
uint32_t cts_timeout_collision;
uint32_t ack_or_ba_timeout_collision;
} __packed; /* IWM_STATISTICS_TX_NON_PHY_API_S_VER_3 */
#define IWM_MAX_CHAINS 3
struct iwm_mvm_statistics_tx_non_phy_agg {
@ -3032,20 +3043,7 @@ struct iwm_mvm_statistics_tx_channel_width {
}; /* IWM_STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */
struct iwm_mvm_statistics_tx {
uint32_t preamble_cnt;
uint32_t rx_detected_cnt;
uint32_t bt_prio_defer_cnt;
uint32_t bt_prio_kill_cnt;
uint32_t few_bytes_cnt;
uint32_t cts_timeout;
uint32_t ack_timeout;
uint32_t expected_ack_cnt;
uint32_t actual_ack_cnt;
uint32_t dump_msdu_cnt;
uint32_t burst_abort_next_frame_mismatch_cnt;
uint32_t burst_abort_missing_next_frame_cnt;
uint32_t cts_timeout_collision;
uint32_t ack_or_ba_timeout_collision;
struct iwm_mvm_statistics_tx_non_phy general;
struct iwm_mvm_statistics_tx_non_phy_agg agg;
struct iwm_mvm_statistics_tx_channel_width channel_width;
} __packed; /* IWM_STATISTICS_TX_API_S_VER_4 */
@ -3062,17 +3060,38 @@ struct iwm_mvm_statistics_bt_activity {
uint32_t lo_priority_rx_denied_cnt;
} __packed; /* IWM_STATISTICS_BT_ACTIVITY_API_S_VER_1 */
struct iwm_mvm_statistics_general {
struct iwm_mvm_statistics_general_common common;
struct iwm_mvm_statistics_general_v8 {
uint32_t radio_temperature;
uint32_t radio_voltage;
struct iwm_mvm_statistics_dbg dbg;
uint32_t sleep_time;
uint32_t slots_out;
uint32_t slots_idle;
uint32_t ttl_timestamp;
struct iwm_mvm_statistics_div slow_div;
uint32_t rx_enable_counter;
/*
* num_of_sos_states:
* count the number of times we have to re-tune
* in order to get out of bad PHY status
*/
uint32_t num_of_sos_states;
uint32_t beacon_filtered;
uint32_t missed_beacons;
int8_t beacon_filter_average_energy;
int8_t beacon_filter_reason;
int8_t beacon_filter_current_energy;
int8_t beacon_filter_reserved;
uint8_t beacon_filter_average_energy;
uint8_t beacon_filter_reason;
uint8_t beacon_filter_current_energy;
uint8_t beacon_filter_reserved;
uint32_t beacon_filter_delta_time;
struct iwm_mvm_statistics_bt_activity bt_activity;
} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */
uint64_t rx_time;
uint64_t on_time_rf;
uint64_t on_time_scan;
uint64_t tx_time;
uint32_t beacon_counter[IWM_NUM_MAC_INDEX];
uint8_t beacon_average_energy[IWM_NUM_MAC_INDEX];
uint8_t reserved[4 - (IWM_NUM_MAC_INDEX % 4)];
} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_8 */
struct iwm_mvm_statistics_rx {
struct iwm_mvm_statistics_rx_phy ofdm;
@ -3086,23 +3105,22 @@ struct iwm_mvm_statistics_rx {
*
* By default, uCode issues this notification after receiving a beacon
* while associated. To disable this behavior, set DISABLE_NOTIF flag in the
* IWM_REPLY_STATISTICS_CMD 0x9c, above.
*
* Statistics counters continue to increment beacon after beacon, but are
* cleared when changing channels or when driver issues IWM_REPLY_STATISTICS_CMD
* 0x9c with CLEAR_STATS bit set (see above).
*
* uCode also issues this notification during scans. uCode clears statistics
* appropriately so that each notification contains statistics for only the
* one channel that has just been scanned.
* IWM_STATISTICS_CMD (0x9c), below.
*/
struct iwm_notif_statistics { /* IWM_STATISTICS_NTFY_API_S_VER_8 */
struct iwm_notif_statistics_v10 {
uint32_t flag;
struct iwm_mvm_statistics_rx rx;
struct iwm_mvm_statistics_tx tx;
struct iwm_mvm_statistics_general general;
} __packed;
struct iwm_mvm_statistics_general_v8 general;
} __packed; /* IWM_STATISTICS_NTFY_API_S_VER_10 */
#define IWM_STATISTICS_FLG_CLEAR 0x1
#define IWM_STATISTICS_FLG_DISABLE_NOTIF 0x2
struct iwm_statistics_cmd {
uint32_t flags;
} __packed; /* IWM_STATISTICS_CMD_API_S_VER_1 */
/***********************************
* Smart Fifo API
@ -3187,14 +3205,6 @@ struct iwm_sf_cfg_cmd {
* BEGIN mvm/fw-api-mac.h
*/
/*
* The first MAC indices (starting from 0)
* are available to the driver, AUX follows
*/
#define IWM_MAC_INDEX_AUX 4
#define IWM_MAC_INDEX_MIN_DRIVER 0
#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX
enum iwm_ac {
IWM_AC_BK,
IWM_AC_BE,
@ -3971,12 +3981,12 @@ enum {
* Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz
* 0 and 1 are valid for HT and VHT, 2 and 3 only for VHT
*/
#define IWM_RATE_MCS_CHAN_WIDTH_POS 11
#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_POS 11
#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS)
#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS)
/* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */
#define IWM_RATE_MCS_SGI_POS 13
@ -3989,7 +3999,7 @@ enum {
#define IWM_RATE_MCS_ANT_C_MSK (4 << IWM_RATE_MCS_ANT_POS)
#define IWM_RATE_MCS_ANT_AB_MSK (IWM_RATE_MCS_ANT_A_MSK | \
IWM_RATE_MCS_ANT_B_MSK)
#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \
#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \
IWM_RATE_MCS_ANT_C_MSK)
#define IWM_RATE_MCS_ANT_MSK IWM_RATE_MCS_ANT_ABC_MSK
#define IWM_RATE_MCS_ANT_NUM 3
@ -3999,8 +4009,8 @@ enum {
#define IWM_RATE_MCS_STBC_MSK (1 << IWM_RATE_MCS_STBC_POS)
/* Bit 19: (0) Beamforming is off, (1) Beamforming is on */
#define IWM_RATE_MCS_BF_POS 19
#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS)
#define IWM_RATE_MCS_BF_POS 19
#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS)
/* Bit 20: (0) ZLF is off, (1) ZLF is on */
#define IWM_RATE_MCS_ZLF_POS 20
@ -4023,28 +4033,64 @@ enum {
/* Link quality command flags bit fields */
/* Bit 0: (0) Don't use RTS (1) Use RTS */
#define IWM_LQ_FLAG_USE_RTS_POS 0
#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS)
#define IWM_LQ_FLAG_USE_RTS_POS 0
#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS)
/* Bit 1-3: LQ command color. Used to match responses to LQ commands */
#define IWM_LQ_FLAG_COLOR_POS 1
#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS)
#define IWM_LQ_FLAG_COLOR_POS 1
#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS)
/* Bit 4-5: Tx RTS BW Signalling
* (0) No RTS BW signalling
* (1) Static BW signalling
* (2) Dynamic BW signalling
*/
#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4
#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4
#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS)
/* Bit 6: (0) No dynamic BW selection (1) Allow dynamic BW selection
* Dyanmic BW selection allows Tx with narrower BW then requested in rates
*/
#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6
#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS)
#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6
#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS)
/* Single Stream Tx Parameters (lq_cmd->ss_params)
* Flags to control a smart FW decision about whether BFER/STBC/SISO will be
* used for single stream Tx.
*/
/* Bit 0-1: Max STBC streams allowed. Can be 0-3.
* (0) - No STBC allowed
* (1) - 2x1 STBC allowed (HT/VHT)
* (2) - 4x2 STBC allowed (HT/VHT)
* (3) - 3x2 STBC allowed (HT only)
* All our chips are at most 2 antennas so only (1) is valid for now.
*/
#define IWM_LQ_SS_STBC_ALLOWED_POS 0
#define IWM_LQ_SS_STBC_ALLOWED_MSK (3 << IWM_LQ_SS_STBC_ALLOWED_MSK)
/* 2x1 STBC is allowed */
#define IWM_LQ_SS_STBC_1SS_ALLOWED (1 << IWM_LQ_SS_STBC_ALLOWED_POS)
/* Bit 2: Beamformer (VHT only) is allowed */
#define IWM_LQ_SS_BFER_ALLOWED_POS 2
#define IWM_LQ_SS_BFER_ALLOWED (1 << IWM_LQ_SS_BFER_ALLOWED_POS)
/* Bit 3: Force BFER or STBC for testing
* If this is set:
* If BFER is allowed then force the ucode to choose BFER else
* If STBC is allowed then force the ucode to choose STBC over SISO
*/
#define IWM_LQ_SS_FORCE_POS 3
#define IWM_LQ_SS_FORCE (1 << IWM_LQ_SS_FORCE_POS)
/* Bit 31: ss_params field is valid. Used for FW backward compatibility
* with other drivers which don't support the ss_params API yet
*/
#define IWM_LQ_SS_PARAMS_VALID_POS 31
#define IWM_LQ_SS_PARAMS_VALID (1 << IWM_LQ_SS_PARAMS_VALID_POS)
/**
* struct iwm_lq_cmd - link quality command
@ -4068,11 +4114,11 @@ enum {
* 2 - 0x3f: maximal number of frames (up to 3f == 63)
* @rs_table: array of rates for each TX try, each is rate_n_flags,
* meaning it is a combination of IWM_RATE_MCS_* and IWM_RATE_*_PLCP
* @bf_params: beam forming params, currently not used
* @ss_params: single stream features. declare whether STBC or BFER are allowed.
*/
struct iwm_lq_cmd {
uint8_t sta_id;
uint8_t reserved1;
uint8_t reduced_tpc;
uint16_t control;
/* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */
uint8_t flags;
@ -4086,7 +4132,7 @@ struct iwm_lq_cmd {
uint8_t agg_frame_cnt_limit;
uint32_t reserved2;
uint32_t rs_table[IWM_LQ_MAX_RETRY_NUM];
uint32_t bf_params;
uint32_t ss_params;
}; /* LINK_QUALITY_CMD_API_S_VER_1 */
/*
@ -4523,7 +4569,8 @@ struct iwm_mvm_tx_resp {
uint8_t pa_integ_res_b[3];
uint8_t pa_integ_res_c[3];
uint16_t measurement_req_id;
uint16_t reserved;
uint8_t reduced_tpc;
uint8_t reserved;
uint32_t tfd_info;
uint16_t seq_ctl;

View File

@ -529,7 +529,7 @@ struct iwm_softc {
/* phy contexts. we only use the first one */
struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX];
struct iwm_notif_statistics sc_stats;
struct iwm_notif_statistics_v10 sc_stats;
int sc_noise;
caddr_t sc_drvbpf;

View File

@ -1593,9 +1593,7 @@ ixgbe_rx_input(struct rx_ring *rxr, struct ifnet *ifp, struct mbuf *m,
if (tcp_lro_rx(&rxr->lro, m, 0) == 0)
return;
}
IXGBE_RX_UNLOCK(rxr);
(*ifp->if_input)(ifp, m);
IXGBE_RX_LOCK(rxr);
} /* ixgbe_rx_input */
/************************************************************************
@ -1880,7 +1878,9 @@ ixgbe_rxeof(struct ix_queue *que)
/* Now send to the stack or do LRO */
if (sendmp != NULL) {
rxr->next_to_check = i;
IXGBE_RX_UNLOCK(rxr);
ixgbe_rx_input(rxr, ifp, sendmp, ptype);
IXGBE_RX_LOCK(rxr);
i = rxr->next_to_check;
}
@ -1897,13 +1897,13 @@ ixgbe_rxeof(struct ix_queue *que)
rxr->next_to_check = i;
IXGBE_RX_UNLOCK(rxr);
/*
* Flush any outstanding LRO work
*/
tcp_lro_flush_all(lro);
IXGBE_RX_UNLOCK(rxr);
/*
* Still have cleaning to do?
*/

View File

@ -235,7 +235,7 @@ mmcsd_attach(device_t dev)
* insertion that results in switches to/from a transfer mode involving
* re-tuning, iff there are multiple devices on a given bus. Until now
* mmc(4) lacks support for rescanning already attached buses, however,
* and sdhci(4) has no support for embedded/shared buses in the first
* and sdhci(4) to date has no support for shared buses in the first
* place either.
*/
sc->max_data = mmc_get_max_data(dev);

View File

@ -2677,7 +2677,7 @@ mprsas_scsiio_complete(struct mpr_softc *sc, struct mpr_command *cm)
if ((sassc->flags & MPRSAS_QUEUE_FROZEN) == 0) {
xpt_freeze_simq(sassc->sim, 1);
sassc->flags |= MPRSAS_QUEUE_FROZEN;
mpr_dprint(sc, MPR_INFO, "Error sending command, "
mpr_dprint(sc, MPR_XINFO, "Error sending command, "
"freezing SIM queue\n");
}
}

View File

@ -34,7 +34,9 @@
* $FreeBSD$
*/
#ifdef _KERNEL
#ifndef _FS_FDESC_H_
#define _FS_FDESC_H_
/* Private mount flags for fdescfs. */
#define FMNT_UNMOUNTF 0x01
struct fdescmount {
@ -66,4 +68,4 @@ extern vfs_init_t fdesc_init;
extern vfs_uninit_t fdesc_uninit;
extern int fdesc_allocvp(fdntype, unsigned, int, struct mount *,
struct vnode **);
#endif /* _KERNEL */
#endif /* !_FS_FDESC_H_ */

View File

@ -306,10 +306,6 @@ ncl_putpages(struct vop_putpages_args *ap)
printf("ncl_putpages: called on noncache-able vnode\n");
mtx_lock(&np->n_mtx);
}
for (i = 0; i < npages; i++)
rtvals[i] = VM_PAGER_ERROR;
/*
* When putting pages, do not extend file past EOF.
*/
@ -320,6 +316,9 @@ ncl_putpages(struct vop_putpages_args *ap)
}
mtx_unlock(&np->n_mtx);
for (i = 0; i < npages; i++)
rtvals[i] = VM_PAGER_ERROR;
VM_CNT_INC(v_vnodeout);
VM_CNT_ADD(v_vnodepgsout, count);
@ -337,8 +336,10 @@ ncl_putpages(struct vop_putpages_args *ap)
cred);
crfree(cred);
if (error == 0 || !nfs_keep_dirty_on_error)
vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
if (error == 0 || !nfs_keep_dirty_on_error) {
vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid,
np->n_size - offset, npages * PAGE_SIZE);
}
return (rtvals[0]);
}

View File

@ -621,9 +621,11 @@ smbfs_putpages(ap)
relpbuf(bp, &smbfs_pbuf_freecnt);
if (!error)
vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid);
return rtvals[0];
if (error == 0) {
vnode_pager_undirty_pages(pages, rtvals, count - uio.uio_resid,
npages * PAGE_SIZE, npages * PAGE_SIZE);
}
return (rtvals[0]);
#endif /* SMBFS_RWGENERIC */
}

View File

@ -738,15 +738,16 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet *ifp)
lagg_setmulti(lp);
LAGG_WUNLOCK(sc);
if ((error = lagg_proto_addport(sc, lp)) != 0) {
/* Remove the port, without calling pr_delport. */
LAGG_WLOCK(sc);
lagg_port_destroy(lp, 0);
LAGG_UNLOCK_ASSERT(sc);
return (error);
}
LAGG_WUNLOCK(sc);
/* Update lagg capabilities */
lagg_capabilities(sc);
lagg_linkstate(sc);

View File

@ -431,11 +431,6 @@ static void
cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type)
{
struct cdg *cdg_data = ccv->cc_data;
uint32_t cwin;
u_int mss;
cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
switch(signal_type) {
case CC_CDG_DELAY:
@ -453,7 +448,7 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type)
*/
if (IN_CONGRECOVERY(CCV(ccv, t_flags)) ||
cdg_data->queue_state < CDG_Q_FULL) {
CCV(ccv, snd_ssthresh) = cwin;
CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd);
CCV(ccv, snd_recover) = CCV(ccv, snd_max);
} else {
/*
@ -466,19 +461,13 @@ cdg_cong_signal(struct cc_var *ccv, uint32_t signal_type)
cdg_data->shadow_w, RENO_BETA);
CCV(ccv, snd_ssthresh) = max(cdg_data->shadow_w,
cdg_window_decrease(ccv, cwin, V_cdg_beta_loss));
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
cdg_window_decrease(ccv, CCV(ccv, snd_cwnd),
V_cdg_beta_loss));
cdg_data->window_incr = cdg_data->rtt_count = 0;
}
ENTER_RECOVERY(CCV(ccv, t_flags));
break;
case CC_RTO:
CCV(ccv, snd_ssthresh) =
max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
* mss;
CCV(ccv, snd_cwnd) = mss;
break;
default:
newreno_cc_algo.cong_signal(ccv, signal_type);
break;

View File

@ -330,12 +330,10 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_type)
struct ertt *e_t;
struct chd *chd_data;
int qdly;
u_int mss;
e_t = khelp_get_osd(CCV(ccv, osd), ertt_id);
chd_data = ccv->cc_data;
qdly = imax(e_t->rtt, chd_data->maxrtt_in_rtt) - e_t->minrtt;
mss = CCV(ccv, t_maxseg);
switch(signal_type) {
case CC_CHD_DELAY:
@ -375,12 +373,6 @@ chd_cong_signal(struct cc_var *ccv, uint32_t signal_type)
}
ENTER_FASTRECOVERY(CCV(ccv, t_flags));
break;
case CC_RTO:
CCV(ccv, snd_ssthresh) =
max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
* mss;
CCV(ccv, snd_cwnd) = mss;
break;
default:
newreno_cc_algo.cong_signal(ccv, signal_type);

View File

@ -225,12 +225,8 @@ static void
cubic_cong_signal(struct cc_var *ccv, uint32_t type)
{
struct cubic *cubic_data;
uint32_t cwin;
u_int mss;
cubic_data = ccv->cc_data;
cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
switch (type) {
case CC_NDUPACK:
@ -239,8 +235,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
cubic_ssthresh_update(ccv);
cubic_data->num_cong_events++;
cubic_data->prev_max_cwnd = cubic_data->max_cwnd;
cubic_data->max_cwnd = cwin;
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
cubic_data->max_cwnd = CCV(ccv, snd_cwnd);
}
ENTER_RECOVERY(CCV(ccv, t_flags));
}
@ -251,7 +246,7 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
cubic_ssthresh_update(ccv);
cubic_data->num_cong_events++;
cubic_data->prev_max_cwnd = cubic_data->max_cwnd;
cubic_data->max_cwnd = cwin;
cubic_data->max_cwnd = CCV(ccv, snd_cwnd);
cubic_data->t_last_cong = ticks;
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
ENTER_CONGRECOVERY(CCV(ccv, t_flags));
@ -266,13 +261,9 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type)
* chance the first one is a false alarm and may not indicate
* congestion.
*/
if (CCV(ccv, t_rxtshift) >= 2) {
if (CCV(ccv, t_rxtshift) >= 2)
cubic_data->num_cong_events++;
cubic_data->t_last_cong = ticks;
cubic_ssthresh_update(ccv);
cubic_data->max_cwnd = cwin;
CCV(ccv, snd_cwnd) = mss;
}
break;
}
}

View File

@ -230,29 +230,27 @@ static void
dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
{
struct dctcp *dctcp_data;
uint32_t cwin, ssthresh_on_loss;
u_int mss;
u_int win, mss;
dctcp_data = ccv->cc_data;
cwin = CCV(ccv, snd_cwnd);
win = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
ssthresh_on_loss =
max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
* mss;
switch (type) {
case CC_NDUPACK:
if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_ssthresh) = mss *
max(win / 2 / mss, 2);
dctcp_data->num_cong_events++;
} else {
/* cwnd has already updated as congestion
* recovery. Reverse cwnd value using
* snd_cwnd_prev and recalculate snd_ssthresh
*/
cwin = CCV(ccv, snd_cwnd_prev);
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
win = CCV(ccv, snd_cwnd_prev);
CCV(ccv, snd_ssthresh) =
max(win / 2 / mss, 2) * mss;
}
ENTER_RECOVERY(CCV(ccv, t_flags));
}
@ -262,17 +260,18 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
* Save current snd_cwnd when the host encounters both
* congestion recovery and fast recovery.
*/
CCV(ccv, snd_cwnd_prev) = cwin;
CCV(ccv, snd_cwnd_prev) = win;
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
if (V_dctcp_slowstart &&
dctcp_data->num_cong_events++ == 0) {
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_ssthresh) =
mss * max(win / 2 / mss, 2);
dctcp_data->alpha = MAX_ALPHA_VALUE;
dctcp_data->bytes_ecn = 0;
dctcp_data->bytes_total = 0;
dctcp_data->save_sndnxt = CCV(ccv, snd_nxt);
} else
CCV(ccv, snd_ssthresh) = max((cwin - ((cwin *
CCV(ccv, snd_ssthresh) = max((win - ((win *
dctcp_data->alpha) >> 11)) / mss, 2) * mss;
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
ENTER_CONGRECOVERY(CCV(ccv, t_flags));
@ -285,8 +284,6 @@ dctcp_cong_signal(struct cc_var *ccv, uint32_t type)
dctcp_update_alpha(ccv);
dctcp_data->save_sndnxt += CCV(ccv, t_maxseg);
dctcp_data->num_cong_events++;
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_cwnd) = mss;
}
break;
}

View File

@ -271,12 +271,8 @@ static void
htcp_cong_signal(struct cc_var *ccv, uint32_t type)
{
struct htcp *htcp_data;
uint32_t cwin;
u_int mss;
htcp_data = ccv->cc_data;
cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
switch (type) {
case CC_NDUPACK:
@ -291,9 +287,8 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type)
(htcp_data->maxrtt - htcp_data->minrtt) *
95) / 100;
htcp_ssthresh_update(ccv);
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
htcp_data->t_last_cong = ticks;
htcp_data->prev_cwnd = cwin;
htcp_data->prev_cwnd = CCV(ccv, snd_cwnd);
}
ENTER_RECOVERY(CCV(ccv, t_flags));
}
@ -310,7 +305,7 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type)
htcp_ssthresh_update(ccv);
CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh);
htcp_data->t_last_cong = ticks;
htcp_data->prev_cwnd = cwin;
htcp_data->prev_cwnd = CCV(ccv, snd_cwnd);
ENTER_CONGRECOVERY(CCV(ccv, t_flags));
}
break;
@ -325,10 +320,6 @@ htcp_cong_signal(struct cc_var *ccv, uint32_t type)
*/
if (CCV(ccv, t_rxtshift) >= 2)
htcp_data->t_last_cong = ticks;
CCV(ccv, snd_ssthresh) =
max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
* mss;
CCV(ccv, snd_cwnd) = mss;
break;
}
}
@ -520,10 +511,6 @@ htcp_ssthresh_update(struct cc_var *ccv)
CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) *
htcp_data->beta) >> HTCP_SHIFT;
}
/* Align ssthresh to MSS boundary */
CCV(ccv, snd_ssthresh) = (CCV(ccv, snd_ssthresh) / CCV(ccv, t_maxseg))
* CCV(ccv, t_maxseg);
}

View File

@ -182,42 +182,30 @@ newreno_after_idle(struct cc_var *ccv)
static void
newreno_cong_signal(struct cc_var *ccv, uint32_t type)
{
uint32_t cwin, ssthresh_on_loss;
u_int mss;
cwin = CCV(ccv, snd_cwnd);
mss = CCV(ccv, t_maxseg);
ssthresh_on_loss =
max((CCV(ccv, snd_max) - CCV(ccv, snd_una)) / 2 / mss, 2)
* mss;
u_int win;
/* Catch algos which mistakenly leak private signal types. */
KASSERT((type & CC_SIGPRIVMASK) == 0,
("%s: congestion signal type 0x%08x is private\n", __func__, type));
cwin = max(cwin / 2 / mss, 2) * mss;
win = max(CCV(ccv, snd_cwnd) / 2 / CCV(ccv, t_maxseg), 2) *
CCV(ccv, t_maxseg);
switch (type) {
case CC_NDUPACK:
if (!IN_FASTRECOVERY(CCV(ccv, t_flags))) {
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_cwnd) = cwin;
}
if (!IN_CONGRECOVERY(CCV(ccv, t_flags)))
CCV(ccv, snd_ssthresh) = win;
ENTER_RECOVERY(CCV(ccv, t_flags));
}
break;
case CC_ECN:
if (!IN_CONGRECOVERY(CCV(ccv, t_flags))) {
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_cwnd) = cwin;
CCV(ccv, snd_ssthresh) = win;
CCV(ccv, snd_cwnd) = win;
ENTER_CONGRECOVERY(CCV(ccv, t_flags));
}
break;
case CC_RTO:
CCV(ccv, snd_ssthresh) = ssthresh_on_loss;
CCV(ccv, snd_cwnd) = mss;
break;
}
}

View File

@ -2074,7 +2074,6 @@ sctp_process_a_data_chunk(struct sctp_tcb *stcb, struct sctp_association *asoc,
struct mbuf *mm;
control->data = dmbuf;
mm = control->data;
for (mm = control->data; mm; mm = mm->m_next) {
control->length += SCTP_BUF_LEN(mm);
}

View File

@ -435,16 +435,9 @@ cc_cong_signal(struct tcpcb *tp, struct tcphdr *th, uint32_t type)
tp->t_dupacks = 0;
tp->t_bytes_acked = 0;
EXIT_RECOVERY(tp->t_flags);
if (CC_ALGO(tp)->cong_signal == NULL) {
/*
* RFC5681 Section 3.1
* ssthresh = max (FlightSize / 2, 2*SMSS) eq (4)
*/
tp->snd_ssthresh =
max((tp->snd_max - tp->snd_una) / 2 / maxseg, 2)
* maxseg;
tp->snd_cwnd = maxseg;
}
tp->snd_ssthresh = max(2, min(tp->snd_wnd, tp->snd_cwnd) / 2 /
maxseg) * maxseg;
tp->snd_cwnd = maxseg;
break;
case CC_RTO_ERR:
TCPSTAT_INC(tcps_sndrexmitbad);
@ -2613,15 +2606,6 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (awnd < tp->snd_ssthresh) {
tp->snd_cwnd += maxseg;
/*
* RFC5681 Section 3.2 talks about cwnd
* inflation on additional dupacks and
* deflation on recovering from loss.
*
* We keep cwnd into check so that
* we don't have to 'deflate' it when we
* get out of recovery.
*/
if (tp->snd_cwnd > tp->snd_ssthresh)
tp->snd_cwnd = tp->snd_ssthresh;
}
@ -2661,22 +2645,19 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so,
TCPSTAT_INC(
tcps_sack_recovery_episode);
tp->sack_newdata = tp->snd_nxt;
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = maxseg;
tp->snd_cwnd = maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
goto drop;
}
tp->snd_nxt = th->th_ack;
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = maxseg;
tp->snd_cwnd = maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
KASSERT(tp->snd_limited <= 2,
("%s: tp->snd_limited too big",
__func__));
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = tp->snd_ssthresh +
maxseg *
(tp->t_dupacks - tp->snd_limited);
tp->snd_cwnd = tp->snd_ssthresh +
maxseg *
(tp->t_dupacks - tp->snd_limited);
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
goto drop;

View File

@ -1052,15 +1052,6 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, struct socket *so,
if (awnd < tp->snd_ssthresh) {
tp->snd_cwnd += tp->t_maxseg;
/*
* RFC5681 Section 3.2 talks about cwnd
* inflation on additional dupacks and
* deflation on recovering from loss.
*
* We keep cwnd into check so that
* we don't have to 'deflate' it when we
* get out of recovery.
*/
if (tp->snd_cwnd > tp->snd_ssthresh)
tp->snd_cwnd = tp->snd_ssthresh;
}
@ -1100,22 +1091,19 @@ tcp_do_slowpath(struct mbuf *m, struct tcphdr *th, struct socket *so,
TCPSTAT_INC(
tcps_sack_recovery_episode);
tp->sack_newdata = tp->snd_nxt;
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = tp->t_maxseg;
tp->snd_cwnd = tp->t_maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
goto drop;
}
tp->snd_nxt = th->th_ack;
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = tp->t_maxseg;
tp->snd_cwnd = tp->t_maxseg;
(void) tp->t_fb->tfb_tcp_output(tp);
KASSERT(tp->snd_limited <= 2,
("%s: tp->snd_limited too big",
__func__));
if (CC_ALGO(tp)->cong_signal == NULL)
tp->snd_cwnd = tp->snd_ssthresh +
tp->t_maxseg *
(tp->t_dupacks - tp->snd_limited);
tp->snd_cwnd = tp->snd_ssthresh +
tp->t_maxseg *
(tp->t_dupacks - tp->snd_limited);
if (SEQ_GT(onxt, tp->snd_nxt))
tp->snd_nxt = onxt;
goto drop;

View File

@ -76,7 +76,7 @@ name##_PCTRIE_LOOKUP(struct pctrie *ptree, uint64_t key) \
return name##_PCTRIE_VAL2PTR(pctrie_lookup(ptree, key)); \
} \
\
static __inline struct type * \
static __inline __unused struct type * \
name##_PCTRIE_LOOKUP_LE(struct pctrie *ptree, uint64_t key) \
{ \
\

View File

@ -1315,13 +1315,24 @@ vnode_pager_putpages_ioflags(int pager_flags)
return (ioflags);
}
/*
* vnode_pager_undirty_pages().
*
* A helper to mark pages as clean after pageout that was possibly
* done with a short write. The lpos argument specifies the page run
* length in bytes, and the written argument specifies how many bytes
* were actually written. eof is the offset past the last valid byte
* in the vnode using the absolute file position of the first byte in
* the run as the base from which it is computed.
*/
void
vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written)
vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written, off_t eof,
int lpos)
{
vm_object_t obj;
int i, pos;
int i, pos, pos_devb;
if (written == 0)
if (written == 0 && eof >= lpos)
return;
obj = ma[0]->object;
VM_OBJECT_WLOCK(obj);
@ -1335,6 +1346,37 @@ vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written)
vm_page_clear_dirty(ma[i], 0, written & PAGE_MASK);
}
}
if (eof >= lpos) /* avoid truncation */
goto done;
for (pos = eof, i = OFF_TO_IDX(trunc_page(pos)); pos < lpos; i++) {
if (pos != trunc_page(pos)) {
/*
* The page contains the last valid byte in
* the vnode, mark the rest of the page as
* clean, potentially making the whole page
* clean.
*/
pos_devb = roundup2(pos & PAGE_MASK, DEV_BSIZE);
vm_page_clear_dirty(ma[i], pos_devb, PAGE_SIZE -
pos_devb);
/*
* If the page was cleaned, report the pageout
* on it as successful. msync() no longer
* needs to write out the page, endlessly
* creating write requests and dirty buffers.
*/
if (ma[i]->dirty == 0)
rtvals[i] = VM_PAGER_OK;
pos = round_page(pos);
} else {
/* vm_pageout_flush() clears dirty */
rtvals[i] = VM_PAGER_BAD;
pos += PAGE_SIZE;
}
}
done:
VM_OBJECT_WUNLOCK(obj);
}

View File

@ -50,7 +50,8 @@ int vnode_pager_local_getpages_async(struct vop_getpages_async_args *ap);
int vnode_pager_putpages_ioflags(int pager_flags);
void vnode_pager_release_writecount(vm_object_t object, vm_offset_t start,
vm_offset_t end);
void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written);
void vnode_pager_undirty_pages(vm_page_t *ma, int *rtvals, int written,
off_t eof, int lpos);
void vnode_pager_update_writecount(vm_object_t object, vm_offset_t start,
vm_offset_t end);

View File

@ -166,6 +166,7 @@ struct pro {
{"sob", PRO_BOOL, false, ON, &swallow_optional_blanklines},
{"st", PRO_SPECIAL, 0, STDIN, 0},
{"ta", PRO_BOOL, false, ON, &auto_typedefs},
{"ts", PRO_INT, 8, 0, &tabsize},
{"troff", PRO_BOOL, false, ON, &troff},
{"ut", PRO_BOOL, true, ON, &use_tabs},
{"v", PRO_BOOL, false, ON, &verbose},

View File

@ -30,7 +30,7 @@
.\" @(#)indent.1 8.1 (Berkeley) 7/1/93
.\" $FreeBSD$
.\"
.Dd January 2, 2017
.Dd July 25, 2017
.Dt INDENT 1
.Os
.Sh NAME
@ -85,6 +85,7 @@
.Op Fl \&st
.Op Fl \&ta
.Op Fl troff
.Op Fl ts Ns Ar n
.Op Fl U Ns Ar file
.Op Fl ut | Fl nut
.Op Fl v | Fl \&nv
@ -459,13 +460,15 @@ listing in much the same spirit as
.Xr vgrind 1 .
If the output file is not specified, the default is standard output,
rather than formatting in place.
.It Fl ts Ns Ar n
Assumed distance between tab stops.
The default is 8.
.It Fl U Ns Ar file
Adds type names from
.Ar file
to the list of type keywords.
.It Fl ut , nut
Enables (disables) the use of tab characters in the output.
Tabs are assumed to be aligned on columns divisible by 8.
The default is
.Fl ut .
.It Fl v , \&nv

View File

@ -292,7 +292,7 @@ main(int argc, char **argv)
if (*p == ' ')
col++;
else if (*p == '\t')
col = ((col - 1) & ~7) + 9;
col = tabsize * (1 + (col - 1) / tabsize) + 1;
else
break;
p++;
@ -1050,7 +1050,7 @@ main(int argc, char **argv)
if (ps.p_l_follow == 0) {
if (ps.block_init_level <= 0)
ps.block_init = 0;
if (break_comma && (!ps.leave_comma || compute_code_target() + (e_code - s_code) > max_col - 8))
if (break_comma && (!ps.leave_comma || compute_code_target() + (e_code - s_code) > max_col - tabsize))
force_nl = true;
}
break;
@ -1267,18 +1267,21 @@ indent_declaration(int cur_dec_ind, int tabs_to_var)
char *startpos = e_code;
/*
* get the tab math right for indentations that are not multiples of 8
* get the tab math right for indentations that are not multiples of tabsize
*/
if ((ps.ind_level * ps.ind_size) % 8 != 0) {
pos += (ps.ind_level * ps.ind_size) % 8;
cur_dec_ind += (ps.ind_level * ps.ind_size) % 8;
if ((ps.ind_level * ps.ind_size) % tabsize != 0) {
pos += (ps.ind_level * ps.ind_size) % tabsize;
cur_dec_ind += (ps.ind_level * ps.ind_size) % tabsize;
}
if (tabs_to_var)
while ((pos & ~7) + 8 <= cur_dec_ind) {
if (tabs_to_var) {
int tpos;
while ((tpos = tabsize * (1 + pos / tabsize)) <= cur_dec_ind) {
CHECK_SIZE_CODE;
*e_code++ = '\t';
pos = (pos & ~7) + 8;
pos = tpos;
}
}
while (pos < cur_dec_ind) {
CHECK_SIZE_CODE;
*e_code++ = ' ';

View File

@ -42,10 +42,6 @@
#define label_offset 2 /* number of levels a label is placed to left
* of code */
#define tabsize 8 /* the size of a tab */
#define tabmask 0177770 /* mask used when figuring length of lines
* with tabs */
#define false 0
#define true 1
@ -213,6 +209,7 @@ int use_tabs; /* set true to use tabs for spacing,
int auto_typedefs; /* set true to recognize identifiers
* ending in "_t" like typedefs */
int space_after_cast; /* "b = (int) a" vs "b = (int)a" */
int tabsize; /* the size of a tab */
/* -troff font state information */

View File

@ -227,12 +227,12 @@ dump_line(void)
target += ps.comment_delta;
while (*com_st == '\t') /* consider original indentation in
* case this is a box comment */
com_st++, target += 8;
com_st++, target += tabsize;
while (target <= 0)
if (*com_st == ' ')
target++, com_st++;
else if (*com_st == '\t')
target = ((target - 1) & ~7) + 9, com_st++;
target = tabsize * (1 + (target - 1) / tabsize) + 1, com_st++;
else
target = 1;
if (cur_col > target) { /* if comment can't fit on this line,
@ -458,17 +458,19 @@ pad_output(int current, int target)
/* current: the current column value */
/* target: position we want it at */
{
int curr; /* internal column pointer */
int tcur;
if (troff)
fprintf(output, "\\h'|%dp'", (target - 1) * 7);
else {
int curr; /* internal column pointer */
if (current >= target)
return (current); /* line is already long enough */
curr = current;
if (use_tabs) {
while ((tcur = ((curr - 1) & tabmask) + tabsize + 1) <= target) {
int tcur;
while ((tcur = tabsize * (1 + (curr - 1) / tabsize) + 1) <= target) {
putc('\t', output);
curr = tcur;
}
@ -517,7 +519,7 @@ count_spaces_until(int cur, char *buffer, char *end)
break;
case '\t':
cur = ((cur - 1) & tabmask) + tabsize + 1;
cur = tabsize * (1 + (cur - 1) / tabsize) + 1;
break;
case 010: /* backspace */

View File

@ -142,7 +142,7 @@ pr_comment(void)
}
ps.com_col = ps.decl_on_line || ps.ind_level == 0 ? ps.decl_com_ind : ps.com_ind;
if (ps.com_col <= target_col)
ps.com_col = ((target_col + 7) & ~7) + 1;
ps.com_col = tabsize * (1 + (target_col - 1) / tabsize) + 1;
if (ps.com_col + 24 > adj_max_col)
adj_max_col = ps.com_col + 24;
}

View File

@ -607,8 +607,6 @@ static struct syscall decoded_syscalls[] = {
.args = { { Ptr, 0 }, { CloudABIMFlags, 1 } } },
{ .name = "cloudabi_sys_mem_advise", .ret_type = 1, .nargs = 3,
.args = { { Ptr, 0 }, { Int, 1 }, { CloudABIAdvice, 2 } } },
{ .name = "cloudabi_sys_mem_lock", .ret_type = 1, .nargs = 2,
.args = { { Ptr, 0 }, { Int, 1 } } },
{ .name = "cloudabi_sys_mem_map", .ret_type = 1, .nargs = 6,
.args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMProt, 2 },
{ CloudABIMFlags, 3 }, { Int, 4 }, { Int, 5 } } },
@ -616,8 +614,6 @@ static struct syscall decoded_syscalls[] = {
.args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMProt, 2 } } },
{ .name = "cloudabi_sys_mem_sync", .ret_type = 1, .nargs = 3,
.args = { { Ptr, 0 }, { Int, 1 }, { CloudABIMSFlags, 2 } } },
{ .name = "cloudabi_sys_mem_unlock", .ret_type = 1, .nargs = 2,
.args = { { Ptr, 0 }, { Int, 1 } } },
{ .name = "cloudabi_sys_mem_unmap", .ret_type = 1, .nargs = 2,
.args = { { Ptr, 0 }, { Int, 1 } } },
{ .name = "cloudabi_sys_proc_exec", .ret_type = 1, .nargs = 5,
@ -796,8 +792,8 @@ static struct xlat cloudabi_filetype[] = {
X(FILETYPE_CHARACTER_DEVICE) X(FILETYPE_DIRECTORY)
X(FILETYPE_FIFO) X(FILETYPE_POLL) X(FILETYPE_PROCESS)
X(FILETYPE_REGULAR_FILE) X(FILETYPE_SHARED_MEMORY)
X(FILETYPE_SOCKET_DGRAM) X(FILETYPE_SOCKET_SEQPACKET)
X(FILETYPE_SOCKET_STREAM) X(FILETYPE_SYMBOLIC_LINK)
X(FILETYPE_SOCKET_DGRAM) X(FILETYPE_SOCKET_STREAM)
X(FILETYPE_SYMBOLIC_LINK)
XEND
};
@ -827,11 +823,6 @@ static struct xlat cloudabi_oflags[] = {
XEND
};
static struct xlat cloudabi_sa_family[] = {
X(AF_UNSPEC) X(AF_INET) X(AF_INET6) X(AF_UNIX)
XEND
};
static struct xlat cloudabi_sdflags[] = {
X(SHUT_RD) X(SHUT_WR)
XEND
@ -2279,10 +2270,6 @@ print_arg(struct syscall_args *sc, unsigned long *args, long *retval,
cloudabi_sockstat_t ss;
if (get_struct(pid, (void *)args[sc->offset], &ss, sizeof(ss))
!= -1) {
fprintf(fp, "{ %s, ", xlookup(
cloudabi_sa_family, ss.ss_sockname.sa_family));
fprintf(fp, "%s, ", xlookup(
cloudabi_sa_family, ss.ss_peername.sa_family));
fprintf(fp, "%s, ", xlookup(
cloudabi_errno, ss.ss_error));
fprintf(fp, "%s }", xlookup_bits(