Merge ^/head r357966 through r357999.

This commit is contained in:
Dimitry Andric 2020-02-16 13:23:54 +00:00
commit b33a8b3822
140 changed files with 1092 additions and 357 deletions

View File

@ -63,6 +63,7 @@ int pthread_mutex_setyieldloops_np(pthread_mutex_t *mutex, int count);
int pthread_mutex_isowned_np(pthread_mutex_t *mutex);
void pthread_resume_all_np(void);
int pthread_resume_np(pthread_t);
int pthread_peekjoin_np(pthread_t, void **);
void pthread_set_name_np(pthread_t, const char *);
int pthread_setaffinity_np(pthread_t, size_t, const cpuset_t *);
int pthread_single_np(void);

View File

@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <inttypes.h>
#include <netdb.h>
#include <poll.h>
#include <pwd.h>
@ -74,6 +75,64 @@ static struct fetcherr netdb_errlist[] = {
{ -1, FETCH_UNKNOWN, "Unknown resolver error" }
};
/*
* SOCKS5 error enumerations
*/
enum SOCKS5_ERR {
/* Protocol errors */
SOCKS5_ERR_SELECTION,
SOCKS5_ERR_READ_METHOD,
SOCKS5_ERR_VER5_ONLY,
SOCKS5_ERR_NOMETHODS,
SOCKS5_ERR_NOTIMPLEMENTED,
SOCKS5_ERR_HOSTNAME_SIZE,
SOCKS5_ERR_REQUEST,
SOCKS5_ERR_REPLY,
SOCKS5_ERR_NON_VER5_RESP,
SOCKS5_ERR_GENERAL,
SOCKS5_ERR_NOT_ALLOWED,
SOCKS5_ERR_NET_UNREACHABLE,
SOCKS5_ERR_HOST_UNREACHABLE,
SOCKS5_ERR_CONN_REFUSED,
SOCKS5_ERR_TTL_EXPIRED,
SOCKS5_ERR_COM_UNSUPPORTED,
SOCKS5_ERR_ADDR_UNSUPPORTED,
SOCKS5_ERR_UNSPECIFIED,
/* Configuration errors */
SOCKS5_ERR_BAD_HOST,
SOCKS5_ERR_BAD_PROXY_FORMAT,
SOCKS5_ERR_BAD_PORT
};
/*
* Error messages for SOCKS5 errors
*/
static struct fetcherr socks5_errlist[] = {
/* SOCKS5 protocol errors */
{ SOCKS5_ERR_SELECTION, FETCH_ABORT, "SOCKS5: Failed to send selection method" },
{ SOCKS5_ERR_READ_METHOD, FETCH_ABORT, "SOCKS5: Failed to read method" },
{ SOCKS5_ERR_VER5_ONLY, FETCH_PROTO, "SOCKS5: Only version 5 is implemented" },
{ SOCKS5_ERR_NOMETHODS, FETCH_PROTO, "SOCKS5: No acceptable methods" },
{ SOCKS5_ERR_NOTIMPLEMENTED, FETCH_PROTO, "SOCKS5: Method currently not implemented" },
{ SOCKS5_ERR_HOSTNAME_SIZE, FETCH_PROTO, "SOCKS5: Hostname size is above 256 bytes" },
{ SOCKS5_ERR_REQUEST, FETCH_PROTO, "SOCKS5: Failed to request" },
{ SOCKS5_ERR_REPLY, FETCH_PROTO, "SOCKS5: Failed to receive reply" },
{ SOCKS5_ERR_NON_VER5_RESP, FETCH_PROTO, "SOCKS5: Server responded with a non-version 5 response" },
{ SOCKS5_ERR_GENERAL, FETCH_ABORT, "SOCKS5: General server failure" },
{ SOCKS5_ERR_NOT_ALLOWED, FETCH_AUTH, "SOCKS5: Connection not allowed by ruleset" },
{ SOCKS5_ERR_NET_UNREACHABLE, FETCH_NETWORK, "SOCKS5: Network unreachable" },
{ SOCKS5_ERR_HOST_UNREACHABLE, FETCH_ABORT, "SOCKS5: Host unreachable" },
{ SOCKS5_ERR_CONN_REFUSED, FETCH_ABORT, "SOCKS5: Connection refused" },
{ SOCKS5_ERR_TTL_EXPIRED, FETCH_TIMEOUT, "SOCKS5: TTL expired" },
{ SOCKS5_ERR_COM_UNSUPPORTED, FETCH_PROTO, "SOCKS5: Command not supported" },
{ SOCKS5_ERR_ADDR_UNSUPPORTED, FETCH_ABORT, "SOCKS5: Address type not supported" },
{ SOCKS5_ERR_UNSPECIFIED, FETCH_UNKNOWN, "SOCKS5: Unspecified error" },
/* Configuration error */
{ SOCKS5_ERR_BAD_HOST, FETCH_ABORT, "SOCKS5: Bad proxy host" },
{ SOCKS5_ERR_BAD_PROXY_FORMAT, FETCH_ABORT, "SOCKS5: Bad proxy format" },
{ SOCKS5_ERR_BAD_PORT, FETCH_ABORT, "SOCKS5: Bad port" }
};
/* End-of-Line */
static const char ENDL[2] = "\r\n";
@ -314,7 +373,6 @@ fetch_resolve(const char *addr, int port, int af)
}
/*
* Bind a socket to a specific local address
*/
@ -336,6 +394,192 @@ fetch_bind(int sd, int af, const char *addr)
}
/*
* SOCKS5 connection initiation, based on RFC 1928
* Default DNS resolution over SOCKS5
*/
int
fetch_socks5_init(conn_t *conn, const char *host, int port, int verbose)
{
/*
* Size is based on largest packet prefix (4 bytes) +
* Largest FQDN (256) + one byte size (1) +
* Port (2)
*/
unsigned char buf[BUFF_SIZE];
unsigned char *ptr;
int ret = 1;
if (verbose)
fetch_info("Initializing SOCKS5 connection: %s:%d", host, port);
/* Connection initialization */
ptr = buf;
*ptr++ = SOCKS_VERSION_5;
*ptr++ = SOCKS_CONNECTION;
*ptr++ = SOCKS_RSV;
if (fetch_write(conn, buf, 3) != 3) {
ret = SOCKS5_ERR_SELECTION;
goto fail;
}
/* Verify response from SOCKS5 server */
if (fetch_read(conn, buf, 2) != 2) {
ret = SOCKS5_ERR_READ_METHOD;
goto fail;
}
ptr = buf;
if (ptr[0] != SOCKS_VERSION_5) {
ret = SOCKS5_ERR_VER5_ONLY;
goto fail;
}
if (ptr[1] == SOCKS_NOMETHODS) {
ret = SOCKS5_ERR_NOMETHODS;
goto fail;
}
else if (ptr[1] != SOCKS5_NOTIMPLEMENTED) {
ret = SOCKS5_ERR_NOTIMPLEMENTED;
goto fail;
}
/* Send Request */
*ptr++ = SOCKS_VERSION_5;
*ptr++ = SOCKS_CONNECTION;
*ptr++ = SOCKS_RSV;
/* Encode all targets as a hostname to avoid DNS leaks */
*ptr++ = SOCKS_ATYP_DOMAINNAME;
if (strlen(host) > FQDN_SIZE) {
ret = SOCKS5_ERR_HOSTNAME_SIZE;
goto fail;
}
*ptr++ = strlen(host);
strncpy(ptr, host, strlen(host));
ptr = ptr + strlen(host);
port = htons(port);
*ptr++ = port & 0x00ff;
*ptr++ = (port & 0xff00) >> 8;
if (fetch_write(conn, buf, ptr - buf) != ptr - buf) {
ret = SOCKS5_ERR_REQUEST;
goto fail;
}
/* BND.ADDR is variable length, read the largest on non-blocking socket */
if (!fetch_read(conn, buf, BUFF_SIZE)) {
ret = SOCKS5_ERR_REPLY;
goto fail;
}
ptr = buf;
if (*ptr++ != SOCKS_VERSION_5) {
ret = SOCKS5_ERR_NON_VER5_RESP;
goto fail;
}
switch(*ptr++) {
case SOCKS_SUCCESS:
break;
case SOCKS_GENERAL_FAILURE:
ret = SOCKS5_ERR_GENERAL;
goto fail;
case SOCKS_CONNECTION_NOT_ALLOWED:
ret = SOCKS5_ERR_NOT_ALLOWED;
goto fail;
case SOCKS_NETWORK_UNREACHABLE:
ret = SOCKS5_ERR_NET_UNREACHABLE;
goto fail;
case SOCKS_HOST_UNREACHABLE:
ret = SOCKS5_ERR_HOST_UNREACHABLE;
goto fail;
case SOCKS_CONNECTION_REFUSED:
ret = SOCKS5_ERR_CONN_REFUSED;
goto fail;
case SOCKS_TTL_EXPIRED:
ret = SOCKS5_ERR_TTL_EXPIRED;
goto fail;
case SOCKS_COMMAND_NOT_SUPPORTED:
ret = SOCKS5_ERR_COM_UNSUPPORTED;
goto fail;
case SOCKS_ADDRESS_NOT_SUPPORTED:
ret = SOCKS5_ERR_ADDR_UNSUPPORTED;
goto fail;
default:
ret = SOCKS5_ERR_UNSPECIFIED;
goto fail;
}
return (ret);
fail:
socks5_seterr(ret);
return (0);
}
/*
* Perform SOCKS5 initialization
*/
int
fetch_socks5_getenv(char **host, int *port)
{
char *socks5env, *endptr, *ext;
const char *portDelim;
size_t slen;
portDelim = ":";
if ((socks5env = getenv("SOCKS5_PROXY")) == NULL || *socks5env == '\0') {
*host = NULL;
*port = -1;
return (-1);
}
/*
* IPv6 addresses begin and end in brackets. Set the port delimiter
* accordingly and search for it so we can do appropriate validation.
*/
if (socks5env[0] == '[')
portDelim = "]:";
slen = strlen(socks5env);
ext = strstr(socks5env, portDelim);
if (socks5env[0] == '[') {
if (socks5env[slen - 1] == ']') {
*host = strndup(socks5env, slen);
} else if (ext != NULL) {
*host = strndup(socks5env, ext - socks5env + 1);
} else {
socks5_seterr(SOCKS5_ERR_BAD_PROXY_FORMAT);
return (0);
}
} else {
*host = strndup(socks5env, ext - socks5env);
}
if (*host == NULL) {
fprintf(stderr, "Failure to allocate memory, exiting.\n");
return (-1);
}
if (ext == NULL) {
*port = 1080; /* Default port as defined in RFC1928 */
} else {
ext += strlen(portDelim);
errno = 0;
*port = strtoimax(ext, (char **)&endptr, 10);
if (*endptr != '\0' || errno != 0 || *port < 0 ||
*port > 65535) {
free(*host);
*host = NULL;
socks5_seterr(SOCKS5_ERR_BAD_PORT);
return (0);
}
}
return (2);
}
/*
* Establish a TCP connection to the specified port on the specified host.
*/
@ -346,22 +590,46 @@ fetch_connect(const char *host, int port, int af, int verbose)
const char *bindaddr;
conn_t *conn = NULL;
int err = 0, sd = -1;
char *sockshost;
int socksport;
DEBUGF("---> %s:%d\n", host, port);
/* resolve server address */
if (verbose)
fetch_info("resolving server address: %s:%d", host, port);
if ((sais = fetch_resolve(host, port, af)) == NULL)
/*
* Check if SOCKS5_PROXY env variable is set. fetch_socks5_getenv
* will either set sockshost = NULL or allocate memory in all cases.
*/
sockshost = NULL;
if (!fetch_socks5_getenv(&sockshost, &socksport))
goto fail;
/* resolve client address */
bindaddr = getenv("FETCH_BIND_ADDRESS");
if (bindaddr != NULL && *bindaddr != '\0') {
/* Not using SOCKS5 proxy */
if (sockshost == NULL) {
/* resolve server address */
if (verbose)
fetch_info("resolving client address: %s", bindaddr);
if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
fetch_info("resolving server address: %s:%d", host,
port);
if ((sais = fetch_resolve(host, port, af)) == NULL)
goto fail;
/* resolve client address */
bindaddr = getenv("FETCH_BIND_ADDRESS");
if (bindaddr != NULL && *bindaddr != '\0') {
if (verbose)
fetch_info("resolving client address: %s",
bindaddr);
if ((cais = fetch_resolve(bindaddr, 0, af)) == NULL)
goto fail;
}
} else {
/* resolve socks5 proxy address */
if (verbose)
fetch_info("resolving SOCKS5 server address: %s:%d",
sockshost, socksport);
if ((sais = fetch_resolve(sockshost, socksport, af)) == NULL) {
socks5_seterr(SOCKS5_ERR_BAD_HOST);
goto fail;
}
}
/* try each server address in turn */
@ -389,13 +657,26 @@ fetch_connect(const char *host, int port, int af, int verbose)
sd = -1;
}
if (err != 0) {
if (verbose)
if (verbose && sockshost == NULL) {
fetch_info("failed to connect to %s:%d", host, port);
goto syserr;
} else if (sockshost != NULL) {
if (verbose)
fetch_info(
"failed to connect to SOCKS5 server %s:%d",
sockshost, socksport);
socks5_seterr(SOCKS5_ERR_CONN_REFUSED);
goto fail;
}
goto syserr;
}
if ((conn = fetch_reopen(sd)) == NULL)
goto syserr;
if (sockshost)
if (!fetch_socks5_init(conn, host, port, verbose))
goto fail;
if (cais != NULL)
freeaddrinfo(cais);
if (sais != NULL)
@ -403,8 +684,8 @@ fetch_connect(const char *host, int port, int af, int verbose)
return (conn);
syserr:
fetch_syserr();
goto fail;
fail:
free(sockshost);
if (sd >= 0)
close(sd);
if (cais != NULL)

