MFhead@r313360
This commit is contained in:
commit
15df32b48d
@ -38,6 +38,13 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20170206: remove bdes(1)
|
||||
OLD_FILES+=usr/bin/bdes
|
||||
OLD_FILES+=usr/lib/debug/usr/bin/bdes.debug
|
||||
OLD_FILES+=usr/share/man/man1/bdes.1.gz
|
||||
# 20170206: merged projects/ipsec
|
||||
OLD_FILES+=usr/include/netinet/ip_ipsec.h
|
||||
OLD_FILES+=usr/include/netinet6/ip6_ipsec.h
|
||||
# 20170128: remove pc98 support
|
||||
OLD_FILES+=usr/include/dev/ic/i8251.h
|
||||
OLD_FILES+=usr/include/dev/ic/i8255.h
|
||||
|
@ -1,5 +1,5 @@
|
||||
.\" $FreeBSD$
|
||||
.Dd October 2, 2016
|
||||
.Dd February 5, 2017
|
||||
.Dt ED 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -871,9 +871,6 @@ writes.
|
||||
If a newline alone is entered as the key, then encryption is
|
||||
turned off.
|
||||
Otherwise, echoing is disabled while a key is read.
|
||||
Encryption/decryption is done using the
|
||||
.Xr bdes 1
|
||||
algorithm.
|
||||
.It Pf (.+1)z n
|
||||
Scroll
|
||||
.Ar n
|
||||
@ -962,7 +959,6 @@ results in an error.
|
||||
If the command is entered a second time, it succeeds,
|
||||
but any changes to the buffer are lost.
|
||||
.Sh SEE ALSO
|
||||
.Xr bdes 1 ,
|
||||
.Xr sed 1 ,
|
||||
.Xr sh 1 ,
|
||||
.Xr vi 1 ,
|
||||
|
@ -131,7 +131,7 @@ ssize_t drainbuf(int, unsigned char *, size_t *);
|
||||
ssize_t fillbuf(int, unsigned char *, size_t *);
|
||||
|
||||
#ifdef IPSEC
|
||||
void add_ipsec_policy(int, char *);
|
||||
void add_ipsec_policy(int, int, char *);
|
||||
|
||||
char *ipsec_policy[2];
|
||||
#endif
|
||||
@ -642,12 +642,6 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
|
||||
if ((s = socket(res0->ai_family, res0->ai_socktype,
|
||||
res0->ai_protocol)) < 0)
|
||||
continue;
|
||||
#ifdef IPSEC
|
||||
if (ipsec_policy[0] != NULL)
|
||||
add_ipsec_policy(s, ipsec_policy[0]);
|
||||
if (ipsec_policy[1] != NULL)
|
||||
add_ipsec_policy(s, ipsec_policy[1]);
|
||||
#endif
|
||||
|
||||
if (rtableid >= 0 && (setsockopt(s, SOL_SOCKET, SO_SETFIB,
|
||||
&rtableid, sizeof(rtableid)) == -1))
|
||||
@ -765,12 +759,7 @@ local_listen(char *host, char *port, struct addrinfo hints)
|
||||
ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));
|
||||
if (ret == -1)
|
||||
err(1, NULL);
|
||||
#ifdef IPSEC
|
||||
if (ipsec_policy[0] != NULL)
|
||||
add_ipsec_policy(s, ipsec_policy[0]);
|
||||
if (ipsec_policy[1] != NULL)
|
||||
add_ipsec_policy(s, ipsec_policy[1]);
|
||||
#endif
|
||||
|
||||
if (FreeBSD_Oflag) {
|
||||
if (setsockopt(s, IPPROTO_TCP, TCP_NOOPT,
|
||||
&FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1)
|
||||
@ -1235,6 +1224,12 @@ set_common_sockopts(int s, int af)
|
||||
&FreeBSD_Oflag, sizeof(FreeBSD_Oflag)) == -1)
|
||||
err(1, "disable TCP options");
|
||||
}
|
||||
#ifdef IPSEC
|
||||
if (ipsec_policy[0] != NULL)
|
||||
add_ipsec_policy(s, af, ipsec_policy[0]);
|
||||
if (ipsec_policy[1] != NULL)
|
||||
add_ipsec_policy(s, af, ipsec_policy[1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
@ -1360,7 +1355,7 @@ help(void)
|
||||
|
||||
#ifdef IPSEC
|
||||
void
|
||||
add_ipsec_policy(int s, char *policy)
|
||||
add_ipsec_policy(int s, int af, char *policy)
|
||||
{
|
||||
char *raw;
|
||||
int e;
|
||||
@ -1369,8 +1364,12 @@ add_ipsec_policy(int s, char *policy)
|
||||
if (raw == NULL)
|
||||
errx(1, "ipsec_set_policy `%s': %s", policy,
|
||||
ipsec_strerror());
|
||||
e = setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, raw,
|
||||
ipsec_get_policylen(raw));
|
||||
if (af == AF_INET)
|
||||
e = setsockopt(s, IPPROTO_IP, IP_IPSEC_POLICY, raw,
|
||||
ipsec_get_policylen(raw));
|
||||
if (af == AF_INET6)
|
||||
e = setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY, raw,
|
||||
ipsec_get_policylen(raw));
|
||||
if (e < 0)
|
||||
err(1, "ipsec policy cannot be configured");
|
||||
free(raw);
|
||||
|
@ -272,7 +272,7 @@ nomatch 10 {
|
||||
match "bus" "pccard[0-9]+";
|
||||
match "manufacturer" "0x1234";
|
||||
match "product" "0x2323";
|
||||
action "kldload if_deqna";
|
||||
action "kldload -n if_deqna";
|
||||
};
|
||||
attach 10 {
|
||||
device-name "deqna[0-9]+";
|
||||
|
@ -1776,21 +1776,17 @@ pfkey_align(msg, mhp)
|
||||
case SADB_EXT_SPIRANGE:
|
||||
case SADB_X_EXT_POLICY:
|
||||
case SADB_X_EXT_SA2:
|
||||
case SADB_X_EXT_SA_REPLAY:
|
||||
mhp[ext->sadb_ext_type] = (caddr_t)ext;
|
||||
break;
|
||||
case SADB_X_EXT_NAT_T_TYPE:
|
||||
case SADB_X_EXT_NAT_T_SPORT:
|
||||
case SADB_X_EXT_NAT_T_DPORT:
|
||||
/* case SADB_X_EXT_NAT_T_OA: is OAI */
|
||||
case SADB_X_EXT_NAT_T_OAI:
|
||||
case SADB_X_EXT_NAT_T_OAR:
|
||||
case SADB_X_EXT_NAT_T_FRAG:
|
||||
if (feature_present("ipsec_natt")) {
|
||||
mhp[ext->sadb_ext_type] = (caddr_t)ext;
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case SADB_X_EXT_SA_REPLAY:
|
||||
case SADB_X_EXT_NEW_ADDRESS_SRC:
|
||||
case SADB_X_EXT_NEW_ADDRESS_DST:
|
||||
mhp[ext->sadb_ext_type] = (caddr_t)ext;
|
||||
break;
|
||||
default:
|
||||
__ipsec_errcode = EIPSEC_INVAL_EXTTYPE;
|
||||
return -1;
|
||||
|
@ -220,6 +220,9 @@ pfkey_sadump(m)
|
||||
struct sadb_ident *m_sid, *m_did;
|
||||
struct sadb_sens *m_sens;
|
||||
struct sadb_x_sa_replay *m_sa_replay;
|
||||
struct sadb_x_nat_t_type *natt_type;
|
||||
struct sadb_x_nat_t_port *natt_sport, *natt_dport;
|
||||
struct sadb_address *natt_oai, *natt_oar;
|
||||
|
||||
/* check pfkey message. */
|
||||
if (pfkey_align(m, mhp)) {
|
||||
@ -245,33 +248,46 @@ pfkey_sadump(m)
|
||||
m_did = (struct sadb_ident *)mhp[SADB_EXT_IDENTITY_DST];
|
||||
m_sens = (struct sadb_sens *)mhp[SADB_EXT_SENSITIVITY];
|
||||
m_sa_replay = (struct sadb_x_sa_replay *)mhp[SADB_X_EXT_SA_REPLAY];
|
||||
natt_type = (struct sadb_x_nat_t_type *)mhp[SADB_X_EXT_NAT_T_TYPE];
|
||||
natt_sport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_SPORT];
|
||||
natt_dport = (struct sadb_x_nat_t_port *)mhp[SADB_X_EXT_NAT_T_DPORT];
|
||||
natt_oai = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAI];
|
||||
natt_oar = (struct sadb_address *)mhp[SADB_X_EXT_NAT_T_OAR];
|
||||
|
||||
|
||||
/* source address */
|
||||
if (m_saddr == NULL) {
|
||||
printf("no ADDRESS_SRC extension.\n");
|
||||
return;
|
||||
}
|
||||
printf("%s ", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
|
||||
printf("%s", str_ipaddr((struct sockaddr *)(m_saddr + 1)));
|
||||
if (natt_type != NULL && natt_sport != NULL)
|
||||
printf("[%u]", ntohs(natt_sport->sadb_x_nat_t_port_port));
|
||||
|
||||
/* destination address */
|
||||
if (m_daddr == NULL) {
|
||||
printf("no ADDRESS_DST extension.\n");
|
||||
printf("\nno ADDRESS_DST extension.\n");
|
||||
return;
|
||||
}
|
||||
printf("%s ", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
|
||||
printf(" %s", str_ipaddr((struct sockaddr *)(m_daddr + 1)));
|
||||
if (natt_type != NULL && natt_dport != NULL)
|
||||
printf("[%u]", ntohs(natt_dport->sadb_x_nat_t_port_port));
|
||||
|
||||
/* SA type */
|
||||
if (m_sa == NULL) {
|
||||
printf("no SA extension.\n");
|
||||
printf("\nno SA extension.\n");
|
||||
return;
|
||||
}
|
||||
if (m_sa2 == NULL) {
|
||||
printf("no SA2 extension.\n");
|
||||
printf("\nno SA2 extension.\n");
|
||||
return;
|
||||
}
|
||||
printf("\n\t");
|
||||
|
||||
GETMSGSTR(str_satype, m->sadb_msg_satype);
|
||||
if (m->sadb_msg_satype == SADB_SATYPE_ESP && natt_type != NULL)
|
||||
printf("esp-udp ");
|
||||
else
|
||||
GETMSGSTR(str_satype, m->sadb_msg_satype);
|
||||
|
||||
printf("mode=");
|
||||
GETMSGSTR(str_mode, m_sa2->sadb_x_sa2_mode);
|
||||
@ -282,6 +298,18 @@ pfkey_sadump(m)
|
||||
(u_int32_t)m_sa2->sadb_x_sa2_reqid,
|
||||
(u_int32_t)m_sa2->sadb_x_sa2_reqid);
|
||||
|
||||
/* other NAT-T information */
|
||||
if (natt_type != NULL && (natt_oai != NULL || natt_oar != NULL)) {
|
||||
printf("\tNAT:");
|
||||
if (natt_oai != NULL)
|
||||
printf(" OAI=%s",
|
||||
str_ipaddr((struct sockaddr *)(natt_oai + 1)));
|
||||
if (natt_oar != NULL)
|
||||
printf(" OAR=%s",
|
||||
str_ipaddr((struct sockaddr *)(natt_oar + 1)));
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/* encryption key */
|
||||
if (m->sadb_msg_satype == SADB_X_SATYPE_IPCOMP) {
|
||||
printf("\tC: ");
|
||||
|
@ -168,6 +168,7 @@ struct devdesc
|
||||
#define DEVT_NET 2
|
||||
#define DEVT_CD 3
|
||||
#define DEVT_ZFS 4
|
||||
#define DEVT_FD 5
|
||||
int d_unit;
|
||||
void *d_opendata;
|
||||
};
|
||||
|
@ -34,6 +34,7 @@ SRCS+= ifvlan.c # SIOC[GS]ETVLAN support
|
||||
SRCS+= ifvxlan.c # VXLAN support
|
||||
SRCS+= ifgre.c # GRE keys etc
|
||||
SRCS+= ifgif.c # GIF reversed header workaround
|
||||
SRCS+= ifipsec.c # IPsec VTI
|
||||
|
||||
SRCS+= sfp.c # SFP/SFP+ information
|
||||
LIBADD+= m
|
||||
|
101
sbin/ifconfig/ifipsec.c
Normal file
101
sbin/ifconfig/ifipsec.c
Normal file
@ -0,0 +1,101 @@
|
||||
/*-
|
||||
* Copyright (c) 2016 Yandex LLC
|
||||
* Copyright (c) 2016 Andrey V. Elsukov <ae@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/sockio.h>
|
||||
#include <sys/stdint.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if.h>
|
||||
#include <net/if_ipsec.h>
|
||||
#include <net/route.h>
|
||||
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "ifconfig.h"
|
||||
|
||||
static void
|
||||
ipsec_status(int s)
|
||||
{
|
||||
uint32_t reqid;
|
||||
|
||||
ifr.ifr_data = (caddr_t)&reqid;
|
||||
if (ioctl(s, IPSECGREQID, &ifr) == -1)
|
||||
return;
|
||||
printf("\treqid: %u\n", reqid);
|
||||
}
|
||||
|
||||
static
|
||||
DECL_CMD_FUNC(setreqid, val, arg)
|
||||
{
|
||||
char *ep;
|
||||
uint32_t v;
|
||||
|
||||
v = strtoul(val, &ep, 0);
|
||||
if (*ep != '\0') {
|
||||
warn("Invalid reqid value %s", val);
|
||||
return;
|
||||
}
|
||||
ifr.ifr_data = (char *)&v;
|
||||
if (ioctl(s, IPSECSREQID, &ifr) == -1) {
|
||||
warn("ioctl(IPSECSREQID)");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static struct cmd ipsec_cmds[] = {
|
||||
DEF_CMD_ARG("reqid", setreqid),
|
||||
};
|
||||
|
||||
static struct afswtch af_ipsec = {
|
||||
.af_name = "af_ipsec",
|
||||
.af_af = AF_UNSPEC,
|
||||
.af_other_status = ipsec_status,
|
||||
};
|
||||
|
||||
static __constructor void
|
||||
ipsec_ctor(void)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < nitems(ipsec_cmds); i++)
|
||||
cmd_register(&ipsec_cmds[i]);
|
||||
af_register(&af_ipsec);
|
||||
#undef N
|
||||
}
|
@ -41,9 +41,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#define PATHCTL "kern.module_path"
|
||||
|
||||
static int path_check(const char *, int);
|
||||
static void usage(void);
|
||||
|
||||
/*
|
||||
* Check to see if the requested module is specified as a filename with no
|
||||
* path. If so and if a file by the same name exists in the module path,
|
||||
@ -52,43 +49,37 @@ static void usage(void);
|
||||
static int
|
||||
path_check(const char *kldname, int quiet)
|
||||
{
|
||||
int mib[5], found;
|
||||
size_t miblen, pathlen;
|
||||
char kldpath[MAXPATHLEN];
|
||||
char *path, *tmppath, *element;
|
||||
struct stat sb;
|
||||
int mib[5];
|
||||
char kldpath[MAXPATHLEN];
|
||||
size_t miblen, pathlen;
|
||||
dev_t dev;
|
||||
ino_t ino;
|
||||
int found;
|
||||
|
||||
if (strchr(kldname, '/') != NULL) {
|
||||
if (strchr(kldname, '/') != NULL)
|
||||
return (0);
|
||||
}
|
||||
if (strstr(kldname, ".ko") == NULL) {
|
||||
if (strstr(kldname, ".ko") == NULL)
|
||||
return (0);
|
||||
}
|
||||
if (stat(kldname, &sb) != 0) {
|
||||
if (stat(kldname, &sb) != 0)
|
||||
return (0);
|
||||
}
|
||||
|
||||
found = 0;
|
||||
dev = sb.st_dev;
|
||||
ino = sb.st_ino;
|
||||
|
||||
miblen = nitems(mib);
|
||||
if (sysctlnametomib(PATHCTL, mib, &miblen) != 0) {
|
||||
if (sysctlnametomib(PATHCTL, mib, &miblen) != 0)
|
||||
err(1, "sysctlnametomib(%s)", PATHCTL);
|
||||
}
|
||||
if (sysctl(mib, miblen, NULL, &pathlen, NULL, 0) == -1) {
|
||||
if (sysctl(mib, miblen, NULL, &pathlen, NULL, 0) == -1)
|
||||
err(1, "getting path: sysctl(%s) - size only", PATHCTL);
|
||||
}
|
||||
path = malloc(pathlen + 1);
|
||||
if (path == NULL) {
|
||||
if (path == NULL)
|
||||
err(1, "allocating %lu bytes for the path",
|
||||
(unsigned long)pathlen + 1);
|
||||
}
|
||||
if (sysctl(mib, miblen, path, &pathlen, NULL, 0) == -1) {
|
||||
if (sysctl(mib, miblen, path, &pathlen, NULL, 0) == -1)
|
||||
err(1, "getting path: sysctl(%s)", PATHCTL);
|
||||
}
|
||||
tmppath = path;
|
||||
|
||||
while ((element = strsep(&tmppath, ";")) != NULL) {
|
||||
@ -97,39 +88,36 @@ path_check(const char *kldname, int quiet)
|
||||
strlcat(kldpath, "/", MAXPATHLEN);
|
||||
}
|
||||
strlcat(kldpath, kldname, MAXPATHLEN);
|
||||
|
||||
if (stat(kldpath, &sb) == -1) {
|
||||
|
||||
if (stat(kldpath, &sb) == -1)
|
||||
continue;
|
||||
}
|
||||
|
||||
found = 1;
|
||||
|
||||
if (sb.st_dev != dev || sb.st_ino != ino) {
|
||||
if (!quiet) {
|
||||
if (!quiet)
|
||||
warnx("%s will be loaded from %s, not the "
|
||||
"current directory", kldname, element);
|
||||
}
|
||||
break;
|
||||
} else if (sb.st_dev == dev && sb.st_ino == ino) {
|
||||
} else if (sb.st_dev == dev && sb.st_ino == ino)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free(path);
|
||||
|
||||
|
||||
if (!found) {
|
||||
if (!quiet) {
|
||||
if (!quiet)
|
||||
warnx("%s is not in the module path", kldname);
|
||||
}
|
||||
return (-1);
|
||||
}
|
||||
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
usage(void)
|
||||
{
|
||||
|
||||
fprintf(stderr, "usage: kldload [-nqv] file ...\n");
|
||||
exit(1);
|
||||
}
|
||||
@ -138,17 +126,17 @@ int
|
||||
main(int argc, char** argv)
|
||||
{
|
||||
int c;
|
||||
int check_loaded;
|
||||
int errors;
|
||||
int fileid;
|
||||
int verbose;
|
||||
int quiet;
|
||||
int check_loaded;
|
||||
int verbose;
|
||||
|
||||
errors = 0;
|
||||
verbose = 0;
|
||||
quiet = 0;
|
||||
check_loaded = 0;
|
||||
|
||||
|
||||
while ((c = getopt(argc, argv, "nqv")) != -1) {
|
||||
switch (c) {
|
||||
case 'q':
|
||||
@ -204,9 +192,8 @@ main(int argc, char** argv)
|
||||
printf("Loaded %s, id=%d\n", argv[0],
|
||||
fileid);
|
||||
}
|
||||
} else {
|
||||
} else
|
||||
errors++;
|
||||
}
|
||||
argv++;
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd October 3, 2016
|
||||
.Dd February 6, 2017
|
||||
.Dt SETKEY 8
|
||||
.Os
|
||||
.\"
|
||||
@ -270,8 +270,6 @@ must be a decimal number, or a hexadecimal number with
|
||||
prefix.
|
||||
SPI values between 0 and 255 are reserved for future use by IANA
|
||||
and they cannot be used.
|
||||
TCP-MD5 associations must use 0x1000 and therefore only have per-host
|
||||
granularity at this time.
|
||||
.\"
|
||||
.Pp
|
||||
.It Ar extensions
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
SUBDIR=
|
||||
.if ${MK_OPENSSL} != "no"
|
||||
SUBDIR+=bdes openssl
|
||||
SUBDIR+=openssl
|
||||
.if ${MK_OPENSSH} != "no"
|
||||
SUBDIR+=scp sftp ssh ssh-add ssh-agent ssh-keygen ssh-keyscan
|
||||
.endif
|
||||
|
@ -1,10 +0,0 @@
|
||||
# @(#)Makefile 8.1 (Berkeley) 6/6/93
|
||||
# $FreeBSD$
|
||||
|
||||
PROG= bdes
|
||||
|
||||
WARNS?= 2
|
||||
|
||||
LIBADD= crypto
|
||||
|
||||
.include <bsd.prog.mk>
|
@ -1,19 +0,0 @@
|
||||
# $FreeBSD$
|
||||
# Autogenerated - do NOT edit!
|
||||
|
||||
DIRDEPS = \
|
||||
gnu/lib/csu \
|
||||
gnu/lib/libgcc \
|
||||
include \
|
||||
include/xlocale \
|
||||
lib/${CSU_DIR} \
|
||||
lib/libc \
|
||||
lib/libcompiler_rt \
|
||||
secure/lib/libcrypto \
|
||||
|
||||
|
||||
.include <dirdeps.mk>
|
||||
|
||||
.if ${DEP_RELDIR} == ${_DEP_RELDIR}
|
||||
# local dependencies - needed for -jN in clean tree
|
||||
.endif
|
@ -1,390 +0,0 @@
|
||||
.\" Copyright (c) 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" Matt Bishop of Dartmouth College.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. Neither the name of the University nor the names of its contributors
|
||||
.\" may be used to endorse or promote products derived from this software
|
||||
.\" without specific prior written permission.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)bdes.1 8.1 (Berkeley) 6/29/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd September 20, 2013
|
||||
.Dt BDES 1
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm bdes
|
||||
.Nd "encrypt / decrypt using the Data Encryption Standard (DES)"
|
||||
.Sh SYNOPSIS
|
||||
.Nm
|
||||
.Op Fl abdp
|
||||
.Op Fl F Ar N
|
||||
.Op Fl f Ar N
|
||||
.Op Fl k Ar key
|
||||
.Op Fl m Ar N
|
||||
.Op Fl o Ar N
|
||||
.Op Fl v Ar vector
|
||||
.Sh DESCRIPTION
|
||||
.Bf -symbolic
|
||||
The DES cipher should no longer be considered secure.
|
||||
Please consider using a more modern alternative.
|
||||
.Ef
|
||||
.Pp
|
||||
The
|
||||
.Nm
|
||||
utility implements all
|
||||
.Tn DES
|
||||
modes of operation described in
|
||||
.%T "FIPS PUB 81" ,
|
||||
including alternative cipher feedback mode and both authentication
|
||||
modes.
|
||||
The
|
||||
.Nm
|
||||
utility reads from the standard input
|
||||
and writes to the standard output.
|
||||
By default,
|
||||
the input is encrypted
|
||||
using cipher block chaining (CBC) mode.
|
||||
Using the same key
|
||||
for encryption and decryption
|
||||
preserves plain text.
|
||||
.Pp
|
||||
All modes but the electronic code book (ECB) mode
|
||||
require an initialization vector;
|
||||
if none is supplied,
|
||||
the zero vector is used.
|
||||
If no
|
||||
.Ar key
|
||||
is specified on the command line,
|
||||
the user is prompted for one (see
|
||||
.Xr getpass 3
|
||||
for more details).
|
||||
.Pp
|
||||
The options are as follows:
|
||||
.Bl -tag -width indent
|
||||
.It Fl a
|
||||
The key and initialization vector strings
|
||||
are to be taken as
|
||||
.Tn ASCII ,
|
||||
suppressing the special interpretation given to leading
|
||||
.Dq Li 0X ,
|
||||
.Dq Li 0x ,
|
||||
.Dq Li 0B ,
|
||||
and
|
||||
.Dq Li 0b
|
||||
characters.
|
||||
This flag applies to
|
||||
.Em both
|
||||
the key and initialization vector.
|
||||
.It Fl b
|
||||
Use ECB mode.
|
||||
.It Fl d
|
||||
Decrypt the input.
|
||||
.It Fl F Ar N
|
||||
Use
|
||||
.Ar N Ns \-bit
|
||||
alternative CFB mode.
|
||||
Currently
|
||||
.Ar N
|
||||
must be a multiple of 7
|
||||
between 7 and 56 inclusive
|
||||
(this does not conform to the alternative CFB mode specification).
|
||||
.It Fl f Ar N
|
||||
Use
|
||||
.Ar N Ns \-bit
|
||||
CFB mode.
|
||||
Currently
|
||||
.Ar N
|
||||
must be a multiple of 8 between 8 and 64 inclusive (this does not conform
|
||||
to the standard CFB mode specification).
|
||||
.It Fl k Ar key
|
||||
Use
|
||||
.Ar key
|
||||
as the cryptographic key.
|
||||
.It Fl m Ar N
|
||||
Compute a message authentication code (MAC) of
|
||||
.Ar N
|
||||
bits on the input.
|
||||
The value of
|
||||
.Ar N
|
||||
must be between 1 and 64 inclusive; if
|
||||
.Ar N
|
||||
is not a multiple of 8,
|
||||
enough 0 bits will be added
|
||||
to pad the MAC length
|
||||
to the nearest multiple of 8.
|
||||
Only the MAC is output.
|
||||
MACs are only available
|
||||
in CBC mode
|
||||
or in CFB mode.
|
||||
.It Fl o Ar N
|
||||
Use
|
||||
.Ar N Ns \-bit
|
||||
output feedback (OFB) mode.
|
||||
Currently
|
||||
.Ar N
|
||||
must be a multiple of 8 between 8 and 64 inclusive (this does not conform
|
||||
to the OFB mode specification).
|
||||
.It Fl p
|
||||
Disable the resetting of the parity bit.
|
||||
This flag forces
|
||||
the parity bit of the key
|
||||
to be used as typed,
|
||||
rather than making
|
||||
each character be of odd parity.
|
||||
It is used only if the key is given in
|
||||
.Tn ASCII .
|
||||
.It Fl v Ar vector
|
||||
Set the initialization vector to
|
||||
.Ar vector ;
|
||||
the vector is interpreted in the same way as the key.
|
||||
The vector is ignored in ECB mode.
|
||||
.El
|
||||
.Pp
|
||||
The key and initialization vector
|
||||
are taken as sequences of
|
||||
.Tn ASCII
|
||||
characters which are then mapped
|
||||
into their bit representations.
|
||||
If either begins with
|
||||
.Dq Li 0X
|
||||
or
|
||||
.Dq Li 0x ,
|
||||
that one is taken
|
||||
as a sequence of hexadecimal digits
|
||||
indicating the bit pattern;
|
||||
if either begins with
|
||||
.Dq Li 0B
|
||||
or
|
||||
.Dq Li 0b ,
|
||||
that one is taken
|
||||
as a sequence of binary digits
|
||||
indicating the bit pattern.
|
||||
In either case,
|
||||
only the leading 64 bits
|
||||
of the key or initialization vector
|
||||
are used,
|
||||
and if fewer than 64 bits are provided,
|
||||
enough 0 bits are appended
|
||||
to pad the key to 64 bits.
|
||||
.Pp
|
||||
According to the
|
||||
.Tn DES
|
||||
standard,
|
||||
the low-order bit of each character
|
||||
in the key string is deleted.
|
||||
Since most
|
||||
.Tn ASCII
|
||||
representations
|
||||
set the high-order bit to 0,
|
||||
simply deleting the low-order bit
|
||||
effectively reduces the size of the key space
|
||||
from 2^56 to 2^48 keys.
|
||||
To prevent this,
|
||||
the high-order bit must be a function
|
||||
depending in part upon the low-order bit;
|
||||
so,
|
||||
the high-order bit is set
|
||||
to whatever value gives odd parity.
|
||||
This preserves the key space size.
|
||||
Note this resetting of the parity bit is
|
||||
.Em not
|
||||
done if the key
|
||||
is given in binary or hex,
|
||||
and can be disabled for
|
||||
.Tn ASCII
|
||||
keys as well.
|
||||
.Sh IMPLEMENTATION NOTES
|
||||
For implementors wishing to write
|
||||
software compatible with this program,
|
||||
the following notes are provided.
|
||||
This software is believed
|
||||
to be compatible with the implementation
|
||||
of the data encryption standard
|
||||
distributed by Sun Microsystems, Inc.
|
||||
.Pp
|
||||
In the ECB and CBC modes,
|
||||
plaintext is encrypted in units of 64 bits
|
||||
(8 bytes, also called a block).
|
||||
To ensure that the plaintext file
|
||||
is encrypted correctly,
|
||||
.Nm
|
||||
will (internally) append from 1 to 8 bytes,
|
||||
the last byte containing an integer
|
||||
stating how many bytes of that final block
|
||||
are from the plaintext file,
|
||||
and encrypt the resulting block.
|
||||
Hence,
|
||||
when decrypting,
|
||||
the last block may contain from 0 to 7 characters
|
||||
present in the plaintext file,
|
||||
and the last byte tells how many.
|
||||
Note that if during decryption
|
||||
the last byte of the file
|
||||
does not contain an integer between 0 and 7,
|
||||
either the file has been corrupted
|
||||
or an incorrect key has been given.
|
||||
A similar mechanism is used
|
||||
for the OFB and CFB modes,
|
||||
except that those
|
||||
simply require the length of the input
|
||||
to be a multiple of the mode size,
|
||||
and the final byte contains an integer
|
||||
between 0 and one less than the number
|
||||
of bytes being used as the mode.
|
||||
(This was another reason
|
||||
that the mode size must be
|
||||
a multiple of 8 for those modes.)
|
||||
.Pp
|
||||
Unlike Sun's implementation,
|
||||
unused bytes of that last block
|
||||
are not filled with random data,
|
||||
but instead contain
|
||||
what was in those byte positions
|
||||
in the preceding block.
|
||||
This is quicker and more portable,
|
||||
and does not weaken the encryption significantly.
|
||||
.Pp
|
||||
If the key is entered in
|
||||
.Tn ASCII ,
|
||||
the parity bits of the key characters
|
||||
are set so that each key character
|
||||
is of odd parity.
|
||||
Unlike Sun's implementation,
|
||||
it is possible to enter binary or hexadecimal
|
||||
keys on the command line,
|
||||
and if this is done,
|
||||
the parity bits are
|
||||
.Em not
|
||||
reset.
|
||||
This allows testing
|
||||
using arbitrary bit patterns as keys.
|
||||
.Pp
|
||||
The Sun implementation
|
||||
always uses an initialization vector of 0
|
||||
(that is, all zeroes).
|
||||
By default,
|
||||
.Nm
|
||||
does too,
|
||||
but this may be changed
|
||||
from the command line.
|
||||
.Sh SEE ALSO
|
||||
.Xr getpass 3
|
||||
.Rs
|
||||
.%T "Data Encryption Standard"
|
||||
.%R "Federal Information Processing Standard #46"
|
||||
.%Q "National Bureau of Standards, U.S. Department of Commerce, Washington DC"
|
||||
.%D "January 1977"
|
||||
.Re
|
||||
.Rs
|
||||
.%T "DES Modes of Operation"
|
||||
.%R "Federal Information Processing Standard #81"
|
||||
.%Q "National Bureau of Standards, U.S. Department of Commerce, Washington DC"
|
||||
.%D "December 1980"
|
||||
.Re
|
||||
.Rs
|
||||
.%A "Dorothy Denning"
|
||||
.%B "Cryptography and Data Security"
|
||||
.%Q "Addison-Wesley Publishing Co., Reading, MA"
|
||||
.%D 1982
|
||||
.Re
|
||||
.Rs
|
||||
.%A "Matt Bishop"
|
||||
.%T "Implementation Notes on bdes(1)"
|
||||
.%R "Technical Report PCS-TR-91-158"
|
||||
.%Q "Department of Mathematics and Computer Science, Dartmouth College, Hanover, NH 03755"
|
||||
.%D "April 1991"
|
||||
.Re
|
||||
.Sh DISCLAIMER
|
||||
.Bd -literal
|
||||
THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
.Ed
|
||||
.Sh BUGS
|
||||
As the key or key schedule
|
||||
is stored in memory,
|
||||
the encryption can be
|
||||
compromised if memory is readable.
|
||||
Additionally,
|
||||
programs which display programs' arguments
|
||||
may compromise the key and initialization vector,
|
||||
if they are specified on the command line.
|
||||
To avoid this
|
||||
.Nm
|
||||
overwrites its arguments,
|
||||
however,
|
||||
the obvious race
|
||||
cannot currently be avoided.
|
||||
.Pp
|
||||
Certain specific keys
|
||||
should be avoided
|
||||
because they introduce
|
||||
potential weaknesses;
|
||||
these keys,
|
||||
called the
|
||||
.Em weak
|
||||
and
|
||||
.Em semiweak
|
||||
keys, are (in hex notation, where
|
||||
.Ar p
|
||||
is either 0 or 1, and
|
||||
.Ar P
|
||||
is either
|
||||
.Ql e
|
||||
or
|
||||
.Ql f ) :
|
||||
.Bl -column "0x0p0p0p0p0p0p0p0p" -offset indent
|
||||
.It "0x0p0p0p0p0p0p0p0p 0x0p1P0p1P0p0P0p0P"
|
||||
.It "0x0pep0pep0pfp0pfp 0x0pfP0pfP0pfP0pfP"
|
||||
.It "0x1P0p1P0p0P0p0P0p 0x1P1P1P1P0P0P0P0P"
|
||||
.It "0x1Pep1Pep0Pfp0Pfp 0x1PfP1PfP0PfP0PfP"
|
||||
.It "0xep0pep0pfp0pfp0p 0xep1Pep1pfp0Pfp0P"
|
||||
.It "0xepepepepepepepep 0xepfPepfPfpfPfpfP"
|
||||
.It "0xfP0pfP0pfP0pfP0p 0xfP1PfP1PfP0PfP0P"
|
||||
.It "0xfPepfPepfPepfPep 0xfPfPfPfPfPfPfPfP"
|
||||
.El
|
||||
.Pp
|
||||
This is inherent in the
|
||||
.Tn DES
|
||||
algorithm;
|
||||
see
|
||||
.Rs
|
||||
.%A Moore
|
||||
.%A Simmons
|
||||
.%T "Cycle structure of the DES with weak and semi-weak keys"
|
||||
.%B "Advances in Cryptology \- Crypto '86 Proceedings"
|
||||
.%Q "Springer-Verlag New York"
|
||||
.%D 1987
|
||||
.%P "pp. 9-32"
|
||||
.Re
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -201,6 +201,7 @@ MAN= aac.4 \
|
||||
icmp.4 \
|
||||
icmp6.4 \
|
||||
ida.4 \
|
||||
if_ipsec.4 \
|
||||
ifmib.4 \
|
||||
ig4.4 \
|
||||
igb.4 \
|
||||
|
@ -167,6 +167,10 @@ Tunables can be set at the
|
||||
.Xr loader 8
|
||||
prompt before booting the kernel or stored in
|
||||
.Xr loader.conf 5 .
|
||||
There are multiple tunables that control the number of queues of various
|
||||
types.
|
||||
A negative value for such a tunable instructs the driver to create
|
||||
up to that many queues if there are enough CPU cores available.
|
||||
.Bl -tag -width indent
|
||||
.It Va hw.cxgbe.ntxq10g
|
||||
Number of tx queues used for a 10Gb or higher-speed port.
|
||||
|
141
share/man/man4/if_ipsec.4
Normal file
141
share/man/man4/if_ipsec.4
Normal file
@ -0,0 +1,141 @@
|
||||
.\" Copyright (c) 2017 Andrey V. Elsukov <ae@FreeBSD.org>
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd February 6, 2017
|
||||
.Dt if_ipsec 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm if_ipsec
|
||||
.Nd IPsec virtual tunneling interface
|
||||
.Sh SYNOPSIS
|
||||
The
|
||||
.Cm if_ipsec
|
||||
network interface is a part of the
|
||||
.Fx
|
||||
IPsec implementation.
|
||||
To compile it into the kernel, place this line in the kernel
|
||||
configuration file:
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "options IPSEC"
|
||||
.Ed
|
||||
.Pp
|
||||
It can also be loaded as part of the
|
||||
.Cm ipsec
|
||||
kernel module if the kernel was compiled with
|
||||
.Bd -ragged -offset indent
|
||||
.Cd "options IPSEC_SUPPORT"
|
||||
.Ed
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
network interface is targeted for creating route-based VPNs.
|
||||
It can tunnel IPv4 and IPv6 traffic over either IPv4 or IPv6 and secure
|
||||
it with ESP.
|
||||
.Pp
|
||||
.Nm
|
||||
interfaces are dynamically created and destroyed with the
|
||||
.Xr ifconfig 8
|
||||
.Cm create
|
||||
and
|
||||
.Cm destroy
|
||||
subcommands.
|
||||
The administrator must configure IPsec
|
||||
.Cm tunnel
|
||||
endpoint addresses.
|
||||
These addresses will be used for the outer IP header of ESP packets.
|
||||
The administrator can also configure the protocol and addresses for the inner
|
||||
IP header with
|
||||
.Xr ifconfig 8 ,
|
||||
and modify the routing table to route the packets through the
|
||||
.Nm
|
||||
interface.
|
||||
.Pp
|
||||
When the
|
||||
.Nm
|
||||
interface is configured, it automatically creates special security policies.
|
||||
These policies can be used to acquire security associations from the IKE daemon,
|
||||
which are needed for establishing an IPsec tunnel.
|
||||
It is also possible to create needed security associations manually with the
|
||||
.Xr setkey 8
|
||||
utility.
|
||||
.Pp
|
||||
Each
|
||||
.Nm
|
||||
interface has an additional numeric configuration option
|
||||
.Cm reqid Ar id .
|
||||
This
|
||||
.Ar id
|
||||
is used to distinguish traffic and security policies between several
|
||||
.Nm
|
||||
interfaces.
|
||||
The
|
||||
.Cm reqid
|
||||
can be specified on interface creation and changed later.
|
||||
If not specified, it is automatically assigned.
|
||||
Note that changing
|
||||
.Cm reqid
|
||||
will lead to generation of new security policies, and this
|
||||
may require creating new security associations.
|
||||
.Sh EXAMPLES
|
||||
The example below shows manual configuration of an IPsec tunnel
|
||||
between two FreeBSD hosts.
|
||||
Host A has the IP address 192.168.0.3, and host B has the IP address
|
||||
192.168.0.5.
|
||||
.Pp
|
||||
On host A:
|
||||
.Bd -literal -offset indent
|
||||
ifconfig ipsec0 create reqid 100
|
||||
ifconfig ipsec0 inet tunnel 192.168.0.3 192.168.0.5
|
||||
ifconfig ipsec0 inet 172.16.0.3/16 172.16.0.5
|
||||
setkey -c
|
||||
add 192.168.0.3 192.168.0.5 esp 10000 -m tunnel -u 100 -E rijndael-cbc "VerySecureKey!!1";
|
||||
add 192.168.0.5 192.168.0.3 esp 10001 -m tunnel -u 100 -E rijndael-cbc "VerySecureKey!!2";
|
||||
^D
|
||||
.Ed
|
||||
.Pp
|
||||
On host B:
|
||||
.Bd -literal -offset indent
|
||||
ifconfig ipsec0 create reqid 200
|
||||
ifconfig ipsec0 inet tunnel 192.168.0.5 192.168.0.3
|
||||
ifconfig ipsec0 inet 172.16.0.5/16 172.16.0.3
|
||||
setkey -c
|
||||
add 192.168.0.3 192.168.0.5 esp 10000 -m tunnel -u 200 -E rijndael-cbc "VerySecureKey!!1";
|
||||
add 192.168.0.5 192.168.0.3 esp 10001 -m tunnel -u 200 -E rijndael-cbc "VerySecureKey!!2";
|
||||
^D
|
||||
.Ed
|
||||
.Pp
|
||||
Note the value 100 on host A and value 200 on host B are used as reqid.
|
||||
The same value must be used as identifier of the policy entry in the
|
||||
.Xr setkey 8
|
||||
command.
|
||||
.Sh SEE ALSO
|
||||
.Xr gif 4 ,
|
||||
.Xr gre 4 ,
|
||||
.Xr ipsec 4 ,
|
||||
.Xr ifconfig 8 ,
|
||||
.Xr setkey 8
|
||||
.Sh AUTHORS
|
||||
.An Andrey V. Elsukov Aq Mt ae@FreeBSD.org
|
@ -29,7 +29,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd November 29, 2009
|
||||
.Dd February 6, 2017
|
||||
.Dt IPSEC 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -37,6 +37,7 @@
|
||||
.Nd Internet Protocol Security protocol
|
||||
.Sh SYNOPSIS
|
||||
.Cd "options IPSEC"
|
||||
.Cd "options IPSEC_SUPPORT"
|
||||
.Cd "device crypto"
|
||||
.Pp
|
||||
.In sys/types.h
|
||||
@ -151,6 +152,16 @@ Refer to
|
||||
.Xr setkey 8
|
||||
on how to use it.
|
||||
.Pp
|
||||
Depending on the socket's address family, IPPROTO_IP or IPPROTO_IPV6
|
||||
transport level and IP_IPSEC_POLICY or IPV6_IPSEC_POLICY socket options
|
||||
may be used to configure per-socket security policies.
|
||||
A properly-formed IPsec policy specification structure can be
|
||||
created using
|
||||
.Xr ipsec_set_policy 3
|
||||
function and used as socket option value for the
|
||||
.Xr setsockopt 2
|
||||
call.
|
||||
.Pp
|
||||
When setting policies using the
|
||||
.Xr setkey 8
|
||||
command, the
|
||||
@ -228,6 +239,8 @@ for tweaking the kernel's IPsec behavior:
|
||||
.It "net.inet.ipsec.dfbit integer yes"
|
||||
.It "net.inet.ipsec.ecn integer yes"
|
||||
.It "net.inet.ipsec.debug integer yes"
|
||||
.It "net.inet.ipsec.natt_cksum_policy integer yes"
|
||||
.It "net.inet.ipsec.check_policy_history integer yes"
|
||||
.It "net.inet6.ipsec6.ecn integer yes"
|
||||
.It "net.inet6.ipsec6.debug integer yes"
|
||||
.El
|
||||
@ -270,6 +283,23 @@ talks more about the behavior.
|
||||
.It Li ipsec.debug
|
||||
If set to non-zero, debug messages will be generated via
|
||||
.Xr syslog 3 .
|
||||
.It Li ipsec.natt_cksum_policy
|
||||
Controls how the kernel handles TCP and UDP checksums when ESP in UDP
|
||||
encapsulation is used for IPsec transport mode.
|
||||
If set to a non-zero value, the kernel fully recomputes checksums for
|
||||
inbound TCP segments and UDP datagrams after they are decapsulated and
|
||||
decrypted.
|
||||
If set to 0 and original addresses were configured for corresponding SA
|
||||
by the IKE daemon, the kernel incrementally recomputes checksums for
|
||||
inbound TCP segments and UDP datagrams.
|
||||
If addresses were not configured, the checksums are ignored.
|
||||
.It Li ipsec.check_policy_history
|
||||
Enables strict policy checking for inbound packets.
|
||||
By default, inbound security policies check that packets handled by IPsec
|
||||
have been decrypted and authenticated.
|
||||
If this variable is set to a non-zero value, each packet handled by IPsec
|
||||
is checked against the history of IPsec security associations.
|
||||
The IPsec security protocol, mode, and SA addresses must match.
|
||||
.El
|
||||
.Pp
|
||||
Variables under the
|
||||
@ -305,6 +335,7 @@ routines from looking into the IP payload.
|
||||
.Xr ipsec_set_policy 3 ,
|
||||
.Xr crypto 4 ,
|
||||
.Xr enc 4 ,
|
||||
.Xr if_ipsec 4 ,
|
||||
.Xr icmp6 4 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr ip6 4 ,
|
||||
|
@ -34,7 +34,7 @@
|
||||
.\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd Jan 29, 2017
|
||||
.Dd February 6, 2017
|
||||
.Dt TCP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -272,33 +272,27 @@ or the internal send buffer is filled.
|
||||
This option enables the use of MD5 digests (also known as TCP-MD5)
|
||||
on writes to the specified socket.
|
||||
Outgoing traffic is digested;
|
||||
digests on incoming traffic are verified if the
|
||||
.Va net.inet.tcp.signature_verify_input
|
||||
sysctl is nonzero.
|
||||
The current default behavior for the system is to respond to a system
|
||||
advertising this option with TCP-MD5; this may change.
|
||||
digests on incoming traffic are verified.
|
||||
When this option is enabled on a socket, all inbound and outgoing
|
||||
TCP segments must be signed with MD5 digests.
|
||||
.Pp
|
||||
One common use for this in a
|
||||
.Fx
|
||||
router deployment is to enable
|
||||
based routers to interwork with Cisco equipment at peering points.
|
||||
Support for this feature conforms to RFC 2385.
|
||||
Only IPv4
|
||||
.Pq Dv AF_INET
|
||||
sessions are supported.
|
||||
.Pp
|
||||
In order for this option to function correctly, it is necessary for the
|
||||
administrator to add a tcp-md5 key entry to the system's security
|
||||
associations database (SADB) using the
|
||||
.Xr setkey 8
|
||||
utility.
|
||||
This entry must have an SPI of 0x1000 and can therefore only be specified
|
||||
on a per-host basis at this time.
|
||||
This entry can only be specified on a per-host basis at this time.
|
||||
.Pp
|
||||
If an SADB entry cannot be found for the destination, the outgoing traffic
|
||||
will have an invalid digest option prepended, and the following error message
|
||||
will be visible on the system console:
|
||||
.Em "tcp_signature_compute: SADB lookup failed for %d.%d.%d.%d" .
|
||||
If an SADB entry cannot be found for the destination,
|
||||
the system does not send any outgoing segments and drops any inbound segments.
|
||||
.Pp
|
||||
Each dropped segment is taken into account in the TCP protocol statistics.
|
||||
.El
|
||||
.Pp
|
||||
The option level for the
|
||||
|
@ -28,7 +28,7 @@
|
||||
.\" @(#)udp.4 8.1 (Berkeley) 6/5/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 5, 1993
|
||||
.Dd February 6, 2017
|
||||
.Dt UDP 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -99,6 +99,17 @@ transport level may be used with
|
||||
.Tn UDP ;
|
||||
see
|
||||
.Xr ip 4 .
|
||||
.Tn UDP_ENCAP
|
||||
socket option may be used at the
|
||||
.Tn IPPROTO_UDP
|
||||
level to encapsulate
|
||||
.Tn ESP
|
||||
packets in
|
||||
.Tn UDP .
|
||||
Only one value is supported for this option:
|
||||
.Tn UDP_ENCAP_ESPINUDP
|
||||
from RFC 3948, defined in
|
||||
.In netinet/udp.h .
|
||||
.Sh MIB VARIABLES
|
||||
The
|
||||
.Nm
|
||||
@ -158,7 +169,8 @@ exists.
|
||||
.Xr blackhole 4 ,
|
||||
.Xr inet 4 ,
|
||||
.Xr intro 4 ,
|
||||
.Xr ip 4
|
||||
.Xr ip 4 ,
|
||||
.Xr udplite 4
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
|
@ -82,41 +82,86 @@ DUMMY(mq_timedreceive);
|
||||
DUMMY(mq_notify);
|
||||
DUMMY(mq_getsetattr);
|
||||
DUMMY(kexec_load);
|
||||
/* linux 2.6.11: */
|
||||
DUMMY(add_key);
|
||||
DUMMY(request_key);
|
||||
DUMMY(keyctl);
|
||||
/* linux 2.6.13: */
|
||||
DUMMY(ioprio_set);
|
||||
DUMMY(ioprio_get);
|
||||
DUMMY(inotify_init);
|
||||
DUMMY(inotify_add_watch);
|
||||
DUMMY(inotify_rm_watch);
|
||||
/* linux 2.6.16: */
|
||||
DUMMY(migrate_pages);
|
||||
DUMMY(unshare);
|
||||
/* linux 2.6.17: */
|
||||
DUMMY(splice);
|
||||
DUMMY(tee);
|
||||
DUMMY(sync_file_range);
|
||||
DUMMY(vmsplice);
|
||||
/* linux 2.6.18: */
|
||||
DUMMY(move_pages);
|
||||
/* linux 2.6.22: */
|
||||
DUMMY(signalfd);
|
||||
DUMMY(timerfd);
|
||||
DUMMY(timerfd_create);
|
||||
/* linux 2.6.25: */
|
||||
DUMMY(timerfd_settime);
|
||||
DUMMY(timerfd_gettime);
|
||||
/* linux 2.6.27: */
|
||||
DUMMY(signalfd4);
|
||||
DUMMY(inotify_init1);
|
||||
/* linux 2.6.30: */
|
||||
DUMMY(preadv);
|
||||
DUMMY(pwritev);
|
||||
DUMMY(rt_tsigqueueinfo);
|
||||
/* linux 2.6.31: */
|
||||
DUMMY(rt_tgsigqueueinfo);
|
||||
DUMMY(perf_event_open);
|
||||
/* linux 2.6.38: */
|
||||
DUMMY(fanotify_init);
|
||||
DUMMY(fanotify_mark);
|
||||
/* linux 2.6.39: */
|
||||
DUMMY(name_to_handle_at);
|
||||
DUMMY(open_by_handle_at);
|
||||
DUMMY(clock_adjtime);
|
||||
/* linux 3.0: */
|
||||
DUMMY(setns);
|
||||
DUMMY(getcpu);
|
||||
/* linux 3.2: */
|
||||
DUMMY(process_vm_readv);
|
||||
DUMMY(process_vm_writev);
|
||||
/* linux 3.5: */
|
||||
DUMMY(kcmp);
|
||||
/* linux 3.8: */
|
||||
DUMMY(finit_module);
|
||||
DUMMY(sched_setattr);
|
||||
DUMMY(sched_getattr);
|
||||
/* linux 3.14: */
|
||||
DUMMY(renameat2);
|
||||
/* linux 3.15: */
|
||||
DUMMY(seccomp);
|
||||
DUMMY(getrandom);
|
||||
DUMMY(memfd_create);
|
||||
DUMMY(kexec_file_load);
|
||||
/* linux 3.18: */
|
||||
DUMMY(bpf);
|
||||
/* linux 3.19: */
|
||||
DUMMY(execveat);
|
||||
/* linux 4.2: */
|
||||
DUMMY(userfaultfd);
|
||||
/* linux 4.3: */
|
||||
DUMMY(membarrier);
|
||||
/* linux 4.4: */
|
||||
DUMMY(mlock2);
|
||||
/* linux 4.5: */
|
||||
DUMMY(copy_file_range);
|
||||
/* linux 4.6: */
|
||||
DUMMY(preadv2);
|
||||
DUMMY(pwritev2);
|
||||
/* linux 4.8: */
|
||||
DUMMY(pkey_mprotect);
|
||||
DUMMY(pkey_alloc);
|
||||
DUMMY(pkey_free);
|
||||
|
||||
#define DUMMY_XATTR(s) \
|
||||
int \
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_SYSPROTO_H_
|
||||
@ -1000,7 +1000,7 @@ struct linux_epoll_pwait_args {
|
||||
struct linux_signalfd_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct linux_timerfd_args {
|
||||
struct linux_timerfd_create_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct linux_eventfd_args {
|
||||
@ -1044,16 +1044,27 @@ struct linux_pipe2_args {
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_inotify_init1_args {
|
||||
register_t dummy;
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_preadv_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_pwritev_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_rt_tsigqueueinfo_args {
|
||||
register_t dummy;
|
||||
struct linux_rt_tgsigqueueinfo_args {
|
||||
char tgid_l_[PADL_(l_pid_t)]; l_pid_t tgid; char tgid_r_[PADR_(l_pid_t)];
|
||||
char tid_l_[PADL_(l_pid_t)]; l_pid_t tid; char tid_r_[PADR_(l_pid_t)];
|
||||
char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
|
||||
char uinfo_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * uinfo; char uinfo_r_[PADR_(l_siginfo_t *)];
|
||||
};
|
||||
struct linux_perf_event_open_args {
|
||||
register_t dummy;
|
||||
@ -1096,19 +1107,141 @@ struct linux_sendmmsg_args {
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_setns_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
|
||||
char nstype_l_[PADL_(l_int)]; l_int nstype; char nstype_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_getcpu_args {
|
||||
char cpu_l_[PADL_(l_uint *)]; l_uint * cpu; char cpu_r_[PADR_(l_uint *)];
|
||||
char node_l_[PADL_(l_uint *)]; l_uint * node; char node_r_[PADR_(l_uint *)];
|
||||
char cache_l_[PADL_(void *)]; void * cache; char cache_r_[PADR_(void *)];
|
||||
};
|
||||
struct linux_process_vm_readv_args {
|
||||
register_t dummy;
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)];
|
||||
char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)];
|
||||
char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)];
|
||||
char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_process_vm_writev_args {
|
||||
register_t dummy;
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)];
|
||||
char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)];
|
||||
char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)];
|
||||
char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_kcmp_args {
|
||||
register_t dummy;
|
||||
char pid1_l_[PADL_(l_pid_t)]; l_pid_t pid1; char pid1_r_[PADR_(l_pid_t)];
|
||||
char pid2_l_[PADL_(l_pid_t)]; l_pid_t pid2; char pid2_r_[PADR_(l_pid_t)];
|
||||
char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
|
||||
char idx1_l_[PADL_(l_ulong)]; l_ulong idx1; char idx1_r_[PADR_(l_ulong)];
|
||||
char idx_l_[PADL_(l_ulong)]; l_ulong idx; char idx_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_finit_module_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
|
||||
char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_sched_setattr_args {
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_sched_getattr_args {
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_renameat2_args {
|
||||
char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
|
||||
char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
|
||||
char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
|
||||
char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)];
|
||||
};
|
||||
struct linux_seccomp_args {
|
||||
char op_l_[PADL_(l_uint)]; l_uint op; char op_r_[PADR_(l_uint)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)];
|
||||
};
|
||||
struct linux_getrandom_args {
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_memfd_create_args {
|
||||
char uname_ptr_l_[PADL_(const char *)]; const char * uname_ptr; char uname_ptr_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_kexec_file_load_args {
|
||||
char kernel_fd_l_[PADL_(l_int)]; l_int kernel_fd; char kernel_fd_r_[PADR_(l_int)];
|
||||
char initrd_fd_l_[PADL_(l_int)]; l_int initrd_fd; char initrd_fd_r_[PADR_(l_int)];
|
||||
char cmdline_len_l_[PADL_(l_ulong)]; l_ulong cmdline_len; char cmdline_len_r_[PADR_(l_ulong)];
|
||||
char cmdline_ptr_l_[PADL_(const char *)]; const char * cmdline_ptr; char cmdline_ptr_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_bpf_args {
|
||||
char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_execveat_args {
|
||||
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
|
||||
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
|
||||
char argv_l_[PADL_(const char **)]; const char ** argv; char argv_r_[PADR_(const char **)];
|
||||
char envp_l_[PADL_(const char **)]; const char ** envp; char envp_r_[PADR_(const char **)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_userfaultfd_args {
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_membarrier_args {
|
||||
char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_mlock2_args {
|
||||
char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_copy_file_range_args {
|
||||
char fd_in_l_[PADL_(l_int)]; l_int fd_in; char fd_in_r_[PADR_(l_int)];
|
||||
char off_in_l_[PADL_(l_loff_t *)]; l_loff_t * off_in; char off_in_r_[PADR_(l_loff_t *)];
|
||||
char fd_out_l_[PADL_(l_int)]; l_int fd_out; char fd_out_r_[PADR_(l_int)];
|
||||
char off_out_l_[PADL_(l_loff_t *)]; l_loff_t * off_out; char off_out_r_[PADR_(l_loff_t *)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_preadv2_args {
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pwritev2_args {
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pkey_mprotect_args {
|
||||
char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)];
|
||||
char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pkey_alloc_args {
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
char init_val_l_[PADL_(l_ulong)]; l_ulong init_val; char init_val_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_pkey_free_args {
|
||||
char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)];
|
||||
};
|
||||
#define nosys linux_nosys
|
||||
int linux_open(struct thread *, struct linux_open_args *);
|
||||
@ -1339,7 +1472,7 @@ int linux_move_pages(struct thread *, struct linux_move_pages_args *);
|
||||
int linux_utimensat(struct thread *, struct linux_utimensat_args *);
|
||||
int linux_epoll_pwait(struct thread *, struct linux_epoll_pwait_args *);
|
||||
int linux_signalfd(struct thread *, struct linux_signalfd_args *);
|
||||
int linux_timerfd(struct thread *, struct linux_timerfd_args *);
|
||||
int linux_timerfd_create(struct thread *, struct linux_timerfd_create_args *);
|
||||
int linux_eventfd(struct thread *, struct linux_eventfd_args *);
|
||||
int linux_fallocate(struct thread *, struct linux_fallocate_args *);
|
||||
int linux_timerfd_settime(struct thread *, struct linux_timerfd_settime_args *);
|
||||
@ -1353,7 +1486,7 @@ int linux_pipe2(struct thread *, struct linux_pipe2_args *);
|
||||
int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *);
|
||||
int linux_preadv(struct thread *, struct linux_preadv_args *);
|
||||
int linux_pwritev(struct thread *, struct linux_pwritev_args *);
|
||||
int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *);
|
||||
int linux_rt_tgsigqueueinfo(struct thread *, struct linux_rt_tgsigqueueinfo_args *);
|
||||
int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *);
|
||||
int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *);
|
||||
int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *);
|
||||
@ -1365,10 +1498,29 @@ int linux_clock_adjtime(struct thread *, struct linux_clock_adjtime_args *);
|
||||
int linux_syncfs(struct thread *, struct linux_syncfs_args *);
|
||||
int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *);
|
||||
int linux_setns(struct thread *, struct linux_setns_args *);
|
||||
int linux_getcpu(struct thread *, struct linux_getcpu_args *);
|
||||
int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *);
|
||||
int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *);
|
||||
int linux_kcmp(struct thread *, struct linux_kcmp_args *);
|
||||
int linux_finit_module(struct thread *, struct linux_finit_module_args *);
|
||||
int linux_sched_setattr(struct thread *, struct linux_sched_setattr_args *);
|
||||
int linux_sched_getattr(struct thread *, struct linux_sched_getattr_args *);
|
||||
int linux_renameat2(struct thread *, struct linux_renameat2_args *);
|
||||
int linux_seccomp(struct thread *, struct linux_seccomp_args *);
|
||||
int linux_getrandom(struct thread *, struct linux_getrandom_args *);
|
||||
int linux_memfd_create(struct thread *, struct linux_memfd_create_args *);
|
||||
int linux_kexec_file_load(struct thread *, struct linux_kexec_file_load_args *);
|
||||
int linux_bpf(struct thread *, struct linux_bpf_args *);
|
||||
int linux_execveat(struct thread *, struct linux_execveat_args *);
|
||||
int linux_userfaultfd(struct thread *, struct linux_userfaultfd_args *);
|
||||
int linux_membarrier(struct thread *, struct linux_membarrier_args *);
|
||||
int linux_mlock2(struct thread *, struct linux_mlock2_args *);
|
||||
int linux_copy_file_range(struct thread *, struct linux_copy_file_range_args *);
|
||||
int linux_preadv2(struct thread *, struct linux_preadv2_args *);
|
||||
int linux_pwritev2(struct thread *, struct linux_pwritev2_args *);
|
||||
int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *);
|
||||
int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *);
|
||||
int linux_pkey_free(struct thread *, struct linux_pkey_free_args *);
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
@ -1632,7 +1784,7 @@ int linux_finit_module(struct thread *, struct linux_finit_module_args *);
|
||||
#define LINUX_SYS_AUE_linux_utimensat AUE_FUTIMESAT
|
||||
#define LINUX_SYS_AUE_linux_epoll_pwait AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_signalfd AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_timerfd AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_timerfd_create AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_eventfd AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_fallocate AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_timerfd_settime AUE_NULL
|
||||
@ -1646,7 +1798,7 @@ int linux_finit_module(struct thread *, struct linux_finit_module_args *);
|
||||
#define LINUX_SYS_AUE_linux_inotify_init1 AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_preadv AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_pwritev AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_rt_tgsigqueueinfo AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_perf_event_open AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_recvmmsg AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_fanotify_init AUE_NULL
|
||||
@ -1658,10 +1810,29 @@ int linux_finit_module(struct thread *, struct linux_finit_module_args *);
|
||||
#define LINUX_SYS_AUE_linux_syncfs AUE_SYNC
|
||||
#define LINUX_SYS_AUE_linux_sendmmsg AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_setns AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_getcpu AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_process_vm_readv AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_process_vm_writev AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_kcmp AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_finit_module AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_sched_setattr AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_sched_getattr AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_renameat2 AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_seccomp AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_getrandom AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_memfd_create AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_kexec_file_load AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_bpf AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_execveat AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_userfaultfd AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_membarrier AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_mlock2 AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_copy_file_range AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_preadv2 AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_pwritev2 AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_pkey_mprotect AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_pkey_alloc AUE_NULL
|
||||
#define LINUX_SYS_AUE_linux_pkey_free AUE_NULL
|
||||
|
||||
#undef PAD_
|
||||
#undef PADL_
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#define LINUX_SYS_read 0
|
||||
@ -277,7 +277,7 @@
|
||||
#define LINUX_SYS_linux_utimensat 280
|
||||
#define LINUX_SYS_linux_epoll_pwait 281
|
||||
#define LINUX_SYS_linux_signalfd 282
|
||||
#define LINUX_SYS_linux_timerfd 283
|
||||
#define LINUX_SYS_linux_timerfd_create 283
|
||||
#define LINUX_SYS_linux_eventfd 284
|
||||
#define LINUX_SYS_linux_fallocate 285
|
||||
#define LINUX_SYS_linux_timerfd_settime 286
|
||||
@ -291,7 +291,7 @@
|
||||
#define LINUX_SYS_linux_inotify_init1 294
|
||||
#define LINUX_SYS_linux_preadv 295
|
||||
#define LINUX_SYS_linux_pwritev 296
|
||||
#define LINUX_SYS_linux_rt_tsigqueueinfo 297
|
||||
#define LINUX_SYS_linux_rt_tgsigqueueinfo 297
|
||||
#define LINUX_SYS_linux_perf_event_open 298
|
||||
#define LINUX_SYS_linux_recvmmsg 299
|
||||
#define LINUX_SYS_linux_fanotify_init 300
|
||||
@ -303,8 +303,27 @@
|
||||
#define LINUX_SYS_linux_syncfs 306
|
||||
#define LINUX_SYS_linux_sendmmsg 307
|
||||
#define LINUX_SYS_linux_setns 308
|
||||
#define LINUX_SYS_linux_process_vm_readv 309
|
||||
#define LINUX_SYS_linux_process_vm_writev 310
|
||||
#define LINUX_SYS_linux_kcmp 311
|
||||
#define LINUX_SYS_linux_finit_module 312
|
||||
#define LINUX_SYS_MAXSYSCALL 314
|
||||
#define LINUX_SYS_linux_getcpu 309
|
||||
#define LINUX_SYS_linux_process_vm_readv 310
|
||||
#define LINUX_SYS_linux_process_vm_writev 311
|
||||
#define LINUX_SYS_linux_kcmp 312
|
||||
#define LINUX_SYS_linux_finit_module 313
|
||||
#define LINUX_SYS_linux_sched_setattr 314
|
||||
#define LINUX_SYS_linux_sched_getattr 315
|
||||
#define LINUX_SYS_linux_renameat2 316
|
||||
#define LINUX_SYS_linux_seccomp 317
|
||||
#define LINUX_SYS_linux_getrandom 318
|
||||
#define LINUX_SYS_linux_memfd_create 319
|
||||
#define LINUX_SYS_linux_kexec_file_load 320
|
||||
#define LINUX_SYS_linux_bpf 321
|
||||
#define LINUX_SYS_linux_execveat 322
|
||||
#define LINUX_SYS_linux_userfaultfd 323
|
||||
#define LINUX_SYS_linux_membarrier 324
|
||||
#define LINUX_SYS_linux_mlock2 325
|
||||
#define LINUX_SYS_linux_copy_file_range 326
|
||||
#define LINUX_SYS_linux_preadv2 327
|
||||
#define LINUX_SYS_linux_pwritev2 328
|
||||
#define LINUX_SYS_linux_pkey_mprotect 329
|
||||
#define LINUX_SYS_linux_pkey_alloc 330
|
||||
#define LINUX_SYS_linux_pkey_free 331
|
||||
#define LINUX_SYS_MAXSYSCALL 333
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
const char *linux_syscallnames[] = {
|
||||
@ -217,7 +217,7 @@ const char *linux_syscallnames[] = {
|
||||
"#206", /* 206 = linux_io_setup */
|
||||
"#207", /* 207 = linux_io_destroy */
|
||||
"#208", /* 208 = linux_io_getevents */
|
||||
"#209", /* 209 = inux_io_submit */
|
||||
"#209", /* 209 = linux_io_submit */
|
||||
"#210", /* 210 = linux_io_cancel */
|
||||
"#211", /* 211 = linux_get_thread_area */
|
||||
"linux_lookup_dcookie", /* 212 = linux_lookup_dcookie */
|
||||
@ -291,7 +291,7 @@ const char *linux_syscallnames[] = {
|
||||
"linux_utimensat", /* 280 = linux_utimensat */
|
||||
"linux_epoll_pwait", /* 281 = linux_epoll_pwait */
|
||||
"linux_signalfd", /* 282 = linux_signalfd */
|
||||
"linux_timerfd", /* 283 = linux_timerfd */
|
||||
"linux_timerfd_create", /* 283 = linux_timerfd_create */
|
||||
"linux_eventfd", /* 284 = linux_eventfd */
|
||||
"linux_fallocate", /* 285 = linux_fallocate */
|
||||
"linux_timerfd_settime", /* 286 = linux_timerfd_settime */
|
||||
@ -305,7 +305,7 @@ const char *linux_syscallnames[] = {
|
||||
"linux_inotify_init1", /* 294 = linux_inotify_init1 */
|
||||
"linux_preadv", /* 295 = linux_preadv */
|
||||
"linux_pwritev", /* 296 = linux_pwritev */
|
||||
"linux_rt_tsigqueueinfo", /* 297 = linux_rt_tsigqueueinfo */
|
||||
"linux_rt_tgsigqueueinfo", /* 297 = linux_rt_tgsigqueueinfo */
|
||||
"linux_perf_event_open", /* 298 = linux_perf_event_open */
|
||||
"linux_recvmmsg", /* 299 = linux_recvmmsg */
|
||||
"linux_fanotify_init", /* 300 = linux_fanotify_init */
|
||||
@ -317,9 +317,28 @@ const char *linux_syscallnames[] = {
|
||||
"linux_syncfs", /* 306 = linux_syncfs */
|
||||
"linux_sendmmsg", /* 307 = linux_sendmmsg */
|
||||
"linux_setns", /* 308 = linux_setns */
|
||||
"linux_process_vm_readv", /* 309 = linux_process_vm_readv */
|
||||
"linux_process_vm_writev", /* 310 = linux_process_vm_writev */
|
||||
"linux_kcmp", /* 311 = linux_kcmp */
|
||||
"linux_finit_module", /* 312 = linux_finit_module */
|
||||
"#313", /* 313 = nosys */
|
||||
"linux_getcpu", /* 309 = linux_getcpu */
|
||||
"linux_process_vm_readv", /* 310 = linux_process_vm_readv */
|
||||
"linux_process_vm_writev", /* 311 = linux_process_vm_writev */
|
||||
"linux_kcmp", /* 312 = linux_kcmp */
|
||||
"linux_finit_module", /* 313 = linux_finit_module */
|
||||
"linux_sched_setattr", /* 314 = linux_sched_setattr */
|
||||
"linux_sched_getattr", /* 315 = linux_sched_getattr */
|
||||
"linux_renameat2", /* 316 = linux_renameat2 */
|
||||
"linux_seccomp", /* 317 = linux_seccomp */
|
||||
"linux_getrandom", /* 318 = linux_getrandom */
|
||||
"linux_memfd_create", /* 319 = linux_memfd_create */
|
||||
"linux_kexec_file_load", /* 320 = linux_kexec_file_load */
|
||||
"linux_bpf", /* 321 = linux_bpf */
|
||||
"linux_execveat", /* 322 = linux_execveat */
|
||||
"linux_userfaultfd", /* 323 = linux_userfaultfd */
|
||||
"linux_membarrier", /* 324 = linux_membarrier */
|
||||
"linux_mlock2", /* 325 = linux_mlock2 */
|
||||
"linux_copy_file_range", /* 326 = linux_copy_file_range */
|
||||
"linux_preadv2", /* 327 = linux_preadv2 */
|
||||
"linux_pwritev2", /* 328 = linux_pwritev2 */
|
||||
"linux_pkey_mprotect", /* 329 = linux_pkey_mprotect */
|
||||
"linux_pkey_alloc", /* 330 = linux_pkey_alloc */
|
||||
"linux_pkey_free", /* 331 = linux_pkey_free */
|
||||
"#332", /* 332 = nosys */
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -227,7 +227,7 @@ struct sysent linux_sysent[] = {
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 206 = linux_io_setup */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 207 = linux_io_destroy */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 208 = linux_io_getevents */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = inux_io_submit */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 209 = linux_io_submit */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 210 = linux_io_cancel */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 211 = linux_get_thread_area */
|
||||
{ 0, (sy_call_t *)linux_lookup_dcookie, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 212 = linux_lookup_dcookie */
|
||||
@ -301,7 +301,7 @@ struct sysent linux_sysent[] = {
|
||||
{ AS(linux_utimensat_args), (sy_call_t *)linux_utimensat, AUE_FUTIMESAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 280 = linux_utimensat */
|
||||
{ AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 281 = linux_epoll_pwait */
|
||||
{ 0, (sy_call_t *)linux_signalfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 282 = linux_signalfd */
|
||||
{ 0, (sy_call_t *)linux_timerfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd */
|
||||
{ 0, (sy_call_t *)linux_timerfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 283 = linux_timerfd_create */
|
||||
{ AS(linux_eventfd_args), (sy_call_t *)linux_eventfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 284 = linux_eventfd */
|
||||
{ AS(linux_fallocate_args), (sy_call_t *)linux_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 285 = linux_fallocate */
|
||||
{ 0, (sy_call_t *)linux_timerfd_settime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 286 = linux_timerfd_settime */
|
||||
@ -312,10 +312,10 @@ struct sysent linux_sysent[] = {
|
||||
{ AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 291 = linux_epoll_create1 */
|
||||
{ AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 292 = linux_dup3 */
|
||||
{ AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 293 = linux_pipe2 */
|
||||
{ 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */
|
||||
{ 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 295 = linux_preadv */
|
||||
{ 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */
|
||||
{ 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tsigqueueinfo */
|
||||
{ AS(linux_inotify_init1_args), (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 294 = linux_inotify_init1 */
|
||||
{ AS(linux_preadv_args), (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 295 = linux_preadv */
|
||||
{ AS(linux_pwritev_args), (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 296 = linux_pwritev */
|
||||
{ AS(linux_rt_tgsigqueueinfo_args), (sy_call_t *)linux_rt_tgsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 297 = linux_rt_tgsigqueueinfo */
|
||||
{ 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 298 = linux_perf_event_open */
|
||||
{ AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 299 = linux_recvmmsg */
|
||||
{ 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 300 = linux_fanotify_init */
|
||||
@ -326,10 +326,29 @@ struct sysent linux_sysent[] = {
|
||||
{ 0, (sy_call_t *)linux_clock_adjtime, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 305 = linux_clock_adjtime */
|
||||
{ AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 306 = linux_syncfs */
|
||||
{ AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 307 = linux_sendmmsg */
|
||||
{ 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */
|
||||
{ 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_process_vm_readv */
|
||||
{ 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_writev */
|
||||
{ 0, (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_kcmp */
|
||||
{ 0, (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_finit_module */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 313 = nosys */
|
||||
{ AS(linux_setns_args), (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 308 = linux_setns */
|
||||
{ AS(linux_getcpu_args), (sy_call_t *)linux_getcpu, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 309 = linux_getcpu */
|
||||
{ AS(linux_process_vm_readv_args), (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 310 = linux_process_vm_readv */
|
||||
{ AS(linux_process_vm_writev_args), (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 311 = linux_process_vm_writev */
|
||||
{ AS(linux_kcmp_args), (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 312 = linux_kcmp */
|
||||
{ AS(linux_finit_module_args), (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 313 = linux_finit_module */
|
||||
{ AS(linux_sched_setattr_args), (sy_call_t *)linux_sched_setattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 314 = linux_sched_setattr */
|
||||
{ AS(linux_sched_getattr_args), (sy_call_t *)linux_sched_getattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 315 = linux_sched_getattr */
|
||||
{ AS(linux_renameat2_args), (sy_call_t *)linux_renameat2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 316 = linux_renameat2 */
|
||||
{ AS(linux_seccomp_args), (sy_call_t *)linux_seccomp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 317 = linux_seccomp */
|
||||
{ AS(linux_getrandom_args), (sy_call_t *)linux_getrandom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 318 = linux_getrandom */
|
||||
{ AS(linux_memfd_create_args), (sy_call_t *)linux_memfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 319 = linux_memfd_create */
|
||||
{ AS(linux_kexec_file_load_args), (sy_call_t *)linux_kexec_file_load, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 320 = linux_kexec_file_load */
|
||||
{ AS(linux_bpf_args), (sy_call_t *)linux_bpf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 321 = linux_bpf */
|
||||
{ AS(linux_execveat_args), (sy_call_t *)linux_execveat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 322 = linux_execveat */
|
||||
{ AS(linux_userfaultfd_args), (sy_call_t *)linux_userfaultfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 323 = linux_userfaultfd */
|
||||
{ AS(linux_membarrier_args), (sy_call_t *)linux_membarrier, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 324 = linux_membarrier */
|
||||
{ AS(linux_mlock2_args), (sy_call_t *)linux_mlock2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 325 = linux_mlock2 */
|
||||
{ AS(linux_copy_file_range_args), (sy_call_t *)linux_copy_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 326 = linux_copy_file_range */
|
||||
{ AS(linux_preadv2_args), (sy_call_t *)linux_preadv2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 327 = linux_preadv2 */
|
||||
{ AS(linux_pwritev2_args), (sy_call_t *)linux_pwritev2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 328 = linux_pwritev2 */
|
||||
{ AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 329 = linux_pkey_mprotect */
|
||||
{ AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_pkey_alloc */
|
||||
{ AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pkey_free */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 332 = nosys */
|
||||
};
|
||||
|
@ -2076,7 +2076,7 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
|
||||
*n_args = 0;
|
||||
break;
|
||||
}
|
||||
/* linux_timerfd */
|
||||
/* linux_timerfd_create */
|
||||
case 283: {
|
||||
*n_args = 0;
|
||||
break;
|
||||
@ -2157,22 +2157,41 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
|
||||
}
|
||||
/* linux_inotify_init1 */
|
||||
case 294: {
|
||||
*n_args = 0;
|
||||
struct linux_inotify_init1_args *p = params;
|
||||
iarg[0] = p->flags; /* l_int */
|
||||
*n_args = 1;
|
||||
break;
|
||||
}
|
||||
/* linux_preadv */
|
||||
case 295: {
|
||||
*n_args = 0;
|
||||
struct linux_preadv_args *p = params;
|
||||
iarg[0] = p->fd; /* l_ulong */
|
||||
uarg[1] = (intptr_t) p->vec; /* struct iovec * */
|
||||
iarg[2] = p->vlen; /* l_ulong */
|
||||
iarg[3] = p->pos_l; /* l_ulong */
|
||||
iarg[4] = p->pos_h; /* l_ulong */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_pwritev */
|
||||
case 296: {
|
||||
*n_args = 0;
|
||||
struct linux_pwritev_args *p = params;
|
||||
iarg[0] = p->fd; /* l_ulong */
|
||||
uarg[1] = (intptr_t) p->vec; /* struct iovec * */
|
||||
iarg[2] = p->vlen; /* l_ulong */
|
||||
iarg[3] = p->pos_l; /* l_ulong */
|
||||
iarg[4] = p->pos_h; /* l_ulong */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_rt_tsigqueueinfo */
|
||||
/* linux_rt_tgsigqueueinfo */
|
||||
case 297: {
|
||||
*n_args = 0;
|
||||
struct linux_rt_tgsigqueueinfo_args *p = params;
|
||||
iarg[0] = p->tgid; /* l_pid_t */
|
||||
iarg[1] = p->tid; /* l_pid_t */
|
||||
iarg[2] = p->sig; /* l_int */
|
||||
uarg[3] = (intptr_t) p->uinfo; /* l_siginfo_t * */
|
||||
*n_args = 4;
|
||||
break;
|
||||
}
|
||||
/* linux_perf_event_open */
|
||||
@ -2245,27 +2264,235 @@ systrace_args(int sysnum, void *params, uint64_t *uarg, int *n_args)
|
||||
}
|
||||
/* linux_setns */
|
||||
case 308: {
|
||||
*n_args = 0;
|
||||
struct linux_setns_args *p = params;
|
||||
iarg[0] = p->fd; /* l_int */
|
||||
iarg[1] = p->nstype; /* l_int */
|
||||
*n_args = 2;
|
||||
break;
|
||||
}
|
||||
/* linux_getcpu */
|
||||
case 309: {
|
||||
struct linux_getcpu_args *p = params;
|
||||
uarg[0] = (intptr_t) p->cpu; /* l_uint * */
|
||||
uarg[1] = (intptr_t) p->node; /* l_uint * */
|
||||
uarg[2] = (intptr_t) p->cache; /* void * */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_process_vm_readv */
|
||||
case 309: {
|
||||
*n_args = 0;
|
||||
case 310: {
|
||||
struct linux_process_vm_readv_args *p = params;
|
||||
iarg[0] = p->pid; /* l_pid_t */
|
||||
uarg[1] = (intptr_t) p->lvec; /* const struct iovec * */
|
||||
iarg[2] = p->liovcnt; /* l_ulong */
|
||||
uarg[3] = (intptr_t) p->rvec; /* const struct iovec * */
|
||||
iarg[4] = p->riovcnt; /* l_ulong */
|
||||
iarg[5] = p->flags; /* l_ulong */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
/* linux_process_vm_writev */
|
||||
case 310: {
|
||||
*n_args = 0;
|
||||
case 311: {
|
||||
struct linux_process_vm_writev_args *p = params;
|
||||
iarg[0] = p->pid; /* l_pid_t */
|
||||
uarg[1] = (intptr_t) p->lvec; /* const struct iovec * */
|
||||
iarg[2] = p->liovcnt; /* l_ulong */
|
||||
uarg[3] = (intptr_t) p->rvec; /* const struct iovec * */
|
||||
iarg[4] = p->riovcnt; /* l_ulong */
|
||||
iarg[5] = p->flags; /* l_ulong */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
/* linux_kcmp */
|
||||
case 311: {
|
||||
*n_args = 0;
|
||||
case 312: {
|
||||
struct linux_kcmp_args *p = params;
|
||||
iarg[0] = p->pid1; /* l_pid_t */
|
||||
iarg[1] = p->pid2; /* l_pid_t */
|
||||
iarg[2] = p->type; /* l_int */
|
||||
iarg[3] = p->idx1; /* l_ulong */
|
||||
iarg[4] = p->idx; /* l_ulong */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_finit_module */
|
||||
case 312: {
|
||||
*n_args = 0;
|
||||
case 313: {
|
||||
struct linux_finit_module_args *p = params;
|
||||
iarg[0] = p->fd; /* l_int */
|
||||
uarg[1] = (intptr_t) p->uargs; /* const char * */
|
||||
iarg[2] = p->flags; /* l_int */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_sched_setattr */
|
||||
case 314: {
|
||||
struct linux_sched_setattr_args *p = params;
|
||||
iarg[0] = p->pid; /* l_pid_t */
|
||||
uarg[1] = (intptr_t) p->attr; /* void * */
|
||||
iarg[2] = p->flags; /* l_uint */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_sched_getattr */
|
||||
case 315: {
|
||||
struct linux_sched_getattr_args *p = params;
|
||||
iarg[0] = p->pid; /* l_pid_t */
|
||||
uarg[1] = (intptr_t) p->attr; /* void * */
|
||||
iarg[2] = p->size; /* l_uint */
|
||||
iarg[3] = p->flags; /* l_uint */
|
||||
*n_args = 4;
|
||||
break;
|
||||
}
|
||||
/* linux_renameat2 */
|
||||
case 316: {
|
||||
struct linux_renameat2_args *p = params;
|
||||
iarg[0] = p->oldfd; /* l_int */
|
||||
uarg[1] = (intptr_t) p->oldname; /* const char * */
|
||||
iarg[2] = p->newfd; /* l_int */
|
||||
uarg[3] = (intptr_t) p->newname; /* const char * */
|
||||
uarg[4] = p->flags; /* unsigned int */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_seccomp */
|
||||
case 317: {
|
||||
struct linux_seccomp_args *p = params;
|
||||
iarg[0] = p->op; /* l_uint */
|
||||
iarg[1] = p->flags; /* l_uint */
|
||||
uarg[2] = (intptr_t) p->uargs; /* const char * */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_getrandom */
|
||||
case 318: {
|
||||
struct linux_getrandom_args *p = params;
|
||||
uarg[0] = (intptr_t) p->buf; /* char * */
|
||||
iarg[1] = p->count; /* l_size_t */
|
||||
iarg[2] = p->flags; /* l_uint */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_memfd_create */
|
||||
case 319: {
|
||||
struct linux_memfd_create_args *p = params;
|
||||
uarg[0] = (intptr_t) p->uname_ptr; /* const char * */
|
||||
iarg[1] = p->flags; /* l_uint */
|
||||
*n_args = 2;
|
||||
break;
|
||||
}
|
||||
/* linux_kexec_file_load */
|
||||
case 320: {
|
||||
struct linux_kexec_file_load_args *p = params;
|
||||
iarg[0] = p->kernel_fd; /* l_int */
|
||||
iarg[1] = p->initrd_fd; /* l_int */
|
||||
iarg[2] = p->cmdline_len; /* l_ulong */
|
||||
uarg[3] = (intptr_t) p->cmdline_ptr; /* const char * */
|
||||
iarg[4] = p->flags; /* l_ulong */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_bpf */
|
||||
case 321: {
|
||||
struct linux_bpf_args *p = params;
|
||||
iarg[0] = p->cmd; /* l_int */
|
||||
uarg[1] = (intptr_t) p->attr; /* void * */
|
||||
iarg[2] = p->size; /* l_uint */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_execveat */
|
||||
case 322: {
|
||||
struct linux_execveat_args *p = params;
|
||||
iarg[0] = p->dfd; /* l_int */
|
||||
uarg[1] = (intptr_t) p->filename; /* const char * */
|
||||
uarg[2] = (intptr_t) p->argv; /* const char ** */
|
||||
uarg[3] = (intptr_t) p->envp; /* const char ** */
|
||||
iarg[4] = p->flags; /* l_int */
|
||||
*n_args = 5;
|
||||
break;
|
||||
}
|
||||
/* linux_userfaultfd */
|
||||
case 323: {
|
||||
struct linux_userfaultfd_args *p = params;
|
||||
iarg[0] = p->flags; /* l_int */
|
||||
*n_args = 1;
|
||||
break;
|
||||
}
|
||||
/* linux_membarrier */
|
||||
case 324: {
|
||||
struct linux_membarrier_args *p = params;
|
||||
iarg[0] = p->cmd; /* l_int */
|
||||
iarg[1] = p->flags; /* l_int */
|
||||
*n_args = 2;
|
||||
break;
|
||||
}
|
||||
/* linux_mlock2 */
|
||||
case 325: {
|
||||
struct linux_mlock2_args *p = params;
|
||||
iarg[0] = p->start; /* l_ulong */
|
||||
iarg[1] = p->len; /* l_size_t */
|
||||
iarg[2] = p->flags; /* l_int */
|
||||
*n_args = 3;
|
||||
break;
|
||||
}
|
||||
/* linux_copy_file_range */
|
||||
case 326: {
|
||||
struct linux_copy_file_range_args *p = params;
|
||||
iarg[0] = p->fd_in; /* l_int */
|
||||
uarg[1] = (intptr_t) p->off_in; /* l_loff_t * */
|
||||
iarg[2] = p->fd_out; /* l_int */
|
||||
uarg[3] = (intptr_t) p->off_out; /* l_loff_t * */
|
||||
iarg[4] = p->len; /* l_size_t */
|
||||
iarg[5] = p->flags; /* l_uint */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
/* linux_preadv2 */
|
||||
case 327: {
|
||||
struct linux_preadv2_args *p = params;
|
||||
iarg[0] = p->fd; /* l_ulong */
|
||||
uarg[1] = (intptr_t) p->vec; /* const struct iovec * */
|
||||
iarg[2] = p->vlen; /* l_ulong */
|
||||
iarg[3] = p->pos_l; /* l_ulong */
|
||||
iarg[4] = p->pos_h; /* l_ulong */
|
||||
iarg[5] = p->flags; /* l_int */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
/* linux_pwritev2 */
|
||||
case 328: {
|
||||
struct linux_pwritev2_args *p = params;
|
||||
iarg[0] = p->fd; /* l_ulong */
|
||||
uarg[1] = (intptr_t) p->vec; /* const struct iovec * */
|
||||
iarg[2] = p->vlen; /* l_ulong */
|
||||
iarg[3] = p->pos_l; /* l_ulong */
|
||||
iarg[4] = p->pos_h; /* l_ulong */
|
||||
iarg[5] = p->flags; /* l_int */
|
||||
*n_args = 6;
|
||||
break;
|
||||
}
|
||||
/* linux_pkey_mprotect */
|
||||
case 329: {
|
||||
struct linux_pkey_mprotect_args *p = params;
|
||||
iarg[0] = p->start; /* l_ulong */
|
||||
iarg[1] = p->len; /* l_size_t */
|
||||
iarg[2] = p->prot; /* l_ulong */
|
||||
iarg[3] = p->pkey; /* l_int */
|
||||
*n_args = 4;
|
||||
break;
|
||||
}
|
||||
/* linux_pkey_alloc */
|
||||
case 330: {
|
||||
struct linux_pkey_alloc_args *p = params;
|
||||
iarg[0] = p->flags; /* l_ulong */
|
||||
iarg[1] = p->init_val; /* l_ulong */
|
||||
*n_args = 2;
|
||||
break;
|
||||
}
|
||||
/* linux_pkey_free */
|
||||
case 331: {
|
||||
struct linux_pkey_free_args *p = params;
|
||||
iarg[0] = p->pkey; /* l_int */
|
||||
*n_args = 1;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -5415,7 +5642,7 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
/* linux_signalfd */
|
||||
case 282:
|
||||
break;
|
||||
/* linux_timerfd */
|
||||
/* linux_timerfd_create */
|
||||
case 283:
|
||||
break;
|
||||
/* linux_eventfd */
|
||||
@ -5529,15 +5756,76 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
/* linux_inotify_init1 */
|
||||
case 294:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_preadv */
|
||||
case 295:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_pwritev */
|
||||
case 296:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_rt_tsigqueueinfo */
|
||||
/* linux_rt_tgsigqueueinfo */
|
||||
case 297:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland l_siginfo_t *";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_perf_event_open */
|
||||
case 298:
|
||||
@ -5629,18 +5917,438 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
/* linux_setns */
|
||||
case 308:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_getcpu */
|
||||
case 309:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "userland l_uint *";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland l_uint *";
|
||||
break;
|
||||
case 2:
|
||||
p = "userland void *";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_process_vm_readv */
|
||||
case 309:
|
||||
case 310:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 5:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_process_vm_writev */
|
||||
case 310:
|
||||
case 311:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 5:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_kcmp */
|
||||
case 311:
|
||||
case 312:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_finit_module */
|
||||
case 312:
|
||||
case 313:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_sched_setattr */
|
||||
case 314:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland void *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_sched_getattr */
|
||||
case 315:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_pid_t";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland void *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_uint";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_renameat2 */
|
||||
case 316:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 4:
|
||||
p = "unsigned int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_seccomp */
|
||||
case 317:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_uint";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_uint";
|
||||
break;
|
||||
case 2:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_getrandom */
|
||||
case 318:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "userland char *";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_size_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_memfd_create */
|
||||
case 319:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_kexec_file_load */
|
||||
case 320:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_bpf */
|
||||
case 321:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland void *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_execveat */
|
||||
case 322:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const char *";
|
||||
break;
|
||||
case 2:
|
||||
p = "userland const char **";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland const char **";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_userfaultfd */
|
||||
case 323:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_membarrier */
|
||||
case 324:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_mlock2 */
|
||||
case 325:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_size_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_copy_file_range */
|
||||
case 326:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland l_loff_t *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_int";
|
||||
break;
|
||||
case 3:
|
||||
p = "userland l_loff_t *";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_size_t";
|
||||
break;
|
||||
case 5:
|
||||
p = "l_uint";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_preadv2 */
|
||||
case 327:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 5:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_pwritev2 */
|
||||
case 328:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "userland const struct iovec *";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 4:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 5:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_pkey_mprotect */
|
||||
case 329:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_size_t";
|
||||
break;
|
||||
case 2:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 3:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_pkey_alloc */
|
||||
case 330:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
case 1:
|
||||
p = "l_ulong";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
/* linux_pkey_free */
|
||||
case 331:
|
||||
switch(ndx) {
|
||||
case 0:
|
||||
p = "l_int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -6784,7 +7492,7 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
/* linux_signalfd */
|
||||
case 282:
|
||||
/* linux_timerfd */
|
||||
/* linux_timerfd_create */
|
||||
case 283:
|
||||
/* linux_eventfd */
|
||||
case 284:
|
||||
@ -6829,12 +7537,24 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
/* linux_inotify_init1 */
|
||||
case 294:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_preadv */
|
||||
case 295:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_pwritev */
|
||||
case 296:
|
||||
/* linux_rt_tsigqueueinfo */
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_rt_tgsigqueueinfo */
|
||||
case 297:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_perf_event_open */
|
||||
case 298:
|
||||
/* linux_recvmmsg */
|
||||
@ -6869,14 +7589,124 @@ systrace_return_setargdesc(int sysnum, int ndx, char *desc, size_t descsz)
|
||||
break;
|
||||
/* linux_setns */
|
||||
case 308:
|
||||
/* linux_process_vm_readv */
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_getcpu */
|
||||
case 309:
|
||||
/* linux_process_vm_writev */
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_process_vm_readv */
|
||||
case 310:
|
||||
/* linux_kcmp */
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_process_vm_writev */
|
||||
case 311:
|
||||
/* linux_finit_module */
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_kcmp */
|
||||
case 312:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_finit_module */
|
||||
case 313:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_sched_setattr */
|
||||
case 314:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_sched_getattr */
|
||||
case 315:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_renameat2 */
|
||||
case 316:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_seccomp */
|
||||
case 317:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_getrandom */
|
||||
case 318:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_memfd_create */
|
||||
case 319:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_kexec_file_load */
|
||||
case 320:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_bpf */
|
||||
case 321:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_execveat */
|
||||
case 322:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_userfaultfd */
|
||||
case 323:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_membarrier */
|
||||
case 324:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_mlock2 */
|
||||
case 325:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_copy_file_range */
|
||||
case 326:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_preadv2 */
|
||||
case 327:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_pwritev2 */
|
||||
case 328:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_pkey_mprotect */
|
||||
case 329:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_pkey_alloc */
|
||||
case 330:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
/* linux_pkey_free */
|
||||
case 331:
|
||||
if (ndx == 0 || ndx == 1)
|
||||
p = "int";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
|
@ -11,18 +11,20 @@
|
||||
; there is no audit event for the call at this time. For the
|
||||
; case where the event exists, but we don't want auditing, the
|
||||
; event should be #defined to AUE_NULL in audit_kevents.h.
|
||||
; type one of STD, OBSOL, UNIMPL
|
||||
; type one of STD, NOPROTO, UNIMPL
|
||||
; name psuedo-prototype of syscall routine
|
||||
; If one of the following alts is different, then all appear:
|
||||
; altname name of system call if different
|
||||
; alttag name of args struct tag if different from [o]`name'"_args"
|
||||
; altrtyp return type if not int (bogus - syscalls always return int)
|
||||
; for UNIMPL/OBSOL, name continues with comments
|
||||
; for UNIMPL, name continues with comments
|
||||
|
||||
; types:
|
||||
; STD always included
|
||||
; OBSOL obsolete, not included in system, only specifies name
|
||||
; UNIMPL not implemented, placeholder only
|
||||
; NOPROTO same as STD except do not create structure or
|
||||
; function prototype in sys/sysproto.h. Does add a
|
||||
; definition to syscall.h besides adding a sysent.
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/sysent.h>
|
||||
@ -369,7 +371,7 @@
|
||||
206 AUE_NULL UNIMPL linux_io_setup
|
||||
207 AUE_NULL UNIMPL linux_io_destroy
|
||||
208 AUE_NULL UNIMPL linux_io_getevents
|
||||
209 AUE_NULL UNIMPL inux_io_submit
|
||||
209 AUE_NULL UNIMPL linux_io_submit
|
||||
210 AUE_NULL UNIMPL linux_io_cancel
|
||||
211 AUE_NULL UNIMPL linux_get_thread_area
|
||||
212 AUE_NULL STD { int linux_lookup_dcookie(void); }
|
||||
@ -473,7 +475,7 @@
|
||||
281 AUE_NULL STD { int linux_epoll_pwait(l_int epfd, struct epoll_event *events, \
|
||||
l_int maxevents, l_int timeout, l_sigset_t *mask); }
|
||||
282 AUE_NULL STD { int linux_signalfd(void); }
|
||||
283 AUE_NULL STD { int linux_timerfd(void); }
|
||||
283 AUE_NULL STD { int linux_timerfd_create(void); }
|
||||
284 AUE_NULL STD { int linux_eventfd(l_uint initval); }
|
||||
285 AUE_NULL STD { int linux_fallocate(l_int fd, l_int mode, \
|
||||
l_loff_t offset, l_loff_t len); }
|
||||
@ -481,35 +483,114 @@
|
||||
287 AUE_NULL STD { int linux_timerfd_gettime(void); }
|
||||
288 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \
|
||||
l_uintptr_t namelen, int flags); }
|
||||
; linux 2.6.27:
|
||||
289 AUE_NULL STD { int linux_signalfd4(void); }
|
||||
290 AUE_NULL STD { int linux_eventfd2(l_uint initval, l_int flags); }
|
||||
291 AUE_NULL STD { int linux_epoll_create1(l_int flags); }
|
||||
292 AUE_NULL STD { int linux_dup3(l_int oldfd, \
|
||||
l_int newfd, l_int flags); }
|
||||
293 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); }
|
||||
294 AUE_NULL STD { int linux_inotify_init1(void); }
|
||||
295 AUE_NULL STD { int linux_preadv(void); }
|
||||
296 AUE_NULL STD { int linux_pwritev(void); }
|
||||
297 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); }
|
||||
294 AUE_NULL STD { int linux_inotify_init1(l_int flags); }
|
||||
; linux 2.6.30:
|
||||
295 AUE_NULL STD { int linux_preadv(l_ulong fd, \
|
||||
struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h); }
|
||||
296 AUE_NULL STD { int linux_pwritev(l_ulong fd, \
|
||||
struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h); }
|
||||
; linux 2.6.31:
|
||||
297 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \
|
||||
l_pid_t tid, l_int sig, l_siginfo_t *uinfo); }
|
||||
298 AUE_NULL STD { int linux_perf_event_open(void); }
|
||||
; linux 2.6.33:
|
||||
299 AUE_NULL STD { int linux_recvmmsg(l_int s, \
|
||||
struct l_mmsghdr *msg, l_uint vlen, \
|
||||
l_uint flags, struct l_timespec *timeout); }
|
||||
; linux 2.6.37:
|
||||
300 AUE_NULL STD { int linux_fanotify_init(void); }
|
||||
301 AUE_NULL STD { int linux_fanotify_mark(void); }
|
||||
; linux 2.6.36:
|
||||
302 AUE_NULL STD { int linux_prlimit64(l_pid_t pid, l_uint resource, \
|
||||
struct rlimit *new, struct rlimit *old); }
|
||||
; linux 2.6.39 (glibc 2.14):
|
||||
303 AUE_NULL STD { int linux_name_to_handle_at(void); }
|
||||
304 AUE_NULL STD { int linux_open_by_handle_at(void); }
|
||||
305 AUE_NULL STD { int linux_clock_adjtime(void); }
|
||||
306 AUE_SYNC STD { int linux_syncfs(l_int fd); }
|
||||
; linux 3.0 (glibc 2.14):
|
||||
307 AUE_NULL STD { int linux_sendmmsg(l_int s, \
|
||||
struct l_mmsghdr *msg, l_uint vlen, \
|
||||
l_uint flags); }
|
||||
308 AUE_NULL STD { int linux_setns(void); }
|
||||
309 AUE_NULL STD { int linux_process_vm_readv(void); }
|
||||
310 AUE_NULL STD { int linux_process_vm_writev(void); }
|
||||
311 AUE_NULL STD { int linux_kcmp(void); }
|
||||
312 AUE_NULL STD { int linux_finit_module(void); }
|
||||
308 AUE_NULL STD { int linux_setns(l_int fd, l_int nstype); }
|
||||
; linux 2.6.19 (no glibc wrapper):
|
||||
309 AUE_NULL STD { int linux_getcpu(l_uint *cpu, l_uint *node, \
|
||||
void *cache); }
|
||||
; linux 3.2 (glibc 2.15):
|
||||
310 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \
|
||||
const struct iovec *lvec, l_ulong liovcnt, \
|
||||
const struct iovec *rvec, l_ulong riovcnt, \
|
||||
l_ulong flags); }
|
||||
311 AUE_NULL STD { int linux_process_vm_writev(l_pid_t pid, \
|
||||
const struct iovec *lvec, l_ulong liovcnt, \
|
||||
const struct iovec *rvec, l_ulong riovcnt, \
|
||||
l_ulong flags); }
|
||||
; linux 3.5 (no glibc wrapper):
|
||||
312 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \
|
||||
l_int type, l_ulong idx1, l_ulong idx); }
|
||||
; linux 3.8 (no glibc wrapper):
|
||||
313 AUE_NULL STD { int linux_finit_module(l_int fd, \
|
||||
const char *uargs, l_int flags); }
|
||||
; linux 3.14:
|
||||
314 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \
|
||||
void *attr, l_uint flags); }
|
||||
315 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \
|
||||
void *attr, l_uint size, l_uint flags); }
|
||||
; linux 3.15:
|
||||
316 AUE_NULL STD { int linux_renameat2(l_int oldfd, \
|
||||
const char *oldname, l_int newfd, \
|
||||
const char *newname, unsigned int flags); }
|
||||
; linux 3.17:
|
||||
317 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \
|
||||
const char *uargs); }
|
||||
318 AUE_NULL STD { int linux_getrandom(char *buf, \
|
||||
l_size_t count, l_uint flags); }
|
||||
319 AUE_NULL STD { int linux_memfd_create(const char *uname_ptr, \
|
||||
l_uint flags); }
|
||||
320 AUE_NULL STD { int linux_kexec_file_load(l_int kernel_fd, \
|
||||
l_int initrd_fd, l_ulong cmdline_len, \
|
||||
const char *cmdline_ptr, l_ulong flags); }
|
||||
; linux 3.18:
|
||||
321 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \
|
||||
l_uint size); }
|
||||
; linux 3.19:
|
||||
322 AUE_NULL STD { int linux_execveat(l_int dfd, \
|
||||
const char *filename, const char **argv, \
|
||||
const char **envp, l_int flags); }
|
||||
; linux 4.2:
|
||||
323 AUE_NULL STD { int linux_userfaultfd(l_int flags); }
|
||||
; linux 4.3:
|
||||
324 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); }
|
||||
; linux 4.4:
|
||||
325 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \
|
||||
l_int flags); }
|
||||
; linux 4.5:
|
||||
326 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \
|
||||
l_loff_t *off_in, l_int fd_out, \
|
||||
l_loff_t *off_out, l_size_t len, \
|
||||
l_uint flags); }
|
||||
; linux 4.6:
|
||||
327 AUE_NULL STD { int linux_preadv2(l_ulong fd, \
|
||||
const struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h, l_int flags); }
|
||||
328 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \
|
||||
const struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h, l_int flags); }
|
||||
; linux 4.8:
|
||||
329 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \
|
||||
l_size_t len, l_ulong prot, l_int pkey); }
|
||||
330 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \
|
||||
l_ulong init_val); }
|
||||
331 AUE_NULL STD { int linux_pkey_free(l_int pkey); }
|
||||
|
||||
; please, keep this line at the end.
|
||||
313 AUE_NULL UNIMPL nosys
|
||||
332 AUE_NULL UNIMPL nosys
|
||||
|
@ -114,18 +114,51 @@ DUMMY(inotify_init1);
|
||||
DUMMY(preadv);
|
||||
DUMMY(pwritev);
|
||||
/* linux 2.6.31: */
|
||||
DUMMY(rt_tsigqueueinfo);
|
||||
DUMMY(rt_tgsigqueueinfo);
|
||||
DUMMY(perf_event_open);
|
||||
/* linux 2.6.33: */
|
||||
DUMMY(fanotify_init);
|
||||
DUMMY(fanotify_mark);
|
||||
/* later: */
|
||||
/* linux 2.6.39: */
|
||||
DUMMY(name_to_handle_at);
|
||||
DUMMY(open_by_handle_at);
|
||||
DUMMY(clock_adjtime);
|
||||
/* linux 3.0: */
|
||||
DUMMY(setns);
|
||||
/* linux 3.2: */
|
||||
DUMMY(process_vm_readv);
|
||||
DUMMY(process_vm_writev);
|
||||
/* linux 3.5: */
|
||||
DUMMY(kcmp);
|
||||
/* linux 3.8: */
|
||||
DUMMY(finit_module);
|
||||
DUMMY(sched_setattr);
|
||||
DUMMY(sched_getattr);
|
||||
/* linux 3.14: */
|
||||
DUMMY(renameat2);
|
||||
/* linux 3.15: */
|
||||
DUMMY(seccomp);
|
||||
DUMMY(getrandom);
|
||||
DUMMY(memfd_create);
|
||||
/* linux 3.18: */
|
||||
DUMMY(bpf);
|
||||
/* linux 3.19: */
|
||||
DUMMY(execveat);
|
||||
/* linux 4.2: */
|
||||
DUMMY(userfaultfd);
|
||||
/* linux 4.3: */
|
||||
DUMMY(membarrier);
|
||||
/* linux 4.4: */
|
||||
DUMMY(mlock2);
|
||||
/* linux 4.5: */
|
||||
DUMMY(copy_file_range);
|
||||
/* linux 4.6: */
|
||||
DUMMY(preadv2);
|
||||
DUMMY(pwritev2);
|
||||
/* linux 4.8: */
|
||||
DUMMY(pkey_mprotect);
|
||||
DUMMY(pkey_alloc);
|
||||
DUMMY(pkey_free);
|
||||
|
||||
#define DUMMY_XATTR(s) \
|
||||
int \
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#ifndef _LINUX32_SYSPROTO_H_
|
||||
@ -1103,13 +1103,24 @@ struct linux_inotify_init1_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct linux_preadv_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_pwritev_args {
|
||||
register_t dummy;
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(struct iovec *)]; struct iovec * vec; char vec_r_[PADR_(struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_rt_tsigqueueinfo_args {
|
||||
register_t dummy;
|
||||
struct linux_rt_tgsigqueueinfo_args {
|
||||
char tgid_l_[PADL_(l_pid_t)]; l_pid_t tgid; char tgid_r_[PADR_(l_pid_t)];
|
||||
char tid_l_[PADL_(l_pid_t)]; l_pid_t tid; char tid_r_[PADR_(l_pid_t)];
|
||||
char sig_l_[PADL_(l_int)]; l_int sig; char sig_r_[PADR_(l_int)];
|
||||
char uinfo_l_[PADL_(l_siginfo_t *)]; l_siginfo_t * uinfo; char uinfo_r_[PADR_(l_siginfo_t *)];
|
||||
};
|
||||
struct linux_perf_event_open_args {
|
||||
register_t dummy;
|
||||
@ -1155,10 +1166,210 @@ struct linux_setns_args {
|
||||
register_t dummy;
|
||||
};
|
||||
struct linux_process_vm_readv_args {
|
||||
register_t dummy;
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)];
|
||||
char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)];
|
||||
char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)];
|
||||
char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_process_vm_writev_args {
|
||||
register_t dummy;
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char lvec_l_[PADL_(const struct iovec *)]; const struct iovec * lvec; char lvec_r_[PADR_(const struct iovec *)];
|
||||
char liovcnt_l_[PADL_(l_ulong)]; l_ulong liovcnt; char liovcnt_r_[PADR_(l_ulong)];
|
||||
char rvec_l_[PADL_(const struct iovec *)]; const struct iovec * rvec; char rvec_r_[PADR_(const struct iovec *)];
|
||||
char riovcnt_l_[PADL_(l_ulong)]; l_ulong riovcnt; char riovcnt_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_kcmp_args {
|
||||
char pid1_l_[PADL_(l_pid_t)]; l_pid_t pid1; char pid1_r_[PADR_(l_pid_t)];
|
||||
char pid2_l_[PADL_(l_pid_t)]; l_pid_t pid2; char pid2_r_[PADR_(l_pid_t)];
|
||||
char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
|
||||
char idx1_l_[PADL_(l_ulong)]; l_ulong idx1; char idx1_r_[PADR_(l_ulong)];
|
||||
char idx_l_[PADL_(l_ulong)]; l_ulong idx; char idx_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_finit_module_args {
|
||||
char fd_l_[PADL_(l_int)]; l_int fd; char fd_r_[PADR_(l_int)];
|
||||
char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_sched_setattr_args {
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_sched_getattr_args {
|
||||
char pid_l_[PADL_(l_pid_t)]; l_pid_t pid; char pid_r_[PADR_(l_pid_t)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_renameat2_args {
|
||||
char oldfd_l_[PADL_(l_int)]; l_int oldfd; char oldfd_r_[PADR_(l_int)];
|
||||
char oldname_l_[PADL_(const char *)]; const char * oldname; char oldname_r_[PADR_(const char *)];
|
||||
char newfd_l_[PADL_(l_int)]; l_int newfd; char newfd_r_[PADR_(l_int)];
|
||||
char newname_l_[PADL_(const char *)]; const char * newname; char newname_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(unsigned int)]; unsigned int flags; char flags_r_[PADR_(unsigned int)];
|
||||
};
|
||||
struct linux_seccomp_args {
|
||||
char op_l_[PADL_(l_uint)]; l_uint op; char op_r_[PADR_(l_uint)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
char uargs_l_[PADL_(const char *)]; const char * uargs; char uargs_r_[PADR_(const char *)];
|
||||
};
|
||||
struct linux_getrandom_args {
|
||||
char buf_l_[PADL_(char *)]; char * buf; char buf_r_[PADR_(char *)];
|
||||
char count_l_[PADL_(l_size_t)]; l_size_t count; char count_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_memfd_create_args {
|
||||
char uname_ptr_l_[PADL_(const char *)]; const char * uname_ptr; char uname_ptr_r_[PADR_(const char *)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_bpf_args {
|
||||
char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
|
||||
char attr_l_[PADL_(void *)]; void * attr; char attr_r_[PADR_(void *)];
|
||||
char size_l_[PADL_(l_uint)]; l_uint size; char size_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_execveat_args {
|
||||
char dfd_l_[PADL_(l_int)]; l_int dfd; char dfd_r_[PADR_(l_int)];
|
||||
char filename_l_[PADL_(const char *)]; const char * filename; char filename_r_[PADR_(const char *)];
|
||||
char argv_l_[PADL_(const char **)]; const char ** argv; char argv_r_[PADR_(const char **)];
|
||||
char envp_l_[PADL_(const char **)]; const char ** envp; char envp_r_[PADR_(const char **)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_socket_args {
|
||||
char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)];
|
||||
char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
|
||||
char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_socketpair_args {
|
||||
char domain_l_[PADL_(l_int)]; l_int domain; char domain_r_[PADR_(l_int)];
|
||||
char type_l_[PADL_(l_int)]; l_int type; char type_r_[PADR_(l_int)];
|
||||
char protocol_l_[PADL_(l_int)]; l_int protocol; char protocol_r_[PADR_(l_int)];
|
||||
char rsv_l_[PADL_(l_uintptr_t)]; l_uintptr_t rsv; char rsv_r_[PADR_(l_uintptr_t)];
|
||||
};
|
||||
struct linux_bind_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)];
|
||||
char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_connect_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char name_l_[PADL_(l_uintptr_t)]; l_uintptr_t name; char name_r_[PADR_(l_uintptr_t)];
|
||||
char namelen_l_[PADL_(l_int)]; l_int namelen; char namelen_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_listen_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char backlog_l_[PADL_(l_int)]; l_int backlog; char backlog_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_accept4_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
|
||||
char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_getsockopt_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)];
|
||||
char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)];
|
||||
char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)];
|
||||
char optlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t optlen; char optlen_r_[PADR_(l_uintptr_t)];
|
||||
};
|
||||
struct linux_setsockopt_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char level_l_[PADL_(l_int)]; l_int level; char level_r_[PADR_(l_int)];
|
||||
char optname_l_[PADL_(l_int)]; l_int optname; char optname_r_[PADR_(l_int)];
|
||||
char optval_l_[PADL_(l_uintptr_t)]; l_uintptr_t optval; char optval_r_[PADR_(l_uintptr_t)];
|
||||
char optlen_l_[PADL_(l_int)]; l_int optlen; char optlen_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_getsockname_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
|
||||
char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
|
||||
};
|
||||
struct linux_getpeername_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char addr_l_[PADL_(l_uintptr_t)]; l_uintptr_t addr; char addr_r_[PADR_(l_uintptr_t)];
|
||||
char namelen_l_[PADL_(l_uintptr_t)]; l_uintptr_t namelen; char namelen_r_[PADR_(l_uintptr_t)];
|
||||
};
|
||||
struct linux_sendto_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
|
||||
char len_l_[PADL_(l_int)]; l_int len; char len_r_[PADR_(l_int)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
char to_l_[PADL_(l_uintptr_t)]; l_uintptr_t to; char to_r_[PADR_(l_uintptr_t)];
|
||||
char tolen_l_[PADL_(l_int)]; l_int tolen; char tolen_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_sendmsg_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_recvfrom_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char buf_l_[PADL_(l_uintptr_t)]; l_uintptr_t buf; char buf_r_[PADR_(l_uintptr_t)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
char from_l_[PADL_(l_uintptr_t)]; l_uintptr_t from; char from_r_[PADR_(l_uintptr_t)];
|
||||
char fromlen_l_[PADL_(l_uintptr_t)]; l_uintptr_t fromlen; char fromlen_r_[PADR_(l_uintptr_t)];
|
||||
};
|
||||
struct linux_recvmsg_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char msg_l_[PADL_(l_uintptr_t)]; l_uintptr_t msg; char msg_r_[PADR_(l_uintptr_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_shutdown_args {
|
||||
char s_l_[PADL_(l_int)]; l_int s; char s_r_[PADR_(l_int)];
|
||||
char how_l_[PADL_(l_int)]; l_int how; char how_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_userfaultfd_args {
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_membarrier_args {
|
||||
char cmd_l_[PADL_(l_int)]; l_int cmd; char cmd_r_[PADR_(l_int)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_mlock2_args {
|
||||
char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_copy_file_range_args {
|
||||
char fd_in_l_[PADL_(l_int)]; l_int fd_in; char fd_in_r_[PADR_(l_int)];
|
||||
char off_in_l_[PADL_(l_loff_t *)]; l_loff_t * off_in; char off_in_r_[PADR_(l_loff_t *)];
|
||||
char fd_out_l_[PADL_(l_int)]; l_int fd_out; char fd_out_r_[PADR_(l_int)];
|
||||
char off_out_l_[PADL_(l_loff_t *)]; l_loff_t * off_out; char off_out_r_[PADR_(l_loff_t *)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char flags_l_[PADL_(l_uint)]; l_uint flags; char flags_r_[PADR_(l_uint)];
|
||||
};
|
||||
struct linux_preadv2_args {
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pwritev2_args {
|
||||
char fd_l_[PADL_(l_ulong)]; l_ulong fd; char fd_r_[PADR_(l_ulong)];
|
||||
char vec_l_[PADL_(const struct iovec *)]; const struct iovec * vec; char vec_r_[PADR_(const struct iovec *)];
|
||||
char vlen_l_[PADL_(l_ulong)]; l_ulong vlen; char vlen_r_[PADR_(l_ulong)];
|
||||
char pos_l_l_[PADL_(l_ulong)]; l_ulong pos_l; char pos_l_r_[PADR_(l_ulong)];
|
||||
char pos_h_l_[PADL_(l_ulong)]; l_ulong pos_h; char pos_h_r_[PADR_(l_ulong)];
|
||||
char flags_l_[PADL_(l_int)]; l_int flags; char flags_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pkey_mprotect_args {
|
||||
char start_l_[PADL_(l_ulong)]; l_ulong start; char start_r_[PADR_(l_ulong)];
|
||||
char len_l_[PADL_(l_size_t)]; l_size_t len; char len_r_[PADR_(l_size_t)];
|
||||
char prot_l_[PADL_(l_ulong)]; l_ulong prot; char prot_r_[PADR_(l_ulong)];
|
||||
char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)];
|
||||
};
|
||||
struct linux_pkey_alloc_args {
|
||||
char flags_l_[PADL_(l_ulong)]; l_ulong flags; char flags_r_[PADR_(l_ulong)];
|
||||
char init_val_l_[PADL_(l_ulong)]; l_ulong init_val; char init_val_r_[PADR_(l_ulong)];
|
||||
};
|
||||
struct linux_pkey_free_args {
|
||||
char pkey_l_[PADL_(l_int)]; l_int pkey; char pkey_r_[PADR_(l_int)];
|
||||
};
|
||||
#define nosys linux_nosys
|
||||
int linux_exit(struct thread *, struct linux_exit_args *);
|
||||
@ -1424,7 +1635,7 @@ int linux_pipe2(struct thread *, struct linux_pipe2_args *);
|
||||
int linux_inotify_init1(struct thread *, struct linux_inotify_init1_args *);
|
||||
int linux_preadv(struct thread *, struct linux_preadv_args *);
|
||||
int linux_pwritev(struct thread *, struct linux_pwritev_args *);
|
||||
int linux_rt_tsigqueueinfo(struct thread *, struct linux_rt_tsigqueueinfo_args *);
|
||||
int linux_rt_tgsigqueueinfo(struct thread *, struct linux_rt_tgsigqueueinfo_args *);
|
||||
int linux_perf_event_open(struct thread *, struct linux_perf_event_open_args *);
|
||||
int linux_recvmmsg(struct thread *, struct linux_recvmmsg_args *);
|
||||
int linux_fanotify_init(struct thread *, struct linux_fanotify_init_args *);
|
||||
@ -1438,6 +1649,40 @@ int linux_sendmmsg(struct thread *, struct linux_sendmmsg_args *);
|
||||
int linux_setns(struct thread *, struct linux_setns_args *);
|
||||
int linux_process_vm_readv(struct thread *, struct linux_process_vm_readv_args *);
|
||||
int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args *);
|
||||
int linux_kcmp(struct thread *, struct linux_kcmp_args *);
|
||||
int linux_finit_module(struct thread *, struct linux_finit_module_args *);
|
||||
int linux_sched_setattr(struct thread *, struct linux_sched_setattr_args *);
|
||||
int linux_sched_getattr(struct thread *, struct linux_sched_getattr_args *);
|
||||
int linux_renameat2(struct thread *, struct linux_renameat2_args *);
|
||||
int linux_seccomp(struct thread *, struct linux_seccomp_args *);
|
||||
int linux_getrandom(struct thread *, struct linux_getrandom_args *);
|
||||
int linux_memfd_create(struct thread *, struct linux_memfd_create_args *);
|
||||
int linux_bpf(struct thread *, struct linux_bpf_args *);
|
||||
int linux_execveat(struct thread *, struct linux_execveat_args *);
|
||||
int linux_socket(struct thread *, struct linux_socket_args *);
|
||||
int linux_socketpair(struct thread *, struct linux_socketpair_args *);
|
||||
int linux_bind(struct thread *, struct linux_bind_args *);
|
||||
int linux_connect(struct thread *, struct linux_connect_args *);
|
||||
int linux_listen(struct thread *, struct linux_listen_args *);
|
||||
int linux_accept4(struct thread *, struct linux_accept4_args *);
|
||||
int linux_getsockopt(struct thread *, struct linux_getsockopt_args *);
|
||||
int linux_setsockopt(struct thread *, struct linux_setsockopt_args *);
|
||||
int linux_getsockname(struct thread *, struct linux_getsockname_args *);
|
||||
int linux_getpeername(struct thread *, struct linux_getpeername_args *);
|
||||
int linux_sendto(struct thread *, struct linux_sendto_args *);
|
||||
int linux_sendmsg(struct thread *, struct linux_sendmsg_args *);
|
||||
int linux_recvfrom(struct thread *, struct linux_recvfrom_args *);
|
||||
int linux_recvmsg(struct thread *, struct linux_recvmsg_args *);
|
||||
int linux_shutdown(struct thread *, struct linux_shutdown_args *);
|
||||
int linux_userfaultfd(struct thread *, struct linux_userfaultfd_args *);
|
||||
int linux_membarrier(struct thread *, struct linux_membarrier_args *);
|
||||
int linux_mlock2(struct thread *, struct linux_mlock2_args *);
|
||||
int linux_copy_file_range(struct thread *, struct linux_copy_file_range_args *);
|
||||
int linux_preadv2(struct thread *, struct linux_preadv2_args *);
|
||||
int linux_pwritev2(struct thread *, struct linux_pwritev2_args *);
|
||||
int linux_pkey_mprotect(struct thread *, struct linux_pkey_mprotect_args *);
|
||||
int linux_pkey_alloc(struct thread *, struct linux_pkey_alloc_args *);
|
||||
int linux_pkey_free(struct thread *, struct linux_pkey_free_args *);
|
||||
|
||||
#ifdef COMPAT_43
|
||||
|
||||
@ -1736,7 +1981,7 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
|
||||
#define LINUX32_SYS_AUE_linux_inotify_init1 AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_preadv AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_pwritev AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_rt_tsigqueueinfo AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_rt_tgsigqueueinfo AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_perf_event_open AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_recvmmsg AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_fanotify_init AUE_NULL
|
||||
@ -1750,6 +1995,40 @@ int linux_process_vm_writev(struct thread *, struct linux_process_vm_writev_args
|
||||
#define LINUX32_SYS_AUE_linux_setns AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_process_vm_readv AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_process_vm_writev AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_kcmp AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_finit_module AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_sched_setattr AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_sched_getattr AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_renameat2 AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_seccomp AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_getrandom AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_memfd_create AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_bpf AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_execveat AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_socket AUE_SOCKET
|
||||
#define LINUX32_SYS_AUE_linux_socketpair AUE_SOCKETPAIR
|
||||
#define LINUX32_SYS_AUE_linux_bind AUE_BIND
|
||||
#define LINUX32_SYS_AUE_linux_connect AUE_CONNECT
|
||||
#define LINUX32_SYS_AUE_linux_listen AUE_LISTEN
|
||||
#define LINUX32_SYS_AUE_linux_accept4 AUE_ACCEPT
|
||||
#define LINUX32_SYS_AUE_linux_getsockopt AUE_GETSOCKOPT
|
||||
#define LINUX32_SYS_AUE_linux_setsockopt AUE_SETSOCKOPT
|
||||
#define LINUX32_SYS_AUE_linux_getsockname AUE_GETSOCKNAME
|
||||
#define LINUX32_SYS_AUE_linux_getpeername AUE_GETPEERNAME
|
||||
#define LINUX32_SYS_AUE_linux_sendto AUE_SENDTO
|
||||
#define LINUX32_SYS_AUE_linux_sendmsg AUE_SENDMSG
|
||||
#define LINUX32_SYS_AUE_linux_recvfrom AUE_RECVFROM
|
||||
#define LINUX32_SYS_AUE_linux_recvmsg AUE_RECVMSG
|
||||
#define LINUX32_SYS_AUE_linux_shutdown AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_userfaultfd AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_membarrier AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_mlock2 AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_copy_file_range AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_preadv2 AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_pwritev2 AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_pkey_mprotect AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_pkey_alloc AUE_NULL
|
||||
#define LINUX32_SYS_AUE_linux_pkey_free AUE_NULL
|
||||
|
||||
#undef PAD_
|
||||
#undef PADL_
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#define LINUX32_SYS_linux_exit 1
|
||||
@ -307,7 +307,7 @@
|
||||
#define LINUX32_SYS_linux_inotify_init1 332
|
||||
#define LINUX32_SYS_linux_preadv 333
|
||||
#define LINUX32_SYS_linux_pwritev 334
|
||||
#define LINUX32_SYS_linux_rt_tsigqueueinfo 335
|
||||
#define LINUX32_SYS_linux_rt_tgsigqueueinfo 335
|
||||
#define LINUX32_SYS_linux_perf_event_open 336
|
||||
#define LINUX32_SYS_linux_recvmmsg 337
|
||||
#define LINUX32_SYS_linux_fanotify_init 338
|
||||
@ -321,4 +321,38 @@
|
||||
#define LINUX32_SYS_linux_setns 346
|
||||
#define LINUX32_SYS_linux_process_vm_readv 347
|
||||
#define LINUX32_SYS_linux_process_vm_writev 348
|
||||
#define LINUX32_SYS_MAXSYSCALL 350
|
||||
#define LINUX32_SYS_linux_kcmp 349
|
||||
#define LINUX32_SYS_linux_finit_module 350
|
||||
#define LINUX32_SYS_linux_sched_setattr 351
|
||||
#define LINUX32_SYS_linux_sched_getattr 352
|
||||
#define LINUX32_SYS_linux_renameat2 353
|
||||
#define LINUX32_SYS_linux_seccomp 354
|
||||
#define LINUX32_SYS_linux_getrandom 355
|
||||
#define LINUX32_SYS_linux_memfd_create 356
|
||||
#define LINUX32_SYS_linux_bpf 357
|
||||
#define LINUX32_SYS_linux_execveat 358
|
||||
#define LINUX32_SYS_linux_socket 359
|
||||
#define LINUX32_SYS_linux_socketpair 360
|
||||
#define LINUX32_SYS_linux_bind 361
|
||||
#define LINUX32_SYS_linux_connect 362
|
||||
#define LINUX32_SYS_linux_listen 363
|
||||
#define LINUX32_SYS_linux_accept4 364
|
||||
#define LINUX32_SYS_linux_getsockopt 365
|
||||
#define LINUX32_SYS_linux_setsockopt 366
|
||||
#define LINUX32_SYS_linux_getsockname 367
|
||||
#define LINUX32_SYS_linux_getpeername 368
|
||||
#define LINUX32_SYS_linux_sendto 369
|
||||
#define LINUX32_SYS_linux_sendmsg 370
|
||||
#define LINUX32_SYS_linux_recvfrom 371
|
||||
#define LINUX32_SYS_linux_recvmsg 372
|
||||
#define LINUX32_SYS_linux_shutdown 373
|
||||
#define LINUX32_SYS_linux_userfaultfd 374
|
||||
#define LINUX32_SYS_linux_membarrier 375
|
||||
#define LINUX32_SYS_linux_mlock2 376
|
||||
#define LINUX32_SYS_linux_copy_file_range 377
|
||||
#define LINUX32_SYS_linux_preadv2 378
|
||||
#define LINUX32_SYS_linux_pwritev2 379
|
||||
#define LINUX32_SYS_linux_pkey_mprotect 380
|
||||
#define LINUX32_SYS_linux_pkey_alloc 381
|
||||
#define LINUX32_SYS_linux_pkey_free 382
|
||||
#define LINUX32_SYS_MAXSYSCALL 384
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
const char *linux32_syscallnames[] = {
|
||||
@ -343,7 +343,7 @@ const char *linux32_syscallnames[] = {
|
||||
"linux_inotify_init1", /* 332 = linux_inotify_init1 */
|
||||
"linux_preadv", /* 333 = linux_preadv */
|
||||
"linux_pwritev", /* 334 = linux_pwritev */
|
||||
"linux_rt_tsigqueueinfo", /* 335 = linux_rt_tsigqueueinfo */
|
||||
"linux_rt_tgsigqueueinfo", /* 335 = linux_rt_tgsigqueueinfo */
|
||||
"linux_perf_event_open", /* 336 = linux_perf_event_open */
|
||||
"linux_recvmmsg", /* 337 = linux_recvmmsg */
|
||||
"linux_fanotify_init", /* 338 = linux_fanotify_init */
|
||||
@ -357,5 +357,39 @@ const char *linux32_syscallnames[] = {
|
||||
"linux_setns", /* 346 = linux_setns */
|
||||
"linux_process_vm_readv", /* 347 = linux_process_vm_readv */
|
||||
"linux_process_vm_writev", /* 348 = linux_process_vm_writev */
|
||||
"#349", /* 349 = nosys */
|
||||
"linux_kcmp", /* 349 = linux_kcmp */
|
||||
"linux_finit_module", /* 350 = linux_finit_module */
|
||||
"linux_sched_setattr", /* 351 = linux_sched_setattr */
|
||||
"linux_sched_getattr", /* 352 = linux_sched_getattr */
|
||||
"linux_renameat2", /* 353 = linux_renameat2 */
|
||||
"linux_seccomp", /* 354 = linux_seccomp */
|
||||
"linux_getrandom", /* 355 = linux_getrandom */
|
||||
"linux_memfd_create", /* 356 = linux_memfd_create */
|
||||
"linux_bpf", /* 357 = linux_bpf */
|
||||
"linux_execveat", /* 358 = linux_execveat */
|
||||
"linux_socket", /* 359 = linux_socket */
|
||||
"linux_socketpair", /* 360 = linux_socketpair */
|
||||
"linux_bind", /* 361 = linux_bind */
|
||||
"linux_connect", /* 362 = linux_connect */
|
||||
"linux_listen", /* 363 = linux_listen */
|
||||
"linux_accept4", /* 364 = linux_accept4 */
|
||||
"linux_getsockopt", /* 365 = linux_getsockopt */
|
||||
"linux_setsockopt", /* 366 = linux_setsockopt */
|
||||
"linux_getsockname", /* 367 = linux_getsockname */
|
||||
"linux_getpeername", /* 368 = linux_getpeername */
|
||||
"linux_sendto", /* 369 = linux_sendto */
|
||||
"linux_sendmsg", /* 370 = linux_sendmsg */
|
||||
"linux_recvfrom", /* 371 = linux_recvfrom */
|
||||
"linux_recvmsg", /* 372 = linux_recvmsg */
|
||||
"linux_shutdown", /* 373 = linux_shutdown */
|
||||
"linux_userfaultfd", /* 374 = linux_userfaultfd */
|
||||
"linux_membarrier", /* 375 = linux_membarrier */
|
||||
"linux_mlock2", /* 376 = linux_mlock2 */
|
||||
"linux_copy_file_range", /* 377 = linux_copy_file_range */
|
||||
"linux_preadv2", /* 378 = linux_preadv2 */
|
||||
"linux_pwritev2", /* 379 = linux_pwritev2 */
|
||||
"linux_pkey_mprotect", /* 380 = linux_pkey_mprotect */
|
||||
"linux_pkey_alloc", /* 381 = linux_pkey_alloc */
|
||||
"linux_pkey_free", /* 382 = linux_pkey_free */
|
||||
"#383", /* 383 = nosys */
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* DO NOT EDIT-- this file is automatically generated.
|
||||
* $FreeBSD$
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 302515 2016-07-10 08:15:50Z dchagin
|
||||
* created from FreeBSD: head/sys/amd64/linux32/syscalls.master 313284 2017-02-05 14:17:09Z dchagin
|
||||
*/
|
||||
|
||||
#include "opt_compat.h"
|
||||
@ -352,9 +352,9 @@ struct sysent linux32_sysent[] = {
|
||||
{ AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 330 = linux_dup3 */
|
||||
{ AS(linux_pipe2_args), (sy_call_t *)linux_pipe2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 331 = linux_pipe2 */
|
||||
{ 0, (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 332 = linux_inotify_init1 */
|
||||
{ 0, (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */
|
||||
{ 0, (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */
|
||||
{ 0, (sy_call_t *)linux_rt_tsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tsigqueueinfo */
|
||||
{ AS(linux_preadv_args), (sy_call_t *)linux_preadv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 333 = linux_preadv */
|
||||
{ AS(linux_pwritev_args), (sy_call_t *)linux_pwritev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 334 = linux_pwritev */
|
||||
{ AS(linux_rt_tgsigqueueinfo_args), (sy_call_t *)linux_rt_tgsigqueueinfo, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 335 = linux_rt_tgsigqueueinfo */
|
||||
{ 0, (sy_call_t *)linux_perf_event_open, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 336 = linux_perf_event_open */
|
||||
{ AS(linux_recvmmsg_args), (sy_call_t *)linux_recvmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 337 = linux_recvmmsg */
|
||||
{ 0, (sy_call_t *)linux_fanotify_init, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 338 = linux_fanotify_init */
|
||||
@ -366,7 +366,41 @@ struct sysent linux32_sysent[] = {
|
||||
{ AS(linux_syncfs_args), (sy_call_t *)linux_syncfs, AUE_SYNC, NULL, 0, 0, 0, SY_THR_STATIC }, /* 344 = linux_syncfs */
|
||||
{ AS(linux_sendmmsg_args), (sy_call_t *)linux_sendmmsg, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 345 = linux_sendmmsg */
|
||||
{ 0, (sy_call_t *)linux_setns, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 346 = linux_setns */
|
||||
{ 0, (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */
|
||||
{ 0, (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 349 = nosys */
|
||||
{ AS(linux_process_vm_readv_args), (sy_call_t *)linux_process_vm_readv, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 347 = linux_process_vm_readv */
|
||||
{ AS(linux_process_vm_writev_args), (sy_call_t *)linux_process_vm_writev, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 348 = linux_process_vm_writev */
|
||||
{ AS(linux_kcmp_args), (sy_call_t *)linux_kcmp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 349 = linux_kcmp */
|
||||
{ AS(linux_finit_module_args), (sy_call_t *)linux_finit_module, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 350 = linux_finit_module */
|
||||
{ AS(linux_sched_setattr_args), (sy_call_t *)linux_sched_setattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 351 = linux_sched_setattr */
|
||||
{ AS(linux_sched_getattr_args), (sy_call_t *)linux_sched_getattr, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 352 = linux_sched_getattr */
|
||||
{ AS(linux_renameat2_args), (sy_call_t *)linux_renameat2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 353 = linux_renameat2 */
|
||||
{ AS(linux_seccomp_args), (sy_call_t *)linux_seccomp, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 354 = linux_seccomp */
|
||||
{ AS(linux_getrandom_args), (sy_call_t *)linux_getrandom, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 355 = linux_getrandom */
|
||||
{ AS(linux_memfd_create_args), (sy_call_t *)linux_memfd_create, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 356 = linux_memfd_create */
|
||||
{ AS(linux_bpf_args), (sy_call_t *)linux_bpf, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 357 = linux_bpf */
|
||||
{ AS(linux_execveat_args), (sy_call_t *)linux_execveat, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 358 = linux_execveat */
|
||||
{ AS(linux_socket_args), (sy_call_t *)linux_socket, AUE_SOCKET, NULL, 0, 0, 0, SY_THR_STATIC }, /* 359 = linux_socket */
|
||||
{ AS(linux_socketpair_args), (sy_call_t *)linux_socketpair, AUE_SOCKETPAIR, NULL, 0, 0, 0, SY_THR_STATIC }, /* 360 = linux_socketpair */
|
||||
{ AS(linux_bind_args), (sy_call_t *)linux_bind, AUE_BIND, NULL, 0, 0, 0, SY_THR_STATIC }, /* 361 = linux_bind */
|
||||
{ AS(linux_connect_args), (sy_call_t *)linux_connect, AUE_CONNECT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 362 = linux_connect */
|
||||
{ AS(linux_listen_args), (sy_call_t *)linux_listen, AUE_LISTEN, NULL, 0, 0, 0, SY_THR_STATIC }, /* 363 = linux_listen */
|
||||
{ AS(linux_accept4_args), (sy_call_t *)linux_accept4, AUE_ACCEPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 364 = linux_accept4 */
|
||||
{ AS(linux_getsockopt_args), (sy_call_t *)linux_getsockopt, AUE_GETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 365 = linux_getsockopt */
|
||||
{ AS(linux_setsockopt_args), (sy_call_t *)linux_setsockopt, AUE_SETSOCKOPT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 366 = linux_setsockopt */
|
||||
{ AS(linux_getsockname_args), (sy_call_t *)linux_getsockname, AUE_GETSOCKNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 367 = linux_getsockname */
|
||||
{ AS(linux_getpeername_args), (sy_call_t *)linux_getpeername, AUE_GETPEERNAME, NULL, 0, 0, 0, SY_THR_STATIC }, /* 368 = linux_getpeername */
|
||||
{ AS(linux_sendto_args), (sy_call_t *)linux_sendto, AUE_SENDTO, NULL, 0, 0, 0, SY_THR_STATIC }, /* 369 = linux_sendto */
|
||||
{ AS(linux_sendmsg_args), (sy_call_t *)linux_sendmsg, AUE_SENDMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 370 = linux_sendmsg */
|
||||
{ AS(linux_recvfrom_args), (sy_call_t *)linux_recvfrom, AUE_RECVFROM, NULL, 0, 0, 0, SY_THR_STATIC }, /* 371 = linux_recvfrom */
|
||||
{ AS(linux_recvmsg_args), (sy_call_t *)linux_recvmsg, AUE_RECVMSG, NULL, 0, 0, 0, SY_THR_STATIC }, /* 372 = linux_recvmsg */
|
||||
{ AS(linux_shutdown_args), (sy_call_t *)linux_shutdown, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 373 = linux_shutdown */
|
||||
{ AS(linux_userfaultfd_args), (sy_call_t *)linux_userfaultfd, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 374 = linux_userfaultfd */
|
||||
{ AS(linux_membarrier_args), (sy_call_t *)linux_membarrier, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 375 = linux_membarrier */
|
||||
{ AS(linux_mlock2_args), (sy_call_t *)linux_mlock2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 376 = linux_mlock2 */
|
||||
{ AS(linux_copy_file_range_args), (sy_call_t *)linux_copy_file_range, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 377 = linux_copy_file_range */
|
||||
{ AS(linux_preadv2_args), (sy_call_t *)linux_preadv2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 378 = linux_preadv2 */
|
||||
{ AS(linux_pwritev2_args), (sy_call_t *)linux_pwritev2, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 379 = linux_pwritev2 */
|
||||
{ AS(linux_pkey_mprotect_args), (sy_call_t *)linux_pkey_mprotect, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 380 = linux_pkey_mprotect */
|
||||
{ AS(linux_pkey_alloc_args), (sy_call_t *)linux_pkey_alloc, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 381 = linux_pkey_alloc */
|
||||
{ AS(linux_pkey_free_args), (sy_call_t *)linux_pkey_free, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 382 = linux_pkey_free */
|
||||
{ 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 383 = nosys */
|
||||
};
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,18 +11,20 @@
|
||||
; there is no audit event for the call at this time. For the
|
||||
; case where the event exists, but we don't want auditing, the
|
||||
; event should be #defined to AUE_NULL in audit_kevents.h.
|
||||
; type one of STD, OBSOL, UNIMPL
|
||||
; type one of STD, NOPROTO, UNIMPL
|
||||
; name psuedo-prototype of syscall routine
|
||||
; If one of the following alts is different, then all appear:
|
||||
; altname name of system call if different
|
||||
; alttag name of args struct tag if different from [o]`name'"_args"
|
||||
; altrtyp return type if not int (bogus - syscalls always return int)
|
||||
; for UNIMPL/OBSOL, name continues with comments
|
||||
; for UNIMPL, name continues with comments
|
||||
|
||||
; types:
|
||||
; STD always included
|
||||
; OBSOL obsolete, not included in system, only specifies name
|
||||
; UNIMPL not implemented, placeholder only
|
||||
; NOPROTO same as STD except do not create structure or
|
||||
; function prototype in sys/sysproto.h. Does add a
|
||||
; definition to syscall.h besides adding a sysent.
|
||||
|
||||
#include "opt_compat.h"
|
||||
#include <sys/param.h>
|
||||
@ -553,10 +555,15 @@
|
||||
331 AUE_NULL STD { int linux_pipe2(l_int *pipefds, l_int flags); }
|
||||
332 AUE_NULL STD { int linux_inotify_init1(void); }
|
||||
; linux 2.6.30:
|
||||
333 AUE_NULL STD { int linux_preadv(void); }
|
||||
334 AUE_NULL STD { int linux_pwritev(void); }
|
||||
333 AUE_NULL STD { int linux_preadv(l_ulong fd, \
|
||||
struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h); }
|
||||
334 AUE_NULL STD { int linux_pwritev(l_ulong fd, \
|
||||
struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h); }
|
||||
; linux 2.6.31:
|
||||
335 AUE_NULL STD { int linux_rt_tsigqueueinfo(void); }
|
||||
335 AUE_NULL STD { int linux_rt_tgsigqueueinfo(l_pid_t tgid, \
|
||||
l_pid_t tid, l_int sig, l_siginfo_t *uinfo); }
|
||||
336 AUE_NULL STD { int linux_perf_event_open(void); }
|
||||
; linux 2.6.33:
|
||||
337 AUE_NULL STD { int linux_recvmmsg(l_int s, \
|
||||
@ -569,16 +576,113 @@
|
||||
l_uint resource, \
|
||||
struct rlimit *new, \
|
||||
struct rlimit *old); }
|
||||
; later:
|
||||
; linux 2.6.39:
|
||||
341 AUE_NULL STD { int linux_name_to_handle_at(void); }
|
||||
342 AUE_NULL STD { int linux_open_by_handle_at(void); }
|
||||
343 AUE_NULL STD { int linux_clock_adjtime(void); }
|
||||
344 AUE_SYNC STD { int linux_syncfs(l_int fd); }
|
||||
; linux 3.0:
|
||||
345 AUE_NULL STD { int linux_sendmmsg(l_int s, \
|
||||
struct l_mmsghdr *msg, l_uint vlen, \
|
||||
l_uint flags); }
|
||||
346 AUE_NULL STD { int linux_setns(void); }
|
||||
347 AUE_NULL STD { int linux_process_vm_readv(void); }
|
||||
348 AUE_NULL STD { int linux_process_vm_writev(void); }
|
||||
; linux 3.2 (glibc 2.15):
|
||||
347 AUE_NULL STD { int linux_process_vm_readv(l_pid_t pid, \
|
||||
const struct iovec *lvec, l_ulong liovcnt, \
|
||||
const struct iovec *rvec, l_ulong riovcnt, \
|
||||
l_ulong flags); }
|
||||
348 AUE_NULL STD { int linux_process_vm_writev(l_pid_t pid, \
|
||||
const struct iovec *lvec, l_ulong liovcnt, \
|
||||
const struct iovec *rvec, l_ulong riovcnt, \
|
||||
l_ulong flags); }
|
||||
; linux 3.5 (no glibc wrapper):
|
||||
349 AUE_NULL STD { int linux_kcmp(l_pid_t pid1, l_pid_t pid2, \
|
||||
l_int type, l_ulong idx1, l_ulong idx); }
|
||||
; linux 3.8 (no glibc wrapper):
|
||||
350 AUE_NULL STD { int linux_finit_module(l_int fd, \
|
||||
const char *uargs, l_int flags); }
|
||||
; linux 3.14:
|
||||
351 AUE_NULL STD { int linux_sched_setattr(l_pid_t pid, \
|
||||
void *attr, l_uint flags); }
|
||||
352 AUE_NULL STD { int linux_sched_getattr(l_pid_t pid, \
|
||||
void *attr, l_uint size, l_uint flags); }
|
||||
; linux 3.15:
|
||||
353 AUE_NULL STD { int linux_renameat2(l_int oldfd, \
|
||||
const char *oldname, l_int newfd, \
|
||||
const char *newname, unsigned int flags); }
|
||||
; linux 3.17:
|
||||
354 AUE_NULL STD { int linux_seccomp(l_uint op, l_uint flags, \
|
||||
const char *uargs); }
|
||||
355 AUE_NULL STD { int linux_getrandom(char *buf, \
|
||||
l_size_t count, l_uint flags); }
|
||||
356 AUE_NULL STD { int linux_memfd_create(const char *uname_ptr, \
|
||||
l_uint flags); }
|
||||
; linux 3.18:
|
||||
357 AUE_NULL STD { int linux_bpf(l_int cmd, void *attr, \
|
||||
l_uint size); }
|
||||
; linux 3.19:
|
||||
358 AUE_NULL STD { int linux_execveat(l_int dfd, \
|
||||
const char *filename, const char **argv, \
|
||||
const char **envp, l_int flags); }
|
||||
; linux 4.3: sockets now direct system calls:
|
||||
359 AUE_SOCKET STD { int linux_socket(l_int domain, l_int type, \
|
||||
l_int protocol); }
|
||||
360 AUE_SOCKETPAIR STD { int linux_socketpair(l_int domain, \
|
||||
l_int type, l_int protocol, l_uintptr_t rsv); }
|
||||
361 AUE_BIND STD { int linux_bind(l_int s, l_uintptr_t name, \
|
||||
l_int namelen); }
|
||||
362 AUE_CONNECT STD { int linux_connect(l_int s, l_uintptr_t name, \
|
||||
l_int namelen); }
|
||||
363 AUE_LISTEN STD { int linux_listen(l_int s, l_int backlog); }
|
||||
364 AUE_ACCEPT STD { int linux_accept4(l_int s, l_uintptr_t addr, \
|
||||
l_uintptr_t namelen, l_int flags); }
|
||||
365 AUE_GETSOCKOPT STD { int linux_getsockopt(l_int s, l_int level, \
|
||||
l_int optname, l_uintptr_t optval, \
|
||||
l_uintptr_t optlen); }
|
||||
366 AUE_SETSOCKOPT STD { int linux_setsockopt(l_int s, l_int level, \
|
||||
l_int optname, l_uintptr_t optval, \
|
||||
l_int optlen); }
|
||||
367 AUE_GETSOCKNAME STD { int linux_getsockname(l_int s, \
|
||||
l_uintptr_t addr, l_uintptr_t namelen); }
|
||||
368 AUE_GETPEERNAME STD { int linux_getpeername(l_int s, \
|
||||
l_uintptr_t addr, l_uintptr_t namelen); }
|
||||
369 AUE_SENDTO STD { int linux_sendto(l_int s, l_uintptr_t msg, \
|
||||
l_int len, l_int flags, l_uintptr_t to, \
|
||||
l_int tolen); }
|
||||
370 AUE_SENDMSG STD { int linux_sendmsg(l_int s, l_uintptr_t msg, \
|
||||
l_int flags); }
|
||||
371 AUE_RECVFROM STD { int linux_recvfrom(l_int s, l_uintptr_t buf, \
|
||||
l_size_t len, l_int flags, l_uintptr_t from, \
|
||||
l_uintptr_t fromlen); }
|
||||
372 AUE_RECVMSG STD { int linux_recvmsg(l_int s, l_uintptr_t msg, \
|
||||
l_int flags); }
|
||||
373 AUE_NULL STD { int linux_shutdown(l_int s, l_int how); }
|
||||
;
|
||||
; linux 4.2:
|
||||
374 AUE_NULL STD { int linux_userfaultfd(l_int flags); }
|
||||
; linux 4.3:
|
||||
375 AUE_NULL STD { int linux_membarrier(l_int cmd, l_int flags); }
|
||||
; linux 4.4:
|
||||
376 AUE_NULL STD { int linux_mlock2(l_ulong start, l_size_t len, \
|
||||
l_int flags); }
|
||||
; linux 4.5:
|
||||
377 AUE_NULL STD { int linux_copy_file_range(l_int fd_in, \
|
||||
l_loff_t *off_in, l_int fd_out, \
|
||||
l_loff_t *off_out, l_size_t len, \
|
||||
l_uint flags); }
|
||||
; linux 4.6:
|
||||
378 AUE_NULL STD { int linux_preadv2(l_ulong fd, \
|
||||
const struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h, l_int flags); }
|
||||
379 AUE_NULL STD { int linux_pwritev2(l_ulong fd, \
|
||||
const struct iovec *vec, l_ulong vlen, \
|
||||
l_ulong pos_l, l_ulong pos_h, l_int flags); }
|
||||
; linux 4.8:
|
||||
380 AUE_NULL STD { int linux_pkey_mprotect(l_ulong start, \
|
||||
l_size_t len, l_ulong prot, l_int pkey); }
|
||||
381 AUE_NULL STD { int linux_pkey_alloc(l_ulong flags, \
|
||||
l_ulong init_val); }
|
||||
382 AUE_NULL STD { int linux_pkey_free(l_int pkey); }
|
||||
|
||||
; please, keep this line at the end.
|
||||
349 AUE_NULL UNIMPL nosys
|
||||
383 AUE_NULL UNIMPL nosys
|
||||
|
@ -294,8 +294,7 @@ u_int cpu_pfr(int num)
|
||||
void
|
||||
identify_arm_cpu(void)
|
||||
{
|
||||
u_int cpuid;
|
||||
u_int8_t ctrl;
|
||||
u_int cpuid, ctrl;
|
||||
int i;
|
||||
|
||||
ctrl = cpu_get_control();
|
||||
|
@ -31,12 +31,9 @@
|
||||
|
||||
#include <sys/pcpu.h>
|
||||
#include <machine/atomic.h>
|
||||
#ifdef INVARIANTS
|
||||
#include <sys/proc.h>
|
||||
#endif
|
||||
|
||||
#define counter_enter() critical_enter()
|
||||
#define counter_exit() critical_exit()
|
||||
#define counter_enter() do {} while (0)
|
||||
#define counter_exit() do {} while (0)
|
||||
|
||||
#ifdef IN_SUBR_COUNTER_C
|
||||
|
||||
@ -55,7 +52,7 @@ counter_u64_fetch_inline(uint64_t *p)
|
||||
int i;
|
||||
|
||||
r = 0;
|
||||
for (i = 0; i < mp_ncpus; i++)
|
||||
CPU_FOREACH(i)
|
||||
r += counter_u64_read_one((uint64_t *)p, i);
|
||||
|
||||
return (r);
|
||||
@ -78,18 +75,13 @@ counter_u64_zero_inline(counter_u64_t c)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define counter_u64_add_protected(c, inc) do { \
|
||||
CRITICAL_ASSERT(curthread); \
|
||||
atomic_add_64((uint64_t *)zpcpu_get(c), (inc)); \
|
||||
} while (0)
|
||||
#define counter_u64_add_protected(c, inc) counter_u64_add(c, inc)
|
||||
|
||||
static inline void
|
||||
counter_u64_add(counter_u64_t c, int64_t inc)
|
||||
{
|
||||
|
||||
counter_enter();
|
||||
counter_u64_add_protected(c, inc);
|
||||
counter_exit();
|
||||
atomic_add_64((uint64_t *)zpcpu_get(c), inc);
|
||||
}
|
||||
|
||||
#endif /* ! __MACHINE_COUNTER_H__ */
|
||||
|
@ -103,19 +103,6 @@ ENTRY(arm64_tlb_flushID)
|
||||
ret
|
||||
END(arm64_tlb_flushID)
|
||||
|
||||
ENTRY(arm64_tlb_flushID_SE)
|
||||
ldr x1, .Lpage_mask
|
||||
bic x0, x0, x1
|
||||
#ifdef SMP
|
||||
tlbi vae1is, x0
|
||||
#else
|
||||
tlbi vae1, x0
|
||||
#endif
|
||||
dsb ish
|
||||
isb
|
||||
ret
|
||||
END(arm64_tlb_flushID_SE)
|
||||
|
||||
/*
|
||||
* void arm64_dcache_wb_range(vm_offset_t, vm_size_t)
|
||||
*/
|
||||
|
@ -30,12 +30,10 @@
|
||||
#define _MACHINE_COUNTER_H_
|
||||
|
||||
#include <sys/pcpu.h>
|
||||
#ifdef INVARIANTS
|
||||
#include <sys/proc.h>
|
||||
#endif
|
||||
#include <machine/atomic.h>
|
||||
|
||||
#define counter_enter() critical_enter()
|
||||
#define counter_exit() critical_exit()
|
||||
#define counter_enter() do {} while (0)
|
||||
#define counter_exit() do {} while (0)
|
||||
|
||||
#ifdef IN_SUBR_COUNTER_C
|
||||
static inline uint64_t
|
||||
@ -52,13 +50,12 @@ counter_u64_fetch_inline(uint64_t *p)
|
||||
int i;
|
||||
|
||||
r = 0;
|
||||
for (i = 0; i < mp_ncpus; i++)
|
||||
CPU_FOREACH(i)
|
||||
r += counter_u64_read_one((uint64_t *)p, i);
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
/* XXXKIB might interrupt increment */
|
||||
static void
|
||||
counter_u64_zero_one_cpu(void *arg)
|
||||
{
|
||||
@ -76,18 +73,13 @@ counter_u64_zero_inline(counter_u64_t c)
|
||||
}
|
||||
#endif
|
||||
|
||||
#define counter_u64_add_protected(c, inc) do { \
|
||||
CRITICAL_ASSERT(curthread); \
|
||||
*(uint64_t *)zpcpu_get(c) += (inc); \
|
||||
} while (0)
|
||||
#define counter_u64_add_protected(c, inc) counter_u64_add(c, inc)
|
||||
|
||||
static inline void
|
||||
counter_u64_add(counter_u64_t c, int64_t inc)
|
||||
{
|
||||
|
||||
counter_enter();
|
||||
counter_u64_add_protected(c, inc);
|
||||
counter_exit();
|
||||
atomic_add_64((uint64_t *)zpcpu_get(c), inc);
|
||||
}
|
||||
|
||||
#endif /* ! _MACHINE_COUNTER_H_ */
|
||||
|
@ -129,7 +129,6 @@ extern int64_t dczva_line_size;
|
||||
#define cpu_setttb(a) arm64_setttb(a)
|
||||
|
||||
#define cpu_tlb_flushID() arm64_tlb_flushID()
|
||||
#define cpu_tlb_flushID_SE(e) arm64_tlb_flushID_SE(e)
|
||||
|
||||
#define cpu_dcache_wbinv_range(a, s) arm64_dcache_wbinv_range((a), (s))
|
||||
#define cpu_dcache_inv_range(a, s) arm64_dcache_inv_range((a), (s))
|
||||
|
@ -64,7 +64,7 @@ struct bcachectl
|
||||
struct bcache {
|
||||
struct bcachectl *bcache_ctl;
|
||||
caddr_t bcache_data;
|
||||
u_int bcache_nblks;
|
||||
size_t bcache_nblks;
|
||||
size_t ra;
|
||||
};
|
||||
|
||||
@ -86,6 +86,7 @@ static u_int bcache_rablks;
|
||||
((bc)->bcache_ctl[BHASH((bc), (blkno))].bc_blkno != (blkno))
|
||||
#define BCACHE_READAHEAD 256
|
||||
#define BCACHE_MINREADAHEAD 32
|
||||
#define BCACHE_MARKER 0xdeadbeef
|
||||
|
||||
static void bcache_invalidate(struct bcache *bc, daddr_t blkno);
|
||||
static void bcache_insert(struct bcache *bc, daddr_t blkno);
|
||||
@ -95,7 +96,7 @@ static void bcache_free_instance(struct bcache *bc);
|
||||
* Initialise the cache for (nblks) of (bsize).
|
||||
*/
|
||||
void
|
||||
bcache_init(u_int nblks, size_t bsize)
|
||||
bcache_init(size_t nblks, size_t bsize)
|
||||
{
|
||||
/* set up control data */
|
||||
bcache_total_nblks = nblks;
|
||||
@ -122,6 +123,7 @@ bcache_allocate(void)
|
||||
u_int i;
|
||||
struct bcache *bc = malloc(sizeof (struct bcache));
|
||||
int disks = bcache_numdev;
|
||||
uint32_t *marker;
|
||||
|
||||
if (disks == 0)
|
||||
disks = 1; /* safe guard */
|
||||
@ -140,11 +142,13 @@ bcache_allocate(void)
|
||||
|
||||
bc->bcache_nblks = bcache_total_nblks >> i;
|
||||
bcache_unit_nblks = bc->bcache_nblks;
|
||||
bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize);
|
||||
bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize +
|
||||
sizeof(uint32_t));
|
||||
if (bc->bcache_data == NULL) {
|
||||
/* dont error out yet. fall back to 32 blocks and try again */
|
||||
bc->bcache_nblks = 32;
|
||||
bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize);
|
||||
bc->bcache_data = malloc(bc->bcache_nblks * bcache_blksize +
|
||||
sizeof(uint32_t));
|
||||
}
|
||||
|
||||
bc->bcache_ctl = malloc(bc->bcache_nblks * sizeof(struct bcachectl));
|
||||
@ -152,8 +156,11 @@ bcache_allocate(void)
|
||||
if ((bc->bcache_data == NULL) || (bc->bcache_ctl == NULL)) {
|
||||
bcache_free_instance(bc);
|
||||
errno = ENOMEM;
|
||||
return(NULL);
|
||||
return (NULL);
|
||||
}
|
||||
/* Insert cache end marker. */
|
||||
marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
|
||||
*marker = BCACHE_MARKER;
|
||||
|
||||
/* Flush the cache */
|
||||
for (i = 0; i < bc->bcache_nblks; i++) {
|
||||
@ -215,6 +222,9 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
int result;
|
||||
daddr_t p_blk;
|
||||
caddr_t p_buf;
|
||||
uint32_t *marker;
|
||||
|
||||
marker = (uint32_t *)(bc->bcache_data + bc->bcache_nblks * bcache_blksize);
|
||||
|
||||
if (bc == NULL) {
|
||||
errno = ENODEV;
|
||||
@ -261,9 +271,35 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
|
||||
p_size = MIN(r_size, nblk - i); /* read at least those blocks */
|
||||
|
||||
/*
|
||||
* The read ahead size setup.
|
||||
* While the read ahead can save us IO, it also can complicate things:
|
||||
* 1. We do not want to read ahead by wrapping around the
|
||||
* bcache end - this would complicate the cache management.
|
||||
* 2. We are using bc->ra as dynamic hint for read ahead size,
|
||||
* detected cache hits will increase the read-ahead block count, and
|
||||
* misses will decrease, see the code above.
|
||||
* 3. The bcache is sized by 512B blocks, however, the underlying device
|
||||
* may have a larger sector size, and we should perform the IO by
|
||||
* taking into account these larger sector sizes. We could solve this by
|
||||
* passing the sector size to bcache_allocate(), or by using ioctl(), but
|
||||
* in this version we are using the constant, 16 blocks, and are rounding
|
||||
* read ahead block count down to multiple of 16.
|
||||
* Using the constant has two reasons, we are not entirely sure if the
|
||||
* BIOS disk interface is providing the correct value for sector size.
|
||||
* And secondly, this way we get the most conservative setup for the ra.
|
||||
*
|
||||
* The selection of multiple of 16 blocks (8KB) is quite arbitrary, however,
|
||||
* we want to have the CD (2K) and the 4K disks to be covered.
|
||||
* Also, as we have 32 blocks to be allocated as the fallback value in the
|
||||
* bcache_allocate(), the 16 ra blocks will allow the read ahead
|
||||
* to be used even with bcache this small.
|
||||
*/
|
||||
|
||||
ra = bc->bcache_nblks - BHASH(bc, p_blk + p_size);
|
||||
if (ra != bc->bcache_nblks) { /* do we have RA space? */
|
||||
ra = MIN(bc->ra, ra);
|
||||
if (ra != 0 && ra != bc->bcache_nblks) { /* do we have RA space? */
|
||||
ra = MIN(bc->ra, ra - 1);
|
||||
ra = rounddown(ra, 16); /* multiple of 16 blocks */
|
||||
p_size += ra;
|
||||
}
|
||||
|
||||
@ -310,6 +346,12 @@ read_strategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
result = 0;
|
||||
}
|
||||
|
||||
if (*marker != BCACHE_MARKER) {
|
||||
printf("BUG: bcache corruption detected: nblks: %zu p_blk: %lu, "
|
||||
"p_size: %zu, ra: %zu\n", bc->bcache_nblks,
|
||||
(long unsigned)BHASH(bc, p_blk), p_size, ra);
|
||||
}
|
||||
|
||||
done:
|
||||
if ((result == 0) && (rsize != NULL))
|
||||
*rsize = size;
|
||||
@ -338,7 +380,7 @@ bcache_strategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
/* bypass large requests, or when the cache is inactive */
|
||||
if (bc == NULL ||
|
||||
((size * 2 / bcache_blksize) > bcache_nblks)) {
|
||||
DEBUG("bypass %d from %d", size / bcache_blksize, blk);
|
||||
DEBUG("bypass %zu from %qu", size / bcache_blksize, blk);
|
||||
bcache_bypasses++;
|
||||
return (dd->dv_strategy(dd->dv_devdata, rw, blk, size, buf, rsize));
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ int kern_pread(int fd, vm_offset_t dest, size_t len, off_t off);
|
||||
void *alloc_pread(int fd, off_t off, size_t len);
|
||||
|
||||
/* bcache.c */
|
||||
void bcache_init(u_int nblks, size_t bsize);
|
||||
void bcache_init(size_t nblks, size_t bsize);
|
||||
void bcache_add_dev(int);
|
||||
void *bcache_allocate(void);
|
||||
void bcache_free(void *);
|
||||
|
@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$");
|
||||
struct open_disk {
|
||||
struct ptable *table;
|
||||
uint64_t mediasize;
|
||||
uint64_t entrysize;
|
||||
u_int sectorsize;
|
||||
u_int flags;
|
||||
int rcnt;
|
||||
@ -264,13 +265,28 @@ disk_write(struct disk_devdesc *dev, void *buf, uint64_t offset, u_int blocks)
|
||||
}
|
||||
|
||||
int
|
||||
disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *buf)
|
||||
disk_ioctl(struct disk_devdesc *dev, u_long cmd, void *data)
|
||||
{
|
||||
struct open_disk *od = dev->d_opendata;
|
||||
|
||||
if (dev->d_dev->dv_ioctl)
|
||||
return ((*dev->d_dev->dv_ioctl)(dev->d_opendata, cmd, buf));
|
||||
if (od == NULL)
|
||||
return (ENOTTY);
|
||||
|
||||
return (ENXIO);
|
||||
switch (cmd) {
|
||||
case DIOCGSECTORSIZE:
|
||||
*(u_int *)data = od->sectorsize;
|
||||
break;
|
||||
case DIOCGMEDIASIZE:
|
||||
if (dev->d_offset == 0)
|
||||
*(uint64_t *)data = od->mediasize;
|
||||
else
|
||||
*(uint64_t *)data = od->entrysize * od->sectorsize;
|
||||
break;
|
||||
default:
|
||||
return (ENOTTY);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
@ -315,6 +331,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize,
|
||||
}
|
||||
dev->d_opendata = od;
|
||||
od->rcnt = 0;
|
||||
od->entrysize = 0;
|
||||
}
|
||||
od->mediasize = mediasize;
|
||||
od->sectorsize = sectorsize;
|
||||
@ -330,14 +347,24 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize, u_int sectorsize,
|
||||
rc = ENXIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (ptable_getsize(od->table, &mediasize) != 0) {
|
||||
rc = ENXIO;
|
||||
goto out;
|
||||
}
|
||||
if (mediasize > od->mediasize) {
|
||||
od->mediasize = mediasize;
|
||||
}
|
||||
opened:
|
||||
rc = 0;
|
||||
if (ptable_gettype(od->table) == PTABLE_BSD &&
|
||||
partition >= 0) {
|
||||
/* It doesn't matter what value has d_slice */
|
||||
rc = ptable_getpart(od->table, &part, partition);
|
||||
if (rc == 0)
|
||||
if (rc == 0) {
|
||||
dev->d_offset = part.start;
|
||||
od->entrysize = part.end - part.start + 1;
|
||||
}
|
||||
} else if (slice >= 0) {
|
||||
/* Try to get information about partition */
|
||||
if (slice == 0)
|
||||
@ -347,6 +374,7 @@ opened:
|
||||
if (rc != 0) /* Partition doesn't exist */
|
||||
goto out;
|
||||
dev->d_offset = part.start;
|
||||
od->entrysize = part.end - part.start + 1;
|
||||
slice = part.index;
|
||||
if (ptable_gettype(od->table) == PTABLE_GPT) {
|
||||
partition = 255;
|
||||
@ -389,6 +417,7 @@ opened:
|
||||
if (rc != 0)
|
||||
goto out;
|
||||
dev->d_offset += part.start;
|
||||
od->entrysize = part.end - part.start + 1;
|
||||
}
|
||||
out:
|
||||
if (table != NULL)
|
||||
|
@ -310,10 +310,30 @@ ptable_gptread(struct ptable *table, void *dev, diskread_t dread)
|
||||
DEBUG("GPT detected");
|
||||
size = MIN(hdr.hdr_entries * hdr.hdr_entsz,
|
||||
MAXTBLSZ * table->sectorsize);
|
||||
|
||||
/*
|
||||
* If the disk's sector count is smaller than the sector count recorded
|
||||
* in the disk's GPT table header, set the table->sectors to the value
|
||||
* recorded in GPT tables. This is done to work around buggy firmware
|
||||
* that returns truncated disk sizes.
|
||||
*
|
||||
* Note, this is still not a foolproof way to get disk's size. For
|
||||
* example, an image file can be truncated when copied to smaller media.
|
||||
*/
|
||||
if (hdr.hdr_lba_alt + 1 > table->sectors)
|
||||
table->sectors = hdr.hdr_lba_alt + 1;
|
||||
|
||||
for (i = 0; i < size / hdr.hdr_entsz; i++) {
|
||||
ent = (struct gpt_ent *)(tbl + i * hdr.hdr_entsz);
|
||||
if (uuid_equal(&ent->ent_type, &gpt_uuid_unused, NULL))
|
||||
continue;
|
||||
|
||||
/* Simple sanity checks. */
|
||||
if (ent->ent_lba_start < hdr.hdr_lba_start ||
|
||||
ent->ent_lba_end > hdr.hdr_lba_end ||
|
||||
ent->ent_lba_start > ent->ent_lba_end)
|
||||
continue;
|
||||
|
||||
entry = malloc(sizeof(*entry));
|
||||
if (entry == NULL)
|
||||
break;
|
||||
@ -734,6 +754,19 @@ ptable_gettype(const struct ptable *table)
|
||||
return (table->type);
|
||||
}
|
||||
|
||||
int
|
||||
ptable_getsize(const struct ptable *table, uint64_t *sizep)
|
||||
{
|
||||
uint64_t tmp = table->sectors * table->sectorsize;
|
||||
|
||||
if (tmp < table->sectors)
|
||||
return (EOVERFLOW);
|
||||
|
||||
if (sizep != NULL)
|
||||
*sizep = tmp;
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
ptable_getpart(const struct ptable *table, struct ptable_entry *part, int index)
|
||||
{
|
||||
|
@ -70,6 +70,7 @@ struct ptable *ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize,
|
||||
diskread_t *dread);
|
||||
void ptable_close(struct ptable *table);
|
||||
enum ptable_type ptable_gettype(const struct ptable *table);
|
||||
int ptable_getsize(const struct ptable *table, uint64_t *sizep);
|
||||
|
||||
int ptable_getpart(const struct ptable *table, struct ptable_entry *part,
|
||||
int index);
|
||||
|
@ -31,16 +31,37 @@
|
||||
#define _LOADER_EFILIB_H
|
||||
|
||||
#include <stand.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
extern EFI_HANDLE IH;
|
||||
extern EFI_SYSTEM_TABLE *ST;
|
||||
extern EFI_BOOT_SERVICES *BS;
|
||||
extern EFI_RUNTIME_SERVICES *RS;
|
||||
|
||||
extern struct devsw efipart_dev;
|
||||
extern struct devsw efipart_fddev;
|
||||
extern struct devsw efipart_cddev;
|
||||
extern struct devsw efipart_hddev;
|
||||
extern struct devsw efinet_dev;
|
||||
extern struct netif_driver efinetif;
|
||||
|
||||
/* EFI block device data, included here to help efi_zfs_probe() */
|
||||
typedef STAILQ_HEAD(pdinfo_list, pdinfo) pdinfo_list_t;
|
||||
|
||||
typedef struct pdinfo
|
||||
{
|
||||
STAILQ_ENTRY(pdinfo) pd_link; /* link in device list */
|
||||
pdinfo_list_t pd_part; /* link of partitions */
|
||||
EFI_HANDLE pd_handle;
|
||||
EFI_HANDLE pd_alias;
|
||||
EFI_DEVICE_PATH *pd_devpath;
|
||||
EFI_BLOCK_IO *pd_blkio;
|
||||
int pd_unit; /* unit number */
|
||||
int pd_open; /* reference counter */
|
||||
void *pd_bcache; /* buffer cache data */
|
||||
} pdinfo_t;
|
||||
|
||||
pdinfo_list_t *efiblk_get_pdinfo_list(struct devsw *dev);
|
||||
|
||||
void *efi_get_table(EFI_GUID *tbl);
|
||||
|
||||
int efi_register_handles(struct devsw *, EFI_HANDLE *, EFI_HANDLE *, int);
|
||||
@ -53,6 +74,7 @@ EFI_DEVICE_PATH *efi_lookup_devpath(EFI_HANDLE);
|
||||
EFI_HANDLE efi_devpath_handle(EFI_DEVICE_PATH *);
|
||||
EFI_DEVICE_PATH *efi_devpath_last_node(EFI_DEVICE_PATH *);
|
||||
EFI_DEVICE_PATH *efi_devpath_trim(EFI_DEVICE_PATH *);
|
||||
int efi_devpath_match(EFI_DEVICE_PATH *, EFI_DEVICE_PATH *);
|
||||
CHAR16 *efi_devpath_name(EFI_DEVICE_PATH *);
|
||||
void efi_free_devpath_name(CHAR16 *);
|
||||
|
||||
|
@ -138,3 +138,31 @@ efi_devpath_handle(EFI_DEVICE_PATH *devpath)
|
||||
return (NULL);
|
||||
return (h);
|
||||
}
|
||||
|
||||
int
|
||||
efi_devpath_match(EFI_DEVICE_PATH *devpath1, EFI_DEVICE_PATH *devpath2)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (devpath1 == NULL || devpath2 == NULL)
|
||||
return (0);
|
||||
|
||||
while (1) {
|
||||
if (DevicePathType(devpath1) != DevicePathType(devpath2) ||
|
||||
DevicePathSubType(devpath1) != DevicePathSubType(devpath2))
|
||||
return (0);
|
||||
|
||||
len = DevicePathNodeLength(devpath1);
|
||||
if (len != DevicePathNodeLength(devpath2))
|
||||
return (0);
|
||||
|
||||
if (memcmp(devpath1, devpath2, (size_t)len) != 0)
|
||||
return (0);
|
||||
|
||||
if (IsDevicePathEnd(devpath1))
|
||||
break;
|
||||
devpath1 = NextDevicePathNode(devpath1);
|
||||
devpath2 = NextDevicePathNode(devpath2);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
|
@ -27,8 +27,10 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/disk.h>
|
||||
#include <sys/param.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/queue.h>
|
||||
#include <stddef.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
@ -37,57 +39,110 @@ __FBSDID("$FreeBSD$");
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
#include <efiprot.h>
|
||||
#include <disk.h>
|
||||
|
||||
static EFI_GUID blkio_guid = BLOCK_IO_PROTOCOL;
|
||||
|
||||
static int efipart_init(void);
|
||||
static int efipart_initfd(void);
|
||||
static int efipart_initcd(void);
|
||||
static int efipart_inithd(void);
|
||||
|
||||
static int efipart_strategy(void *, int, daddr_t, size_t, char *, size_t *);
|
||||
static int efipart_realstrategy(void *, int, daddr_t, size_t, char *, size_t *);
|
||||
|
||||
static int efipart_open(struct open_file *, ...);
|
||||
static int efipart_close(struct open_file *);
|
||||
static int efipart_print(int);
|
||||
static int efipart_ioctl(struct open_file *, u_long, void *);
|
||||
|
||||
struct devsw efipart_dev = {
|
||||
.dv_name = "part",
|
||||
.dv_type = DEVT_DISK,
|
||||
.dv_init = efipart_init,
|
||||
static int efipart_printfd(int);
|
||||
static int efipart_printcd(int);
|
||||
static int efipart_printhd(int);
|
||||
|
||||
struct devsw efipart_fddev = {
|
||||
.dv_name = "fd",
|
||||
.dv_type = DEVT_FD,
|
||||
.dv_init = efipart_initfd,
|
||||
.dv_strategy = efipart_strategy,
|
||||
.dv_open = efipart_open,
|
||||
.dv_close = efipart_close,
|
||||
.dv_ioctl = noioctl,
|
||||
.dv_print = efipart_print,
|
||||
.dv_ioctl = efipart_ioctl,
|
||||
.dv_print = efipart_printfd,
|
||||
.dv_cleanup = NULL
|
||||
};
|
||||
|
||||
/*
|
||||
* info structure to support bcache
|
||||
*/
|
||||
struct pdinfo {
|
||||
int pd_unit; /* unit number */
|
||||
int pd_open; /* reference counter */
|
||||
void *pd_bcache; /* buffer cache data */
|
||||
struct devsw efipart_cddev = {
|
||||
.dv_name = "cd",
|
||||
.dv_type = DEVT_CD,
|
||||
.dv_init = efipart_initcd,
|
||||
.dv_strategy = efipart_strategy,
|
||||
.dv_open = efipart_open,
|
||||
.dv_close = efipart_close,
|
||||
.dv_ioctl = efipart_ioctl,
|
||||
.dv_print = efipart_printcd,
|
||||
.dv_cleanup = NULL
|
||||
};
|
||||
static struct pdinfo *pdinfo;
|
||||
static int npdinfo = 0;
|
||||
|
||||
#define PD(dev) (pdinfo[(dev)->d_unit])
|
||||
struct devsw efipart_hddev = {
|
||||
.dv_name = "disk",
|
||||
.dv_type = DEVT_DISK,
|
||||
.dv_init = efipart_inithd,
|
||||
.dv_strategy = efipart_strategy,
|
||||
.dv_open = efipart_open,
|
||||
.dv_close = efipart_close,
|
||||
.dv_ioctl = efipart_ioctl,
|
||||
.dv_print = efipart_printhd,
|
||||
.dv_cleanup = NULL
|
||||
};
|
||||
|
||||
static pdinfo_list_t fdinfo;
|
||||
static pdinfo_list_t cdinfo;
|
||||
static pdinfo_list_t hdinfo;
|
||||
|
||||
static EFI_HANDLE *efipart_handles = NULL;
|
||||
static UINTN efipart_nhandles = 0;
|
||||
|
||||
static pdinfo_t *
|
||||
efiblk_get_pdinfo(pdinfo_list_t *pdi, int unit)
|
||||
{
|
||||
pdinfo_t *pd;
|
||||
|
||||
STAILQ_FOREACH(pd, pdi, pd_link) {
|
||||
if (pd->pd_unit == unit)
|
||||
return (pd);
|
||||
}
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_init(void)
|
||||
efiblk_pdinfo_count(pdinfo_list_t *pdi)
|
||||
{
|
||||
pdinfo_t *pd;
|
||||
int i = 0;
|
||||
|
||||
STAILQ_FOREACH(pd, pdi, pd_link) {
|
||||
i++;
|
||||
}
|
||||
return (i);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_inithandles(void)
|
||||
{
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node;
|
||||
EFI_HANDLE *hin, *hout, *aliases, handle;
|
||||
EFI_STATUS status;
|
||||
UINTN sz;
|
||||
u_int n, nin, nout, nrdisk;
|
||||
int err;
|
||||
EFI_HANDLE *hin;
|
||||
EFI_STATUS status;
|
||||
|
||||
if (efipart_nhandles != 0) {
|
||||
free(efipart_handles);
|
||||
efipart_handles = NULL;
|
||||
efipart_nhandles = 0;
|
||||
}
|
||||
|
||||
sz = 0;
|
||||
hin = NULL;
|
||||
status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, 0);
|
||||
status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz, hin);
|
||||
if (status == EFI_BUFFER_TOO_SMALL) {
|
||||
hin = (EFI_HANDLE *)malloc(sz * 3);
|
||||
hin = malloc(sz);
|
||||
status = BS->LocateHandle(ByProtocol, &blkio_guid, 0, &sz,
|
||||
hin);
|
||||
if (EFI_ERROR(status))
|
||||
@ -96,33 +151,150 @@ efipart_init(void)
|
||||
if (EFI_ERROR(status))
|
||||
return (efi_status_to_errno(status));
|
||||
|
||||
/* Filter handles to only include FreeBSD partitions. */
|
||||
nin = sz / sizeof(EFI_HANDLE);
|
||||
hout = hin + nin;
|
||||
aliases = hout + nin;
|
||||
nout = 0;
|
||||
nrdisk = 0;
|
||||
efipart_handles = hin;
|
||||
efipart_nhandles = sz;
|
||||
return (0);
|
||||
}
|
||||
|
||||
bzero(aliases, nin * sizeof(EFI_HANDLE));
|
||||
pdinfo = malloc(nin * sizeof(*pdinfo));
|
||||
if (pdinfo == NULL)
|
||||
return (ENOMEM);
|
||||
static ACPI_HID_DEVICE_PATH *
|
||||
efipart_floppy(EFI_DEVICE_PATH *node)
|
||||
{
|
||||
ACPI_HID_DEVICE_PATH *acpi = NULL;
|
||||
|
||||
for (n = 0; n < nin; n++) {
|
||||
devpath = efi_lookup_devpath(hin[n]);
|
||||
if (devpath == NULL) {
|
||||
continue;
|
||||
if (DevicePathType(node) == ACPI_DEVICE_PATH &&
|
||||
DevicePathSubType(node) == ACPI_DP) {
|
||||
acpi = (ACPI_HID_DEVICE_PATH *) node;
|
||||
if (acpi->HID == EISA_PNP_ID(0x604) ||
|
||||
acpi->HID == EISA_PNP_ID(0x700) ||
|
||||
acpi->HID == EISA_ID(0x41d1, 0x701)) {
|
||||
return (acpi);
|
||||
}
|
||||
}
|
||||
return (acpi);
|
||||
}
|
||||
|
||||
status = BS->HandleProtocol(hin[n], &blkio_guid,
|
||||
(void**)&blkio);
|
||||
/*
|
||||
* Add or update entries with new handle data.
|
||||
*/
|
||||
static int
|
||||
efipart_fdinfo_add(EFI_HANDLE handle, uint32_t uid, EFI_DEVICE_PATH *devpath)
|
||||
{
|
||||
pdinfo_t *fd;
|
||||
|
||||
fd = malloc(sizeof(pdinfo_t));
|
||||
if (fd == NULL) {
|
||||
printf("Failed to register floppy %d, out of memory\n", uid);
|
||||
return (ENOMEM);
|
||||
}
|
||||
memset(fd, 0, sizeof(pdinfo_t));
|
||||
STAILQ_INIT(&fd->pd_part);
|
||||
|
||||
fd->pd_unit = uid;
|
||||
fd->pd_handle = handle;
|
||||
fd->pd_devpath = devpath;
|
||||
STAILQ_INSERT_TAIL(&fdinfo, fd, pd_link);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
efipart_updatefd(void)
|
||||
{
|
||||
EFI_DEVICE_PATH *devpath, *node;
|
||||
ACPI_HID_DEVICE_PATH *acpi;
|
||||
int i, nin;
|
||||
|
||||
nin = efipart_nhandles / sizeof (*efipart_handles);
|
||||
for (i = 0; i < nin; i++) {
|
||||
devpath = efi_lookup_devpath(efipart_handles[i]);
|
||||
if (devpath == NULL)
|
||||
continue;
|
||||
|
||||
if ((node = efi_devpath_last_node(devpath)) == NULL)
|
||||
continue;
|
||||
if ((acpi = efipart_floppy(node)) != NULL) {
|
||||
efipart_fdinfo_add(efipart_handles[i], acpi->UID,
|
||||
devpath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_initfd(void)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = efipart_inithandles();
|
||||
if (rv != 0)
|
||||
return (rv);
|
||||
STAILQ_INIT(&fdinfo);
|
||||
|
||||
efipart_updatefd();
|
||||
|
||||
bcache_add_dev(efiblk_pdinfo_count(&fdinfo));
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Add or update entries with new handle data.
|
||||
*/
|
||||
static int
|
||||
efipart_cdinfo_add(EFI_HANDLE handle, EFI_HANDLE alias,
|
||||
EFI_DEVICE_PATH *devpath)
|
||||
{
|
||||
int unit;
|
||||
pdinfo_t *cd;
|
||||
pdinfo_t *pd;
|
||||
|
||||
unit = 0;
|
||||
STAILQ_FOREACH(pd, &cdinfo, pd_link) {
|
||||
if (efi_devpath_match(pd->pd_devpath, devpath) != 0) {
|
||||
pd->pd_handle = handle;
|
||||
pd->pd_alias = alias;
|
||||
return (0);
|
||||
}
|
||||
unit++;
|
||||
}
|
||||
|
||||
cd = malloc(sizeof(pdinfo_t));
|
||||
if (cd == NULL) {
|
||||
printf("Failed to add cd %d, out of memory\n", unit);
|
||||
return (ENOMEM);
|
||||
}
|
||||
memset(cd, 0, sizeof(pdinfo_t));
|
||||
STAILQ_INIT(&cd->pd_part);
|
||||
|
||||
cd->pd_handle = handle;
|
||||
cd->pd_unit = unit;
|
||||
cd->pd_alias = alias;
|
||||
cd->pd_devpath = devpath;
|
||||
STAILQ_INSERT_TAIL(&cdinfo, cd, pd_link);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
efipart_updatecd(void)
|
||||
{
|
||||
int i, nin;
|
||||
EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node;
|
||||
EFI_HANDLE handle;
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_STATUS status;
|
||||
|
||||
nin = efipart_nhandles / sizeof (*efipart_handles);
|
||||
for (i = 0; i < nin; i++) {
|
||||
devpath = efi_lookup_devpath(efipart_handles[i]);
|
||||
if (devpath == NULL)
|
||||
continue;
|
||||
|
||||
if ((node = efi_devpath_last_node(devpath)) == NULL)
|
||||
continue;
|
||||
if (efipart_floppy(node) != NULL)
|
||||
continue;
|
||||
|
||||
status = BS->HandleProtocol(efipart_handles[i],
|
||||
&blkio_guid, (void **)&blkio);
|
||||
if (EFI_ERROR(status))
|
||||
continue;
|
||||
if (!blkio->Media->LogicalPartition) {
|
||||
nrdisk++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we come across a logical partition of subtype CDROM
|
||||
* it doesn't refer to the CD filesystem itself, but rather
|
||||
@ -130,8 +302,6 @@ efipart_init(void)
|
||||
* we try to find the parent device and add that instead as
|
||||
* that will be the CD filesystem.
|
||||
*/
|
||||
if ((node = efi_devpath_last_node(devpath)) == NULL)
|
||||
continue;
|
||||
if (DevicePathType(node) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType(node) == MEDIA_CDROM_DP) {
|
||||
devpathcpy = efi_devpath_trim(devpath);
|
||||
@ -143,109 +313,400 @@ efipart_init(void)
|
||||
free(devpathcpy);
|
||||
if (EFI_ERROR(status))
|
||||
continue;
|
||||
hout[nout] = handle;
|
||||
aliases[nout] = hin[n];
|
||||
} else
|
||||
hout[nout] = hin[n];
|
||||
nout++;
|
||||
pdinfo[npdinfo].pd_open = 0;
|
||||
pdinfo[npdinfo].pd_bcache = NULL;
|
||||
pdinfo[npdinfo].pd_unit = npdinfo;
|
||||
npdinfo++;
|
||||
devpath = efi_lookup_devpath(handle);
|
||||
efipart_cdinfo_add(handle, efipart_handles[i],
|
||||
devpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (DevicePathType(node) == MESSAGING_DEVICE_PATH &&
|
||||
DevicePathSubType(node) == MSG_ATAPI_DP) {
|
||||
efipart_cdinfo_add(efipart_handles[i], NULL,
|
||||
devpath);
|
||||
continue;
|
||||
}
|
||||
|
||||
/* USB or SATA cd without the media. */
|
||||
if (blkio->Media->RemovableMedia &&
|
||||
!blkio->Media->MediaPresent) {
|
||||
efipart_cdinfo_add(efipart_handles[i], NULL,
|
||||
devpath);
|
||||
}
|
||||
}
|
||||
|
||||
bcache_add_dev(npdinfo);
|
||||
err = efi_register_handles(&efipart_dev, hout, aliases, nout);
|
||||
free(hin);
|
||||
|
||||
if (nout == 0 && nrdisk > 0)
|
||||
printf("Found %d disk(s) but no logical partition\n", nrdisk);
|
||||
return (err);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_print(int verbose)
|
||||
efipart_initcd(void)
|
||||
{
|
||||
char line[80];
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_HANDLE h;
|
||||
EFI_STATUS status;
|
||||
u_int unit;
|
||||
int ret = 0;
|
||||
int rv;
|
||||
|
||||
printf("%s devices:", efipart_dev.dv_name);
|
||||
rv = efipart_inithandles();
|
||||
if (rv != 0)
|
||||
return (rv);
|
||||
STAILQ_INIT(&cdinfo);
|
||||
|
||||
efipart_updatecd();
|
||||
|
||||
bcache_add_dev(efiblk_pdinfo_count(&cdinfo));
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_hdinfo_add(EFI_HANDLE disk_handle, EFI_HANDLE part_handle)
|
||||
{
|
||||
EFI_DEVICE_PATH *disk_devpath, *part_devpath;
|
||||
HARDDRIVE_DEVICE_PATH *node;
|
||||
int unit;
|
||||
pdinfo_t *hd, *pd, *last;
|
||||
|
||||
disk_devpath = efi_lookup_devpath(disk_handle);
|
||||
part_devpath = efi_lookup_devpath(part_handle);
|
||||
if (disk_devpath == NULL || part_devpath == NULL) {
|
||||
return (ENOENT);
|
||||
}
|
||||
|
||||
pd = malloc(sizeof(pdinfo_t));
|
||||
if (pd == NULL) {
|
||||
printf("Failed to add disk, out of memory\n");
|
||||
return (ENOMEM);
|
||||
}
|
||||
memset(pd, 0, sizeof(pdinfo_t));
|
||||
STAILQ_INIT(&pd->pd_part);
|
||||
node = (HARDDRIVE_DEVICE_PATH *)efi_devpath_last_node(part_devpath);
|
||||
|
||||
STAILQ_FOREACH(hd, &hdinfo, pd_link) {
|
||||
if (efi_devpath_match(hd->pd_devpath, disk_devpath) != 0) {
|
||||
/* Add the partition. */
|
||||
pd->pd_handle = part_handle;
|
||||
pd->pd_unit = node->PartitionNumber;
|
||||
pd->pd_devpath = part_devpath;
|
||||
STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
last = STAILQ_LAST(&hdinfo, pdinfo, pd_link);
|
||||
if (last != NULL)
|
||||
unit = last->pd_unit + 1;
|
||||
else
|
||||
unit = 0;
|
||||
|
||||
/* Add the disk. */
|
||||
hd = pd;
|
||||
hd->pd_handle = disk_handle;
|
||||
hd->pd_unit = unit;
|
||||
hd->pd_devpath = disk_devpath;
|
||||
STAILQ_INSERT_TAIL(&hdinfo, hd, pd_link);
|
||||
|
||||
pd = malloc(sizeof(pdinfo_t));
|
||||
if (pd == NULL) {
|
||||
printf("Failed to add partition, out of memory\n");
|
||||
return (ENOMEM);
|
||||
}
|
||||
memset(pd, 0, sizeof(pdinfo_t));
|
||||
STAILQ_INIT(&pd->pd_part);
|
||||
|
||||
/* Add the partition. */
|
||||
pd->pd_handle = part_handle;
|
||||
pd->pd_unit = node->PartitionNumber;
|
||||
pd->pd_devpath = part_devpath;
|
||||
STAILQ_INSERT_TAIL(&hd->pd_part, pd, pd_link);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static void
|
||||
efipart_updatehd(void)
|
||||
{
|
||||
int i, nin;
|
||||
EFI_DEVICE_PATH *devpath, *devpathcpy, *tmpdevpath, *node;
|
||||
EFI_HANDLE handle;
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_STATUS status;
|
||||
|
||||
nin = efipart_nhandles / sizeof (*efipart_handles);
|
||||
for (i = 0; i < nin; i++) {
|
||||
devpath = efi_lookup_devpath(efipart_handles[i]);
|
||||
if (devpath == NULL)
|
||||
continue;
|
||||
|
||||
if ((node = efi_devpath_last_node(devpath)) == NULL)
|
||||
continue;
|
||||
if (efipart_floppy(node) != NULL)
|
||||
continue;
|
||||
|
||||
status = BS->HandleProtocol(efipart_handles[i],
|
||||
&blkio_guid, (void **)&blkio);
|
||||
if (EFI_ERROR(status))
|
||||
continue;
|
||||
|
||||
if (DevicePathType(node) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType(node) == MEDIA_HARDDRIVE_DP) {
|
||||
devpathcpy = efi_devpath_trim(devpath);
|
||||
if (devpathcpy == NULL)
|
||||
continue;
|
||||
tmpdevpath = devpathcpy;
|
||||
status = BS->LocateDevicePath(&blkio_guid, &tmpdevpath,
|
||||
&handle);
|
||||
free(devpathcpy);
|
||||
if (EFI_ERROR(status))
|
||||
continue;
|
||||
/*
|
||||
* We do not support nested partitions.
|
||||
*/
|
||||
devpathcpy = efi_lookup_devpath(handle);
|
||||
if (devpathcpy == NULL)
|
||||
continue;
|
||||
if ((node = efi_devpath_last_node(devpathcpy)) == NULL)
|
||||
continue;
|
||||
if (DevicePathType(node) == MEDIA_DEVICE_PATH &&
|
||||
DevicePathSubType(node) == MEDIA_HARDDRIVE_DP)
|
||||
continue;
|
||||
efipart_hdinfo_add(handle, efipart_handles[i]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_inithd(void)
|
||||
{
|
||||
int rv;
|
||||
|
||||
rv = efipart_inithandles();
|
||||
if (rv != 0)
|
||||
return (rv);
|
||||
STAILQ_INIT(&hdinfo);
|
||||
|
||||
efipart_updatehd();
|
||||
|
||||
bcache_add_dev(efiblk_pdinfo_count(&hdinfo));
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_print_common(struct devsw *dev, pdinfo_list_t *pdlist, int verbose)
|
||||
{
|
||||
int ret = 0;
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_STATUS status;
|
||||
EFI_HANDLE h;
|
||||
pdinfo_t *pd;
|
||||
CHAR16 *text;
|
||||
struct disk_devdesc pd_dev;
|
||||
char line[80];
|
||||
|
||||
if (STAILQ_EMPTY(pdlist))
|
||||
return (0);
|
||||
|
||||
printf("%s devices:", dev->dv_name);
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
return (ret);
|
||||
|
||||
for (unit = 0, h = efi_find_handle(&efipart_dev, 0);
|
||||
h != NULL; h = efi_find_handle(&efipart_dev, ++unit)) {
|
||||
snprintf(line, sizeof(line), " %s%d:",
|
||||
efipart_dev.dv_name, unit);
|
||||
if ((ret = pager_output(line)) != 0)
|
||||
break;
|
||||
|
||||
STAILQ_FOREACH(pd, pdlist, pd_link) {
|
||||
h = pd->pd_handle;
|
||||
if (verbose) { /* Output the device path. */
|
||||
text = efi_devpath_name(efi_lookup_devpath(h));
|
||||
if (text != NULL) {
|
||||
printf(" %S", text);
|
||||
efi_free_devpath_name(text);
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
snprintf(line, sizeof(line),
|
||||
" %s%d", dev->dv_name, pd->pd_unit);
|
||||
printf("%s:", line);
|
||||
status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio);
|
||||
if (!EFI_ERROR(status)) {
|
||||
snprintf(line, sizeof(line), " %llu blocks",
|
||||
(unsigned long long)(blkio->Media->LastBlock + 1));
|
||||
if ((ret = pager_output(line)) != 0)
|
||||
printf(" %llu",
|
||||
blkio->Media->LastBlock == 0? 0:
|
||||
(unsigned long long) (blkio->Media->LastBlock + 1));
|
||||
if (blkio->Media->LastBlock != 0) {
|
||||
printf(" X %u", blkio->Media->BlockSize);
|
||||
}
|
||||
printf(" blocks");
|
||||
if (blkio->Media->MediaPresent) {
|
||||
if (blkio->Media->RemovableMedia)
|
||||
printf(" (removable)");
|
||||
} else
|
||||
printf(" (no media)");
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
break;
|
||||
if (!blkio->Media->MediaPresent)
|
||||
continue;
|
||||
|
||||
pd->pd_blkio = blkio;
|
||||
pd_dev.d_dev = dev;
|
||||
pd_dev.d_unit = pd->pd_unit;
|
||||
pd_dev.d_slice = -1;
|
||||
pd_dev.d_partition = -1;
|
||||
pd_dev.d_opendata = blkio;
|
||||
ret = disk_open(&pd_dev, blkio->Media->BlockSize *
|
||||
(blkio->Media->LastBlock + 1),
|
||||
blkio->Media->BlockSize,
|
||||
blkio->Media->RemovableMedia? DISK_F_NOCACHE: 0);
|
||||
if (ret == 0) {
|
||||
ret = disk_print(&pd_dev, line, verbose);
|
||||
disk_close(&pd_dev);
|
||||
if (ret != 0)
|
||||
return (ret);
|
||||
} else {
|
||||
/* Do not fail from disk_open() */
|
||||
ret = 0;
|
||||
}
|
||||
} else {
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
break;
|
||||
if (blkio->Media->RemovableMedia)
|
||||
if ((ret = pager_output(" (removable)")) != 0)
|
||||
break;
|
||||
}
|
||||
if ((ret = pager_output("\n")) != 0)
|
||||
break;
|
||||
}
|
||||
return (ret);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_printfd(int verbose)
|
||||
{
|
||||
return (efipart_print_common(&efipart_fddev, &fdinfo, verbose));
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_printcd(int verbose)
|
||||
{
|
||||
return (efipart_print_common(&efipart_cddev, &cdinfo, verbose));
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_printhd(int verbose)
|
||||
{
|
||||
return (efipart_print_common(&efipart_hddev, &hdinfo, verbose));
|
||||
}
|
||||
|
||||
pdinfo_list_t *
|
||||
efiblk_get_pdinfo_list(struct devsw *dev)
|
||||
{
|
||||
if (dev->dv_type == DEVT_DISK)
|
||||
return (&hdinfo);
|
||||
if (dev->dv_type == DEVT_CD)
|
||||
return (&cdinfo);
|
||||
if (dev->dv_type == DEVT_FD)
|
||||
return (&fdinfo);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_open(struct open_file *f, ...)
|
||||
{
|
||||
va_list args;
|
||||
struct devdesc *dev;
|
||||
struct disk_devdesc *dev;
|
||||
pdinfo_list_t *pdi;
|
||||
pdinfo_t *pd;
|
||||
EFI_BLOCK_IO *blkio;
|
||||
EFI_HANDLE h;
|
||||
EFI_STATUS status;
|
||||
|
||||
va_start(args, f);
|
||||
dev = va_arg(args, struct devdesc*);
|
||||
dev = va_arg(args, struct disk_devdesc*);
|
||||
va_end(args);
|
||||
|
||||
h = efi_find_handle(&efipart_dev, dev->d_unit);
|
||||
if (h == NULL)
|
||||
if (dev == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
status = BS->HandleProtocol(h, &blkio_guid, (void **)&blkio);
|
||||
if (EFI_ERROR(status))
|
||||
return (efi_status_to_errno(status));
|
||||
pdi = efiblk_get_pdinfo_list(dev->d_dev);
|
||||
if (pdi == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
pd = efiblk_get_pdinfo(pdi, dev->d_unit);
|
||||
if (pd == NULL)
|
||||
return (EIO);
|
||||
|
||||
if (pd->pd_blkio == NULL) {
|
||||
status = BS->HandleProtocol(pd->pd_handle, &blkio_guid,
|
||||
(void **)&pd->pd_blkio);
|
||||
if (EFI_ERROR(status))
|
||||
return (efi_status_to_errno(status));
|
||||
}
|
||||
|
||||
blkio = pd->pd_blkio;
|
||||
if (!blkio->Media->MediaPresent)
|
||||
return (EAGAIN);
|
||||
|
||||
dev->d_opendata = blkio;
|
||||
PD(dev).pd_open++;
|
||||
if (PD(dev).pd_bcache == NULL)
|
||||
PD(dev).pd_bcache = bcache_allocate();
|
||||
pd->pd_open++;
|
||||
if (pd->pd_bcache == NULL)
|
||||
pd->pd_bcache = bcache_allocate();
|
||||
|
||||
if (dev->d_dev->dv_type == DEVT_DISK) {
|
||||
return (disk_open(dev,
|
||||
blkio->Media->BlockSize * (blkio->Media->LastBlock + 1),
|
||||
blkio->Media->BlockSize,
|
||||
blkio->Media->RemovableMedia? DISK_F_NOCACHE: 0));
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_close(struct open_file *f)
|
||||
{
|
||||
struct devdesc *dev;
|
||||
struct disk_devdesc *dev;
|
||||
pdinfo_list_t *pdi;
|
||||
pdinfo_t *pd;
|
||||
|
||||
dev = (struct devdesc *)(f->f_devdata);
|
||||
if (dev->d_opendata == NULL)
|
||||
dev = (struct disk_devdesc *)(f->f_devdata);
|
||||
if (dev == NULL)
|
||||
return (EINVAL);
|
||||
pdi = efiblk_get_pdinfo_list(dev->d_dev);
|
||||
if (pdi == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
dev->d_opendata = NULL;
|
||||
PD(dev).pd_open--;
|
||||
if (PD(dev).pd_open == 0) {
|
||||
bcache_free(PD(dev).pd_bcache);
|
||||
PD(dev).pd_bcache = NULL;
|
||||
pd = efiblk_get_pdinfo(pdi, dev->d_unit);
|
||||
if (pd == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
pd->pd_open--;
|
||||
if (pd->pd_open == 0) {
|
||||
pd->pd_blkio = NULL;
|
||||
bcache_free(pd->pd_bcache);
|
||||
pd->pd_bcache = NULL;
|
||||
}
|
||||
if (dev->d_dev->dv_type == DEVT_DISK)
|
||||
return (disk_close(dev));
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
efipart_ioctl(struct open_file *f, u_long cmd, void *data)
|
||||
{
|
||||
struct disk_devdesc *dev;
|
||||
pdinfo_list_t *pdi;
|
||||
pdinfo_t *pd;
|
||||
int rc;
|
||||
|
||||
dev = (struct disk_devdesc *)(f->f_devdata);
|
||||
if (dev == NULL)
|
||||
return (EINVAL);
|
||||
pdi = efiblk_get_pdinfo_list(dev->d_dev);
|
||||
if (pdi == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
pd = efiblk_get_pdinfo(pdi, dev->d_unit);
|
||||
if (pd == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
if (dev->d_dev->dv_type == DEVT_DISK) {
|
||||
rc = disk_ioctl(dev, cmd, data);
|
||||
if (rc != ENOTTY)
|
||||
return (rc);
|
||||
}
|
||||
|
||||
switch (cmd) {
|
||||
case DIOCGSECTORSIZE:
|
||||
*(u_int *)data = pd->pd_blkio->Media->BlockSize;
|
||||
break;
|
||||
case DIOCGMEDIASIZE:
|
||||
*(off_t *)data = pd->pd_blkio->Media->BlockSize *
|
||||
(pd->pd_blkio->Media->LastBlock + 1);
|
||||
break;
|
||||
default:
|
||||
return (ENOTTY);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -294,12 +755,29 @@ efipart_strategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
char *buf, size_t *rsize)
|
||||
{
|
||||
struct bcache_devdata bcd;
|
||||
struct devdesc *dev;
|
||||
struct disk_devdesc *dev;
|
||||
pdinfo_list_t *pdi;
|
||||
pdinfo_t *pd;
|
||||
|
||||
dev = (struct disk_devdesc *)devdata;
|
||||
if (dev == NULL)
|
||||
return (EINVAL);
|
||||
pdi = efiblk_get_pdinfo_list(dev->d_dev);
|
||||
if (pdi == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
pd = efiblk_get_pdinfo(pdi, dev->d_unit);
|
||||
if (pd == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
dev = (struct devdesc *)devdata;
|
||||
bcd.dv_strategy = efipart_realstrategy;
|
||||
bcd.dv_devdata = devdata;
|
||||
bcd.dv_cache = PD(dev).pd_bcache;
|
||||
bcd.dv_cache = pd->pd_bcache;
|
||||
|
||||
if (dev->d_dev->dv_type == DEVT_DISK) {
|
||||
return (bcache_strategy(&bcd, rw, blk + dev->d_offset,
|
||||
size, buf, rsize));
|
||||
}
|
||||
return (bcache_strategy(&bcd, rw, blk, size, buf, rsize));
|
||||
}
|
||||
|
||||
@ -307,7 +785,9 @@ static int
|
||||
efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
char *buf, size_t *rsize)
|
||||
{
|
||||
struct devdesc *dev = (struct devdesc *)devdata;
|
||||
struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
|
||||
pdinfo_list_t *pdi;
|
||||
pdinfo_t *pd;
|
||||
EFI_BLOCK_IO *blkio;
|
||||
off_t off;
|
||||
char *blkbuf;
|
||||
@ -317,7 +797,15 @@ efipart_realstrategy(void *devdata, int rw, daddr_t blk, size_t size,
|
||||
if (dev == NULL || blk < 0)
|
||||
return (EINVAL);
|
||||
|
||||
blkio = dev->d_opendata;
|
||||
pdi = efiblk_get_pdinfo_list(dev->d_dev);
|
||||
if (pdi == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
pd = efiblk_get_pdinfo(pdi, dev->d_unit);
|
||||
if (pd == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
blkio = pd->pd_blkio;
|
||||
if (blkio == NULL)
|
||||
return (ENXIO);
|
||||
|
||||
|
@ -36,7 +36,9 @@ __FBSDID("$FreeBSD$");
|
||||
#endif
|
||||
|
||||
struct devsw *devsw[] = {
|
||||
&efipart_dev,
|
||||
&efipart_fddev,
|
||||
&efipart_cddev,
|
||||
&efipart_hddev,
|
||||
&efinet_dev,
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
&zfs_dev,
|
||||
|
@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/disklabel.h>
|
||||
#include <sys/param.h>
|
||||
#include <bootstrap.h>
|
||||
#include <disk.h>
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
#include <libzfs.h>
|
||||
#endif
|
||||
@ -90,7 +91,7 @@ efi_parsedev(struct devdesc **dev, const char *devspec, const char **path)
|
||||
struct devsw *dv;
|
||||
char *cp;
|
||||
const char *np;
|
||||
int i;
|
||||
int i, err;
|
||||
|
||||
/* minimum length check */
|
||||
if (strlen(devspec) < 2)
|
||||
@ -106,11 +107,26 @@ efi_parsedev(struct devdesc **dev, const char *devspec, const char **path)
|
||||
return (ENOENT);
|
||||
|
||||
np = devspec + strlen(dv->dv_name);
|
||||
err = 0;
|
||||
|
||||
switch (dv->dv_type) {
|
||||
case DEVT_NONE:
|
||||
break;
|
||||
|
||||
case DEVT_DISK:
|
||||
idev = malloc(sizeof(struct disk_devdesc));
|
||||
if (idev == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
err = disk_parsedev((struct disk_devdesc *)idev, np, path);
|
||||
if (err != 0) {
|
||||
free(idev);
|
||||
return (err);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
if (dv->dv_type == DEVT_ZFS) {
|
||||
int err;
|
||||
|
||||
case DEVT_ZFS:
|
||||
idev = malloc(sizeof(struct zfs_devdesc));
|
||||
if (idev == NULL)
|
||||
return (ENOMEM);
|
||||
@ -120,34 +136,35 @@ efi_parsedev(struct devdesc **dev, const char *devspec, const char **path)
|
||||
free(idev);
|
||||
return (err);
|
||||
}
|
||||
cp = strchr(np + 1, ':');
|
||||
} else
|
||||
break;
|
||||
#endif
|
||||
{
|
||||
default:
|
||||
idev = malloc(sizeof(struct devdesc));
|
||||
if (idev == NULL)
|
||||
return (ENOMEM);
|
||||
|
||||
idev->d_dev = dv;
|
||||
idev->d_type = dv->dv_type;
|
||||
idev->d_unit = -1;
|
||||
cp = (char *)np;
|
||||
if (*np != '\0' && *np != ':') {
|
||||
idev->d_unit = strtol(np, &cp, 0);
|
||||
if (cp == np) {
|
||||
idev->d_unit = -1;
|
||||
free(idev);
|
||||
return (EUNIT);
|
||||
}
|
||||
}
|
||||
if (*cp != '\0' && *cp != ':') {
|
||||
free(idev);
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
if (path != NULL)
|
||||
*path = (*cp == 0) ? cp : cp + 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (*cp != '\0' && *cp != ':') {
|
||||
free(idev);
|
||||
return (EINVAL);
|
||||
}
|
||||
idev->d_dev = dv;
|
||||
idev->d_type = dv->dv_type;
|
||||
|
||||
if (path != NULL)
|
||||
*path = (*cp == 0) ? cp : cp + 1;
|
||||
if (dev != NULL)
|
||||
*dev = idev;
|
||||
else
|
||||
@ -162,14 +179,17 @@ efi_fmtdev(void *vdev)
|
||||
static char buf[SPECNAMELEN + 1];
|
||||
|
||||
switch(dev->d_type) {
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
case DEVT_ZFS:
|
||||
return (zfs_fmtdev(dev));
|
||||
#endif
|
||||
case DEVT_NONE:
|
||||
strcpy(buf, "(no device)");
|
||||
break;
|
||||
|
||||
case DEVT_DISK:
|
||||
return (disk_fmtdev(vdev));
|
||||
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
case DEVT_ZFS:
|
||||
return (zfs_fmtdev(dev));
|
||||
#endif
|
||||
default:
|
||||
sprintf(buf, "%s%d:", dev->d_dev->dv_name, dev->d_unit);
|
||||
break;
|
||||
|
@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stand.h>
|
||||
#include <string.h>
|
||||
#include <setjmp.h>
|
||||
#include <disk.h>
|
||||
|
||||
#include <efi.h>
|
||||
#include <efilib.h>
|
||||
@ -70,6 +71,7 @@ EFI_GUID inputid = SIMPLE_TEXT_INPUT_PROTOCOL;
|
||||
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
static void efi_zfs_probe(void);
|
||||
static uint64_t pool_guid;
|
||||
#endif
|
||||
|
||||
static int
|
||||
@ -154,12 +156,109 @@ out:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev, int *unit,
|
||||
uint64_t *extra)
|
||||
static void
|
||||
set_devdesc_currdev(struct devsw *dev, int unit)
|
||||
{
|
||||
struct devdesc currdev;
|
||||
char *devname;
|
||||
|
||||
currdev.d_dev = dev;
|
||||
currdev.d_type = currdev.d_dev->dv_type;
|
||||
currdev.d_unit = unit;
|
||||
currdev.d_opendata = NULL;
|
||||
devname = efi_fmtdev(&currdev);
|
||||
|
||||
env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev,
|
||||
env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, devname, env_noset, env_nounset);
|
||||
}
|
||||
|
||||
static int
|
||||
find_currdev(EFI_LOADED_IMAGE *img)
|
||||
{
|
||||
pdinfo_list_t *pdi_list;
|
||||
pdinfo_t *dp, *pp;
|
||||
EFI_DEVICE_PATH *devpath, *copy;
|
||||
EFI_HANDLE h;
|
||||
char *devname;
|
||||
struct devsw *dev;
|
||||
int unit;
|
||||
uint64_t extra;
|
||||
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
/* Did efi_zfs_probe() detect the boot pool? */
|
||||
if (pool_guid != 0) {
|
||||
struct zfs_devdesc currdev;
|
||||
|
||||
currdev.d_dev = &zfs_dev;
|
||||
currdev.d_unit = 0;
|
||||
currdev.d_type = currdev.d_dev->dv_type;
|
||||
currdev.d_opendata = NULL;
|
||||
currdev.pool_guid = pool_guid;
|
||||
currdev.root_guid = 0;
|
||||
devname = efi_fmtdev(&currdev);
|
||||
|
||||
env_setenv("currdev", EV_VOLATILE, devname, efi_setcurrdev,
|
||||
env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, devname, env_noset,
|
||||
env_nounset);
|
||||
return (0);
|
||||
}
|
||||
#endif /* EFI_ZFS_BOOT */
|
||||
|
||||
/* We have device lists for hd, cd, fd, walk them all. */
|
||||
pdi_list = efiblk_get_pdinfo_list(&efipart_hddev);
|
||||
STAILQ_FOREACH(dp, pdi_list, pd_link) {
|
||||
struct disk_devdesc currdev;
|
||||
|
||||
currdev.d_dev = &efipart_hddev;
|
||||
currdev.d_type = currdev.d_dev->dv_type;
|
||||
currdev.d_unit = dp->pd_unit;
|
||||
currdev.d_opendata = NULL;
|
||||
currdev.d_slice = -1;
|
||||
currdev.d_partition = -1;
|
||||
|
||||
if (dp->pd_handle == img->DeviceHandle) {
|
||||
devname = efi_fmtdev(&currdev);
|
||||
|
||||
env_setenv("currdev", EV_VOLATILE, devname,
|
||||
efi_setcurrdev, env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, devname,
|
||||
env_noset, env_nounset);
|
||||
return (0);
|
||||
}
|
||||
/* Assuming GPT partitioning. */
|
||||
STAILQ_FOREACH(pp, &dp->pd_part, pd_link) {
|
||||
if (pp->pd_handle == img->DeviceHandle) {
|
||||
currdev.d_slice = pp->pd_unit;
|
||||
currdev.d_partition = 255;
|
||||
devname = efi_fmtdev(&currdev);
|
||||
|
||||
env_setenv("currdev", EV_VOLATILE, devname,
|
||||
efi_setcurrdev, env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, devname,
|
||||
env_noset, env_nounset);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pdi_list = efiblk_get_pdinfo_list(&efipart_cddev);
|
||||
STAILQ_FOREACH(dp, pdi_list, pd_link) {
|
||||
if (dp->pd_handle == img->DeviceHandle ||
|
||||
dp->pd_alias == img->DeviceHandle) {
|
||||
set_devdesc_currdev(&efipart_cddev, dp->pd_unit);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
pdi_list = efiblk_get_pdinfo_list(&efipart_fddev);
|
||||
STAILQ_FOREACH(dp, pdi_list, pd_link) {
|
||||
if (dp->pd_handle == img->DeviceHandle) {
|
||||
set_devdesc_currdev(&efipart_fddev, dp->pd_unit);
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Try the device handle from our loaded image first. If that
|
||||
@ -167,8 +266,10 @@ find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev, int *unit,
|
||||
* any of the nodes in that path match one of the enumerated
|
||||
* handles.
|
||||
*/
|
||||
if (efi_handle_lookup(img->DeviceHandle, dev, unit, extra) == 0)
|
||||
if (efi_handle_lookup(img->DeviceHandle, &dev, &unit, &extra) == 0) {
|
||||
set_devdesc_currdev(dev, unit);
|
||||
return (0);
|
||||
}
|
||||
|
||||
copy = NULL;
|
||||
devpath = efi_lookup_image_devpath(IH);
|
||||
@ -180,8 +281,10 @@ find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev, int *unit,
|
||||
free(copy);
|
||||
copy = NULL;
|
||||
|
||||
if (efi_handle_lookup(h, dev, unit, extra) == 0)
|
||||
if (efi_handle_lookup(h, &dev, &unit, &extra) == 0) {
|
||||
set_devdesc_currdev(dev, unit);
|
||||
return (0);
|
||||
}
|
||||
|
||||
devpath = efi_lookup_devpath(h);
|
||||
if (devpath != NULL) {
|
||||
@ -191,11 +294,6 @@ find_currdev(EFI_LOADED_IMAGE *img, struct devsw **dev, int *unit,
|
||||
}
|
||||
free(copy);
|
||||
|
||||
/* Try to fallback on first device */
|
||||
if (devsw[0] != NULL) {
|
||||
*dev = devsw[0];
|
||||
return (0);
|
||||
}
|
||||
return (ENOENT);
|
||||
}
|
||||
|
||||
@ -205,9 +303,7 @@ main(int argc, CHAR16 *argv[])
|
||||
char var[128];
|
||||
EFI_LOADED_IMAGE *img;
|
||||
EFI_GUID *guid;
|
||||
int i, j, vargood, unit, howto;
|
||||
struct devsw *dev;
|
||||
uint64_t pool_guid;
|
||||
int i, j, vargood, howto;
|
||||
UINTN k;
|
||||
int has_kbd;
|
||||
char buf[40];
|
||||
@ -376,43 +472,9 @@ main(int argc, CHAR16 *argv[])
|
||||
*/
|
||||
BS->SetWatchdogTimer(0, 0, 0, NULL);
|
||||
|
||||
if (find_currdev(img, &dev, &unit, &pool_guid) != 0)
|
||||
if (find_currdev(img) != 0)
|
||||
return (EFI_NOT_FOUND);
|
||||
|
||||
switch (dev->dv_type) {
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
case DEVT_ZFS: {
|
||||
struct zfs_devdesc currdev;
|
||||
|
||||
currdev.d_dev = dev;
|
||||
currdev.d_unit = unit;
|
||||
currdev.d_type = currdev.d_dev->dv_type;
|
||||
currdev.d_opendata = NULL;
|
||||
currdev.pool_guid = pool_guid;
|
||||
currdev.root_guid = 0;
|
||||
env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev),
|
||||
efi_setcurrdev, env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset,
|
||||
env_nounset);
|
||||
init_zfs_bootenv(zfs_fmtdev(&currdev));
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
default: {
|
||||
struct devdesc currdev;
|
||||
|
||||
currdev.d_dev = dev;
|
||||
currdev.d_unit = unit;
|
||||
currdev.d_opendata = NULL;
|
||||
currdev.d_type = currdev.d_dev->dv_type;
|
||||
env_setenv("currdev", EV_VOLATILE, efi_fmtdev(&currdev),
|
||||
efi_setcurrdev, env_nounset);
|
||||
env_setenv("loaddev", EV_VOLATILE, efi_fmtdev(&currdev), env_noset,
|
||||
env_nounset);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
efi_init_environment();
|
||||
setenv("LINES", "24", 1); /* optional */
|
||||
|
||||
@ -733,21 +795,67 @@ COMMAND_SET(fdt, "fdt", "flattened device tree handling", command_fdt);
|
||||
#endif
|
||||
|
||||
#ifdef EFI_ZFS_BOOT
|
||||
static void
|
||||
efipart_probe_img(pdinfo_list_t *hdi)
|
||||
{
|
||||
EFI_GUID imgid = LOADED_IMAGE_PROTOCOL;
|
||||
EFI_LOADED_IMAGE *img;
|
||||
pdinfo_t *hd, *pd = NULL;
|
||||
char devname[SPECNAMELEN + 1];
|
||||
|
||||
BS->HandleProtocol(IH, &imgid, (VOID**)&img);
|
||||
|
||||
/*
|
||||
* Search for the booted image device handle from hard disk list.
|
||||
* Note, this does also include usb sticks, and we assume there is no
|
||||
* ZFS on floppies nor cd.
|
||||
* However, we might have booted from floppy (unlikely) or CD,
|
||||
* so we should not surprised if we can not find the handle.
|
||||
*/
|
||||
STAILQ_FOREACH(hd, hdi, pd_link) {
|
||||
if (hd->pd_handle == img->DeviceHandle)
|
||||
break;
|
||||
STAILQ_FOREACH(pd, &hd->pd_part, pd_link) {
|
||||
if (pd->pd_handle == img->DeviceHandle)
|
||||
break;
|
||||
}
|
||||
if (pd != NULL)
|
||||
break;
|
||||
}
|
||||
if (hd != NULL) {
|
||||
if (pd != NULL) {
|
||||
snprintf(devname, sizeof(devname), "%s%dp%d:",
|
||||
efipart_hddev.dv_name, hd->pd_unit, pd->pd_unit);
|
||||
} else {
|
||||
snprintf(devname, sizeof(devname), "%s%d:",
|
||||
efipart_hddev.dv_name, hd->pd_unit);
|
||||
}
|
||||
(void) zfs_probe_dev(devname, &pool_guid);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
efi_zfs_probe(void)
|
||||
{
|
||||
EFI_HANDLE h;
|
||||
u_int unit;
|
||||
int i;
|
||||
char dname[SPECNAMELEN + 1];
|
||||
uint64_t guid;
|
||||
pdinfo_list_t *hdi;
|
||||
pdinfo_t *hd;
|
||||
char devname[SPECNAMELEN + 1];
|
||||
|
||||
unit = 0;
|
||||
h = efi_find_handle(&efipart_dev, 0);
|
||||
for (i = 0; h != NULL; h = efi_find_handle(&efipart_dev, ++i)) {
|
||||
snprintf(dname, sizeof(dname), "%s%d:", efipart_dev.dv_name, i);
|
||||
if (zfs_probe_dev(dname, &guid) == 0)
|
||||
(void)efi_handle_update_dev(h, &zfs_dev, unit++, guid);
|
||||
hdi = efiblk_get_pdinfo_list(&efipart_hddev);
|
||||
/*
|
||||
* First probe the boot device (from where loader.efi was read),
|
||||
* and set pool_guid global variable if we are booting from zfs.
|
||||
* Since loader is running, we do have an access to the device,
|
||||
* however, it might not be zfs.
|
||||
*/
|
||||
|
||||
if (pool_guid == 0)
|
||||
efipart_probe_img(hdi);
|
||||
|
||||
STAILQ_FOREACH(hd, hdi, pd_link) {
|
||||
snprintf(devname, sizeof(devname), "%s%d:",
|
||||
efipart_hddev.dv_name, hd->pd_unit);
|
||||
(void) zfs_probe_dev(devname, NULL);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -23,6 +23,14 @@
|
||||
#include <sys/types.h>
|
||||
#include <machine/psl.h>
|
||||
|
||||
/*
|
||||
* Memory buffer space for real mode IO.
|
||||
* Just one page is not much, but the space is rather limited.
|
||||
* See ../btx/btx.S for details.
|
||||
*/
|
||||
#define V86_IO_BUFFER 0x8000
|
||||
#define V86_IO_BUFFER_SIZE 0x1000
|
||||
|
||||
#define V86_ADDR 0x10000 /* Segment:offset address */
|
||||
#define V86_CALLF 0x20000 /* Emulate far call */
|
||||
#define V86_FLAGS 0x40000 /* Return flags */
|
||||
|
@ -309,9 +309,6 @@ bc_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Max number of sectors to bounce-buffer at a time. */
|
||||
#define CD_BOUNCEBUF 8
|
||||
|
||||
/* return negative value for an error, otherwise blocks read */
|
||||
static int
|
||||
bc_read(int unit, daddr_t dblk, int blks, caddr_t dest)
|
||||
@ -339,8 +336,9 @@ bc_read(int unit, daddr_t dblk, int blks, caddr_t dest)
|
||||
* physical memory so we have to arrange a suitable
|
||||
* bounce buffer.
|
||||
*/
|
||||
x = min(CD_BOUNCEBUF, (unsigned)blks);
|
||||
bbuf = alloca(x * BIOSCD_SECSIZE);
|
||||
x = V86_IO_BUFFER_SIZE / BIOSCD_SECSIZE;
|
||||
x = min(x, (unsigned)blks);
|
||||
bbuf = PTOV(V86_IO_BUFFER);
|
||||
maxfer = x;
|
||||
} else {
|
||||
bbuf = NULL;
|
||||
|
@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
||||
*/
|
||||
|
||||
#include <sys/disk.h>
|
||||
#include <sys/limits.h>
|
||||
#include <stand.h>
|
||||
#include <machine/bootinfo.h>
|
||||
#include <stdarg.h>
|
||||
@ -302,15 +303,28 @@ bd_int13probe(struct bdinfo *bd)
|
||||
if (!V86_CY(v86.efl)) {
|
||||
uint64_t total;
|
||||
|
||||
if (params.sectors != 0)
|
||||
bd->bd_sectors = params.sectors;
|
||||
/*
|
||||
* Sector size must be a multiple of 512 bytes.
|
||||
* An alternate test would be to check power of 2,
|
||||
* powerof2(params.sector_size).
|
||||
*/
|
||||
if (params.sector_size % BIOSDISK_SECSIZE)
|
||||
bd->bd_sectorsize = BIOSDISK_SECSIZE;
|
||||
else
|
||||
bd->bd_sectorsize = params.sector_size;
|
||||
|
||||
total = bd->bd_sectorsize * params.sectors;
|
||||
if (params.sectors != 0) {
|
||||
/* Only update if we did not overflow. */
|
||||
if (total > params.sectors)
|
||||
bd->bd_sectors = params.sectors;
|
||||
}
|
||||
|
||||
total = (uint64_t)params.cylinders *
|
||||
params.heads * params.sectors_per_track;
|
||||
if (bd->bd_sectors < total)
|
||||
bd->bd_sectors = total;
|
||||
|
||||
bd->bd_sectorsize = params.sector_size;
|
||||
ret = 1;
|
||||
}
|
||||
DEBUG("unit 0x%x flags %x, sectors %llu, sectorsize %u",
|
||||
@ -377,8 +391,10 @@ static int
|
||||
bd_open(struct open_file *f, ...)
|
||||
{
|
||||
struct disk_devdesc *dev, rdev;
|
||||
struct disk_devdesc disk;
|
||||
int err, g_err;
|
||||
va_list ap;
|
||||
uint64_t size;
|
||||
|
||||
va_start(ap, f);
|
||||
dev = va_arg(ap, struct disk_devdesc *);
|
||||
@ -389,6 +405,33 @@ bd_open(struct open_file *f, ...)
|
||||
BD(dev).bd_open++;
|
||||
if (BD(dev).bd_bcache == NULL)
|
||||
BD(dev).bd_bcache = bcache_allocate();
|
||||
|
||||
/*
|
||||
* Read disk size from partition.
|
||||
* This is needed to work around buggy BIOS systems returning
|
||||
* wrong (truncated) disk media size.
|
||||
* During bd_probe() we tested if the mulitplication of bd_sectors
|
||||
* would overflow so it should be safe to perform here.
|
||||
*/
|
||||
disk.d_dev = dev->d_dev;
|
||||
disk.d_type = dev->d_type;
|
||||
disk.d_unit = dev->d_unit;
|
||||
disk.d_opendata = NULL;
|
||||
disk.d_slice = -1;
|
||||
disk.d_partition = -1;
|
||||
disk.d_offset = 0;
|
||||
if (disk_open(&disk, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
|
||||
BD(dev).bd_sectorsize, (BD(dev).bd_flags & BD_FLOPPY) ?
|
||||
DISK_F_NOCACHE: 0) == 0) {
|
||||
|
||||
if (disk_ioctl(&disk, DIOCGMEDIASIZE, &size) == 0) {
|
||||
size /= BD(dev).bd_sectorsize;
|
||||
if (size > BD(dev).bd_sectors)
|
||||
BD(dev).bd_sectors = size;
|
||||
}
|
||||
disk_close(&disk);
|
||||
}
|
||||
|
||||
err = disk_open(dev, BD(dev).bd_sectors * BD(dev).bd_sectorsize,
|
||||
BD(dev).bd_sectorsize, (BD(dev).bd_flags & BD_FLOPPY) ?
|
||||
DISK_F_NOCACHE: 0);
|
||||
@ -486,8 +529,14 @@ static int
|
||||
bd_ioctl(struct open_file *f, u_long cmd, void *data)
|
||||
{
|
||||
struct disk_devdesc *dev;
|
||||
int rc;
|
||||
|
||||
dev = (struct disk_devdesc *)f->f_devdata;
|
||||
|
||||
rc = disk_ioctl(dev, cmd, data);
|
||||
if (rc != ENOTTY)
|
||||
return (rc);
|
||||
|
||||
switch (cmd) {
|
||||
case DIOCGSECTORSIZE:
|
||||
*(u_int *)data = BD(dev).bd_sectorsize;
|
||||
@ -521,7 +570,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
char *buf, size_t *rsize)
|
||||
{
|
||||
struct disk_devdesc *dev = (struct disk_devdesc *)devdata;
|
||||
int blks, remaining;
|
||||
uint64_t disk_blocks;
|
||||
int blks;
|
||||
#ifdef BD_SUPPORT_FRAGS /* XXX: sector size */
|
||||
char fragbuf[BIOSDISK_SECSIZE];
|
||||
size_t fragsize;
|
||||
@ -533,19 +583,43 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
#endif
|
||||
|
||||
DEBUG("open_disk %p", dev);
|
||||
|
||||
/*
|
||||
* Check the value of the size argument. We do have quite small
|
||||
* heap (64MB), but we do not know good upper limit, so we check against
|
||||
* INT_MAX here. This will also protect us against possible overflows
|
||||
* while translating block count to bytes.
|
||||
*/
|
||||
if (size > INT_MAX) {
|
||||
DEBUG("too large read: %zu bytes", size);
|
||||
return (EIO);
|
||||
}
|
||||
|
||||
blks = size / BD(dev).bd_sectorsize;
|
||||
if (dblk > dblk + blks)
|
||||
return (EIO);
|
||||
|
||||
if (rsize)
|
||||
*rsize = 0;
|
||||
|
||||
/* Get disk blocks, this value is either for whole disk or for partition */
|
||||
if (disk_ioctl(dev, DIOCGMEDIASIZE, &disk_blocks)) {
|
||||
/* DIOCGMEDIASIZE does return bytes. */
|
||||
disk_blocks /= BD(dev).bd_sectorsize;
|
||||
} else {
|
||||
/* We should not get here. Just try to survive. */
|
||||
disk_blocks = BD(dev).bd_sectors - dev->d_offset;
|
||||
}
|
||||
|
||||
/* Validate source block address. */
|
||||
if (dblk < dev->d_offset || dblk >= dev->d_offset + disk_blocks)
|
||||
return (EIO);
|
||||
|
||||
/*
|
||||
* Perform partial read to prevent read-ahead crossing
|
||||
* the end of disk - or any 32 bit aliases of the end.
|
||||
* Signed arithmetic is used to handle wrap-around cases
|
||||
* like we do for TCP sequence numbers.
|
||||
* Truncate if we are crossing disk or partition end.
|
||||
*/
|
||||
remaining = (int)(BD(dev).bd_sectors - dblk); /* truncate */
|
||||
if (remaining > 0 && remaining < blks) {
|
||||
blks = remaining;
|
||||
if (dblk + blks >= dev->d_offset + disk_blocks) {
|
||||
blks = dev->d_offset + disk_blocks - dblk;
|
||||
size = blks * BD(dev).bd_sectorsize;
|
||||
DEBUG("short read %d", blks);
|
||||
}
|
||||
@ -592,9 +666,6 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, size_t size,
|
||||
return (0);
|
||||
}
|
||||
|
||||
/* Max number of sectors to bounce-buffer if the request crosses a 64k boundary */
|
||||
#define FLOPPY_BOUNCEBUF 18
|
||||
|
||||
static int
|
||||
bd_edd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest,
|
||||
int write)
|
||||
@ -658,7 +729,7 @@ static int
|
||||
bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
|
||||
{
|
||||
u_int x, sec, result, resid, retry, maxfer;
|
||||
caddr_t p, xp, bbuf, breg;
|
||||
caddr_t p, xp, bbuf;
|
||||
|
||||
/* Just in case some idiot actually tries to read/write -1 blocks... */
|
||||
if (blks < 0)
|
||||
@ -680,17 +751,12 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
|
||||
* as we need to. Use the bottom half unless there is a break
|
||||
* there, in which case we use the top half.
|
||||
*/
|
||||
x = min(FLOPPY_BOUNCEBUF, (unsigned)blks);
|
||||
bbuf = alloca(x * 2 * BD(dev).bd_sectorsize);
|
||||
if (((u_int32_t)VTOP(bbuf) & 0xffff0000) ==
|
||||
((u_int32_t)VTOP(bbuf + x * BD(dev).bd_sectorsize) & 0xffff0000)) {
|
||||
breg = bbuf;
|
||||
} else {
|
||||
breg = bbuf + x * BD(dev).bd_sectorsize;
|
||||
}
|
||||
x = V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize;
|
||||
x = min(x, (unsigned)blks);
|
||||
bbuf = PTOV(V86_IO_BUFFER);
|
||||
maxfer = x; /* limit transfers to bounce region size */
|
||||
} else {
|
||||
breg = bbuf = NULL;
|
||||
bbuf = NULL;
|
||||
maxfer = 0;
|
||||
}
|
||||
|
||||
@ -705,14 +771,14 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
|
||||
x = min(x, maxfer); /* fit bounce buffer */
|
||||
|
||||
/* where do we transfer to? */
|
||||
xp = bbuf == NULL ? p : breg;
|
||||
xp = bbuf == NULL ? p : bbuf;
|
||||
|
||||
/*
|
||||
* Put your Data In, Put your Data out,
|
||||
* Put your Data In, and shake it all about
|
||||
*/
|
||||
if (write && bbuf != NULL)
|
||||
bcopy(p, breg, x * BD(dev).bd_sectorsize);
|
||||
bcopy(p, bbuf, x * BD(dev).bd_sectorsize);
|
||||
|
||||
/*
|
||||
* Loop retrying the operation a couple of times. The BIOS
|
||||
@ -746,7 +812,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest, int write)
|
||||
return(-1);
|
||||
}
|
||||
if (!write && bbuf != NULL)
|
||||
bcopy(breg, p, x * BD(dev).bd_sectorsize);
|
||||
bcopy(bbuf, p, x * BD(dev).bd_sectorsize);
|
||||
p += (x * BD(dev).bd_sectorsize);
|
||||
dblk += x;
|
||||
resid -= x;
|
||||
|
@ -137,10 +137,20 @@ umass_disk_open(struct open_file *f,...)
|
||||
}
|
||||
|
||||
static int
|
||||
umass_disk_ioctl(struct open_file *f __unused, u_long cmd, void *buf)
|
||||
umass_disk_ioctl(struct open_file *f, u_long cmd, void *buf)
|
||||
{
|
||||
struct disk_devdesc *dev;
|
||||
uint32_t nblock;
|
||||
uint32_t blocksize;
|
||||
int rc;
|
||||
|
||||
dev = (struct disk_devdesc *)(f->f_devdata);
|
||||
if (dev == NULL)
|
||||
return (EINVAL);
|
||||
|
||||
rc = disk_ioctl(dev, cmd, buf);
|
||||
if (rc != ENOTTY)
|
||||
return (rc);
|
||||
|
||||
switch (cmd) {
|
||||
case DIOCGSECTORSIZE:
|
||||
|
@ -483,9 +483,11 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid)
|
||||
{
|
||||
struct ptable *table;
|
||||
struct zfs_probe_args pa;
|
||||
off_t mediasz;
|
||||
uint64_t mediasz;
|
||||
int ret;
|
||||
|
||||
if (pool_guid)
|
||||
*pool_guid = 0;
|
||||
pa.fd = open(devname, O_RDONLY);
|
||||
if (pa.fd == -1)
|
||||
return (ENXIO);
|
||||
@ -493,6 +495,7 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid)
|
||||
ret = zfs_probe(pa.fd, pool_guid);
|
||||
if (ret == 0)
|
||||
return (0);
|
||||
|
||||
/* Probe each partition */
|
||||
ret = ioctl(pa.fd, DIOCGMEDIASIZE, &mediasz);
|
||||
if (ret == 0)
|
||||
@ -508,6 +511,8 @@ zfs_probe_dev(const char *devname, uint64_t *pool_guid)
|
||||
}
|
||||
}
|
||||
close(pa.fd);
|
||||
if (pool_guid && *pool_guid == 0)
|
||||
ret = ENXIO;
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,10 @@
|
||||
|
||||
#ifndef _DTRACE_XOROSHIRO128_PLUS_H
|
||||
#define _DTRACE_XOROSHIRO128_PLUS_H
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
extern void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const);
|
||||
extern uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const);
|
||||
void dtrace_xoroshiro128_plus_jump(uint64_t * const, uint64_t * const);
|
||||
uint64_t dtrace_xoroshiro128_plus_next(uint64_t * const);
|
||||
|
||||
#endif
|
||||
|
@ -28,7 +28,9 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/sysproto.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#include <vm/vm_extern.h>
|
||||
|
||||
#include <contrib/cloudabi/cloudabi_types_common.h>
|
||||
|
||||
@ -62,137 +64,115 @@ int
|
||||
cloudabi_sys_mem_advise(struct thread *td,
|
||||
struct cloudabi_sys_mem_advise_args *uap)
|
||||
{
|
||||
struct madvise_args madvise_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
int behav;
|
||||
|
||||
switch (uap->advice) {
|
||||
case CLOUDABI_ADVICE_DONTNEED:
|
||||
madvise_args.behav = MADV_DONTNEED;
|
||||
behav = MADV_DONTNEED;
|
||||
break;
|
||||
case CLOUDABI_ADVICE_NORMAL:
|
||||
madvise_args.behav = MADV_NORMAL;
|
||||
behav = MADV_NORMAL;
|
||||
break;
|
||||
case CLOUDABI_ADVICE_RANDOM:
|
||||
madvise_args.behav = MADV_RANDOM;
|
||||
behav = MADV_RANDOM;
|
||||
break;
|
||||
case CLOUDABI_ADVICE_SEQUENTIAL:
|
||||
madvise_args.behav = MADV_SEQUENTIAL;
|
||||
behav = MADV_SEQUENTIAL;
|
||||
break;
|
||||
case CLOUDABI_ADVICE_WILLNEED:
|
||||
madvise_args.behav = MADV_WILLNEED;
|
||||
behav = MADV_WILLNEED;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
|
||||
return (sys_madvise(td, &madvise_args));
|
||||
return (kern_vm_madvise(td, (vm_offset_t)uap->mapping,
|
||||
uap->mapping_len, behav));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_lock(struct thread *td, struct cloudabi_sys_mem_lock_args *uap)
|
||||
{
|
||||
struct mlock_args mlock_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_mlock(td, &mlock_args));
|
||||
return (vm_mlock(td->td_proc, td->td_ucred, uap->mapping,
|
||||
uap->mapping_len));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_map(struct thread *td, struct cloudabi_sys_mem_map_args *uap)
|
||||
{
|
||||
struct mmap_args mmap_args = {
|
||||
.addr = uap->addr,
|
||||
.len = uap->len,
|
||||
.fd = uap->fd,
|
||||
.pos = uap->off
|
||||
};
|
||||
int error;
|
||||
int error, flags, prot;
|
||||
|
||||
/* Translate flags. */
|
||||
flags = 0;
|
||||
if (uap->flags & CLOUDABI_MAP_ANON)
|
||||
mmap_args.flags |= MAP_ANON;
|
||||
flags |= MAP_ANON;
|
||||
if (uap->flags & CLOUDABI_MAP_FIXED)
|
||||
mmap_args.flags |= MAP_FIXED;
|
||||
flags |= MAP_FIXED;
|
||||
if (uap->flags & CLOUDABI_MAP_PRIVATE)
|
||||
mmap_args.flags |= MAP_PRIVATE;
|
||||
flags |= MAP_PRIVATE;
|
||||
if (uap->flags & CLOUDABI_MAP_SHARED)
|
||||
mmap_args.flags |= MAP_SHARED;
|
||||
flags |= MAP_SHARED;
|
||||
|
||||
/* Translate protection. */
|
||||
error = convert_mprot(uap->prot, &mmap_args.prot);
|
||||
error = convert_mprot(uap->prot, &prot);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
return (sys_mmap(td, &mmap_args));
|
||||
return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, prot,
|
||||
flags, uap->fd, uap->off));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_protect(struct thread *td,
|
||||
struct cloudabi_sys_mem_protect_args *uap)
|
||||
{
|
||||
struct mprotect_args mprotect_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len,
|
||||
};
|
||||
int error;
|
||||
int error, prot;
|
||||
|
||||
/* Translate protection. */
|
||||
error = convert_mprot(uap->prot, &mprotect_args.prot);
|
||||
error = convert_mprot(uap->prot, &prot);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
return (sys_mprotect(td, &mprotect_args));
|
||||
return (kern_vm_mprotect(td, (vm_offset_t)uap->mapping,
|
||||
uap->mapping_len, prot));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_sync(struct thread *td, struct cloudabi_sys_mem_sync_args *uap)
|
||||
{
|
||||
struct msync_args msync_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len,
|
||||
};
|
||||
int flags;
|
||||
|
||||
/* Convert flags. */
|
||||
switch (uap->flags & (CLOUDABI_MS_ASYNC | CLOUDABI_MS_SYNC)) {
|
||||
case CLOUDABI_MS_ASYNC:
|
||||
msync_args.flags |= MS_ASYNC;
|
||||
flags = MS_ASYNC;
|
||||
break;
|
||||
case CLOUDABI_MS_SYNC:
|
||||
msync_args.flags |= MS_SYNC;
|
||||
flags = MS_SYNC;
|
||||
break;
|
||||
default:
|
||||
return (EINVAL);
|
||||
}
|
||||
if ((uap->flags & CLOUDABI_MS_INVALIDATE) != 0)
|
||||
msync_args.flags |= MS_INVALIDATE;
|
||||
flags |= MS_INVALIDATE;
|
||||
|
||||
return (sys_msync(td, &msync_args));
|
||||
return (kern_vm_msync(td, (vm_offset_t)uap->mapping,
|
||||
uap->mapping_len, flags));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_unlock(struct thread *td,
|
||||
struct cloudabi_sys_mem_unlock_args *uap)
|
||||
{
|
||||
struct munlock_args munlock_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_munlock(td, &munlock_args));
|
||||
return (kern_vm_munlock(td, (vm_offset_t)uap->mapping, uap->mapping_len));
|
||||
}
|
||||
|
||||
int
|
||||
cloudabi_sys_mem_unmap(struct thread *td,
|
||||
struct cloudabi_sys_mem_unmap_args *uap)
|
||||
{
|
||||
struct munmap_args munmap_args = {
|
||||
.addr = uap->mapping,
|
||||
.len = uap->mapping_len
|
||||
};
|
||||
|
||||
return (sys_munmap(td, &munmap_args));
|
||||
return (kern_vm_munmap(td, (vm_offset_t)uap->mapping, uap->mapping_len));
|
||||
}
|
||||
|
@ -449,42 +449,30 @@ freebsd32_fexecve(struct thread *td, struct freebsd32_fexecve_args *uap)
|
||||
int
|
||||
freebsd32_mprotect(struct thread *td, struct freebsd32_mprotect_args *uap)
|
||||
{
|
||||
struct mprotect_args ap;
|
||||
int prot;
|
||||
|
||||
ap.addr = PTRIN(uap->addr);
|
||||
ap.len = uap->len;
|
||||
ap.prot = uap->prot;
|
||||
prot = uap->prot;
|
||||
#if defined(__amd64__)
|
||||
if (i386_read_exec && (ap.prot & PROT_READ) != 0)
|
||||
ap.prot |= PROT_EXEC;
|
||||
if (i386_read_exec && (prot & PROT_READ) != 0)
|
||||
prot |= PROT_EXEC;
|
||||
#endif
|
||||
return (sys_mprotect(td, &ap));
|
||||
return (kern_vm_mprotect(td, (vm_offset_t)PTRIN(uap->addr),
|
||||
uap->len, prot));
|
||||
}
|
||||
|
||||
int
|
||||
freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
|
||||
{
|
||||
struct mmap_args ap;
|
||||
vm_offset_t addr = (vm_offset_t) uap->addr;
|
||||
vm_size_t len = uap->len;
|
||||
int prot = uap->prot;
|
||||
int flags = uap->flags;
|
||||
int fd = uap->fd;
|
||||
off_t pos = PAIR32TO64(off_t,uap->pos);
|
||||
int prot;
|
||||
|
||||
prot = uap->prot;
|
||||
#if defined(__amd64__)
|
||||
if (i386_read_exec && (prot & PROT_READ))
|
||||
prot |= PROT_EXEC;
|
||||
#endif
|
||||
|
||||
ap.addr = (void *) addr;
|
||||
ap.len = len;
|
||||
ap.prot = prot;
|
||||
ap.flags = flags;
|
||||
ap.fd = fd;
|
||||
ap.pos = pos;
|
||||
|
||||
return (sys_mmap(td, &ap));
|
||||
return (kern_vm_mmap(td, (vm_offset_t)uap->addr, uap->len, prot,
|
||||
uap->flags, uap->fd, PAIR32TO64(off_t, uap->pos)));
|
||||
}
|
||||
|
||||
#ifdef COMPAT_FREEBSD6
|
||||
@ -2554,30 +2542,18 @@ int
|
||||
freebsd32_cpuset_getaffinity(struct thread *td,
|
||||
struct freebsd32_cpuset_getaffinity_args *uap)
|
||||
{
|
||||
struct cpuset_getaffinity_args ap;
|
||||
|
||||
ap.level = uap->level;
|
||||
ap.which = uap->which;
|
||||
ap.id = PAIR32TO64(id_t,uap->id);
|
||||
ap.cpusetsize = uap->cpusetsize;
|
||||
ap.mask = uap->mask;
|
||||
|
||||
return (sys_cpuset_getaffinity(td, &ap));
|
||||
return (kern_cpuset_getaffinity(td, uap->level, uap->which,
|
||||
PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask));
|
||||
}
|
||||
|
||||
int
|
||||
freebsd32_cpuset_setaffinity(struct thread *td,
|
||||
struct freebsd32_cpuset_setaffinity_args *uap)
|
||||
{
|
||||
struct cpuset_setaffinity_args ap;
|
||||
|
||||
ap.level = uap->level;
|
||||
ap.which = uap->which;
|
||||
ap.id = PAIR32TO64(id_t,uap->id);
|
||||
ap.cpusetsize = uap->cpusetsize;
|
||||
ap.mask = uap->mask;
|
||||
|
||||
return (sys_cpuset_setaffinity(td, &ap));
|
||||
return (kern_cpuset_setaffinity(td, uap->level, uap->which,
|
||||
PAIR32TO64(id_t,uap->id), uap->cpusetsize, uap->mask));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -1537,11 +1537,16 @@ linux_pipe(struct thread *td, struct linux_pipe_args *args)
|
||||
#endif
|
||||
|
||||
error = kern_pipe(td, fildes, 0, NULL, NULL);
|
||||
if (error)
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
/* XXX: Close descriptors on error. */
|
||||
return (copyout(fildes, args->pipefds, sizeof(fildes)));
|
||||
error = copyout(fildes, args->pipefds, sizeof(fildes));
|
||||
if (error != 0) {
|
||||
(void)kern_close(td, fildes[0]);
|
||||
(void)kern_close(td, fildes[1]);
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
@ -1564,11 +1569,16 @@ linux_pipe2(struct thread *td, struct linux_pipe2_args *args)
|
||||
if ((args->flags & LINUX_O_CLOEXEC) != 0)
|
||||
flags |= O_CLOEXEC;
|
||||
error = kern_pipe(td, fildes, flags, NULL, NULL);
|
||||
if (error)
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
/* XXX: Close descriptors on error. */
|
||||
return (copyout(fildes, args->pipefds, sizeof(fildes)));
|
||||
error = copyout(fildes, args->pipefds, sizeof(fildes));
|
||||
if (error != 0) {
|
||||
(void)kern_close(td, fildes[0]);
|
||||
(void)kern_close(td, fildes[1]);
|
||||
}
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -585,10 +585,8 @@ select_out:
|
||||
int
|
||||
linux_mremap(struct thread *td, struct linux_mremap_args *args)
|
||||
{
|
||||
struct munmap_args /* {
|
||||
void *addr;
|
||||
size_t len;
|
||||
} */ bsd_args;
|
||||
uintptr_t addr;
|
||||
size_t len;
|
||||
int error = 0;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -623,10 +621,9 @@ linux_mremap(struct thread *td, struct linux_mremap_args *args)
|
||||
}
|
||||
|
||||
if (args->new_len < args->old_len) {
|
||||
bsd_args.addr =
|
||||
(caddr_t)((uintptr_t)args->addr + args->new_len);
|
||||
bsd_args.len = args->old_len - args->new_len;
|
||||
error = sys_munmap(td, &bsd_args);
|
||||
addr = args->addr + args->new_len;
|
||||
len = args->old_len - args->new_len;
|
||||
error = kern_vm_munmap(td, addr, len);
|
||||
}
|
||||
|
||||
td->td_retval[0] = error ? 0 : (uintptr_t)args->addr;
|
||||
@ -640,13 +637,9 @@ linux_mremap(struct thread *td, struct linux_mremap_args *args)
|
||||
int
|
||||
linux_msync(struct thread *td, struct linux_msync_args *args)
|
||||
{
|
||||
struct msync_args bsd_args;
|
||||
|
||||
bsd_args.addr = (caddr_t)(uintptr_t)args->addr;
|
||||
bsd_args.len = (uintptr_t)args->len;
|
||||
bsd_args.flags = args->fl & ~LINUX_MS_SYNC;
|
||||
|
||||
return (sys_msync(td, &bsd_args));
|
||||
return (kern_vm_msync(td, args->addr, args->len,
|
||||
args->fl & ~LINUX_MS_SYNC));
|
||||
}
|
||||
|
||||
int
|
||||
@ -2102,7 +2095,6 @@ linux_sched_getaffinity(struct thread *td,
|
||||
{
|
||||
int error;
|
||||
struct thread *tdt;
|
||||
struct cpuset_getaffinity_args cga;
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(sched_getaffinity))
|
||||
@ -2117,13 +2109,10 @@ linux_sched_getaffinity(struct thread *td,
|
||||
return (ESRCH);
|
||||
|
||||
PROC_UNLOCK(tdt->td_proc);
|
||||
cga.level = CPU_LEVEL_WHICH;
|
||||
cga.which = CPU_WHICH_TID;
|
||||
cga.id = tdt->td_tid;
|
||||
cga.cpusetsize = sizeof(cpuset_t);
|
||||
cga.mask = (cpuset_t *) args->user_mask_ptr;
|
||||
|
||||
if ((error = sys_cpuset_getaffinity(td, &cga)) == 0)
|
||||
error = kern_cpuset_getaffinity(td, CPU_LEVEL_WHICH, CPU_WHICH_TID,
|
||||
tdt->td_tid, sizeof(cpuset_t), (cpuset_t *)args->user_mask_ptr);
|
||||
if (error == 0)
|
||||
td->td_retval[0] = sizeof(cpuset_t);
|
||||
|
||||
return (error);
|
||||
@ -2136,7 +2125,6 @@ int
|
||||
linux_sched_setaffinity(struct thread *td,
|
||||
struct linux_sched_setaffinity_args *args)
|
||||
{
|
||||
struct cpuset_setaffinity_args csa;
|
||||
struct thread *tdt;
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -2152,13 +2140,9 @@ linux_sched_setaffinity(struct thread *td,
|
||||
return (ESRCH);
|
||||
|
||||
PROC_UNLOCK(tdt->td_proc);
|
||||
csa.level = CPU_LEVEL_WHICH;
|
||||
csa.which = CPU_WHICH_TID;
|
||||
csa.id = tdt->td_tid;
|
||||
csa.cpusetsize = sizeof(cpuset_t);
|
||||
csa.mask = (cpuset_t *) args->user_mask_ptr;
|
||||
|
||||
return (sys_cpuset_setaffinity(td, &csa));
|
||||
return (kern_cpuset_setaffinity(td, CPU_LEVEL_WHICH, CPU_WHICH_TID,
|
||||
tdt->td_tid, sizeof(cpuset_t), (cpuset_t *) args->user_mask_ptr));
|
||||
}
|
||||
|
||||
struct linux_rlimit64 {
|
||||
|
@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/sysproto.h>
|
||||
|
||||
#include <vm/pmap.h>
|
||||
#include <vm/vm_extern.h>
|
||||
#include <vm/vm_map.h>
|
||||
|
||||
#include <compat/linux/linux_emul.h>
|
||||
@ -67,15 +68,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
{
|
||||
struct proc *p = td->td_proc;
|
||||
struct vmspace *vms = td->td_proc->p_vmspace;
|
||||
struct mmap_args /* {
|
||||
caddr_t addr;
|
||||
size_t len;
|
||||
int prot;
|
||||
int flags;
|
||||
int fd;
|
||||
off_t pos;
|
||||
} */ bsd_args;
|
||||
int error;
|
||||
int bsd_flags, error;
|
||||
struct file *fp;
|
||||
|
||||
cap_rights_t rights;
|
||||
@ -83,7 +76,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
addr, len, prot, flags, fd, pos);
|
||||
|
||||
error = 0;
|
||||
bsd_args.flags = 0;
|
||||
bsd_flags = 0;
|
||||
fp = NULL;
|
||||
|
||||
/*
|
||||
@ -94,21 +87,21 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
return (EINVAL);
|
||||
|
||||
if (flags & LINUX_MAP_SHARED)
|
||||
bsd_args.flags |= MAP_SHARED;
|
||||
bsd_flags |= MAP_SHARED;
|
||||
if (flags & LINUX_MAP_PRIVATE)
|
||||
bsd_args.flags |= MAP_PRIVATE;
|
||||
bsd_flags |= MAP_PRIVATE;
|
||||
if (flags & LINUX_MAP_FIXED)
|
||||
bsd_args.flags |= MAP_FIXED;
|
||||
bsd_flags |= MAP_FIXED;
|
||||
if (flags & LINUX_MAP_ANON) {
|
||||
/* Enforce pos to be on page boundary, then ignore. */
|
||||
if ((pos & PAGE_MASK) != 0)
|
||||
return (EINVAL);
|
||||
pos = 0;
|
||||
bsd_args.flags |= MAP_ANON;
|
||||
bsd_flags |= MAP_ANON;
|
||||
} else
|
||||
bsd_args.flags |= MAP_NOSYNC;
|
||||
bsd_flags |= MAP_NOSYNC;
|
||||
if (flags & LINUX_MAP_GROWSDOWN)
|
||||
bsd_args.flags |= MAP_STACK;
|
||||
bsd_flags |= MAP_STACK;
|
||||
|
||||
/*
|
||||
* PROT_READ, PROT_WRITE, or PROT_EXEC implies PROT_READ and PROT_EXEC
|
||||
@ -118,14 +111,13 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
*
|
||||
* XXX. Linux checks that the file system is not mounted with noexec.
|
||||
*/
|
||||
bsd_args.prot = prot;
|
||||
#if defined(__amd64__)
|
||||
linux_fixup_prot(td, &bsd_args.prot);
|
||||
linux_fixup_prot(td, &prot);
|
||||
#endif
|
||||
|
||||
/* Linux does not check file descriptor when MAP_ANONYMOUS is set. */
|
||||
bsd_args.fd = (bsd_args.flags & MAP_ANON) ? -1 : fd;
|
||||
if (bsd_args.fd != -1) {
|
||||
fd = (bsd_flags & MAP_ANON) ? -1 : fd;
|
||||
if (fd != -1) {
|
||||
/*
|
||||
* Linux follows Solaris mmap(2) description:
|
||||
* The file descriptor fildes is opened with
|
||||
@ -133,8 +125,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
* protection options specified.
|
||||
*/
|
||||
|
||||
error = fget(td, bsd_args.fd,
|
||||
cap_rights_init(&rights, CAP_MMAP), &fp);
|
||||
error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), &fp);
|
||||
if (error != 0)
|
||||
return (error);
|
||||
if (fp->f_type != DTYPE_VNODE) {
|
||||
@ -205,21 +196,13 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
* we map the full stack, since we don't have a way
|
||||
* to autogrow it.
|
||||
*/
|
||||
if (len > STACK_SIZE - GUARD_SIZE) {
|
||||
bsd_args.addr = (caddr_t)addr;
|
||||
bsd_args.len = len;
|
||||
} else {
|
||||
bsd_args.addr = (caddr_t)addr -
|
||||
(STACK_SIZE - GUARD_SIZE - len);
|
||||
bsd_args.len = STACK_SIZE - GUARD_SIZE;
|
||||
if (len <= STACK_SIZE - GUARD_SIZE) {
|
||||
addr = addr - (STACK_SIZE - GUARD_SIZE - len);
|
||||
len = STACK_SIZE - GUARD_SIZE;
|
||||
}
|
||||
} else {
|
||||
bsd_args.addr = (caddr_t)addr;
|
||||
bsd_args.len = len;
|
||||
}
|
||||
bsd_args.pos = pos;
|
||||
|
||||
error = sys_mmap(td, &bsd_args);
|
||||
error = kern_vm_mmap(td, addr, len, prot, bsd_flags, fd, pos);
|
||||
|
||||
LINUX_CTR2(mmap2, "return: %d (%p)", error, td->td_retval[0]);
|
||||
|
||||
@ -229,16 +212,11 @@ linux_mmap_common(struct thread *td, uintptr_t addr, size_t len, int prot,
|
||||
int
|
||||
linux_mprotect_common(struct thread *td, uintptr_t addr, size_t len, int prot)
|
||||
{
|
||||
struct mprotect_args bsd_args;
|
||||
|
||||
bsd_args.addr = (void *)addr;
|
||||
bsd_args.len = len;
|
||||
bsd_args.prot = prot;
|
||||
|
||||
#if defined(__amd64__)
|
||||
linux_fixup_prot(td, &bsd_args.prot);
|
||||
linux_fixup_prot(td, &prot);
|
||||
#endif
|
||||
return (sys_mprotect(td, &bsd_args));
|
||||
return (kern_vm_mprotect(td, addr, len, prot));
|
||||
}
|
||||
|
||||
#if defined(__amd64__)
|
||||
|
@ -142,131 +142,18 @@ struct l_ucred {
|
||||
|
||||
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
|
||||
|
||||
struct linux_sendto_args {
|
||||
int s;
|
||||
l_uintptr_t msg;
|
||||
int len;
|
||||
int flags;
|
||||
l_uintptr_t to;
|
||||
int tolen;
|
||||
};
|
||||
|
||||
struct linux_socket_args {
|
||||
int domain;
|
||||
int type;
|
||||
int protocol;
|
||||
};
|
||||
|
||||
struct linux_bind_args {
|
||||
int s;
|
||||
l_uintptr_t name;
|
||||
int namelen;
|
||||
};
|
||||
|
||||
struct linux_connect_args {
|
||||
int s;
|
||||
l_uintptr_t name;
|
||||
int namelen;
|
||||
};
|
||||
|
||||
struct linux_listen_args {
|
||||
int s;
|
||||
int backlog;
|
||||
};
|
||||
|
||||
struct linux_accept_args {
|
||||
int s;
|
||||
l_uintptr_t addr;
|
||||
l_uintptr_t namelen;
|
||||
};
|
||||
|
||||
struct linux_accept4_args {
|
||||
int s;
|
||||
l_uintptr_t addr;
|
||||
l_uintptr_t namelen;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct linux_getsockname_args {
|
||||
int s;
|
||||
l_uintptr_t addr;
|
||||
l_uintptr_t namelen;
|
||||
};
|
||||
|
||||
struct linux_getpeername_args {
|
||||
int s;
|
||||
l_uintptr_t addr;
|
||||
l_uintptr_t namelen;
|
||||
};
|
||||
|
||||
struct linux_socketpair_args {
|
||||
int domain;
|
||||
int type;
|
||||
int protocol;
|
||||
l_uintptr_t rsv;
|
||||
};
|
||||
|
||||
struct linux_recvfrom_args {
|
||||
int s;
|
||||
l_uintptr_t buf;
|
||||
int len;
|
||||
int flags;
|
||||
l_uintptr_t from;
|
||||
l_uintptr_t fromlen;
|
||||
};
|
||||
|
||||
struct linux_sendmsg_args {
|
||||
int s;
|
||||
l_uintptr_t msg;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct linux_recvmsg_args {
|
||||
int s;
|
||||
l_uintptr_t msg;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct linux_shutdown_args {
|
||||
int s;
|
||||
int how;
|
||||
};
|
||||
|
||||
struct linux_setsockopt_args {
|
||||
int s;
|
||||
int level;
|
||||
int optname;
|
||||
l_uintptr_t optval;
|
||||
int optlen;
|
||||
};
|
||||
|
||||
struct linux_getsockopt_args {
|
||||
int s;
|
||||
int level;
|
||||
int optname;
|
||||
l_uintptr_t optval;
|
||||
l_uintptr_t optlen;
|
||||
};
|
||||
|
||||
int linux_socket(struct thread *td, struct linux_socket_args *args);
|
||||
int linux_bind(struct thread *td, struct linux_bind_args *args);
|
||||
int linux_connect(struct thread *, struct linux_connect_args *);
|
||||
int linux_listen(struct thread *td, struct linux_listen_args *args);
|
||||
int linux_accept(struct thread *td, struct linux_accept_args *args);
|
||||
int linux_accept4(struct thread *td, struct linux_accept4_args *args);
|
||||
int linux_getsockname(struct thread *td, struct linux_getsockname_args *args);
|
||||
int linux_getpeername(struct thread *td, struct linux_getpeername_args *args);
|
||||
int linux_socketpair(struct thread *td, struct linux_socketpair_args *args);
|
||||
int linux_sendto(struct thread *td, struct linux_sendto_args *args);
|
||||
int linux_recvfrom(struct thread *td, struct linux_recvfrom_args *args);
|
||||
int linux_sendmsg(struct thread *td, struct linux_sendmsg_args *args);
|
||||
int linux_recvmsg(struct thread *td, struct linux_recvmsg_args *args);
|
||||
int linux_shutdown(struct thread *td, struct linux_shutdown_args *args);
|
||||
int linux_setsockopt(struct thread *td, struct linux_setsockopt_args *args);
|
||||
int linux_getsockopt(struct thread *td, struct linux_getsockopt_args *args);
|
||||
|
||||
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
|
||||
|
||||
|
||||
|
||||
/* Operations for socketcall */
|
||||
|
||||
#define LINUX_SOCKET 1
|
||||
|
@ -627,12 +627,12 @@ options TCP_OFFLOAD # TCP offload support.
|
||||
# In order to enable IPSEC you MUST also add device crypto to
|
||||
# your kernel configuration
|
||||
options IPSEC #IP security (requires device crypto)
|
||||
|
||||
# Option IPSEC_SUPPORT does not enable IPsec, but makes it possible to
|
||||
# load it as a kernel module. You still MUST add device crypto to your kernel
|
||||
# configuration.
|
||||
options IPSEC_SUPPORT
|
||||
#options IPSEC_DEBUG #debug for IP security
|
||||
#
|
||||
# Set IPSEC_NAT_T to enable NAT-Traversal support. This enables
|
||||
# optional UDP encapsulation of ESP packets.
|
||||
#
|
||||
options IPSEC_NAT_T #NAT-T support, UDP encap of ESP
|
||||
|
||||
#
|
||||
# SMB/CIFS requester
|
||||
@ -1027,7 +1027,8 @@ options ACCEPT_FILTER_HTTP
|
||||
# carried in TCP option 19. This option is commonly used to protect
|
||||
# TCP sessions (e.g. BGP) where IPSEC is not available nor desirable.
|
||||
# This is enabled on a per-socket basis using the TCP_MD5SIG socket option.
|
||||
# This requires the use of 'device crypto' and 'options IPSEC'.
|
||||
# This requires the use of 'device crypto' and either 'options IPSEC' or
|
||||
# 'options IPSEC_SUPPORT'.
|
||||
options TCP_SIGNATURE #include support for RFC 2385
|
||||
|
||||
# DUMMYNET enables the "dummynet" bandwidth limiter. You need IPFIREWALL
|
||||
|
@ -587,22 +587,24 @@ contrib/ngatm/netnatm/sig/sig_unimsgcpy.c optional ngatm_uni \
|
||||
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
|
||||
contrib/ngatm/netnatm/sig/sig_verify.c optional ngatm_uni \
|
||||
compile-with "${NORMAL_C} -I$S/contrib/ngatm"
|
||||
crypto/blowfish/bf_ecb.c optional ipsec
|
||||
crypto/blowfish/bf_skey.c optional crypto | ipsec
|
||||
crypto/camellia/camellia.c optional crypto | ipsec
|
||||
crypto/camellia/camellia-api.c optional crypto | ipsec
|
||||
crypto/des/des_ecb.c optional crypto | ipsec | netsmb
|
||||
crypto/des/des_setkey.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support
|
||||
crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support
|
||||
crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support
|
||||
crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi
|
||||
crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \
|
||||
ipsec | random !random_loadable | wlan_ccmp
|
||||
ipsec | ipsec_support | random !random_loadable | wlan_ccmp
|
||||
crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | random !random_loadable
|
||||
crypto/rijndael/rijndael-api.c optional crypto | ipsec | wlan_ccmp
|
||||
crypto/rijndael/rijndael-api.c optional crypto | ipsec | ipsec_support | \
|
||||
wlan_ccmp
|
||||
crypto/sha1.c optional carp | crypto | ipsec | \
|
||||
netgraph_mppc_encryption | sctp
|
||||
crypto/sha2/sha256c.c optional crypto | ekcd | geom_bde | ipsec | random !random_loadable | \
|
||||
sctp | zfs
|
||||
crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | zfs
|
||||
ipsec_support | netgraph_mppc_encryption | sctp
|
||||
crypto/sha2/sha256c.c optional crypto | ekcd | geom_bde | ipsec | \
|
||||
ipsec_support | random !random_loadable | sctp | zfs
|
||||
crypto/sha2/sha512c.c optional crypto | geom_bde | ipsec | \
|
||||
ipsec_support | zfs
|
||||
crypto/skein/skein.c optional crypto | zfs
|
||||
crypto/skein/skein_block.c optional crypto | zfs
|
||||
crypto/siphash/siphash.c optional inet | inet6
|
||||
@ -666,11 +668,6 @@ dev/acpica/acpi_ec.c optional acpi
|
||||
dev/acpica/acpi_isab.c optional acpi isa
|
||||
dev/acpica/acpi_lid.c optional acpi
|
||||
dev/acpica/acpi_package.c optional acpi
|
||||
dev/acpica/acpi_pci.c optional acpi pci
|
||||
dev/acpica/acpi_pci_link.c optional acpi pci
|
||||
dev/acpica/acpi_pcib.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_acpi.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_pci.c optional acpi pci
|
||||
dev/acpica/acpi_perf.c optional acpi
|
||||
dev/acpica/acpi_powerres.c optional acpi
|
||||
dev/acpica/acpi_quirk.c optional acpi
|
||||
@ -1882,6 +1879,7 @@ dev/iwm/if_iwm.c optional iwm
|
||||
dev/iwm/if_iwm_binding.c optional iwm
|
||||
dev/iwm/if_iwm_led.c optional iwm
|
||||
dev/iwm/if_iwm_mac_ctxt.c optional iwm
|
||||
dev/iwm/if_iwm_notif_wait.c optional iwm
|
||||
dev/iwm/if_iwm_pcie_trans.c optional iwm
|
||||
dev/iwm/if_iwm_phy_ctxt.c optional iwm
|
||||
dev/iwm/if_iwm_phy_db.c optional iwm
|
||||
@ -3878,8 +3876,7 @@ libkern/strtouq.c standard
|
||||
libkern/strvalid.c standard
|
||||
libkern/timingsafe_bcmp.c standard
|
||||
libkern/zlib.c optional crypto | geom_uzip | ipsec | \
|
||||
mxge | netgraph_deflate | \
|
||||
ddb_ctf | gzio
|
||||
ipsec_support | mxge | netgraph_deflate | ddb_ctf | gzio
|
||||
net/altq/altq_cbq.c optional altq
|
||||
net/altq/altq_cdnr.c optional altq
|
||||
net/altq/altq_codel.c optional altq
|
||||
@ -3915,6 +3912,7 @@ net/if_fwsubr.c optional fwip
|
||||
net/if_gif.c optional gif inet | gif inet6 | \
|
||||
netgraph_gif inet | netgraph_gif inet6
|
||||
net/if_gre.c optional gre inet | gre inet6
|
||||
net/if_ipsec.c optional inet ipsec | inet6 ipsec
|
||||
net/if_iso88025subr.c optional token
|
||||
net/if_lagg.c optional lagg
|
||||
net/if_loop.c optional loop
|
||||
@ -4103,7 +4101,6 @@ netinet/ip_encap.c optional inet | inet6
|
||||
netinet/ip_fastfwd.c optional inet
|
||||
netinet/ip_icmp.c optional inet | inet6
|
||||
netinet/ip_input.c optional inet
|
||||
netinet/ip_ipsec.c optional inet ipsec
|
||||
netinet/ip_mroute.c optional mrouting inet
|
||||
netinet/ip_options.c optional inet
|
||||
netinet/ip_output.c optional inet
|
||||
@ -4173,7 +4170,6 @@ netinet6/ip6_id.c optional inet6
|
||||
netinet6/ip6_input.c optional inet6
|
||||
netinet6/ip6_mroute.c optional mrouting inet6
|
||||
netinet6/ip6_output.c optional inet6
|
||||
netinet6/ip6_ipsec.c optional inet6 ipsec
|
||||
netinet6/mld6.c optional inet6
|
||||
netinet6/nd6.c optional inet6
|
||||
netinet6/nd6_nbr.c optional inet6
|
||||
@ -4186,15 +4182,25 @@ netinet6/udp6_usrreq.c optional inet6
|
||||
netipsec/ipsec.c optional ipsec inet | ipsec inet6
|
||||
netipsec/ipsec_input.c optional ipsec inet | ipsec inet6
|
||||
netipsec/ipsec_mbuf.c optional ipsec inet | ipsec inet6
|
||||
netipsec/ipsec_mod.c optional ipsec inet | ipsec inet6
|
||||
netipsec/ipsec_output.c optional ipsec inet | ipsec inet6
|
||||
netipsec/key.c optional ipsec inet | ipsec inet6
|
||||
netipsec/key_debug.c optional ipsec inet | ipsec inet6
|
||||
netipsec/keysock.c optional ipsec inet | ipsec inet6
|
||||
netipsec/ipsec_pcb.c optional ipsec inet | ipsec inet6 | \
|
||||
ipsec_support inet | ipsec_support inet6
|
||||
netipsec/key.c optional ipsec inet | ipsec inet6 | \
|
||||
ipsec_support inet | ipsec_support inet6
|
||||
netipsec/key_debug.c optional ipsec inet | ipsec inet6 | \
|
||||
ipsec_support inet | ipsec_support inet6
|
||||
netipsec/keysock.c optional ipsec inet | ipsec inet6 | \
|
||||
ipsec_support inet | ipsec_support inet6
|
||||
netipsec/subr_ipsec.c optional ipsec inet | ipsec inet6 | \
|
||||
ipsec_support inet | ipsec_support inet6
|
||||
netipsec/udpencap.c optional ipsec inet
|
||||
netipsec/xform_ah.c optional ipsec inet | ipsec inet6
|
||||
netipsec/xform_esp.c optional ipsec inet | ipsec inet6
|
||||
netipsec/xform_ipcomp.c optional ipsec inet | ipsec inet6
|
||||
netipsec/xform_tcp.c optional ipsec inet tcp_signature | \
|
||||
ipsec inet6 tcp_signature
|
||||
ipsec inet6 tcp_signature | ipsec_support inet tcp_signature | \
|
||||
ipsec_support inet6 tcp_signature
|
||||
netnatm/natm.c optional natm
|
||||
netnatm/natm_pcb.c optional natm
|
||||
netnatm/natm_proto.c optional natm
|
||||
@ -4546,18 +4552,18 @@ ofed/drivers/infiniband/hw/mthca/mthca_uar.c optional mthca \
|
||||
compile-with "${OFED_C}"
|
||||
|
||||
# crypto support
|
||||
opencrypto/cast.c optional crypto | ipsec
|
||||
opencrypto/criov.c optional crypto | ipsec
|
||||
opencrypto/crypto.c optional crypto | ipsec
|
||||
opencrypto/cast.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/criov.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/crypto.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/cryptodev.c optional cryptodev
|
||||
opencrypto/cryptodev_if.m optional crypto | ipsec
|
||||
opencrypto/cryptosoft.c optional crypto | ipsec
|
||||
opencrypto/cryptodeflate.c optional crypto | ipsec
|
||||
opencrypto/gmac.c optional crypto | ipsec
|
||||
opencrypto/gfmult.c optional crypto | ipsec
|
||||
opencrypto/rmd160.c optional crypto | ipsec
|
||||
opencrypto/skipjack.c optional crypto | ipsec
|
||||
opencrypto/xform.c optional crypto | ipsec
|
||||
opencrypto/cryptodev_if.m optional crypto | ipsec | ipsec_support
|
||||
opencrypto/cryptosoft.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/cryptodeflate.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/gmac.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/gfmult.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/rmd160.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/skipjack.c optional crypto | ipsec | ipsec_support
|
||||
opencrypto/xform.c optional crypto | ipsec | ipsec_support
|
||||
rpc/auth_none.c optional krpc | nfslockd | nfscl | nfsd
|
||||
rpc/auth_unix.c optional krpc | nfslockd | nfscl | nfsd
|
||||
rpc/authunix_prot.c optional krpc | nfslockd | nfscl | nfsd
|
||||
|
@ -180,13 +180,19 @@ aesni_wrap.o optional aesni \
|
||||
compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \
|
||||
no-implicit-rule \
|
||||
clean "aesni_wrap.o"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | \
|
||||
ipsec_support | netsmb
|
||||
crypto/via/padlock.c optional padlock
|
||||
crypto/via/padlock_cipher.c optional padlock
|
||||
crypto/via/padlock_hash.c optional padlock
|
||||
dev/acpica/acpi_if.m standard
|
||||
dev/acpica/acpi_hpet.c optional acpi
|
||||
dev/acpica/acpi_pci.c optional acpi pci
|
||||
dev/acpica/acpi_pci_link.c optional acpi pci
|
||||
dev/acpica/acpi_pcib.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_acpi.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_pci.c optional acpi pci
|
||||
dev/acpica/acpi_timer.c optional acpi
|
||||
dev/acpi_support/acpi_wmi_if.m standard
|
||||
dev/agp/agp_amd64.c optional agp
|
||||
|
@ -112,8 +112,8 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-
|
||||
cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
|
||||
cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
|
||||
cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
dev/cpufreq/cpufreq_dt.c optional cpufreq fdt
|
||||
dev/dwc/if_dwc.c optional dwc
|
||||
dev/dwc/if_dwc_if.m optional dwc
|
||||
|
@ -88,7 +88,7 @@ arm64/arm64/disassem.c optional ddb
|
||||
arm64/arm64/dump_machdep.c standard
|
||||
arm64/arm64/elf_machdep.c standard
|
||||
arm64/arm64/exception.S standard
|
||||
arm64/arm64/gicv3_its.c optional intrng
|
||||
arm64/arm64/gicv3_its.c optional intrng fdt
|
||||
arm64/arm64/gic_v3.c standard
|
||||
arm64/arm64/gic_v3_fdt.c optional fdt
|
||||
arm64/arm64/identcpu.c standard
|
||||
@ -142,8 +142,8 @@ armv8_crypto_wrap.o optional armv8crypto \
|
||||
compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8a+crypto ${.IMPSRC}" \
|
||||
no-implicit-rule \
|
||||
clean "armv8_crypto_wrap.o"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
dev/acpica/acpi_if.m optional acpi
|
||||
dev/ahci/ahci_generic.c optional ahci
|
||||
dev/cpufreq/cpufreq_dt.c optional cpufreq fdt
|
||||
|
@ -143,7 +143,7 @@ compat/svr4/svr4_syscallnames.c optional compat_svr4
|
||||
compat/svr4/svr4_sysent.c optional compat_svr4
|
||||
compat/svr4/svr4_sysvec.c optional compat_svr4
|
||||
compat/svr4/svr4_termios.c optional compat_svr4
|
||||
bf_enc.o optional crypto | ipsec \
|
||||
bf_enc.o optional crypto | ipsec | ipsec_support \
|
||||
dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \
|
||||
compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \
|
||||
no-implicit-rule
|
||||
@ -159,10 +159,15 @@ aesni_wrap.o optional aesni \
|
||||
compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc} ${WERROR} ${NO_WCAST_QUAL} ${PROF} -mmmx -msse -msse4 -maes ${.IMPSRC}" \
|
||||
no-implicit-rule \
|
||||
clean "aesni_wrap.o"
|
||||
crypto/des/arch/i386/des_enc.S optional crypto | ipsec | netsmb
|
||||
crypto/des/arch/i386/des_enc.S optional crypto | ipsec | ipsec_support | netsmb
|
||||
crypto/via/padlock.c optional padlock
|
||||
crypto/via/padlock_cipher.c optional padlock
|
||||
crypto/via/padlock_hash.c optional padlock
|
||||
dev/acpica/acpi_pci.c optional acpi pci
|
||||
dev/acpica/acpi_pci_link.c optional acpi pci
|
||||
dev/acpica/acpi_pcib.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_acpi.c optional acpi pci
|
||||
dev/acpica/acpi_pcib_pci.c optional acpi pci
|
||||
dev/advansys/adv_isa.c optional adv isa
|
||||
dev/agp/agp_ali.c optional agp
|
||||
dev/agp/agp_amd.c optional agp
|
||||
|
@ -83,8 +83,10 @@ mips/mips/sc_machdep.c optional sc
|
||||
dev/uart/uart_cpu_fdt.c optional uart fdt
|
||||
|
||||
# crypto support -- use generic
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | \
|
||||
ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | \
|
||||
ipsec_support | netsmb
|
||||
|
||||
# AP common nvram interface MIPS specific, but maybe should be more generic
|
||||
dev/nvram2env/nvram2env_mips.c optional nvram2env
|
||||
|
@ -20,8 +20,8 @@ cddl/contrib/opensolaris/common/atomic/powerpc64/opensolaris_atomic.S optional z
|
||||
cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
|
||||
cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
|
||||
cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
dev/bm/if_bm.c optional bm powermac
|
||||
dev/adb/adb_bus.c optional adb
|
||||
dev/adb/adb_kbd.c optional adb
|
||||
|
@ -3,8 +3,8 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs | dtrace compile-
|
||||
cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
|
||||
cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
|
||||
cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
dev/ofw/ofw_cpu.c optional fdt
|
||||
dev/uart/uart_cpu_fdt.c optional uart fdt
|
||||
dev/xilinx/axi_quad_spi.c optional xilinx_spi
|
||||
|
@ -23,8 +23,8 @@ ukbdmap.h optional ukbd_dflt_keymap \
|
||||
clean "ukbdmap.h"
|
||||
#
|
||||
cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S optional zfs compile-with "${ZFS_S}"
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec
|
||||
crypto/des/des_enc.c optional crypto | ipsec | netsmb
|
||||
crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support
|
||||
crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb
|
||||
dev/atkbdc/atkbd.c optional atkbd atkbdc
|
||||
dev/atkbdc/atkbd_atkbdc.c optional atkbd atkbdc
|
||||
dev/atkbdc/atkbdc.c optional atkbdc
|
||||
|
@ -34,6 +34,7 @@ __DEFAULT_YES_OPTIONS = \
|
||||
INET \
|
||||
INET6 \
|
||||
IPFILTER \
|
||||
IPSEC_SUPPORT \
|
||||
ISCSI \
|
||||
KERNEL_SYMBOLS \
|
||||
NETGRAPH \
|
||||
|
@ -428,7 +428,7 @@ IPFIREWALL_VERBOSE opt_ipfw.h
|
||||
IPFIREWALL_VERBOSE_LIMIT opt_ipfw.h
|
||||
IPSEC opt_ipsec.h
|
||||
IPSEC_DEBUG opt_ipsec.h
|
||||
IPSEC_NAT_T opt_ipsec.h
|
||||
IPSEC_SUPPORT opt_ipsec.h
|
||||
IPSTEALTH
|
||||
KRPC
|
||||
LIBALIAS
|
||||
@ -451,7 +451,7 @@ TCP_HHOOK opt_inet.h
|
||||
TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading
|
||||
TCP_RFC7413 opt_inet.h
|
||||
TCP_RFC7413_MAX_KEYS opt_inet.h
|
||||
TCP_SIGNATURE opt_inet.h
|
||||
TCP_SIGNATURE opt_ipsec.h
|
||||
VLAN_ARRAY opt_vlan.h
|
||||
XBONEHACK
|
||||
FLOWTABLE opt_route.h
|
||||
|
@ -232,8 +232,8 @@ SLIST_HEAD(, uld_info) t4_uld_list;
|
||||
* Tunables. See tweak_tunables() too.
|
||||
*
|
||||
* Each tunable is set to a default value here if it's known at compile-time.
|
||||
* Otherwise it is set to -1 as an indication to tweak_tunables() that it should
|
||||
* provide a reasonable default when the driver is loaded.
|
||||
* Otherwise it is set to -n as an indication to tweak_tunables() that it should
|
||||
* provide a reasonable default (upto n) when the driver is loaded.
|
||||
*
|
||||
* Tunables applicable to both T4 and T5 are under hw.cxgbe. Those specific to
|
||||
* T5 are under hw.cxl.
|
||||
@ -243,27 +243,27 @@ SLIST_HEAD(, uld_info) t4_uld_list;
|
||||
* Number of queues for tx and rx, 10G and 1G, NIC and offload.
|
||||
*/
|
||||
#define NTXQ_10G 16
|
||||
int t4_ntxq10g = -1;
|
||||
int t4_ntxq10g = -NTXQ_10G;
|
||||
TUNABLE_INT("hw.cxgbe.ntxq10g", &t4_ntxq10g);
|
||||
|
||||
#define NRXQ_10G 8
|
||||
int t4_nrxq10g = -1;
|
||||
int t4_nrxq10g = -NRXQ_10G;
|
||||
TUNABLE_INT("hw.cxgbe.nrxq10g", &t4_nrxq10g);
|
||||
|
||||
#define NTXQ_1G 4
|
||||
int t4_ntxq1g = -1;
|
||||
int t4_ntxq1g = -NTXQ_1G;
|
||||
TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1g);
|
||||
|
||||
#define NRXQ_1G 2
|
||||
int t4_nrxq1g = -1;
|
||||
int t4_nrxq1g = -NRXQ_1G;
|
||||
TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g);
|
||||
|
||||
#define NTXQ_VI 1
|
||||
static int t4_ntxq_vi = -1;
|
||||
static int t4_ntxq_vi = -NTXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.ntxq_vi", &t4_ntxq_vi);
|
||||
|
||||
#define NRXQ_VI 1
|
||||
static int t4_nrxq_vi = -1;
|
||||
static int t4_nrxq_vi = -NRXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi);
|
||||
|
||||
static int t4_rsrv_noflowq = 0;
|
||||
@ -271,37 +271,37 @@ TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq);
|
||||
|
||||
#ifdef TCP_OFFLOAD
|
||||
#define NOFLDTXQ_10G 8
|
||||
static int t4_nofldtxq10g = -1;
|
||||
static int t4_nofldtxq10g = -NOFLDTXQ_10G;
|
||||
TUNABLE_INT("hw.cxgbe.nofldtxq10g", &t4_nofldtxq10g);
|
||||
|
||||
#define NOFLDRXQ_10G 2
|
||||
static int t4_nofldrxq10g = -1;
|
||||
static int t4_nofldrxq10g = -NOFLDRXQ_10G;
|
||||
TUNABLE_INT("hw.cxgbe.nofldrxq10g", &t4_nofldrxq10g);
|
||||
|
||||
#define NOFLDTXQ_1G 2
|
||||
static int t4_nofldtxq1g = -1;
|
||||
static int t4_nofldtxq1g = -NOFLDTXQ_1G;
|
||||
TUNABLE_INT("hw.cxgbe.nofldtxq1g", &t4_nofldtxq1g);
|
||||
|
||||
#define NOFLDRXQ_1G 1
|
||||
static int t4_nofldrxq1g = -1;
|
||||
static int t4_nofldrxq1g = -NOFLDRXQ_1G;
|
||||
TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g);
|
||||
|
||||
#define NOFLDTXQ_VI 1
|
||||
static int t4_nofldtxq_vi = -1;
|
||||
static int t4_nofldtxq_vi = -NOFLDTXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi);
|
||||
|
||||
#define NOFLDRXQ_VI 1
|
||||
static int t4_nofldrxq_vi = -1;
|
||||
static int t4_nofldrxq_vi = -NOFLDRXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi);
|
||||
#endif
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
#define NNMTXQ_VI 2
|
||||
static int t4_nnmtxq_vi = -1;
|
||||
static int t4_nnmtxq_vi = -NNMTXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.nnmtxq_vi", &t4_nnmtxq_vi);
|
||||
|
||||
#define NNMRXQ_VI 2
|
||||
static int t4_nnmrxq_vi = -1;
|
||||
static int t4_nnmrxq_vi = -NNMRXQ_VI;
|
||||
TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi);
|
||||
#endif
|
||||
|
||||
@ -9531,6 +9531,22 @@ uld_active(struct adapter *sc, int uld_id)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* t = ptr to tunable.
|
||||
* nc = number of CPUs.
|
||||
* c = compiled in default for that tunable.
|
||||
*/
|
||||
static void
|
||||
calculate_nqueues(int *t, int nc, const int c)
|
||||
{
|
||||
int nq;
|
||||
|
||||
if (*t > 0)
|
||||
return;
|
||||
nq = *t < 0 ? -*t : c;
|
||||
*t = min(nc, nq);
|
||||
}
|
||||
|
||||
/*
|
||||
* Come up with reasonable defaults for some of the tunables, provided they're
|
||||
* not set by the user (in which case we'll use the values as is).
|
||||
@ -9544,7 +9560,7 @@ tweak_tunables(void)
|
||||
#ifdef RSS
|
||||
t4_ntxq10g = rss_getnumbuckets();
|
||||
#else
|
||||
t4_ntxq10g = min(nc, NTXQ_10G);
|
||||
calculate_nqueues(&t4_ntxq10g, nc, NTXQ_10G);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -9553,18 +9569,17 @@ tweak_tunables(void)
|
||||
/* XXX: way too many for 1GbE? */
|
||||
t4_ntxq1g = rss_getnumbuckets();
|
||||
#else
|
||||
t4_ntxq1g = min(nc, NTXQ_1G);
|
||||
calculate_nqueues(&t4_ntxq1g, nc, NTXQ_1G);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (t4_ntxq_vi < 1)
|
||||
t4_ntxq_vi = min(nc, NTXQ_VI);
|
||||
calculate_nqueues(&t4_ntxq_vi, nc, NTXQ_VI);
|
||||
|
||||
if (t4_nrxq10g < 1) {
|
||||
#ifdef RSS
|
||||
t4_nrxq10g = rss_getnumbuckets();
|
||||
#else
|
||||
t4_nrxq10g = min(nc, NRXQ_10G);
|
||||
calculate_nqueues(&t4_nrxq10g, nc, NRXQ_10G);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -9573,31 +9588,19 @@ tweak_tunables(void)
|
||||
/* XXX: way too many for 1GbE? */
|
||||
t4_nrxq1g = rss_getnumbuckets();
|
||||
#else
|
||||
t4_nrxq1g = min(nc, NRXQ_1G);
|
||||
calculate_nqueues(&t4_nrxq1g, nc, NRXQ_1G);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (t4_nrxq_vi < 1)
|
||||
t4_nrxq_vi = min(nc, NRXQ_VI);
|
||||
calculate_nqueues(&t4_nrxq_vi, nc, NRXQ_VI);
|
||||
|
||||
#ifdef TCP_OFFLOAD
|
||||
if (t4_nofldtxq10g < 1)
|
||||
t4_nofldtxq10g = min(nc, NOFLDTXQ_10G);
|
||||
|
||||
if (t4_nofldtxq1g < 1)
|
||||
t4_nofldtxq1g = min(nc, NOFLDTXQ_1G);
|
||||
|
||||
if (t4_nofldtxq_vi < 1)
|
||||
t4_nofldtxq_vi = min(nc, NOFLDTXQ_VI);
|
||||
|
||||
if (t4_nofldrxq10g < 1)
|
||||
t4_nofldrxq10g = min(nc, NOFLDRXQ_10G);
|
||||
|
||||
if (t4_nofldrxq1g < 1)
|
||||
t4_nofldrxq1g = min(nc, NOFLDRXQ_1G);
|
||||
|
||||
if (t4_nofldrxq_vi < 1)
|
||||
t4_nofldrxq_vi = min(nc, NOFLDRXQ_VI);
|
||||
calculate_nqueues(&t4_nofldtxq10g, nc, NOFLDTXQ_10G);
|
||||
calculate_nqueues(&t4_nofldtxq1g, nc, NOFLDTXQ_1G);
|
||||
calculate_nqueues(&t4_nofldtxq_vi, nc, NOFLDTXQ_VI);
|
||||
calculate_nqueues(&t4_nofldrxq10g, nc, NOFLDRXQ_10G);
|
||||
calculate_nqueues(&t4_nofldrxq1g, nc, NOFLDRXQ_1G);
|
||||
calculate_nqueues(&t4_nofldrxq_vi, nc, NOFLDRXQ_VI);
|
||||
|
||||
if (t4_toecaps_allowed == -1)
|
||||
t4_toecaps_allowed = FW_CAPS_CONFIG_TOE;
|
||||
@ -9624,11 +9627,8 @@ tweak_tunables(void)
|
||||
#endif
|
||||
|
||||
#ifdef DEV_NETMAP
|
||||
if (t4_nnmtxq_vi < 1)
|
||||
t4_nnmtxq_vi = min(nc, NNMTXQ_VI);
|
||||
|
||||
if (t4_nnmrxq_vi < 1)
|
||||
t4_nnmrxq_vi = min(nc, NNMRXQ_VI);
|
||||
calculate_nqueues(&t4_nnmtxq_vi, nc, NNMTXQ_VI);
|
||||
calculate_nqueues(&t4_nnmrxq_vi, nc, NNMRXQ_VI);
|
||||
#endif
|
||||
|
||||
if (t4_tmr_idx_10g < 0 || t4_tmr_idx_10g >= SGE_NTIMERS)
|
||||
|
@ -402,7 +402,7 @@ t4_connect(struct toedev *tod, struct socket *so, struct rtentry *rt,
|
||||
if ((inp->inp_vflag & INP_IPV6) == 0)
|
||||
DONT_OFFLOAD_ACTIVE_OPEN(ENOTSUP);
|
||||
|
||||
toep->ce = hold_lip(td, &inp->in6p_laddr);
|
||||
toep->ce = hold_lip(td, &inp->in6p_laddr, NULL);
|
||||
if (toep->ce == NULL)
|
||||
DONT_OFFLOAD_ACTIVE_OPEN(ENOENT);
|
||||
|
||||
|
@ -209,7 +209,7 @@ alloc_lctx(struct adapter *sc, struct inpcb *inp, struct vi_info *vi)
|
||||
!IN6_ARE_ADDR_EQUAL(&in6addr_any, &inp->in6p_laddr)) {
|
||||
struct tom_data *td = sc->tom_softc;
|
||||
|
||||
lctx->ce = hold_lip(td, &inp->in6p_laddr);
|
||||
lctx->ce = hold_lip(td, &inp->in6p_laddr, NULL);
|
||||
if (lctx->ce == NULL) {
|
||||
free(lctx, M_CXGBE);
|
||||
return (NULL);
|
||||
@ -1584,6 +1584,8 @@ reset:
|
||||
INP_WLOCK_ASSERT(new_inp);
|
||||
MPASS(so->so_vnet == lctx->vnet);
|
||||
toep->vnet = lctx->vnet;
|
||||
if (inc.inc_flags & INC_ISIPV6)
|
||||
toep->ce = hold_lip(sc->tom_softc, &inc.inc6_laddr, lctx->ce);
|
||||
|
||||
/*
|
||||
* This is for the unlikely case where the syncache entry that we added
|
||||
|
@ -730,12 +730,12 @@ search_lip(struct tom_data *td, struct in6_addr *lip)
|
||||
}
|
||||
|
||||
struct clip_entry *
|
||||
hold_lip(struct tom_data *td, struct in6_addr *lip)
|
||||
hold_lip(struct tom_data *td, struct in6_addr *lip, struct clip_entry *ce)
|
||||
{
|
||||
struct clip_entry *ce;
|
||||
|
||||
mtx_lock(&td->clip_table_lock);
|
||||
ce = search_lip(td, lip);
|
||||
if (ce == NULL)
|
||||
ce = search_lip(td, lip);
|
||||
if (ce != NULL)
|
||||
ce->refcount++;
|
||||
mtx_unlock(&td->clip_table_lock);
|
||||
|
@ -321,7 +321,8 @@ uint64_t calc_opt0(struct socket *, struct vi_info *, struct l2t_entry *,
|
||||
uint64_t select_ntuple(struct vi_info *, struct l2t_entry *);
|
||||
void set_tcpddp_ulp_mode(struct toepcb *);
|
||||
int negative_advice(int);
|
||||
struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *);
|
||||
struct clip_entry *hold_lip(struct tom_data *, struct in6_addr *,
|
||||
struct clip_entry *);
|
||||
void release_lip(struct tom_data *, struct clip_entry *);
|
||||
|
||||
/* t4_connect.c */
|
||||
|
@ -171,7 +171,7 @@ gxemul_disk_attach_geom(void *arg, int flag)
|
||||
sc->sc_geom = g_new_geomf(&g_gxemul_disk_class, "%s", device_get_nameunit(sc->sc_dev));
|
||||
sc->sc_geom->softc = sc;
|
||||
|
||||
sc->sc_provider = g_new_providerf(sc->sc_geom, sc->sc_geom->name);
|
||||
sc->sc_provider = g_new_providerf(sc->sc_geom, "%s", sc->sc_geom->name);
|
||||
sc->sc_provider->sectorsize = GXEMUL_DISK_DEV_BLOCKSIZE;
|
||||
sc->sc_provider->mediasize = sc->sc_size;
|
||||
g_error_provider(sc->sc_provider, 0);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -318,6 +318,11 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, struct iwm_node *in,
|
||||
= htole32((ic->ic_flags & IEEE80211_F_SHSLOT)
|
||||
? IWM_MAC_FLG_SHORT_SLOT : 0);
|
||||
|
||||
/*
|
||||
* XXX TODO: if we're doing QOS..
|
||||
* cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA)
|
||||
*/
|
||||
|
||||
/* XXX TODO: set wme parameters; also handle getting updated wme parameters */
|
||||
for (i = 0; i < IWM_AC_NUM+1; i++) {
|
||||
int txf = i;
|
||||
|
219
sys/dev/iwm/if_iwm_notif_wait.c
Normal file
219
sys/dev/iwm/if_iwm_notif_wait.c
Normal file
@ -0,0 +1,219 @@
|
||||
/*-
|
||||
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
|
||||
* which were used as the reference documentation for this implementation.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
*
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
|
||||
* Copyright(c) 2015 Intel Deutschland GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
|
||||
* USA
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution
|
||||
* in the file called COPYING.
|
||||
*
|
||||
* Contact Information:
|
||||
* Intel Linux Wireless <linuxwifi@intel.com>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include "opt_wlan.h"
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/malloc.h>
|
||||
#include <sys/lock.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <dev/iwm/if_iwm_notif_wait.h>
|
||||
|
||||
#define IWM_WAIT_LOCK_INIT(_n, _s) \
|
||||
mtx_init(&(_n)->lk_mtx, (_s), "iwm wait_notif", MTX_DEF);
|
||||
#define IWM_WAIT_LOCK(_n) mtx_lock(&(_n)->lk_mtx)
|
||||
#define IWM_WAIT_UNLOCK(_n) mtx_unlock(&(_n)->lk_mtx)
|
||||
#define IWM_WAIT_LOCK_DESTROY(_n) mtx_destroy(&(_n)->lk_mtx)
|
||||
|
||||
struct iwm_notif_wait_data {
|
||||
struct mtx lk_mtx;
|
||||
char lk_buf[32];
|
||||
STAILQ_HEAD(, iwm_notification_wait) list;
|
||||
struct iwm_softc *sc;
|
||||
};
|
||||
|
||||
struct iwm_notif_wait_data *
|
||||
iwm_notification_wait_init(struct iwm_softc *sc)
|
||||
{
|
||||
struct iwm_notif_wait_data *data;
|
||||
|
||||
data = malloc(sizeof(*data), M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (data != NULL) {
|
||||
snprintf(data->lk_buf, 32, "iwm wait_notif");
|
||||
IWM_WAIT_LOCK_INIT(data, data->lk_buf);
|
||||
STAILQ_INIT(&data->list);
|
||||
data->sc = sc;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
void
|
||||
iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data)
|
||||
{
|
||||
KASSERT(STAILQ_EMPTY(¬if_data->list), ("notif list isn't empty"));
|
||||
IWM_WAIT_LOCK_DESTROY(notif_data);
|
||||
free(notif_data, M_DEVBUF);
|
||||
}
|
||||
|
||||
/* XXX Get rid of separate cmd argument, like in iwlwifi's code */
|
||||
void
|
||||
iwm_notification_wait_notify(struct iwm_notif_wait_data *notif_data,
|
||||
uint16_t cmd, struct iwm_rx_packet *pkt)
|
||||
{
|
||||
struct iwm_notification_wait *wait_entry;
|
||||
|
||||
IWM_WAIT_LOCK(notif_data);
|
||||
STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) {
|
||||
int found = FALSE;
|
||||
int i;
|
||||
|
||||
/*
|
||||
* If it already finished (triggered) or has been
|
||||
* aborted then don't evaluate it again to avoid races,
|
||||
* Otherwise the function could be called again even
|
||||
* though it returned true before
|
||||
*/
|
||||
if (wait_entry->triggered || wait_entry->aborted)
|
||||
continue;
|
||||
|
||||
for (i = 0; i < wait_entry->n_cmds; i++) {
|
||||
if (cmd == wait_entry->cmds[i]) {
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
continue;
|
||||
|
||||
if (!wait_entry->fn ||
|
||||
wait_entry->fn(notif_data->sc, pkt, wait_entry->fn_data)) {
|
||||
wait_entry->triggered = 1;
|
||||
wakeup(wait_entry);
|
||||
}
|
||||
}
|
||||
IWM_WAIT_UNLOCK(notif_data);
|
||||
}
|
||||
|
||||
void
|
||||
iwm_abort_notification_waits(struct iwm_notif_wait_data *notif_data)
|
||||
{
|
||||
struct iwm_notification_wait *wait_entry;
|
||||
|
||||
IWM_WAIT_LOCK(notif_data);
|
||||
STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) {
|
||||
wait_entry->aborted = 1;
|
||||
wakeup(wait_entry);
|
||||
}
|
||||
IWM_WAIT_UNLOCK(notif_data);
|
||||
}
|
||||
|
||||
void
|
||||
iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry, const uint16_t *cmds, int n_cmds,
|
||||
int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data),
|
||||
void *fn_data)
|
||||
{
|
||||
KASSERT(n_cmds <= IWM_MAX_NOTIF_CMDS,
|
||||
("n_cmds %d is too large", n_cmds));
|
||||
wait_entry->fn = fn;
|
||||
wait_entry->fn_data = fn_data;
|
||||
wait_entry->n_cmds = n_cmds;
|
||||
memcpy(wait_entry->cmds, cmds, n_cmds * sizeof(uint16_t));
|
||||
wait_entry->triggered = 0;
|
||||
wait_entry->aborted = 0;
|
||||
|
||||
IWM_WAIT_LOCK(notif_data);
|
||||
STAILQ_INSERT_TAIL(¬if_data->list, wait_entry, entry);
|
||||
IWM_WAIT_UNLOCK(notif_data);
|
||||
}
|
||||
|
||||
int
|
||||
iwm_wait_notification(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry, int timeout)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
IWM_WAIT_LOCK(notif_data);
|
||||
if (!wait_entry->triggered && !wait_entry->aborted) {
|
||||
ret = msleep(wait_entry, ¬if_data->lk_mtx, 0, "iwm_notif",
|
||||
timeout);
|
||||
}
|
||||
STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait,
|
||||
entry);
|
||||
IWM_WAIT_UNLOCK(notif_data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
iwm_remove_notification(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry)
|
||||
{
|
||||
IWM_WAIT_LOCK(notif_data);
|
||||
STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait,
|
||||
entry);
|
||||
IWM_WAIT_UNLOCK(notif_data);
|
||||
}
|
138
sys/dev/iwm/if_iwm_notif_wait.h
Normal file
138
sys/dev/iwm/if_iwm_notif_wait.h
Normal file
@ -0,0 +1,138 @@
|
||||
/*-
|
||||
* Based on BSD-licensed source modules in the Linux iwlwifi driver,
|
||||
* which were used as the reference documentation for this implementation.
|
||||
*
|
||||
******************************************************************************
|
||||
*
|
||||
* This file is provided under a dual BSD/GPLv2 license. When using or
|
||||
* redistributing this file, you may do so under either license.
|
||||
*
|
||||
* GPL LICENSE SUMMARY
|
||||
*
|
||||
* Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved.
|
||||
* Copyright(c) 2015 Intel Deutschland GmbH
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of version 2 of the GNU General Public License as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110,
|
||||
* USA
|
||||
*
|
||||
* The full GNU General Public License is included in this distribution
|
||||
* in the file called COPYING.
|
||||
*
|
||||
* Contact Information:
|
||||
* Intel Linux Wireless <linuxwifi@intel.com>
|
||||
* Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
|
||||
*
|
||||
* BSD LICENSE
|
||||
*
|
||||
* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* * Neither the name Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* $FreeBSD$ */
|
||||
|
||||
#ifndef __IF_IWN_NOTIF_WAIT_H__
|
||||
#define __IF_IWN_NOTIF_WAIT_H__
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
||||
#define IWM_MAX_NOTIF_CMDS 5
|
||||
|
||||
struct iwm_rx_packet;
|
||||
struct iwm_softc;
|
||||
|
||||
/**
|
||||
* struct iwm_notification_wait - notification wait entry
|
||||
* @entry: link for global list
|
||||
* @fn: Function called with the notification. If the function
|
||||
* returns true, the wait is over, if it returns false then
|
||||
* the waiter stays blocked. If no function is given, any
|
||||
* of the listed commands will unblock the waiter.
|
||||
* @cmds: command IDs
|
||||
* @n_cmds: number of command IDs
|
||||
* @triggered: waiter should be woken up
|
||||
* @aborted: wait was aborted
|
||||
*
|
||||
* This structure is not used directly, to wait for a
|
||||
* notification declare it on the stack, and call
|
||||
* iwm_init_notification_wait() with appropriate
|
||||
* parameters. Then do whatever will cause the ucode
|
||||
* to notify the driver, and to wait for that then
|
||||
* call iwm_wait_notification().
|
||||
*
|
||||
* Each notification is one-shot. If at some point we
|
||||
* need to support multi-shot notifications (which
|
||||
* can't be allocated on the stack) we need to modify
|
||||
* the code for them.
|
||||
*/
|
||||
struct iwm_notification_wait {
|
||||
STAILQ_ENTRY(iwm_notification_wait) entry;
|
||||
|
||||
int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data);
|
||||
void *fn_data;
|
||||
|
||||
uint16_t cmds[IWM_MAX_NOTIF_CMDS];
|
||||
uint8_t n_cmds;
|
||||
int triggered, aborted;
|
||||
};
|
||||
|
||||
/* caller functions */
|
||||
extern struct iwm_notif_wait_data *iwm_notification_wait_init(
|
||||
struct iwm_softc *sc);
|
||||
extern void iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data);
|
||||
extern void iwm_notification_wait_notify(
|
||||
struct iwm_notif_wait_data *notif_data, uint16_t cmd,
|
||||
struct iwm_rx_packet *pkt);
|
||||
extern void iwm_abort_notification_waits(
|
||||
struct iwm_notif_wait_data *notif_data);
|
||||
|
||||
/* user functions */
|
||||
extern void iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry,
|
||||
const uint16_t *cmds, int n_cmds,
|
||||
int (*fn)(struct iwm_softc *sc,
|
||||
struct iwm_rx_packet *pkt, void *data),
|
||||
void *fn_data);
|
||||
extern int iwm_wait_notification(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry, int timeout);
|
||||
extern void iwm_remove_notification(struct iwm_notif_wait_data *notif_data,
|
||||
struct iwm_notification_wait *wait_entry);
|
||||
|
||||
#endif /* __IF_IWN_NOTIF_WAIT_H__ */
|
@ -256,7 +256,7 @@ iwm_nic_lock(struct iwm_softc *sc)
|
||||
IWM_SETBITS(sc, IWM_CSR_GP_CNTRL,
|
||||
IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ);
|
||||
|
||||
if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000)
|
||||
if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000)
|
||||
DELAY(2);
|
||||
|
||||
if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL,
|
||||
@ -425,7 +425,7 @@ iwm_apm_init(struct iwm_softc *sc)
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_RESET, "iwm apm start\n");
|
||||
|
||||
/* Disable L0S exit timer (platform NMI Work/Around) */
|
||||
if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) {
|
||||
if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) {
|
||||
IWM_SETBITS(sc, IWM_CSR_GIO_CHICKEN_BITS,
|
||||
IWM_CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER);
|
||||
}
|
||||
@ -476,7 +476,7 @@ iwm_apm_init(struct iwm_softc *sc)
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (sc->host_interrupt_operation_mode) {
|
||||
if (sc->cfg->host_interrupt_operation_mode) {
|
||||
/*
|
||||
* This is a bit of an abuse - This is needed for 7260 / 3160
|
||||
* only check host_interrupt_operation_mode even if this is
|
||||
@ -505,7 +505,7 @@ iwm_apm_init(struct iwm_softc *sc)
|
||||
* do not disable clocks. This preserves any hardware bits already
|
||||
* set by default in "CLK_CTRL_REG" after reset.
|
||||
*/
|
||||
if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) {
|
||||
if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) {
|
||||
iwm_write_prph(sc, IWM_APMG_CLK_EN_REG,
|
||||
IWM_APMG_CLK_VAL_DMA_CLK_RQT);
|
||||
DELAY(20);
|
||||
|
@ -202,8 +202,8 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc,
|
||||
ieee80211_chan2ieee(ic, chan),
|
||||
chains_static,
|
||||
chains_dynamic,
|
||||
iwm_fw_valid_rx_ant(sc),
|
||||
iwm_fw_valid_tx_ant(sc));
|
||||
iwm_mvm_get_valid_rx_ant(sc),
|
||||
iwm_mvm_get_valid_tx_ant(sc));
|
||||
|
||||
|
||||
cmd->ci.band = IEEE80211_IS_CHAN_2GHZ(chan) ?
|
||||
@ -217,13 +217,13 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc,
|
||||
idle_cnt = chains_static;
|
||||
active_cnt = chains_dynamic;
|
||||
|
||||
cmd->rxchain_info = htole32(iwm_fw_valid_rx_ant(sc) <<
|
||||
cmd->rxchain_info = htole32(iwm_mvm_get_valid_rx_ant(sc) <<
|
||||
IWM_PHY_RX_CHAIN_VALID_POS);
|
||||
cmd->rxchain_info |= htole32(idle_cnt << IWM_PHY_RX_CHAIN_CNT_POS);
|
||||
cmd->rxchain_info |= htole32(active_cnt <<
|
||||
IWM_PHY_RX_CHAIN_MIMO_CNT_POS);
|
||||
|
||||
cmd->txchain_info = htole32(iwm_fw_valid_tx_ant(sc));
|
||||
cmd->txchain_info = htole32(iwm_mvm_get_valid_tx_ant(sc));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -150,26 +150,104 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net80211/ieee80211_ratectl.h>
|
||||
#include <net80211/ieee80211_radiotap.h>
|
||||
|
||||
#include <dev/iwm/if_iwmreg.h>
|
||||
#include <dev/iwm/if_iwmvar.h>
|
||||
#include <dev/iwm/if_iwm_debug.h>
|
||||
#include <dev/iwm/if_iwm_util.h>
|
||||
#include <dev/iwm/if_iwm_phy_db.h>
|
||||
#include "if_iwmreg.h"
|
||||
#include "if_iwmvar.h"
|
||||
#include "if_iwm_debug.h"
|
||||
#include "if_iwm_util.h"
|
||||
#include "if_iwm_phy_db.h"
|
||||
|
||||
#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */
|
||||
|
||||
struct iwm_phy_db_entry {
|
||||
uint16_t size;
|
||||
uint8_t *data;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwm_phy_db - stores phy configuration and calibration data.
|
||||
*
|
||||
* @cfg: phy configuration.
|
||||
* @calib_nch: non channel specific calibration data.
|
||||
* @calib_ch: channel specific calibration data.
|
||||
* @n_group_papd: number of entries in papd channel group.
|
||||
* @calib_ch_group_papd: calibration data related to papd channel group.
|
||||
* @n_group_txp: number of entries in tx power channel group.
|
||||
* @calib_ch_group_txp: calibration data related to tx power chanel group.
|
||||
*/
|
||||
struct iwm_phy_db {
|
||||
struct iwm_phy_db_entry cfg;
|
||||
struct iwm_phy_db_entry calib_nch;
|
||||
int n_group_papd;
|
||||
struct iwm_phy_db_entry *calib_ch_group_papd;
|
||||
int n_group_txp;
|
||||
struct iwm_phy_db_entry *calib_ch_group_txp;
|
||||
|
||||
struct iwm_softc *sc;
|
||||
};
|
||||
|
||||
enum iwm_phy_db_section_type {
|
||||
IWM_PHY_DB_CFG = 1,
|
||||
IWM_PHY_DB_CALIB_NCH,
|
||||
IWM_PHY_DB_UNUSED,
|
||||
IWM_PHY_DB_CALIB_CHG_PAPD,
|
||||
IWM_PHY_DB_CALIB_CHG_TXP,
|
||||
IWM_PHY_DB_MAX
|
||||
};
|
||||
|
||||
#define PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */
|
||||
|
||||
/*
|
||||
* BEGIN iwl-phy-db.c
|
||||
* phy db - configure operational ucode
|
||||
*/
|
||||
struct iwm_phy_db_cmd {
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
uint8_t data[];
|
||||
} __packed;
|
||||
|
||||
/* for parsing of tx power channel group data that comes from the firmware*/
|
||||
struct iwm_phy_db_chg_txp {
|
||||
uint32_t space;
|
||||
uint16_t max_channel_idx;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* phy db - Receive phy db chunk after calibrations
|
||||
*/
|
||||
struct iwm_calib_res_notif_phy_db {
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
uint8_t data[];
|
||||
} __packed;
|
||||
|
||||
struct iwm_phy_db *
|
||||
iwm_phy_db_init(struct iwm_softc *sc)
|
||||
{
|
||||
struct iwm_phy_db *phy_db = malloc(sizeof(struct iwm_phy_db),
|
||||
M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
|
||||
if (!phy_db)
|
||||
return phy_db;
|
||||
|
||||
phy_db->sc = sc;
|
||||
|
||||
phy_db->n_group_txp = -1;
|
||||
phy_db->n_group_papd = -1;
|
||||
|
||||
/* TODO: add default values of the phy db. */
|
||||
return phy_db;
|
||||
}
|
||||
|
||||
/*
|
||||
* get phy db section: returns a pointer to a phy db section specified by
|
||||
* type and channel group id.
|
||||
*/
|
||||
static struct iwm_phy_db_entry *
|
||||
iwm_phy_db_get_section(struct iwm_softc *sc,
|
||||
enum iwm_phy_db_section_type type, uint16_t chg_id)
|
||||
iwm_phy_db_get_section(struct iwm_phy_db *phy_db,
|
||||
enum iwm_phy_db_section_type type,
|
||||
uint16_t chg_id)
|
||||
{
|
||||
struct iwm_phy_db *phy_db = &sc->sc_phy_db;
|
||||
|
||||
if (type >= IWM_PHY_DB_MAX)
|
||||
if (!phy_db || type >= IWM_PHY_DB_MAX)
|
||||
return NULL;
|
||||
|
||||
switch (type) {
|
||||
@ -178,11 +256,11 @@ iwm_phy_db_get_section(struct iwm_softc *sc,
|
||||
case IWM_PHY_DB_CALIB_NCH:
|
||||
return &phy_db->calib_nch;
|
||||
case IWM_PHY_DB_CALIB_CHG_PAPD:
|
||||
if (chg_id >= IWM_NUM_PAPD_CH_GROUPS)
|
||||
if (chg_id >= phy_db->n_group_papd)
|
||||
return NULL;
|
||||
return &phy_db->calib_ch_group_papd[chg_id];
|
||||
case IWM_PHY_DB_CALIB_CHG_TXP:
|
||||
if (chg_id >= IWM_NUM_TXP_CH_GROUPS)
|
||||
if (chg_id >= phy_db->n_group_txp)
|
||||
return NULL;
|
||||
return &phy_db->calib_ch_group_txp[chg_id];
|
||||
default:
|
||||
@ -191,24 +269,94 @@ iwm_phy_db_get_section(struct iwm_softc *sc,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
iwm_phy_db_set_section(struct iwm_softc *sc,
|
||||
struct iwm_calib_res_notif_phy_db *phy_db_notif)
|
||||
static void
|
||||
iwm_phy_db_free_section(struct iwm_phy_db *phy_db,
|
||||
enum iwm_phy_db_section_type type, uint16_t chg_id)
|
||||
{
|
||||
struct iwm_phy_db_entry *entry =
|
||||
iwm_phy_db_get_section(phy_db, type, chg_id);
|
||||
if (!entry)
|
||||
return;
|
||||
|
||||
if (entry->data != NULL)
|
||||
free(entry->data, M_DEVBUF);
|
||||
entry->data = NULL;
|
||||
entry->size = 0;
|
||||
}
|
||||
|
||||
void
|
||||
iwm_phy_db_free(struct iwm_phy_db *phy_db)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!phy_db)
|
||||
return;
|
||||
|
||||
iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CFG, 0);
|
||||
iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_NCH, 0);
|
||||
|
||||
for (i = 0; i < phy_db->n_group_papd; i++)
|
||||
iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_PAPD, i);
|
||||
if (phy_db->calib_ch_group_papd != NULL)
|
||||
free(phy_db->calib_ch_group_papd, M_DEVBUF);
|
||||
|
||||
for (i = 0; i < phy_db->n_group_txp; i++)
|
||||
iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_TXP, i);
|
||||
if (phy_db->calib_ch_group_txp != NULL)
|
||||
free(phy_db->calib_ch_group_txp, M_DEVBUF);
|
||||
|
||||
free(phy_db, M_DEVBUF);
|
||||
}
|
||||
|
||||
int
|
||||
iwm_phy_db_set_section(struct iwm_phy_db *phy_db,
|
||||
struct iwm_rx_packet *pkt)
|
||||
{
|
||||
struct iwm_calib_res_notif_phy_db *phy_db_notif =
|
||||
(struct iwm_calib_res_notif_phy_db *)pkt->data;
|
||||
enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type);
|
||||
uint16_t size = le16toh(phy_db_notif->length);
|
||||
struct iwm_phy_db_entry *entry;
|
||||
uint16_t chg_id = 0;
|
||||
uint16_t size = le16toh(phy_db_notif->length);
|
||||
struct iwm_phy_db_entry *entry;
|
||||
uint16_t chg_id = 0;
|
||||
|
||||
if (type == IWM_PHY_DB_CALIB_CHG_PAPD ||
|
||||
type == IWM_PHY_DB_CALIB_CHG_TXP)
|
||||
if (!phy_db)
|
||||
return EINVAL;
|
||||
|
||||
if (type == IWM_PHY_DB_CALIB_CHG_PAPD) {
|
||||
chg_id = le16toh(*(uint16_t *)phy_db_notif->data);
|
||||
if (phy_db && !phy_db->calib_ch_group_papd) {
|
||||
/*
|
||||
* Firmware sends the largest index first, so we can use
|
||||
* it to know how much we should allocate.
|
||||
*/
|
||||
phy_db->calib_ch_group_papd = malloc(
|
||||
(chg_id + 1) * sizeof(struct iwm_phy_db_entry),
|
||||
M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (!phy_db->calib_ch_group_papd)
|
||||
return ENOMEM;
|
||||
phy_db->n_group_papd = chg_id + 1;
|
||||
}
|
||||
} else if (type == IWM_PHY_DB_CALIB_CHG_TXP) {
|
||||
chg_id = le16toh(*(uint16_t *)phy_db_notif->data);
|
||||
if (phy_db && !phy_db->calib_ch_group_txp) {
|
||||
/*
|
||||
* Firmware sends the largest index first, so we can use
|
||||
* it to know how much we should allocate.
|
||||
*/
|
||||
phy_db->calib_ch_group_txp = malloc(
|
||||
(chg_id + 1) * sizeof(struct iwm_phy_db_entry),
|
||||
M_DEVBUF, M_NOWAIT | M_ZERO);
|
||||
if (!phy_db->calib_ch_group_txp)
|
||||
return ENOMEM;
|
||||
phy_db->n_group_txp = chg_id + 1;
|
||||
}
|
||||
}
|
||||
|
||||
entry = iwm_phy_db_get_section(sc, type, chg_id);
|
||||
entry = iwm_phy_db_get_section(phy_db, type, chg_id);
|
||||
if (!entry)
|
||||
return EINVAL;
|
||||
|
||||
if (entry->data)
|
||||
if (entry->data != NULL)
|
||||
free(entry->data, M_DEVBUF);
|
||||
entry->data = malloc(size, M_DEVBUF, M_NOWAIT);
|
||||
if (!entry->data) {
|
||||
@ -216,17 +364,18 @@ iwm_phy_db_set_section(struct iwm_softc *sc,
|
||||
return ENOMEM;
|
||||
}
|
||||
memcpy(entry->data, phy_db_notif->data, size);
|
||||
|
||||
entry->size = size;
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_RESET,
|
||||
"%s(%d): [PHYDB]SET: Type %d , Size: %d, data: %p\n",
|
||||
__func__, __LINE__, type, size, entry->data);
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
|
||||
"%s(%d): [PHYDB]SET: Type %d , Size: %d\n",
|
||||
__func__, __LINE__, type, size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iwm_is_valid_channel(uint16_t ch_id)
|
||||
is_valid_channel(uint16_t ch_id)
|
||||
{
|
||||
if (ch_id <= 14 ||
|
||||
(36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) ||
|
||||
@ -237,10 +386,10 @@ iwm_is_valid_channel(uint16_t ch_id)
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
iwm_ch_id_to_ch_index(uint16_t ch_id)
|
||||
ch_id_to_ch_index(uint16_t ch_id)
|
||||
{
|
||||
if (!iwm_is_valid_channel(ch_id))
|
||||
return 0xff;
|
||||
if (!is_valid_channel(ch_id))
|
||||
return 0xff;
|
||||
|
||||
if (ch_id <= 14)
|
||||
return ch_id - 1;
|
||||
@ -253,9 +402,9 @@ iwm_ch_id_to_ch_index(uint16_t ch_id)
|
||||
|
||||
|
||||
static uint16_t
|
||||
iwm_channel_id_to_papd(uint16_t ch_id)
|
||||
channel_id_to_papd(uint16_t ch_id)
|
||||
{
|
||||
if (!iwm_is_valid_channel(ch_id))
|
||||
if (!is_valid_channel(ch_id))
|
||||
return 0xff;
|
||||
|
||||
if (1 <= ch_id && ch_id <= 14)
|
||||
@ -268,17 +417,15 @@ iwm_channel_id_to_papd(uint16_t ch_id)
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t ch_id)
|
||||
channel_id_to_txp(struct iwm_phy_db *phy_db, uint16_t ch_id)
|
||||
{
|
||||
struct iwm_phy_db *phy_db = &sc->sc_phy_db;
|
||||
struct iwm_phy_db_chg_txp *txp_chg;
|
||||
int i;
|
||||
uint8_t ch_index = iwm_ch_id_to_ch_index(ch_id);
|
||||
|
||||
uint8_t ch_index = ch_id_to_ch_index(ch_id);
|
||||
if (ch_index == 0xff)
|
||||
return 0xff;
|
||||
|
||||
for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) {
|
||||
for (i = 0; i < phy_db->n_group_txp; i++) {
|
||||
txp_chg = (void *)phy_db->calib_ch_group_txp[i].data;
|
||||
if (!txp_chg)
|
||||
return 0xff;
|
||||
@ -293,71 +440,79 @@ iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t ch_id)
|
||||
}
|
||||
|
||||
static int
|
||||
iwm_phy_db_get_section_data(struct iwm_softc *sc,
|
||||
uint32_t type, uint8_t **data, uint16_t *size, uint16_t ch_id)
|
||||
iwm_phy_db_get_section_data(struct iwm_phy_db *phy_db,
|
||||
uint32_t type, uint8_t **data, uint16_t *size,
|
||||
uint16_t ch_id)
|
||||
{
|
||||
struct iwm_phy_db_entry *entry;
|
||||
uint16_t ch_group_id = 0;
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_RESET, "->%s\n", __func__);
|
||||
if (!phy_db)
|
||||
return EINVAL;
|
||||
|
||||
/* find wanted channel group */
|
||||
if (type == IWM_PHY_DB_CALIB_CHG_PAPD)
|
||||
ch_group_id = iwm_channel_id_to_papd(ch_id);
|
||||
ch_group_id = channel_id_to_papd(ch_id);
|
||||
else if (type == IWM_PHY_DB_CALIB_CHG_TXP)
|
||||
ch_group_id = iwm_channel_id_to_txp(sc, ch_id);
|
||||
ch_group_id = channel_id_to_txp(phy_db, ch_id);
|
||||
|
||||
entry = iwm_phy_db_get_section(sc, type, ch_group_id);
|
||||
entry = iwm_phy_db_get_section(phy_db, type, ch_group_id);
|
||||
if (!entry)
|
||||
return EINVAL;
|
||||
|
||||
*data = entry->data;
|
||||
*size = entry->size;
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_RESET,
|
||||
"%s(%d): [PHYDB] GET: Type %d , Size: %d\n",
|
||||
__func__, __LINE__, type, *size);
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
|
||||
"%s(%d): [PHYDB] GET: Type %d , Size: %d\n",
|
||||
__func__, __LINE__, type, *size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
iwm_send_phy_db_cmd(struct iwm_softc *sc, uint16_t type,
|
||||
uint16_t length, void *data)
|
||||
iwm_send_phy_db_cmd(struct iwm_phy_db *phy_db, uint16_t type,
|
||||
uint16_t length, void *data)
|
||||
{
|
||||
struct iwm_phy_db_cmd phy_db_cmd;
|
||||
struct iwm_host_cmd cmd = {
|
||||
.id = IWM_PHY_DB_CMD,
|
||||
.flags = IWM_CMD_SYNC,
|
||||
.id = PHY_DB_CMD,
|
||||
};
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD,
|
||||
"Sending PHY-DB hcmd of type %d, of length %d\n",
|
||||
type, length);
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET,
|
||||
"Sending PHY-DB hcmd of type %d, of length %d\n",
|
||||
type, length);
|
||||
|
||||
/* Set phy db cmd variables */
|
||||
phy_db_cmd.type = le16toh(type);
|
||||
phy_db_cmd.length = le16toh(length);
|
||||
phy_db_cmd.type = htole16(type);
|
||||
phy_db_cmd.length = htole16(length);
|
||||
|
||||
/* Set hcmd variables */
|
||||
cmd.data[0] = &phy_db_cmd;
|
||||
cmd.len[0] = sizeof(struct iwm_phy_db_cmd);
|
||||
cmd.data[1] = data;
|
||||
cmd.len[1] = length;
|
||||
#ifdef notyet
|
||||
cmd.dataflags[1] = IWM_HCMD_DFL_NOCOPY;
|
||||
#endif
|
||||
|
||||
return iwm_send_cmd(sc, &cmd);
|
||||
return iwm_send_cmd(phy_db->sc, &cmd);
|
||||
}
|
||||
|
||||
static int
|
||||
iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc,
|
||||
enum iwm_phy_db_section_type type, uint8_t max_ch_groups)
|
||||
iwm_phy_db_send_all_channel_groups(struct iwm_phy_db *phy_db,
|
||||
enum iwm_phy_db_section_type type,
|
||||
uint8_t max_ch_groups)
|
||||
{
|
||||
uint16_t i;
|
||||
int err;
|
||||
struct iwm_phy_db_entry *entry;
|
||||
|
||||
/* Send all the channel-specific groups to operational fw */
|
||||
/* Send all the channel specific groups to operational fw */
|
||||
for (i = 0; i < max_ch_groups; i++) {
|
||||
entry = iwm_phy_db_get_section(sc, type, i);
|
||||
entry = iwm_phy_db_get_section(phy_db,
|
||||
type,
|
||||
i);
|
||||
if (!entry)
|
||||
return EINVAL;
|
||||
|
||||
@ -365,16 +520,18 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc,
|
||||
continue;
|
||||
|
||||
/* Send the requested PHY DB section */
|
||||
err = iwm_send_phy_db_cmd(sc, type, entry->size, entry->data);
|
||||
err = iwm_send_phy_db_cmd(phy_db,
|
||||
type,
|
||||
entry->size,
|
||||
entry->data);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD,
|
||||
"%s: Can't SEND phy_db section %d (%d), "
|
||||
"err %d\n", __func__, type, i, err);
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"Can't SEND phy_db section %d (%d), err %d\n",
|
||||
type, i, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
DELAY(1000);
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD,
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD,
|
||||
"Sent PHY_DB HCMD, type = %d num = %d\n", type, i);
|
||||
}
|
||||
|
||||
@ -382,102 +539,73 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc,
|
||||
}
|
||||
|
||||
int
|
||||
iwm_send_phy_db_data(struct iwm_softc *sc)
|
||||
iwm_send_phy_db_data(struct iwm_phy_db *phy_db)
|
||||
{
|
||||
uint8_t *data = NULL;
|
||||
uint16_t size = 0;
|
||||
int err;
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
"%s: Sending phy db data and configuration to runtime image\n",
|
||||
__func__);
|
||||
|
||||
/* Send PHY DB CFG section */
|
||||
err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CFG, &data, &size, 0);
|
||||
err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CFG,
|
||||
&data, &size, 0);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot get Phy DB cfg section, %d\n",
|
||||
__func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CFG, size, data);
|
||||
err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CFG, size, data);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot send HCMD of Phy DB cfg section, %d\n",
|
||||
__func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CALIB_NCH,
|
||||
err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CALIB_NCH,
|
||||
&data, &size, 0);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot get Phy DB non specific channel section, "
|
||||
"%d\n", __func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CALIB_NCH, size, data);
|
||||
err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CALIB_NCH, size, data);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot send HCMD of Phy DB non specific channel "
|
||||
"sect, %d\n", __func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Send all the TXP channel specific data */
|
||||
err = iwm_phy_db_send_all_channel_groups(sc,
|
||||
IWM_PHY_DB_CALIB_CHG_PAPD, IWM_NUM_PAPD_CH_GROUPS);
|
||||
err = iwm_phy_db_send_all_channel_groups(phy_db,
|
||||
IWM_PHY_DB_CALIB_CHG_PAPD, phy_db->n_group_papd);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot send channel specific PAPD groups, %d\n",
|
||||
__func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Send all the TXP channel specific data */
|
||||
err = iwm_phy_db_send_all_channel_groups(sc,
|
||||
IWM_PHY_DB_CALIB_CHG_TXP, IWM_NUM_TXP_CH_GROUPS);
|
||||
err = iwm_phy_db_send_all_channel_groups(phy_db,
|
||||
IWM_PHY_DB_CALIB_CHG_TXP, phy_db->n_group_txp);
|
||||
if (err) {
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
device_printf(phy_db->sc->sc_dev,
|
||||
"%s: Cannot send channel specific TX power groups, "
|
||||
"%d\n", __func__, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET,
|
||||
"%s: Finished sending phy db non channel data\n",
|
||||
__func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
iwm_phy_db_free_section(struct iwm_softc *sc,
|
||||
enum iwm_phy_db_section_type type, uint16_t chg_id)
|
||||
{
|
||||
struct iwm_phy_db_entry *entry =
|
||||
iwm_phy_db_get_section(sc, type, chg_id);
|
||||
if (!entry)
|
||||
return;
|
||||
|
||||
if (entry->data != NULL)
|
||||
free(entry->data, M_DEVBUF);
|
||||
entry->data = NULL;
|
||||
entry->size = 0;
|
||||
}
|
||||
|
||||
void
|
||||
iwm_phy_db_free(struct iwm_softc *sc)
|
||||
{
|
||||
int i;
|
||||
|
||||
iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0);
|
||||
iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0);
|
||||
|
||||
for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++)
|
||||
iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i);
|
||||
|
||||
for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++)
|
||||
iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i);
|
||||
}
|
||||
|
@ -106,8 +106,12 @@
|
||||
#ifndef __IF_IWM_PHY_DB_H__
|
||||
#define __IF_IWM_PHY_DB_H__
|
||||
|
||||
extern int iwm_phy_db_set_section(struct iwm_softc *sc,
|
||||
struct iwm_calib_res_notif_phy_db *phy_db_notif);
|
||||
extern int iwm_send_phy_db_data(struct iwm_softc *sc);
|
||||
extern void iwm_phy_db_free(struct iwm_softc *sc);
|
||||
struct iwm_calib_res_notif_phy_db;
|
||||
|
||||
extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc);
|
||||
extern void iwm_phy_db_free(struct iwm_phy_db *phy_db);
|
||||
extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db,
|
||||
struct iwm_rx_packet *pkt);
|
||||
extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db);
|
||||
|
||||
#endif /* __IF_IWM_PHY_DB_H__ */
|
||||
|
@ -172,7 +172,7 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc)
|
||||
uint16_t rx_chain;
|
||||
uint8_t rx_ant;
|
||||
|
||||
rx_ant = iwm_fw_valid_rx_ant(sc);
|
||||
rx_ant = iwm_mvm_get_valid_rx_ant(sc);
|
||||
rx_chain = rx_ant << IWM_PHY_RX_CHAIN_VALID_POS;
|
||||
rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_MIMO_SEL_POS;
|
||||
rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_SEL_POS;
|
||||
@ -209,7 +209,7 @@ iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int flags, int no_cck)
|
||||
for (i = 0, ind = sc->sc_scan_last_antenna;
|
||||
i < IWM_RATE_MCS_ANT_NUM; i++) {
|
||||
ind = (ind + 1) % IWM_RATE_MCS_ANT_NUM;
|
||||
if (iwm_fw_valid_tx_ant(sc) & (1 << ind)) {
|
||||
if (iwm_mvm_get_valid_tx_ant(sc) & (1 << ind)) {
|
||||
sc->sc_scan_last_antenna = ind;
|
||||
break;
|
||||
}
|
||||
@ -407,7 +407,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iwm_scan_probe_req *preq)
|
||||
remain -= 3;
|
||||
}
|
||||
|
||||
if (sc->sc_nvm.sku_cap_band_52GHz_enable) {
|
||||
if (sc->nvm_data->sku_cap_band_52GHz_enable) {
|
||||
/* Fill in 5GHz IEs. */
|
||||
rs = &ic->ic_sup_rates[IEEE80211_MODE_11A];
|
||||
if (rs->rs_nrates > IEEE80211_RATE_SIZE) {
|
||||
@ -469,8 +469,8 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc)
|
||||
if (scan_config == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
scan_config->tx_chains = htole32(iwm_fw_valid_tx_ant(sc));
|
||||
scan_config->rx_chains = htole32(iwm_fw_valid_rx_ant(sc));
|
||||
scan_config->tx_chains = htole32(iwm_mvm_get_valid_tx_ant(sc));
|
||||
scan_config->rx_chains = htole32(iwm_mvm_get_valid_rx_ant(sc));
|
||||
scan_config->legacy_rates = htole32(rates |
|
||||
IWM_SCAN_CONFIG_SUPPORTED_RATE(rates));
|
||||
|
||||
@ -674,7 +674,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc)
|
||||
req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED);
|
||||
|
||||
req->flags = htole32(IWM_PHY_BAND_24);
|
||||
if (sc->sc_nvm.sku_cap_band_52GHz_enable)
|
||||
if (sc->nvm_data->sku_cap_band_52GHz_enable)
|
||||
req->flags |= htole32(IWM_PHY_BAND_5);
|
||||
req->filter_flags =
|
||||
htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON);
|
||||
|
@ -428,31 +428,3 @@ iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd)
|
||||
sc->sc_wantresp = -1;
|
||||
wakeup(&sc->sc_wantresp);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
iwm_fw_valid_tx_ant(struct iwm_softc *sc)
|
||||
{
|
||||
uint8_t tx_ant;
|
||||
|
||||
tx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN)
|
||||
>> IWM_FW_PHY_CFG_TX_CHAIN_POS);
|
||||
|
||||
if (sc->sc_nvm.valid_tx_ant)
|
||||
tx_ant &= sc->sc_nvm.valid_tx_ant;
|
||||
|
||||
return tx_ant;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
iwm_fw_valid_rx_ant(struct iwm_softc *sc)
|
||||
{
|
||||
uint8_t rx_ant;
|
||||
|
||||
rx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RX_CHAIN)
|
||||
>> IWM_FW_PHY_CFG_RX_CHAIN_POS);
|
||||
|
||||
if (sc->sc_nvm.valid_rx_ant)
|
||||
rx_ant &= sc->sc_nvm.valid_rx_ant;
|
||||
|
||||
return rx_ant;
|
||||
}
|
||||
|
@ -116,7 +116,34 @@ extern int iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint8_t id,
|
||||
uint16_t len, const void *data, uint32_t *status);
|
||||
extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd);
|
||||
|
||||
extern uint8_t iwm_fw_valid_tx_ant(struct iwm_softc *sc);
|
||||
extern uint8_t iwm_fw_valid_rx_ant(struct iwm_softc *sc);
|
||||
static inline uint8_t
|
||||
iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc)
|
||||
{
|
||||
return sc->nvm_data && sc->nvm_data->valid_tx_ant ?
|
||||
sc->sc_fw.valid_tx_ant & sc->nvm_data->valid_tx_ant :
|
||||
sc->sc_fw.valid_tx_ant;
|
||||
}
|
||||
|
||||
static inline uint8_t
|
||||
iwm_mvm_get_valid_rx_ant(struct iwm_softc *sc)
|
||||
{
|
||||
return sc->nvm_data && sc->nvm_data->valid_rx_ant ?
|
||||
sc->sc_fw.valid_rx_ant & sc->nvm_data->valid_rx_ant :
|
||||
sc->sc_fw.valid_rx_ant;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
iwm_mvm_get_phy_config(struct iwm_softc *sc)
|
||||
{
|
||||
uint32_t phy_config = ~(IWM_FW_PHY_CFG_TX_CHAIN |
|
||||
IWM_FW_PHY_CFG_RX_CHAIN);
|
||||
uint32_t valid_rx_ant = iwm_mvm_get_valid_rx_ant(sc);
|
||||
uint32_t valid_tx_ant = iwm_mvm_get_valid_tx_ant(sc);
|
||||
|
||||
phy_config |= valid_tx_ant << IWM_FW_PHY_CFG_TX_CHAIN_POS |
|
||||
valid_rx_ant << IWM_FW_PHY_CFG_RX_CHAIN_POS;
|
||||
|
||||
return sc->sc_fw.phy_config & phy_config;
|
||||
}
|
||||
|
||||
#endif /* __IF_IWM_UTIL_H__ */
|
||||
|
@ -297,6 +297,16 @@
|
||||
#define IWM_CSR_HW_REV_DASH(_val) (((_val) & 0x0000003) >> 0)
|
||||
#define IWM_CSR_HW_REV_STEP(_val) (((_val) & 0x000000C) >> 2)
|
||||
|
||||
/**
|
||||
* hw_rev values
|
||||
*/
|
||||
enum {
|
||||
IWM_SILICON_A_STEP = 0,
|
||||
IWM_SILICON_B_STEP,
|
||||
IWM_SILICON_C_STEP,
|
||||
};
|
||||
|
||||
|
||||
#define IWM_CSR_HW_REV_TYPE_MSK (0x000FFF0)
|
||||
#define IWM_CSR_HW_REV_TYPE_5300 (0x0000020)
|
||||
#define IWM_CSR_HW_REV_TYPE_5350 (0x0000030)
|
||||
@ -878,6 +888,28 @@ struct iwm_fw_cipher_scheme {
|
||||
uint8_t hw_cipher;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* Block paging calculations
|
||||
*/
|
||||
#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */
|
||||
#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */
|
||||
#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3
|
||||
/* 8 pages per group */
|
||||
#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE)
|
||||
/* don't change, support only 32KB size */
|
||||
#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE)
|
||||
/* 32K == 2^15 */
|
||||
#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE)
|
||||
|
||||
/*
|
||||
* Image paging calculations
|
||||
*/
|
||||
#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5
|
||||
/* 2^5 == 32 blocks per image */
|
||||
#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE)
|
||||
/* maximum image size 1024KB */
|
||||
#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE)
|
||||
|
||||
/**
|
||||
* struct iwm_fw_cscheme_list - a cipher scheme list
|
||||
* @size: a number of entries
|
||||
@ -2003,45 +2035,6 @@ struct iwm_phy_cfg_cmd {
|
||||
#define IWM_PHY_CFG_RX_CHAIN_B (1 << 13)
|
||||
#define IWM_PHY_CFG_RX_CHAIN_C (1 << 14)
|
||||
|
||||
/*
|
||||
* PHY db
|
||||
*/
|
||||
|
||||
enum iwm_phy_db_section_type {
|
||||
IWM_PHY_DB_CFG = 1,
|
||||
IWM_PHY_DB_CALIB_NCH,
|
||||
IWM_PHY_DB_UNUSED,
|
||||
IWM_PHY_DB_CALIB_CHG_PAPD,
|
||||
IWM_PHY_DB_CALIB_CHG_TXP,
|
||||
IWM_PHY_DB_MAX
|
||||
};
|
||||
|
||||
#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */
|
||||
|
||||
/*
|
||||
* phy db - configure operational ucode
|
||||
*/
|
||||
struct iwm_phy_db_cmd {
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
uint8_t data[];
|
||||
} __packed;
|
||||
|
||||
/* for parsing of tx power channel group data that comes from the firmware */
|
||||
struct iwm_phy_db_chg_txp {
|
||||
uint32_t space;
|
||||
uint16_t max_channel_idx;
|
||||
} __packed;
|
||||
|
||||
/*
|
||||
* phy db - Receive phy db chunk after calibrations
|
||||
*/
|
||||
struct iwm_calib_res_notif_phy_db {
|
||||
uint16_t type;
|
||||
uint16_t length;
|
||||
uint8_t data[];
|
||||
} __packed;
|
||||
|
||||
|
||||
/* Target of the IWM_NVM_ACCESS_CMD */
|
||||
enum {
|
||||
@ -2052,18 +2045,13 @@ enum {
|
||||
|
||||
/* Section types for IWM_NVM_ACCESS_CMD */
|
||||
enum {
|
||||
IWM_NVM_SECTION_TYPE_HW = 0,
|
||||
IWM_NVM_SECTION_TYPE_SW,
|
||||
IWM_NVM_SECTION_TYPE_PAPD,
|
||||
IWM_NVM_SECTION_TYPE_REGULATORY,
|
||||
IWM_NVM_SECTION_TYPE_CALIBRATION,
|
||||
IWM_NVM_SECTION_TYPE_PRODUCTION,
|
||||
IWM_NVM_SECTION_TYPE_POST_FCS_CALIB,
|
||||
/* 7, 8, 9 unknown */
|
||||
IWM_NVM_SECTION_TYPE_HW_8000 = 10,
|
||||
IWM_NVM_SECTION_TYPE_MAC_OVERRIDE,
|
||||
IWM_NVM_SECTION_TYPE_PHY_SKU,
|
||||
IWM_NVM_NUM_OF_SECTIONS,
|
||||
IWM_NVM_SECTION_TYPE_SW = 1,
|
||||
IWM_NVM_SECTION_TYPE_REGULATORY = 3,
|
||||
IWM_NVM_SECTION_TYPE_CALIBRATION = 4,
|
||||
IWM_NVM_SECTION_TYPE_PRODUCTION = 5,
|
||||
IWM_NVM_SECTION_TYPE_MAC_OVERRIDE = 11,
|
||||
IWM_NVM_SECTION_TYPE_PHY_SKU = 12,
|
||||
IWM_NVM_MAX_NUM_SECTIONS = 13,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ struct iwm_tx_radiotap_header {
|
||||
(1 << IEEE80211_RADIOTAP_CHANNEL))
|
||||
|
||||
|
||||
#define IWM_UCODE_SECT_MAX 16
|
||||
#define IWM_UCODE_SECTION_MAX 16
|
||||
#define IWM_FWDMASEGSZ (192*1024)
|
||||
#define IWM_FWDMASEGSZ_8000 (320*1024)
|
||||
/* sanity check value */
|
||||
@ -152,11 +152,21 @@ struct iwm_tx_radiotap_header {
|
||||
#define IWM_FW_STATUS_INPROGRESS 1
|
||||
#define IWM_FW_STATUS_DONE 2
|
||||
|
||||
/**
|
||||
* enum iwm_ucode_type
|
||||
*
|
||||
* The type of ucode.
|
||||
*
|
||||
* @IWM_UCODE_REGULAR: Normal runtime ucode
|
||||
* @IWM_UCODE_INIT: Initial ucode
|
||||
* @IWM_UCODE_WOWLAN: Wake on Wireless enabled ucode
|
||||
* @IWM_UCODE_REGULAR_USNIFFER: Normal runtime ucode when using usniffer image
|
||||
*/
|
||||
enum iwm_ucode_type {
|
||||
IWM_UCODE_TYPE_REGULAR,
|
||||
IWM_UCODE_TYPE_INIT,
|
||||
IWM_UCODE_TYPE_WOW,
|
||||
IWM_UCODE_TYPE_REGULAR_USNIFFER,
|
||||
IWM_UCODE_REGULAR,
|
||||
IWM_UCODE_INIT,
|
||||
IWM_UCODE_WOWLAN,
|
||||
IWM_UCODE_REGULAR_USNIFFER,
|
||||
IWM_UCODE_TYPE_MAX
|
||||
};
|
||||
|
||||
@ -169,9 +179,14 @@ struct iwm_fw_info {
|
||||
const void *fws_data;
|
||||
uint32_t fws_len;
|
||||
uint32_t fws_devoff;
|
||||
} fw_sect[IWM_UCODE_SECT_MAX];
|
||||
} fw_sect[IWM_UCODE_SECTION_MAX];
|
||||
int fw_count;
|
||||
uint32_t paging_mem_size;
|
||||
} fw_sects[IWM_UCODE_TYPE_MAX];
|
||||
|
||||
uint32_t phy_config;
|
||||
uint8_t valid_tx_ant;
|
||||
uint8_t valid_rx_ant;
|
||||
};
|
||||
|
||||
struct iwm_nvm_data {
|
||||
@ -192,10 +207,10 @@ struct iwm_nvm_data {
|
||||
#define IWM_NUM_CHANNELS 39
|
||||
#define IWM_NUM_CHANNELS_8000 51
|
||||
|
||||
uint16_t nvm_ch_flags[IWM_NUM_CHANNELS_8000];
|
||||
|
||||
uint16_t nvm_version;
|
||||
uint8_t max_tx_pwr_half_dbm;
|
||||
|
||||
uint16_t nvm_ch_flags[];
|
||||
};
|
||||
|
||||
/* max bufs per tfd the driver will use */
|
||||
@ -291,10 +306,6 @@ struct iwm_ucode_status {
|
||||
|
||||
#define IWM_CMD_RESP_MAX PAGE_SIZE
|
||||
|
||||
/* lower blocks contain EEPROM image and calibration data */
|
||||
#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 16384
|
||||
#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 32768
|
||||
|
||||
#define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500
|
||||
#define IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS 400
|
||||
|
||||
@ -314,25 +325,6 @@ enum iwm_hcmd_dataflag {
|
||||
IWM_HCMD_DFL_DUP = (1 << 1),
|
||||
};
|
||||
|
||||
/*
|
||||
* iwlwifi/iwl-phy-db
|
||||
*/
|
||||
|
||||
#define IWM_NUM_PAPD_CH_GROUPS 9
|
||||
#define IWM_NUM_TXP_CH_GROUPS 9
|
||||
|
||||
struct iwm_phy_db_entry {
|
||||
uint16_t size;
|
||||
uint8_t *data;
|
||||
};
|
||||
|
||||
struct iwm_phy_db {
|
||||
struct iwm_phy_db_entry cfg;
|
||||
struct iwm_phy_db_entry calib_nch;
|
||||
struct iwm_phy_db_entry calib_ch_group_papd[IWM_NUM_PAPD_CH_GROUPS];
|
||||
struct iwm_phy_db_entry calib_ch_group_txp[IWM_NUM_TXP_CH_GROUPS];
|
||||
};
|
||||
|
||||
struct iwm_int_sta {
|
||||
uint32_t sta_id;
|
||||
uint32_t tfd_queue_msk;
|
||||
@ -385,9 +377,31 @@ struct iwm_node {
|
||||
#define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t))
|
||||
#define IWM_ICT_PADDR_SHIFT 12
|
||||
|
||||
enum iwm_device_family {
|
||||
IWM_DEVICE_FAMILY_UNDEFINED,
|
||||
IWM_DEVICE_FAMILY_7000,
|
||||
IWM_DEVICE_FAMILY_8000,
|
||||
};
|
||||
|
||||
/**
|
||||
* struct iwm_cfg
|
||||
* @fw_name: Firmware filename.
|
||||
* @host_interrupt_operation_mode: device needs host interrupt operation
|
||||
* mode set
|
||||
* @nvm_hw_section_num: the ID of the HW NVM section
|
||||
*/
|
||||
struct iwm_cfg {
|
||||
const char *fw_name;
|
||||
uint16_t eeprom_size;
|
||||
enum iwm_device_family device_family;
|
||||
int host_interrupt_operation_mode;
|
||||
uint8_t nvm_hw_section_num;
|
||||
};
|
||||
|
||||
struct iwm_softc {
|
||||
device_t sc_dev;
|
||||
uint32_t sc_debug;
|
||||
int sc_attached;
|
||||
|
||||
struct mtx sc_mtx;
|
||||
struct mbufq sc_snd;
|
||||
@ -432,20 +446,12 @@ struct iwm_softc {
|
||||
int ict_cur;
|
||||
|
||||
int sc_hw_rev;
|
||||
#define IWM_SILICON_A_STEP 0
|
||||
#define IWM_SILICON_B_STEP 1
|
||||
#define IWM_SILICON_C_STEP 2
|
||||
#define IWM_SILICON_D_STEP 3
|
||||
int sc_hw_id;
|
||||
int sc_device_family;
|
||||
#define IWM_DEVICE_FAMILY_7000 1
|
||||
#define IWM_DEVICE_FAMILY_8000 2
|
||||
|
||||
struct iwm_dma_info kw_dma;
|
||||
struct iwm_dma_info fw_dma;
|
||||
|
||||
int sc_fw_chunk_done;
|
||||
int sc_init_complete;
|
||||
|
||||
struct iwm_ucode_status sc_uc;
|
||||
enum iwm_ucode_type sc_uc_current;
|
||||
@ -471,14 +477,13 @@ struct iwm_softc {
|
||||
*/
|
||||
int sc_generation;
|
||||
|
||||
const char *sc_fwname;
|
||||
bus_size_t sc_fwdmasegsz;
|
||||
struct iwm_fw_info sc_fw;
|
||||
int sc_fw_phy_config;
|
||||
struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX];
|
||||
|
||||
struct iwm_nvm_data sc_nvm;
|
||||
struct iwm_phy_db sc_phy_db;
|
||||
const struct iwm_cfg *cfg;
|
||||
struct iwm_nvm_data *nvm_data;
|
||||
struct iwm_phy_db *sc_phy_db;
|
||||
|
||||
struct iwm_bf_data sc_bf;
|
||||
|
||||
@ -507,14 +512,14 @@ struct iwm_softc {
|
||||
struct iwm_notif_statistics sc_stats;
|
||||
int sc_noise;
|
||||
|
||||
int host_interrupt_operation_mode;
|
||||
|
||||
caddr_t sc_drvbpf;
|
||||
|
||||
struct iwm_rx_radiotap_header sc_rxtap;
|
||||
struct iwm_tx_radiotap_header sc_txtap;
|
||||
|
||||
int sc_max_rssi;
|
||||
|
||||
struct iwm_notif_wait_data *sc_notif_wait;
|
||||
};
|
||||
|
||||
#define IWM_LOCK_INIT(_sc) \
|
||||
|
@ -1123,6 +1123,9 @@ uftdi_attach(device_t dev)
|
||||
FTDI_SIO_SET_DATA_PARITY_NONE |
|
||||
FTDI_SIO_SET_DATA_BITS(8));
|
||||
|
||||
/* Indicate tx bits in sc_lsr can be used to determine busy vs idle. */
|
||||
ucom_use_lsr_txbits(&sc->sc_ucom);
|
||||
|
||||
error = ucom_attach(&sc->sc_super_ucom, &sc->sc_ucom, 1, sc,
|
||||
&uftdi_callback, &sc->sc_mtx);
|
||||
if (error) {
|
||||
@ -1279,16 +1282,20 @@ uftdi_read_callback(struct usb_xfer *xfer, usb_error_t error)
|
||||
offset = 0;
|
||||
/*
|
||||
* Extract packet headers and payload bytes from the buffer.
|
||||
* Feed payload bytes to ucom/tty layer; OR-accumulate header
|
||||
* status bits which are transient and could toggle with each
|
||||
* packet. After processing all packets in the buffer, process
|
||||
* the accumulated transient MSR and LSR values along with the
|
||||
* Feed payload bytes to ucom/tty layer; OR-accumulate the
|
||||
* receiver-related header status bits which are transient and
|
||||
* could toggle with each packet, but for transmitter-related
|
||||
* bits keep only the ones from the last packet.
|
||||
*
|
||||
* After processing all packets in the buffer, process the
|
||||
* accumulated transient MSR and LSR values along with the
|
||||
* non-transient bits from the last packet header.
|
||||
*/
|
||||
while (buflen >= UFTDI_IHDRSIZE) {
|
||||
usbd_copy_out(pc, offset, buf, UFTDI_IHDRSIZE);
|
||||
offset += UFTDI_IHDRSIZE;
|
||||
buflen -= UFTDI_IHDRSIZE;
|
||||
lsr &= ~(ULSR_TXRDY | ULSR_TSRE);
|
||||
lsr |= FTDI_GET_LSR(buf);
|
||||
if (FTDI_GET_MSR(buf) & FTDI_SIO_RI_MASK)
|
||||
msr |= SER_RI;
|
||||
@ -1311,8 +1318,7 @@ uftdi_read_callback(struct usb_xfer *xfer, usb_error_t error)
|
||||
if (ftdi_msr & FTDI_SIO_RLSD_MASK)
|
||||
msr |= SER_DCD;
|
||||
|
||||
if ((sc->sc_msr != msr) ||
|
||||
((sc->sc_lsr & FTDI_LSR_MASK) != (lsr & FTDI_LSR_MASK))) {
|
||||
if (sc->sc_msr != msr || sc->sc_lsr != lsr) {
|
||||
DPRINTF("status change msr=0x%02x (0x%02x) "
|
||||
"lsr=0x%02x (0x%02x)\n", msr, sc->sc_msr,
|
||||
lsr, sc->sc_lsr);
|
||||
|
@ -161,6 +161,7 @@ static tsw_param_t ucom_param;
|
||||
static tsw_outwakeup_t ucom_outwakeup;
|
||||
static tsw_inwakeup_t ucom_inwakeup;
|
||||
static tsw_free_t ucom_free;
|
||||
static tsw_busy_t ucom_busy;
|
||||
|
||||
static struct ttydevsw ucom_class = {
|
||||
.tsw_flags = TF_INITLOCK | TF_CALLOUT,
|
||||
@ -172,6 +173,7 @@ static struct ttydevsw ucom_class = {
|
||||
.tsw_param = ucom_param,
|
||||
.tsw_modem = ucom_modem,
|
||||
.tsw_free = ucom_free,
|
||||
.tsw_busy = ucom_busy,
|
||||
};
|
||||
|
||||
MODULE_DEPEND(ucom, usb, 1, 1, 1);
|
||||
@ -1294,6 +1296,27 @@ ucom_outwakeup(struct tty *tp)
|
||||
ucom_start_transfers(sc);
|
||||
}
|
||||
|
||||
static bool
|
||||
ucom_busy(struct tty *tp)
|
||||
{
|
||||
struct ucom_softc *sc = tty_softc(tp);
|
||||
const uint8_t txidle = ULSR_TXRDY | ULSR_TSRE;
|
||||
|
||||
UCOM_MTX_ASSERT(sc, MA_OWNED);
|
||||
|
||||
DPRINTFN(3, "sc = %p lsr 0x%02x\n", sc, sc->sc_lsr);
|
||||
|
||||
/*
|
||||
* If the driver maintains the txidle bits in LSR, we can use them to
|
||||
* determine whether the transmitter is busy or idle. Otherwise we have
|
||||
* to assume it is idle to avoid hanging forever on tcdrain(3).
|
||||
*/
|
||||
if (sc->sc_flag & UCOM_FLAG_LSRTXIDLE)
|
||||
return ((sc->sc_lsr & txidle) != txidle);
|
||||
else
|
||||
return (false);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
* ucom_get_data
|
||||
*
|
||||
|
@ -180,6 +180,7 @@ struct ucom_softc {
|
||||
#define UCOM_FLAG_WAIT_REFS 0x0100 /* set if we must wait for refs */
|
||||
#define UCOM_FLAG_FREE_UNIT 0x0200 /* set if we must free the unit */
|
||||
#define UCOM_FLAG_INWAKEUP 0x0400 /* set if we are in the tsw_inwakeup callback */
|
||||
#define UCOM_FLAG_LSRTXIDLE 0x0800 /* set if sc_lsr bits ULSR_TSRE+TXRDY work */
|
||||
uint8_t sc_lsr;
|
||||
uint8_t sc_msr;
|
||||
uint8_t sc_mcr;
|
||||
@ -218,4 +219,12 @@ void ucom_drain(struct ucom_super_softc *);
|
||||
void ucom_drain_all(void *);
|
||||
void ucom_ref(struct ucom_super_softc *);
|
||||
int ucom_unref(struct ucom_super_softc *);
|
||||
|
||||
static inline void
|
||||
ucom_use_lsr_txbits(struct ucom_softc *sc)
|
||||
{
|
||||
|
||||
sc->sc_flag |= UCOM_FLAG_LSRTXIDLE;
|
||||
}
|
||||
|
||||
#endif /* _USB_SERIAL_H_ */
|
||||
|
@ -109,19 +109,52 @@ DUMMY(inotify_init1);
|
||||
/* linux 2.6.30: */
|
||||
DUMMY(preadv);
|
||||
DUMMY(pwritev);
|
||||
/* linux 2.6.31 */
|
||||
DUMMY(rt_tsigqueueinfo);
|
||||
/* linux 2.6.31: */
|
||||
DUMMY(rt_tgsigqueueinfo);
|
||||
DUMMY(perf_event_open);
|
||||
/* linux 2.6.33: */
|
||||
DUMMY(fanotify_init);
|
||||
DUMMY(fanotify_mark);
|
||||
/* later: */
|
||||
/* linux 2.6.39: */
|
||||
DUMMY(name_to_handle_at);
|
||||
DUMMY(open_by_handle_at);
|
||||
DUMMY(clock_adjtime);
|
||||
/* linux 3.0: */
|
||||
DUMMY(setns);
|
||||
/* linux 3.2: */
|
||||
DUMMY(process_vm_readv);
|
||||
DUMMY(process_vm_writev);
|
||||
/* linux 3.5: */
|
||||
DUMMY(kcmp);
|
||||
/* linux 3.8: */
|
||||
DUMMY(finit_module);
|
||||
DUMMY(sched_setattr);
|
||||
DUMMY(sched_getattr);
|
||||
/* linux 3.14: */
|
||||
DUMMY(renameat2);
|
||||
/* linux 3.15: */
|
||||
DUMMY(seccomp);
|
||||
DUMMY(getrandom);
|
||||
DUMMY(memfd_create);
|
||||
/* linux 3.18: */
|
||||
DUMMY(bpf);
|
||||
/* linux 3.19: */
|
||||
DUMMY(execveat);
|
||||
/* linux 4.2: */
|
||||
DUMMY(userfaultfd);
|
||||
/* linux 4.3: */
|
||||
DUMMY(membarrier);
|
||||
/* linux 4.4: */
|
||||
DUMMY(mlock2);
|
||||
/* linux 4.5: */
|
||||
DUMMY(copy_file_range);
|
||||
/* linux 4.6: */
|
||||
DUMMY(preadv2);
|
||||
DUMMY(pwritev2);
|
||||
/* linux 4.8: */
|
||||
DUMMY(pkey_mprotect);
|
||||
DUMMY(pkey_alloc);
|
||||
DUMMY(pkey_free);
|
||||
|
||||
#define DUMMY_XATTR(s) \
|
||||
int \
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user