View File

@ -70,12 +70,47 @@ struct fetcherr {
const char *string;
};
/* For SOCKS header size */
#define HEAD_SIZE 4
#define FQDN_SIZE 256
#define PACK_SIZE 1
#define PORT_SIZE 2
#define BUFF_SIZE HEAD_SIZE + FQDN_SIZE + PACK_SIZE + PORT_SIZE
/* SOCKS5 Request Header */
#define SOCKS_VERSION_5 0x05
/* SOCKS5 CMD */
#define SOCKS_CONNECTION 0x01
#define SOCKS_BIND 0x02
#define SOCKS_UDP 0x03
#define SOCKS_NOMETHODS 0xFF
#define SOCKS5_NOTIMPLEMENTED 0x00
/* SOCKS5 Reserved */
#define SOCKS_RSV 0x00
/* SOCKS5 Address Type */
#define SOCKS_ATYP_IPV4 0x01
#define SOCKS_ATYP_DOMAINNAME 0x03
#define SOCKS_ATYP_IPV6 0x04
/* SOCKS5 Reply Field */
#define SOCKS_SUCCESS 0x00
#define SOCKS_GENERAL_FAILURE 0x01
#define SOCKS_CONNECTION_NOT_ALLOWED 0x02
#define SOCKS_NETWORK_UNREACHABLE 0x03
#define SOCKS_HOST_UNREACHABLE 0x04
#define SOCKS_CONNECTION_REFUSED 0x05
#define SOCKS_TTL_EXPIRED 0x06
#define SOCKS_COMMAND_NOT_SUPPORTED 0x07
#define SOCKS_ADDRESS_NOT_SUPPORTED 0x08
/* for fetch_writev */
struct iovec;
void fetch_seterr(struct fetcherr *, int);
void fetch_syserr(void);
void fetch_info(const char *, ...) __printflike(1, 2);
int fetch_socks5_getenv(char **host, int *port);
int fetch_socks5_init(conn_t *conn, const char *host,
int port, int verbose);
int fetch_default_port(const char *);
int fetch_default_proxy_port(const char *);
struct addrinfo *fetch_resolve(const char *, int, int);
@ -102,6 +137,7 @@ int fetch_no_proxy_match(const char *);
#define http_seterr(n) fetch_seterr(http_errlist, n)
#define netdb_seterr(n) fetch_seterr(netdb_errlist, n)
#define url_seterr(n) fetch_seterr(url_errlist, n)
#define socks5_seterr(n) fetch_seterr(socks5_errlist, n)
#ifndef NDEBUG
#define DEBUGF(...) \

View File

@ -668,6 +668,13 @@ which proxies should not be used.
Same as
.Ev NO_PROXY ,
for compatibility.
.It Ev SOCKS5_PROXY
Uses SOCKS version 5 to make connection.
The format must be the IP or hostname followed by a colon for the port.
IPv6 addresses must enclose the address in brackets.
If no port is specified, the default is 1080.
This setting will supercede a connection to an
.Ev HTTP_PROXY .
.It Ev SSL_ALLOW_SSL3
Allow SSL version 3 when negotiating the connection (not recommended).
.It Ev SSL_CA_CERT_FILE
@ -726,6 +733,21 @@ as follows:
NO_PROXY=localhost,127.0.0.1
.Ed
.Pp
To use a SOCKS5 proxy, set the
.Ev SOCKS5_PROXY
environment variable to a
valid host or IP followed by an optional colon and the port.
IPv6 addresses must be enclosed in brackets.
The following are examples of valid settings:
.Bd -literal -offset indent
SOCKS5_PROXY=proxy.example.com
SOCKS5_PROXY=proxy.example.com:1080
SOCKS5_PROXY=192.0.2.0
SOCKS5_PROXY=198.51.100.0:1080
SOCKS5_PROXY=[2001:db8::1]
SOCKS5_PROXY=[2001:db8::2]:1080
.Ed
.Pp
Access HTTPS website without any certificate verification whatsoever:
.Bd -literal -offset indent
SSL_NO_VERIFY_PEER=1

View File

@ -326,3 +326,7 @@ FBSD_1.4 {
FBSD_1.5 {
pthread_get_name_np;
};
FBSD_1.6 {
pthread_peekjoin_np;
};

View File

@ -36,13 +36,15 @@ __FBSDID("$FreeBSD$");
#include "thr_private.h"
int _pthread_peekjoin_np(pthread_t pthread, void **thread_return);
int _pthread_timedjoin_np(pthread_t pthread, void **thread_return,
const struct timespec *abstime);
static int join_common(pthread_t, void **, const struct timespec *);
const struct timespec *abstime);
static int join_common(pthread_t, void **, const struct timespec *, bool peek);
__weak_reference(_thr_join, pthread_join);
__weak_reference(_thr_join, _pthread_join);
__weak_reference(_pthread_timedjoin_np, pthread_timedjoin_np);
__weak_reference(_pthread_peekjoin_np, pthread_peekjoin_np);
static void backout_join(void *arg)
{
@ -57,7 +59,7 @@ static void backout_join(void *arg)
int
_thr_join(pthread_t pthread, void **thread_return)
{
return (join_common(pthread, thread_return, NULL));
return (join_common(pthread, thread_return, NULL, false));
}
int
@ -68,7 +70,13 @@ _pthread_timedjoin_np(pthread_t pthread, void **thread_return,
abstime->tv_nsec >= 1000000000)
return (EINVAL);
return (join_common(pthread, thread_return, abstime));
return (join_common(pthread, thread_return, abstime, false));
}
int
_pthread_peekjoin_np(pthread_t pthread, void **thread_return)
{
return (join_common(pthread, thread_return, NULL, true));
}
/*
@ -77,13 +85,13 @@ _pthread_timedjoin_np(pthread_t pthread, void **thread_return,
*/
static int
join_common(pthread_t pthread, void **thread_return,
const struct timespec *abstime)
const struct timespec *abstime, bool peek)
{
struct pthread *curthread = _get_curthread();
struct timespec ts, ts2, *tsp;
void *tmp;
long tid;
int ret = 0;
int ret;
if (pthread == NULL)
return (EINVAL);
@ -100,10 +108,21 @@ join_common(pthread_t pthread, void **thread_return,
/* Multiple joiners are not supported. */
ret = ENOTSUP;
}
if (ret) {
if (ret != 0) {
THR_THREAD_UNLOCK(curthread, pthread);
return (ret);
}
/* Only peek into status, do not gc the thread. */
if (peek) {
if (pthread->tid != TID_TERMINATED)
ret = EBUSY;
else if (thread_return != NULL)
*thread_return = pthread->ret;
THR_THREAD_UNLOCK(curthread, pthread);
return (ret);
}
/* Set the running thread to be the joiner: */
pthread->joiner = curthread;

View File

@ -238,6 +238,7 @@ static long npackets; /* max packets to transmit */
static long nreceived; /* # of packets we got back */
static long nrepeats; /* number of duplicates */
static long ntransmitted; /* sequence # for outbound packets = #sent */
static long ntransmitfailures; /* number of transmit failures */
static int interval = 1000; /* interval between packets in ms */
static int waittime = MAXWAIT; /* timeout for each packet */
static long nrcvtimeout = 0; /* # of packets we got back after waittime */
@ -1256,7 +1257,12 @@ main(int argc, char *argv[])
if(packet != NULL)
free(packet);
exit(nreceived == 0 ? 2 : 0);
if (nreceived > 0)
exit(0);
else if (ntransmitted > ntransmitfailures)
exit(2);
else
exit(EX_OSERR);
}
static void
@ -1423,8 +1429,10 @@ pinger(void)
i = sendmsg(ssend, &smsghdr, 0);
if (i < 0 || i != cc) {
if (i < 0)
if (i < 0) {
ntransmitfailures++;
warn("sendmsg");
}
(void)printf("ping6: wrote %s %d chars, ret=%d\n",
hostname, cc, i);
}

View File

@ -500,7 +500,8 @@ PTHREAD_MLINKS+=pthread_spin_init.3 pthread_spin_destroy.3 \
PTHREAD_MLINKS+=pthread_switch_add_np.3 pthread_switch_delete_np.3
PTHREAD_MLINKS+=pthread_testcancel.3 pthread_setcancelstate.3 \
pthread_testcancel.3 pthread_setcanceltype.3
PTHREAD_MLINKS+=pthread_join.3 pthread_timedjoin_np.3
PTHREAD_MLINKS+=pthread_join.3 pthread_peekjoin_np.3 \
pthread_join.3 pthread_timedjoin_np.3
.endif
.include <bsd.prog.mk>

View File

@ -30,13 +30,14 @@
.\"
.\" $FreeBSD$
.\"
.Dd February 3, 2018
.Dd February 13, 2019
.Dt PTHREAD_JOIN 3
.Os
.Sh NAME
.Nm pthread_join ,
.Nm pthread_peekjoin_np ,
.Nm pthread_timedjoin_np
.Nd wait for thread termination
.Nd inspect thread termination state
.Sh LIBRARY
.Lb libpthread
.Sh SYNOPSIS
@ -45,7 +46,16 @@
.Fn pthread_join "pthread_t thread" "void **value_ptr"
.In pthread_np.h
.Ft int
.Fn pthread_timedjoin_np "pthread_t thread" "void **value_ptr" "const struct timespec *abstime"
.Fo pthread_peekjoin_np
.Fa "pthread_t thread"
.Fa "void **value_ptr"
.Fc
.Ft int
.Fo pthread_timedjoin_np
.Fa "pthread_t thread"
.Fa "void **value_ptr"
.Fa "const struct timespec *abstime"
.Fc
.Sh DESCRIPTION
The
.Fn pthread_join
@ -82,19 +92,30 @@ function except it will return
.Er ETIMEDOUT
if target thread does not exit before specified absolute time passes.
.Pp
The
.Fn pthread_peekjoin_np
only peeks into the exit status of the specified thread.
If the thread has not exited, the
.Er EBUSY
error is returned.
Otherwise, zero is returned and the thread exit value is optionally stored
into the location of
.Fa *value_ptr .
The target thread is left unjoined and can be used as an argument for
the
.Fn pthread_join
family of functions again.
.Pp
A thread that has exited but remains unjoined counts against
[_POSIX_THREAD_THREADS_MAX].
.Sh RETURN VALUES
If successful, the
.Fn pthread_join
and
.Fn pthread_timedjoin_np
functions will return zero.
Otherwise an error number will be returned to
indicate the error.
If successful, the described functions return zero.
Otherwise an error number is returned to indicate the error or
special condition.
.Sh ERRORS
The
.Fn pthread_join
.Fn pthread_join ,
.Fn pthread_peekjoin_np ,
and
.Fn pthread_timedjoin_np
functions will fail if:
@ -125,6 +146,14 @@ The specified absolute time passed while
.Fn pthread_timedjoin_np
waited for thread exit.
.El
.Pp
The
.Fn pthread_peekjoin_np
function will also fail if:
.Bl -tag -width Er
.It Bq Er EBUSY
The specified thread has not yet exited.
.El
.Sh SEE ALSO
.Xr wait 2 ,
.Xr pthread_create 3
@ -139,3 +168,7 @@ function is a
.Fx
extension which first appeared in
.Fx 6.1 .
Another extension, the
.Fn pthread_peekjoin_np
function, first appearead in
.Fx 13.0 .

View File

@ -49,6 +49,8 @@
.Fn mallocarray "size_t nmemb" "size_t size" "struct malloc_type *type" "int flags"
.Ft void
.Fn free "void *addr" "struct malloc_type *type"
.Ft void
.Fn zfree "void *addr" "struct malloc_type *type"
.Ft void *
.Fn realloc "void *addr" "size_t size" "struct malloc_type *type" "int flags"
.Ft void *
@ -106,6 +108,19 @@ then
.Fn free
does nothing.
.Pp
Like
.Fn free ,
the
.Fn zfree
function releases memory at address
.Fa addr
that was previously allocated by
.Fn malloc
for re-use.
However,
.Fn zfree
will zero the memory before it is released.
.Pp
The
.Fn realloc
function changes the size of the previously allocated memory referenced by

View File

@ -155,6 +155,7 @@ jylefort [label="Jean-Yves Lefort\njylefort@FreeBSD.org\n2005/04/12"]
kai [label="Kai Knoblich\nkai@FreeBSD.org\n2019/02/01"]
kami [label="Dominic Fandrey\nkami@FreeBSD.org\n2014/09/09"]
kbowling [label="Kevin Bowling\nkbowling@FreeBSD.org\n2018/09/02"]
kevans [label="Kyle Evans\nkevans@FreeBSD.org\n2020/02/14"]
kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2003/02/21"]
kmoore [label="Kris Moore\nkmoore@FreeBSD.org\n2009/04/14"]
knu [label="Akinori Musha\nknu@FreeBSD.org\n2000/03/22"]
@ -339,6 +340,7 @@ bapt -> ericbsd
bapt -> grembo
bapt -> jbeich
bapt -> jlaffaye
bapt -> kevans
bapt -> manu
bapt -> marius
bapt -> marino
@ -503,6 +505,7 @@ knu -> nork
koobs -> brnrd
koobs -> kami
koobs -> kevans
koobs -> woodsb02
koobs -> xmj

View File

@ -58,7 +58,8 @@ __FBSDID("$FreeBSD$");
#include "amdvi_priv.h"
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, amdvi, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
#define MOD_INC(a, s, m) (((a) + (s)) % ((m) * (s)))
#define MOD_DEC(a, s, m) (((a) - (s)) % ((m) * (s)))
@ -947,16 +948,16 @@ amdvi_add_sysctl(struct amdvi_softc *softc)
SYSCTL_ADD_U16(ctx, child, OID_AUTO, "end_dev_rid", CTLFLAG_RD,
&softc->end_dev_rid, 0, "End of device under this IOMMU");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_head",
CTLTYPE_UINT | CTLFLAG_RD, softc, 0,
CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 0,
amdvi_handle_sysctl, "IU", "Command head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "command_tail",
CTLTYPE_UINT | CTLFLAG_RD, softc, 1,
CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 1,
amdvi_handle_sysctl, "IU", "Command tail");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "event_head",
CTLTYPE_UINT | CTLFLAG_RD, softc, 2,
CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 2,
amdvi_handle_sysctl, "IU", "Command head");
SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "event_tail",
CTLTYPE_UINT | CTLFLAG_RD, softc, 3,
CTLTYPE_UINT | CTLFLAG_RD | CTLFLAG_MPSAFE, softc, 3,
amdvi_handle_sysctl, "IU", "Command tail");
}

View File

@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$");
#include "npt.h"
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, npt, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, npt, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
static int npt_flags;
SYSCTL_INT(_hw_vmm_npt, OID_AUTO, pmap_flags, CTLFLAG_RD,

View File

@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$");
#include "npt.h"
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, svm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
/*
* SVM CPUID function 0x8000_000A, edx bit decoding.

View File

@ -68,7 +68,8 @@ __FBSDID("$FreeBSD$");
#define EPT_ENABLE_AD_BITS (1 << 6)
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, ept, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, ept, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
static int ept_enable_ad_bits;

View File

@ -123,7 +123,8 @@ static MALLOC_DEFINE(M_VMX, "vmx", "vmx");
static MALLOC_DEFINE(M_VLAPIC, "vlapic", "vlapic");
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, vmx, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
int vmxon_enabled[MAXCPU];
static char vmxon_region[MAXCPU][PAGE_SIZE] __aligned(PAGE_SIZE);
@ -150,7 +151,9 @@ SYSCTL_INT(_hw_vmm_vmx, OID_AUTO, initialized, CTLFLAG_RD,
/*
* Optional capabilities
*/
static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap, CTLFLAG_RW, NULL, NULL);
static SYSCTL_NODE(_hw_vmm_vmx, OID_AUTO, cap,
CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
static int cap_halt_exit;
SYSCTL_INT(_hw_vmm_vmx_cap, OID_AUTO, halt_exit, CTLFLAG_RD, &cap_halt_exit, 0,

View File

@ -48,7 +48,8 @@ __FBSDID("$FreeBSD$");
#include "iommu.h"
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW, 0, "bhyve iommu parameters");
SYSCTL_NODE(_hw_vmm, OID_AUTO, iommu, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"bhyve iommu parameters");
static int iommu_avail;
SYSCTL_INT(_hw_vmm_iommu, OID_AUTO, initialized, CTLFLAG_RD, &iommu_avail,

View File

@ -112,7 +112,8 @@ struct pptdev {
};
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW, 0, "bhyve passthru devices");
SYSCTL_NODE(_hw_vmm, OID_AUTO, ppt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"bhyve passthru devices");
static int num_pptdevs;
SYSCTL_INT(_hw_vmm_ppt, OID_AUTO, devices, CTLFLAG_RD, &num_pptdevs, 0,

View File

@ -106,7 +106,8 @@ static void vrtc_set_reg_c(struct vrtc *vrtc, uint8_t newval);
static MALLOC_DEFINE(M_VRTC, "vrtc", "bhyve virtual rtc");
SYSCTL_DECL(_hw_vmm);
SYSCTL_NODE(_hw_vmm, OID_AUTO, vrtc, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw_vmm, OID_AUTO, vrtc, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
static int rtc_flag_broken_time = 1;
SYSCTL_INT(_hw_vmm_vrtc, OID_AUTO, flag_broken_time, CTLFLAG_RDTUN,

View File

@ -215,7 +215,8 @@ static MALLOC_DEFINE(M_VM, "vm", "vm");
/* statistics */
static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime");
SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL);
SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW | CTLFLAG_MPSAFE, NULL,
NULL);
/*
* Halt the guest if all vcpus are executing a HLT instruction with

View File

@ -962,8 +962,9 @@ sysctl_vmm_destroy(SYSCTL_HANDLER_ARGS)
return (error);
}
SYSCTL_PROC(_hw_vmm, OID_AUTO, destroy,
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
NULL, 0, sysctl_vmm_destroy, "A", NULL);
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
NULL, 0, sysctl_vmm_destroy, "A",
NULL);
static struct cdevsw vmmdevsw = {
.d_name = "vmmdev",
@ -1045,8 +1046,9 @@ sysctl_vmm_create(SYSCTL_HANDLER_ARGS)
return (error);
}
SYSCTL_PROC(_hw_vmm, OID_AUTO, create,
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON,
NULL, 0, sysctl_vmm_create, "A", NULL);
CTLTYPE_STRING | CTLFLAG_RW | CTLFLAG_PRISON | CTLFLAG_MPSAFE,
NULL, 0, sysctl_vmm_create, "A",
NULL);
void
vmmdev_init(void)

View File

@ -50,7 +50,8 @@ __FBSDID("$FreeBSD$");
#include "x86.h"
SYSCTL_DECL(_hw_vmm);
static SYSCTL_NODE(_hw_vmm, OID_AUTO, topology, CTLFLAG_RD, 0, NULL);
static SYSCTL_NODE(_hw_vmm, OID_AUTO, topology, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
NULL);
#define CPUID_VM_HIGH 0x40000000

View File

@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$");
#include <cam/cam_periph.h>
#include <cam/cam_debug.h>
#include <cam/cam_sim.h>
#include <cam/cam_xpt_internal.h> /* For KASSERTs only */
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
@ -682,10 +681,6 @@ camperiphfree(struct cam_periph *periph)
cam_periph_assert(periph, MA_OWNED);
KASSERT(periph->periph_allocating == 0, ("%s%d: freed while allocating",
periph->periph_name, periph->unit_number));
KASSERT(periph->path->device->ccbq.dev_active == 0,
("%s%d: freed with %d active CCBs\n",
periph->periph_name, periph->unit_number,
periph->path->device->ccbq.dev_active));
for (p_drv = periph_drivers; *p_drv != NULL; p_drv++) {
if (strcmp((*p_drv)->driver_name, periph->periph_name) == 0)
break;

View File

@ -91,7 +91,8 @@ __FBSDID("$FreeBSD$");
#include <asm/smp.h>
#endif
SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW, 0, "LinuxKPI parameters");
SYSCTL_NODE(_compat, OID_AUTO, linuxkpi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"LinuxKPI parameters");
int linuxkpi_debug;
SYSCTL_INT(_compat_linuxkpi, OID_AUTO, debug, CTLFLAG_RWTUN,
@ -2441,8 +2442,8 @@ linux_compat_init(void *arg)
kobject_init(&linux_root_device.kobj, &linux_dev_ktype);
kobject_set_name(&linux_root_device.kobj, "device");
linux_root_device.kobj.oidp = SYSCTL_ADD_NODE(NULL,
SYSCTL_CHILDREN(rootoid), OID_AUTO, "device", CTLFLAG_RD, NULL,
"device");
SYSCTL_CHILDREN(rootoid), OID_AUTO, "device",
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "device");
linux_root_device.bsddev = root_bus;
linux_class_misc.name = "misc";
class_register(&linux_class_misc);

View File

@ -4824,6 +4824,23 @@ crypto/libsodium/randombytes.c optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
crypto/libsodium/utils.c optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium"
contrib/libsodium/src/libsodium/crypto_core/hchacha20/core_hchacha20.c \
optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
contrib/libsodium/src/libsodium/crypto_stream/chacha20/stream_chacha20.c \
optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
contrib/libsodium/src/libsodium/crypto_stream/chacha20/ref/chacha20_ref.c \
optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
contrib/libsodium/src/libsodium/crypto_aead/chacha20poly1305/sodium/aead_chacha20poly1305.c \
optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
contrib/libsodium/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c \
optional crypto \
compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include/sodium -I$S/crypto/libsodium"
opencrypto/cbc_mac.c optional crypto
opencrypto/xform_cbc_mac.c optional crypto
rpc/auth_none.c optional krpc | nfslockd | nfscl | nfsd

View File

@ -16,11 +16,11 @@ int sodium_init(void)
SODIUM_EXPORT
int sodium_set_misuse_handler(void (*handler)(void));
#ifndef _KERNEL
SODIUM_EXPORT
void sodium_misuse(void)
__attribute__ ((noreturn));
#endif
#ifdef __cplusplus
}
#endif

View File

@ -54,4 +54,14 @@
#define SODIUM_MIN(A, B) ((A) < (B) ? (A) : (B))
#define SODIUM_SIZE_MAX SODIUM_MIN(UINT64_MAX, SIZE_MAX)
#ifdef _KERNEL
#include <sys/param.h>
#include <sys/libkern.h>
static inline void
sodium_misuse(void)
{
panic("bad value passed to sodium");
}
#endif
#endif

View File

@ -75,7 +75,8 @@ static int sysctl_kern_icl_offloads(SYSCTL_HANDLER_ARGS);
static MALLOC_DEFINE(M_ICL, "icl", "iSCSI Common Layer");
static struct icl_softc *sc;
SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD, 0, "iSCSI Common Layer");
SYSCTL_NODE(_kern, OID_AUTO, icl, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"iSCSI Common Layer");
int icl_debug = 1;
SYSCTL_INT(_kern_icl, OID_AUTO, debug, CTLFLAG_RWTUN,
&icl_debug, 0, "Enable debug messages");

View File

@ -82,7 +82,8 @@ FEATURE(iscsi_kernel_proxy, "iSCSI initiator built with ICL_KERNEL_PROXY");
*/
static struct iscsi_softc *sc;
SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLFLAG_RD, 0, "iSCSI initiator");
SYSCTL_NODE(_kern, OID_AUTO, iscsi, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"iSCSI initiator");
static int debug = 1;
SYSCTL_INT(_kern_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN,
&debug, 0, "Enable debug messages");

View File

@ -102,7 +102,8 @@ static int uaudio_buffer_ms = 8;
#ifdef USB_DEBUG
static int uaudio_debug;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW, 0, "USB uaudio");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uaudio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uaudio");
SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, debug, CTLFLAG_RWTUN,
&uaudio_debug, 0, "uaudio debug level");
@ -133,8 +134,9 @@ uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS)
return (0);
}
SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN,
0, sizeof(int), uaudio_buffer_ms_sysctl, "I",
SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms,
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, 0, sizeof(int),
uaudio_buffer_ms_sysctl, "I",
"uaudio buffering delay from 2ms to 8ms");
#else
#define uaudio_debug 0
@ -2905,7 +2907,7 @@ uaudio_mixer_register_sysctl(struct uaudio_softc *sc, device_t dev)
mixer_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "mixer",
CTLFLAG_RD, NULL, "");
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
if (mixer_tree == NULL)
return;
@ -2925,15 +2927,17 @@ uaudio_mixer_register_sysctl(struct uaudio_softc *sc, device_t dev)
control_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(mixer_tree), OID_AUTO, buf,
CTLFLAG_RD, NULL, "Mixer control nodes");
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL,
"Mixer control nodes");
if (control_tree == NULL)
continue;
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(control_tree),
OID_AUTO, "val", CTLTYPE_INT | CTLFLAG_RWTUN, sc,
pmc->wValue[chan],
OID_AUTO, "val",
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
sc, pmc->wValue[chan],
uaudio_mixer_sysctl_handler, "I", "Current value");
SYSCTL_ADD_INT(device_get_sysctl_ctx(dev),

View File

@ -88,7 +88,7 @@
#ifdef USB_DEBUG
static int atmegadci_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW, 0,
static SYSCTL_NODE(_hw_usb, OID_AUTO, atmegadci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ATMEGA DCI");
SYSCTL_INT(_hw_usb_atmegadci, OID_AUTO, debug, CTLFLAG_RWTUN,
&atmegadci_debug, 0, "ATMEGA DCI debug level");

View File

@ -87,7 +87,9 @@
#ifdef USB_DEBUG
static int avr32dci_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci, CTLFLAG_RW, 0, "USB AVR32 DCI");
static SYSCTL_NODE(_hw_usb, OID_AUTO, avr32dci,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB AVR32 DCI");
SYSCTL_INT(_hw_usb_avr32dci, OID_AUTO, debug, CTLFLAG_RWTUN,
&avr32dci_debug, 0, "AVR32 DCI debug level");
#endif

View File

@ -106,7 +106,8 @@
static int dwc_otg_phy_type = DWC_OTG_PHY_DEFAULT;
static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW, 0, "USB DWC OTG");
static SYSCTL_NODE(_hw_usb, OID_AUTO, dwc_otg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB DWC OTG");
SYSCTL_INT(_hw_usb_dwc_otg, OID_AUTO, phy_type, CTLFLAG_RDTUN,
&dwc_otg_phy_type, 0, "DWC OTG PHY TYPE - 0/1/2/3 - ULPI/HSIC/INTERNAL/UTMI+");

View File

@ -99,7 +99,8 @@ static int ehcinohighspeed = 0;
static int ehciiaadbug = 0;
static int ehcilostintrbug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW, 0, "USB ehci");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ehci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ehci");
SYSCTL_INT(_hw_usb_ehci, OID_AUTO, debug, CTLFLAG_RWTUN,
&ehcidebug, 0, "Debug level");
SYSCTL_INT(_hw_usb_ehci, OID_AUTO, no_hs, CTLFLAG_RWTUN,

View File

@ -91,7 +91,8 @@
#ifdef USB_DEBUG
static int musbotgdebug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW, 0, "USB musbotg");
static SYSCTL_NODE(_hw_usb, OID_AUTO, musbotg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB musbotg");
SYSCTL_INT(_hw_usb_musbotg, OID_AUTO, debug, CTLFLAG_RWTUN,
&musbotgdebug, 0, "Debug level");
#endif

View File

@ -85,7 +85,8 @@
#ifdef USB_DEBUG
static int ohcidebug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW, 0, "USB ohci");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ohci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ohci");
SYSCTL_INT(_hw_usb_ohci, OID_AUTO, debug, CTLFLAG_RWTUN,
&ohcidebug, 0, "ohci debug level");

View File

@ -97,7 +97,7 @@ static int saf1761_otg_debug = 0;
static int saf1761_otg_forcefs = 0;
static
SYSCTL_NODE(_hw_usb, OID_AUTO, saf1761_otg, CTLFLAG_RW, 0,
SYSCTL_NODE(_hw_usb, OID_AUTO, saf1761_otg, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB SAF1761 DCI");
SYSCTL_INT(_hw_usb_saf1761_otg, OID_AUTO, debug, CTLFLAG_RWTUN,

View File

@ -90,7 +90,8 @@
static int uhcidebug = 0;
static int uhcinoloop = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW, 0, "USB uhci");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uhci");
SYSCTL_INT(_hw_usb_uhci, OID_AUTO, debug, CTLFLAG_RWTUN,
&uhcidebug, 0, "uhci debug level");
SYSCTL_INT(_hw_usb_uhci, OID_AUTO, loop, CTLFLAG_RWTUN,

View File

@ -86,7 +86,8 @@ static void usb_attach_sub(device_t, struct usb_bus *);
#ifdef USB_DEBUG
static int usb_ctrl_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW, 0, "USB controller");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ctrl, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB controller");
SYSCTL_INT(_hw_usb_ctrl, OID_AUTO, debug, CTLFLAG_RWTUN, &usb_ctrl_debug, 0,
"Debug level");
#endif

View File

@ -89,7 +89,7 @@
#ifdef USB_DEBUG
static int uss820dcidebug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW, 0,
static SYSCTL_NODE(_hw_usb, OID_AUTO, uss820dci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uss820dci");
SYSCTL_INT(_hw_usb_uss820dci, OID_AUTO, debug, CTLFLAG_RWTUN,
&uss820dcidebug, 0, "uss820dci debug level");

View File

@ -89,7 +89,8 @@
((struct xhci_softc *)(((uint8_t *)(bus)) - \
((uint8_t *)&(((struct xhci_softc *)0)->sc_bus))))
static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW, 0, "USB XHCI");
static SYSCTL_NODE(_hw_usb, OID_AUTO, xhci, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB XHCI");
static int xhcistreams;
SYSCTL_INT(_hw_usb_xhci, OID_AUTO, streams, CTLFLAG_RWTUN,

View File

@ -96,7 +96,8 @@ struct g_audio_softc {
uint8_t sc_sample_rate[32];
};
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_audio, CTLFLAG_RW, 0, "USB audio gadget");
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_audio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB audio gadget");
#ifdef USB_DEBUG
static int g_audio_debug = 0;

View File

@ -61,7 +61,9 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/gadget/g_keyboard.h>
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_keyboard, CTLFLAG_RW, 0, "USB keyboard gadget");
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_keyboard,
CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB keyboard gadget");
#ifdef USB_DEBUG
static int g_keyboard_debug = 0;

View File

@ -92,7 +92,8 @@ struct g_modem_softc {
uint8_t sc_abstract_state[32];
};
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_modem, CTLFLAG_RW, 0, "USB modem gadget");
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_modem, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB modem gadget");
#ifdef USB_DEBUG
static int g_modem_debug = 0;

View File

@ -61,7 +61,8 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/gadget/g_mouse.h>
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_mouse, CTLFLAG_RW, 0, "USB mouse gadget");
static SYSCTL_NODE(_hw_usb, OID_AUTO, g_mouse, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB mouse gadget");
#ifdef USB_DEBUG
static int g_mouse_debug = 0;

View File

@ -170,7 +170,8 @@ __FBSDID("$FreeBSD$");
/* end of driver specific options */
/* Tunables */
static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW, 0, "USB ATP");
static SYSCTL_NODE(_hw_usb, OID_AUTO, atp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ATP");
#ifdef USB_DEBUG
enum atp_log_level {
@ -196,9 +197,11 @@ SYSCTL_UINT(_hw_usb_atp, OID_AUTO, double_tap_threshold, CTLFLAG_RWTUN,
static u_int atp_mickeys_scale_factor = ATP_SCALE_FACTOR;
static int atp_sysctl_scale_factor_handler(SYSCTL_HANDLER_ARGS);
SYSCTL_PROC(_hw_usb_atp, OID_AUTO, scale_factor, CTLTYPE_UINT | CTLFLAG_RWTUN,
SYSCTL_PROC(_hw_usb_atp, OID_AUTO, scale_factor,
CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
&atp_mickeys_scale_factor, sizeof(atp_mickeys_scale_factor),
atp_sysctl_scale_factor_handler, "IU", "movement scale factor");
atp_sysctl_scale_factor_handler, "IU",
"movement scale factor");
static u_int atp_small_movement_threshold = ATP_SMALL_MOVEMENT_THRESHOLD;
SYSCTL_UINT(_hw_usb_atp, OID_AUTO, small_movement, CTLFLAG_RWTUN,

View File

@ -65,7 +65,8 @@
#ifdef USB_DEBUG
static int uep_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW, 0, "USB uep");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uep, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uep");
SYSCTL_INT(_hw_usb_uep, OID_AUTO, debug, CTLFLAG_RWTUN,
&uep_debug, 0, "Debug level");
#endif

View File

@ -80,7 +80,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int uhid_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW, 0, "USB uhid");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhid, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uhid");
SYSCTL_INT(_hw_usb_uhid, OID_AUTO, debug, CTLFLAG_RWTUN,
&uhid_debug, 0, "Debug level");
#endif

View File

@ -98,7 +98,8 @@ static int ukbd_debug = 0;
static int ukbd_no_leds = 0;
static int ukbd_pollrate = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW, 0, "USB keyboard");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ukbd, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB keyboard");
SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, debug, CTLFLAG_RWTUN,
&ukbd_debug, 0, "Debug level");
SYSCTL_INT(_hw_usb_ukbd, OID_AUTO, no_leds, CTLFLAG_RWTUN,

View File

@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int ums_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW, 0, "USB ums");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ums, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ums");
SYSCTL_INT(_hw_usb_ums, OID_AUTO, debug, CTLFLAG_RWTUN,
&ums_debug, 0, "Debug level");
#endif
@ -750,9 +751,10 @@ ums_attach(device_t dev)
SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)),
OID_AUTO, "parseinfo", CTLTYPE_STRING|CTLFLAG_RD,
sc, 0, ums_sysctl_handler_parseinfo,
"", "Dump of parsed HID report descriptor");
OID_AUTO, "parseinfo",
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE,
sc, 0, ums_sysctl_handler_parseinfo, "",
"Dump of parsed HID report descriptor");
return (0);

View File

@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int wmt_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, wmt, CTLFLAG_RW, 0,
static SYSCTL_NODE(_hw_usb, OID_AUTO, wmt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB MSWindows 7/8/10 compatible Multi-touch Device");
SYSCTL_INT(_hw_usb_wmt, OID_AUTO, debug, CTLFLAG_RWTUN,
&wmt_debug, 1, "Debug level");

View File

@ -67,7 +67,8 @@ __FBSDID("$FreeBSD$");
} while (0)
/* Tunables */
static SYSCTL_NODE(_hw_usb, OID_AUTO, wsp, CTLFLAG_RW, 0, "USB wsp");
static SYSCTL_NODE(_hw_usb, OID_AUTO, wsp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB wsp");
#ifdef USB_DEBUG
enum wsp_log_level {

View File

@ -98,7 +98,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int udbp_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW, 0, "USB udbp");
static SYSCTL_NODE(_hw_usb, OID_AUTO, udbp, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB udbp");
SYSCTL_INT(_hw_usb_udbp, OID_AUTO, debug, CTLFLAG_RWTUN,
&udbp_debug, 0, "udbp debug level");
#endif

View File

@ -239,7 +239,7 @@ ugold_attach(device_t dev)
sensor_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev),
SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "sensors",
CTLFLAG_RD, NULL, "");
CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
if (sensor_tree == NULL) {
error = ENOMEM;

View File

@ -114,7 +114,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int aue_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW, 0, "USB aue");
static SYSCTL_NODE(_hw_usb, OID_AUTO, aue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB aue");
SYSCTL_INT(_hw_usb_aue, OID_AUTO, debug, CTLFLAG_RWTUN, &aue_debug, 0,
"Debug level");
#endif

View File

@ -138,7 +138,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int axe_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW, 0, "USB axe");
static SYSCTL_NODE(_hw_usb, OID_AUTO, axe, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB axe");
SYSCTL_INT(_hw_usb_axe, OID_AUTO, debug, CTLFLAG_RWTUN, &axe_debug, 0,
"Debug level");
#endif

View File

@ -142,7 +142,8 @@ static void axge_csum_cfg(struct usb_ether *);
#ifdef USB_DEBUG
static int axge_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge");
static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB axge");
SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RWTUN, &axge_debug, 0,
"Debug level");
#endif

View File

@ -118,7 +118,8 @@ static uint32_t cdce_m_crc32(struct mbuf *, uint32_t, uint32_t);
static int cdce_debug = 0;
static int cdce_tx_interval = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW, 0, "USB CDC-Ethernet");
static SYSCTL_NODE(_hw_usb, OID_AUTO, cdce, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB CDC-Ethernet");
SYSCTL_INT(_hw_usb_cdce, OID_AUTO, debug, CTLFLAG_RWTUN, &cdce_debug, 0,
"Debug level");
SYSCTL_INT(_hw_usb_cdce, OID_AUTO, interval, CTLFLAG_RWTUN, &cdce_tx_interval, 0,

View File

@ -101,7 +101,8 @@ struct cdceem_softc {
#define CDCEEM_SC_FLAGS_ECHO_RESPONSE_PENDING 0x1
#define CDCEEM_SC_FLAGS_ECHO_PENDING 0x2
static SYSCTL_NODE(_hw_usb, OID_AUTO, cdceem, CTLFLAG_RW, 0, "USB CDC EEM");
static SYSCTL_NODE(_hw_usb, OID_AUTO, cdceem, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB CDC EEM");
static int cdceem_debug = 1;
SYSCTL_INT(_hw_usb_cdceem, OID_AUTO, debug, CTLFLAG_RWTUN,
&cdceem_debug, 0, "Debug level");

View File

@ -130,7 +130,8 @@ static void cue_reset(struct cue_softc *);
#ifdef USB_DEBUG
static int cue_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW, 0, "USB cue");
static SYSCTL_NODE(_hw_usb, OID_AUTO, cue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB cue");
SYSCTL_INT(_hw_usb_cue, OID_AUTO, debug, CTLFLAG_RWTUN, &cue_debug, 0,
"Debug level");
#endif

View File

@ -87,7 +87,8 @@ static uether_fn_t ipheth_setpromisc;
#ifdef USB_DEBUG
static int ipheth_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW, 0, "USB iPhone ethernet");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ipheth, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB iPhone ethernet");
SYSCTL_INT(_hw_usb_ipheth, OID_AUTO, debug, CTLFLAG_RWTUN, &ipheth_debug, 0, "Debug level");
#endif

View File

@ -171,7 +171,8 @@ static void kue_reset(struct kue_softc *);
#ifdef USB_DEBUG
static int kue_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW, 0, "USB kue");
static SYSCTL_NODE(_hw_usb, OID_AUTO, kue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB kue");
SYSCTL_INT(_hw_usb_kue, OID_AUTO, debug, CTLFLAG_RWTUN, &kue_debug, 0,
"Debug level");
#endif

View File

@ -144,7 +144,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int mos_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW, 0, "USB mos");
static SYSCTL_NODE(_hw_usb, OID_AUTO, mos, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB mos");
SYSCTL_INT(_hw_usb_mos, OID_AUTO, debug, CTLFLAG_RWTUN, &mos_debug, 0,
"Debug level");
#endif

View File

@ -122,7 +122,7 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int muge_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, muge, CTLFLAG_RW, 0,
SYSCTL_NODE(_hw_usb, OID_AUTO, muge, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"Microchip LAN78xx USB-GigE");
SYSCTL_INT(_hw_usb_muge, OID_AUTO, debug, CTLFLAG_RWTUN, &muge_debug, 0,
"Debug level");

View File

@ -111,7 +111,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int rue_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW, 0, "USB rue");
static SYSCTL_NODE(_hw_usb, OID_AUTO, rue, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB rue");
SYSCTL_INT(_hw_usb_rue, OID_AUTO, debug, CTLFLAG_RWTUN,
&rue_debug, 0, "Debug level");
#endif

View File

@ -122,7 +122,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int smsc_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW, 0, "USB smsc");
SYSCTL_NODE(_hw_usb, OID_AUTO, smsc, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB smsc");
SYSCTL_INT(_hw_usb_smsc, OID_AUTO, debug, CTLFLAG_RWTUN, &smsc_debug, 0,
"Debug level");
#endif

View File

@ -221,7 +221,8 @@ static const struct usb_ether_methods udav_ue_methods_nophy = {
#ifdef USB_DEBUG
static int udav_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW, 0, "USB udav");
static SYSCTL_NODE(_hw_usb, OID_AUTO, udav, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB udav");
SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug, CTLFLAG_RWTUN, &udav_debug, 0,
"Debug level");
#endif

View File

@ -63,7 +63,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int ure_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ure, CTLFLAG_RW, 0, "USB ure");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ure, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ure");
SYSCTL_INT(_hw_usb_ure, OID_AUTO, debug, CTLFLAG_RWTUN, &ure_debug, 0,
"Debug level");
#endif

View File

@ -96,7 +96,8 @@ static uint32_t urndis_ctrl_halt(struct urndis_softc *sc);
#ifdef USB_DEBUG
static int urndis_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, urndis, CTLFLAG_RW, 0, "USB RNDIS-Ethernet");
static SYSCTL_NODE(_hw_usb, OID_AUTO, urndis, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB RNDIS-Ethernet");
SYSCTL_INT(_hw_usb_urndis, OID_AUTO, debug, CTLFLAG_RWTUN, &urndis_debug, 0,
"Debug level");
#endif

View File

@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int usie_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW, 0, "sierra USB modem");
static SYSCTL_NODE(_hw_usb, OID_AUTO, usie, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"sierra USB modem");
SYSCTL_INT(_hw_usb_usie, OID_AUTO, debug, CTLFLAG_RWTUN, &usie_debug, 0,
"usie debug level");
#endif

View File

@ -288,7 +288,8 @@ static const STRUCT_USB_HOST_ID uhso_devs[] = {
#undef UHSO_DEV
};
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW, 0, "USB uhso");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uhso, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uhso");
static int uhso_autoswitch = 1;
SYSCTL_INT(_hw_usb_uhso, OID_AUTO, auto_switch, CTLFLAG_RWTUN,
&uhso_autoswitch, 0, "Automatically switch to modem mode");
@ -599,7 +600,8 @@ uhso_attach(device_t self)
CTLFLAG_RD, uhso_port[UHSO_IFACE_PORT(sc->sc_type)], 0,
"Port available at this interface");
SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "radio",
CTLTYPE_INT | CTLFLAG_RWTUN, sc, 0, uhso_radio_sysctl, "I", "Enable radio");
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, sc, 0,
uhso_radio_sysctl, "I", "Enable radio");
/*
* The default interface description on most Option devices isn't
@ -619,7 +621,7 @@ uhso_attach(device_t self)
CTLFLAG_RD, &sc->sc_ttys, 0, "Number of attached serial ports");
tree = SYSCTL_ADD_NODE(sctx, SYSCTL_CHILDREN(soid), OID_AUTO,
"port", CTLFLAG_RD, NULL, "Serial ports");
"port", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Serial ports");
}
/*
@ -638,7 +640,7 @@ uhso_attach(device_t self)
desc = uhso_port_type_sysctl[port];
tty_node = SYSCTL_ADD_NODE(sctx, SYSCTL_CHILDREN(tree), OID_AUTO,
desc, CTLFLAG_RD, NULL, "");
desc, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
ht->ht_name[0] = 0;
if (sc->sc_ttys == 1)

View File

@ -60,7 +60,7 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/usb_process.h>
#include <dev/usb/net/usb_ethernet.h>
static SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD, 0,
static SYSCTL_NODE(_net, OID_AUTO, ue, CTLFLAG_RD | CTLFLAG_MPSAFE, 0,
"USB Ethernet parameters");
#define UE_LOCK(_ue) mtx_lock((_ue)->ue_mtx)
@ -274,10 +274,10 @@ ue_attach_post_task(struct usb_proc_msg *_task)
snprintf(num, sizeof(num), "%u", ue->ue_unit);
ue->ue_sysctl_oid = SYSCTL_ADD_NODE(&ue->ue_sysctl_ctx,
&SYSCTL_NODE_CHILDREN(_net, ue),
OID_AUTO, num, CTLFLAG_RD, NULL, "");
OID_AUTO, num, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "");
SYSCTL_ADD_PROC(&ue->ue_sysctl_ctx,
SYSCTL_CHILDREN(ue->ue_sysctl_oid), OID_AUTO,
"%parent", CTLTYPE_STRING | CTLFLAG_RD, ue, 0,
SYSCTL_CHILDREN(ue->ue_sysctl_oid), OID_AUTO, "%parent",
CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, ue, 0,
ue_sysctl_parent, "A", "parent device");
UE_LOCK(ue);

View File

@ -67,7 +67,8 @@
#ifdef USB_DEBUG
static int u3g_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW, 0, "USB 3g");
static SYSCTL_NODE(_hw_usb, OID_AUTO, u3g, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB 3g");
SYSCTL_INT(_hw_usb_u3g, OID_AUTO, debug, CTLFLAG_RWTUN,
&u3g_debug, 0, "Debug level");
#endif

View File

@ -90,7 +90,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int ubsa_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW, 0, "USB ubsa");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ubsa, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ubsa");
SYSCTL_INT(_hw_usb_ubsa, OID_AUTO, debug, CTLFLAG_RWTUN,
&ubsa_debug, 0, "ubsa debug level");
#endif

View File

@ -111,7 +111,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int ubser_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW, 0, "USB ubser");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ubser, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ubser");
SYSCTL_INT(_hw_usb_ubser, OID_AUTO, debug, CTLFLAG_RWTUN,
&ubser_debug, 0, "ubser debug level");
#endif

View File

@ -98,7 +98,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int uchcom_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW, 0, "USB uchcom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uchcom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uchcom");
SYSCTL_INT(_hw_usb_uchcom, OID_AUTO, debug, CTLFLAG_RWTUN,
&uchcom_debug, 0, "uchcom debug level");
#endif

View File

@ -457,16 +457,16 @@ ufoma_attach(device_t dev)
soid = device_get_sysctl_tree(dev);
SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "supportmode",
CTLFLAG_RD|CTLTYPE_STRING, sc, 0, ufoma_sysctl_support,
"A", "Supporting port role");
CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_MPSAFE, sc, 0,
ufoma_sysctl_support, "A", "Supporting port role");
SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "currentmode",
CTLFLAG_RD|CTLTYPE_STRING, sc, 0, ufoma_sysctl_current,
"A", "Current port role");
CTLFLAG_RD | CTLTYPE_STRING | CTLFLAG_MPSAFE, sc, 0,
ufoma_sysctl_current, "A", "Current port role");
SYSCTL_ADD_PROC(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "openmode",
CTLFLAG_RW|CTLTYPE_STRING, sc, 0, ufoma_sysctl_open,
"A", "Mode to transit when port is opened");
CTLFLAG_RW | CTLTYPE_STRING | CTLFLAG_MPSAFE, sc, 0,
ufoma_sysctl_open, "A", "Mode to transit when port is opened");
SYSCTL_ADD_UINT(sctx, SYSCTL_CHILDREN(soid), OID_AUTO, "comunit",
CTLFLAG_RD, &(sc->sc_super_ucom.sc_unit), 0,
"Unit number as USB serial");

View File

@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$");
#include <dev/usb/serial/uftdi_reg.h>
#include <dev/usb/uftdiio.h>
static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW, 0, "USB uftdi");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uftdi, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uftdi");
#ifdef USB_DEBUG
static int uftdi_debug = 0;

View File

@ -76,7 +76,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int ulpt_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW, 0, "USB ulpt");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ulpt, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ulpt");
SYSCTL_INT(_hw_usb_ulpt, OID_AUTO, debug, CTLFLAG_RWTUN,
&ulpt_debug, 0, "Debug level");
#endif

View File

@ -81,7 +81,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int umcs_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, umcs, CTLFLAG_RW, 0, "USB umcs quadport serial adapter");
static SYSCTL_NODE(_hw_usb, OID_AUTO, umcs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB umcs quadport serial adapter");
SYSCTL_INT(_hw_usb_umcs, OID_AUTO, debug, CTLFLAG_RWTUN, &umcs_debug, 0, "Debug level");
#endif /* USB_DEBUG */

View File

@ -113,7 +113,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int umodem_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW, 0, "USB umodem");
static SYSCTL_NODE(_hw_usb, OID_AUTO, umodem, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB umodem");
SYSCTL_INT(_hw_usb_umodem, OID_AUTO, debug, CTLFLAG_RWTUN,
&umodem_debug, 0, "Debug level");
#endif

View File

@ -50,7 +50,8 @@
#ifdef USB_DEBUG
static int umoscom_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW, 0, "USB umoscom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, umoscom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB umoscom");
SYSCTL_INT(_hw_usb_umoscom, OID_AUTO, debug, CTLFLAG_RWTUN,
&umoscom_debug, 0, "Debug level");
#endif

View File

@ -113,7 +113,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int uplcom_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW, 0, "USB uplcom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uplcom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uplcom");
SYSCTL_INT(_hw_usb_uplcom, OID_AUTO, debug, CTLFLAG_RWTUN,
&uplcom_debug, 0, "Debug level");
#endif

View File

@ -97,7 +97,8 @@ __FBSDID("$FreeBSD$");
#include "opt_gdb.h"
static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW, 0, "USB ucom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, ucom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ucom");
static int ucom_pps_mode;

View File

@ -59,7 +59,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int uslcom_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW, 0, "USB uslcom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uslcom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uslcom");
SYSCTL_INT(_hw_usb_uslcom, OID_AUTO, debug, CTLFLAG_RWTUN,
&uslcom_debug, 0, "Debug level");
#endif

View File

@ -82,7 +82,8 @@
#ifdef USB_DEBUG
static int uvisor_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW, 0, "USB uvisor");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uvisor, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uvisor");
SYSCTL_INT(_hw_usb_uvisor, OID_AUTO, debug, CTLFLAG_RWTUN,
&uvisor_debug, 0, "Debug level");
#endif

View File

@ -72,7 +72,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int uvscom_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW, 0, "USB uvscom");
static SYSCTL_NODE(_hw_usb, OID_AUTO, uvscom, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB uvscom");
SYSCTL_INT(_hw_usb_uvscom, OID_AUTO, debug, CTLFLAG_RWTUN,
&uvscom_debug, 0, "Debug level");
#endif

View File

@ -69,7 +69,7 @@ __FBSDID("$FreeBSD$");
#include <cam/ctl/ctl_ioctl.h>
#include <cam/ctl/ctl_private.h>
SYSCTL_NODE(_hw_usb, OID_AUTO, cfumass, CTLFLAG_RW, 0,
SYSCTL_NODE(_hw_usb, OID_AUTO, cfumass, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"CAM Target Layer USB Mass Storage Frontend");
static int debug = 1;
SYSCTL_INT(_hw_usb_cfumass, OID_AUTO, debug, CTLFLAG_RWTUN,

View File

@ -168,7 +168,8 @@ __FBSDID("$FreeBSD$");
static int umass_debug;
static int umass_throttle;
static SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW, 0, "USB umass");
static SYSCTL_NODE(_hw_usb, OID_AUTO, umass, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB umass");
SYSCTL_INT(_hw_usb_umass, OID_AUTO, debug, CTLFLAG_RWTUN,
&umass_debug, 0, "umass debug level");
SYSCTL_INT(_hw_usb_umass, OID_AUTO, throttle, CTLFLAG_RWTUN,

View File

@ -82,7 +82,8 @@ __FBSDID("$FreeBSD$");
#ifdef USB_DEBUG
static int urio_debug = 0;
static SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW, 0, "USB urio");
static SYSCTL_NODE(_hw_usb, OID_AUTO, urio, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB urio");
SYSCTL_INT(_hw_usb_urio, OID_AUTO, debug, CTLFLAG_RWTUN,
&urio_debug, 0, "urio debug level");
#endif

View File

@ -72,7 +72,8 @@
#ifdef USB_DEBUG
static int ustorage_fs_debug = 0;
SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW, 0, "USB ustorage_fs");
SYSCTL_NODE(_hw_usb, OID_AUTO, ustorage_fs, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB ustorage_fs");
SYSCTL_INT(_hw_usb_ustorage_fs, OID_AUTO, debug, CTLFLAG_RWTUN,
&ustorage_fs_debug, 0, "ustorage_fs debug level");
#endif

View File

@ -115,7 +115,7 @@ static usb_error_t usb_temp_setup_by_index(struct usb_device *,
uint16_t index);
static void usb_temp_init(void *);
SYSCTL_NODE(_hw_usb, OID_AUTO, templates, CTLFLAG_RW, 0,
SYSCTL_NODE(_hw_usb, OID_AUTO, templates, CTLFLAG_RW | CTLFLAG_MPSAFE, 0,
"USB device side templates");
SYSCTL_PROC(_hw_usb, OID_AUTO, template_power,
CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,

View File

@ -433,7 +433,7 @@ audio_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&audio_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB Audio Interface device side template");
SYSCTL_ADD_U16(&audio_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN, &usb_template_audio.idVendor,

View File

@ -302,7 +302,7 @@ eth_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&eth_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB CDC Ethernet device side template");
SYSCTL_ADD_U16(&eth_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -220,7 +220,7 @@ cdceem_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&cdceem_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB CDC EEM device side template");
SYSCTL_ADD_U16(&cdceem_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -255,7 +255,7 @@ kbd_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&kbd_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB Keyboard device side template");
SYSCTL_ADD_U16(&kbd_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -275,7 +275,7 @@ midi_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&midi_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB MIDI device side template");
SYSCTL_ADD_U16(&midi_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -289,7 +289,7 @@ modem_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&modem_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "Virtual serial port device side template");
SYSCTL_ADD_U16(&modem_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -253,7 +253,7 @@ mouse_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&mouse_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB Mouse device side template");
SYSCTL_ADD_U16(&mouse_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

View File

@ -219,7 +219,7 @@ msc_init(void *arg __unused)
parent = SYSCTL_ADD_NODE(&msc_ctx_list,
SYSCTL_STATIC_CHILDREN(_hw_usb_templates), OID_AUTO,
parent_name, CTLFLAG_RW,
parent_name, CTLFLAG_RW | CTLFLAG_MPSAFE,
0, "USB Mass Storage device side template");
SYSCTL_ADD_U16(&msc_ctx_list, SYSCTL_CHILDREN(parent), OID_AUTO,
"vendor_id", CTLFLAG_RWTUN,

Some files were not shown because too many files have changed in this diff Show More