Merge ^/head r284737 through r285152.
This commit is contained in:
commit
6f44bd3256
@ -1,5 +1,6 @@
|
||||
{
|
||||
"project.name": "S",
|
||||
"repository.callsign" : "S",
|
||||
"phabricator.uri" : "https://reviews.freebsd.org/",
|
||||
"history.immutable" : true
|
||||
}
|
||||
|
4
Makefile
4
Makefile
@ -102,7 +102,7 @@
|
||||
|
||||
# Note: we use this awkward construct to be compatible with FreeBSD's
|
||||
# old make used in 10.0 and 9.2 and earlier.
|
||||
.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes"
|
||||
.if defined(MK_META_MODE) && ${MK_META_MODE} == "yes" && !make(showconfig)
|
||||
# targets/Makefile plays the role of top-level
|
||||
.include "targets/Makefile"
|
||||
.else
|
||||
@ -538,7 +538,9 @@ MK_META_MODE= no
|
||||
MK_STAGING= no
|
||||
# tell meta.autodep.mk to not even think about updating anything.
|
||||
UPDATE_DEPENDFILE= NO
|
||||
.if !make(showconfig)
|
||||
.export MK_META_MODE MK_STAGING UPDATE_DEPENDFILE
|
||||
.endif
|
||||
|
||||
.if make(universe)
|
||||
# we do not want a failure of one branch abort all.
|
||||
|
@ -297,7 +297,6 @@ KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
|
||||
|
||||
# world stage
|
||||
WMAKEENV= ${CROSSENV} \
|
||||
_SHLIBDIRPREFIX=${WORLDTMP} \
|
||||
_LDSCRIPTROOT= \
|
||||
VERSION="${VERSION}" \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
@ -439,7 +438,6 @@ LIB32FLAGS+= --sysroot=${WORLDTMP}
|
||||
|
||||
# Yes, the flags are redundant.
|
||||
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${LIB32_OBJTREE} \
|
||||
_SHLIBDIRPREFIX=${LIB32TMP} \
|
||||
_LDSCRIPTROOT=${LIB32TMP} \
|
||||
VERSION="${VERSION}" \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
||||
@ -1768,9 +1766,9 @@ cddl/lib/libctf__L: lib/libz__L
|
||||
.endif
|
||||
# cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built
|
||||
# on select architectures though (see cddl/lib/Makefile)
|
||||
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
|
||||
${MACHINE_CPUARCH} == "arm"
|
||||
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
|
||||
${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc"
|
||||
_prebuild_libs+= lib/libproc lib/librtld_db
|
||||
.endif
|
||||
|
||||
@ -2123,7 +2121,6 @@ XDTP?=/usr/${XDDIR}
|
||||
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
|
||||
INSTALL="sh ${.CURDIR}/tools/install.sh"
|
||||
CDENV= ${CDBENV} \
|
||||
_SHLIBDIRPREFIX=${XDDESTDIR} \
|
||||
TOOLS_PREFIX=${XDTP}
|
||||
CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
|
||||
--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
|
||||
|
@ -99,6 +99,72 @@ OLD_FILES+=usr/lib/clang/3.6.1/lib/freebsd/libclang_rt.ubsan_cxx-x86_64.a
|
||||
OLD_DIRS+=usr/lib/clang/3.6.1/lib/freebsd
|
||||
OLD_DIRS+=usr/lib/clang/3.6.1/lib
|
||||
OLD_DIRS+=usr/lib/clang/3.6.1
|
||||
# 20150604: Move nvlist man pages to section 9.
|
||||
OLD_FILES+=usr/share/man/man3/libnv.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_stringf.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_add_stringv.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_clone.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_create.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_destroy.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_dump.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_empty.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_error.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_exists_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_fdump.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_flags.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_null.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_free_type.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_parent.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_get_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_move_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_move_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_move_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_move_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_next.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_pack.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_recv.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_send.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_set_error.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_size.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_binary.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_bool.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_descriptor.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_number.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_nvlist.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_take_string.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_unpack.3.gz
|
||||
OLD_FILES+=usr/share/man/man3/nvlist_xfer.3.gz
|
||||
# 20150702: Remove duplicated nvlist includes.
|
||||
OLD_FILES+=usr/include/dnv.h
|
||||
OLD_FILES+=usr/include/nv.h
|
||||
# 20150528: PCI IOV device driver methods moved to a separate kobj interface.
|
||||
OLD_FILES+=usr/share/man/man9/PCI_ADD_VF.9.gz
|
||||
OLD_FILES+=usr/share/man/man9/PCI_INIT_IOV.9.gz
|
||||
@ -1081,6 +1147,7 @@ OLD_FILES+=usr/include/lwres/net.h
|
||||
OLD_FILES+=usr/include/lwres/netdb.h
|
||||
OLD_FILES+=usr/include/lwres/platform.h
|
||||
OLD_FILES+=usr/include/lwres/result.h
|
||||
OLD_FILES+=usr/include/lwres/string.h
|
||||
OLD_FILES+=usr/include/lwres/version.h
|
||||
OLD_FILES+=usr/lib/liblwres.a
|
||||
OLD_FILES+=usr/lib/liblwres.so
|
||||
|
48
UPDATING
48
UPDATING
@ -36,23 +36,45 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
|
||||
20141231 entry below for information about prerequisites and upgrading,
|
||||
if you are not already using 3.5.0 or higher.
|
||||
|
||||
20150616:
|
||||
/etc/make.conf now included earlier.
|
||||
sys.mk now includes /etc/make.conf and {local,src}.sys.mk earlier
|
||||
than previously.
|
||||
This makes it simple to interpose external toolchains etc.
|
||||
However it may cause problems for users who have things like::
|
||||
20150630:
|
||||
The default kernel entropy-processing algorithm is now
|
||||
Fortuna, replacing Yarrow.
|
||||
|
||||
INSTALL+= something
|
||||
Assuming you have 'device random' in your kernel config
|
||||
file, the configurations allow a kernel option to override
|
||||
this default. You may choose *ONE* of:
|
||||
|
||||
in /etc/make.conf, since INSTALL is not yet defined.
|
||||
A safe fix for that is to have::
|
||||
options RANDOM_YARROW # Legacy /dev/random algorithm.
|
||||
options RANDOM_DUMMY # Blocking-only driver.
|
||||
|
||||
INSTALL?= install
|
||||
INSTALL+= something
|
||||
If you have neither, you get Fortuna. For most people,
|
||||
read no further, Fortuna will give a /dev/random that works
|
||||
like it always used to, and the difference will be irrelevant.
|
||||
|
||||
If you remove 'device random', you get *NO* kernel-processed
|
||||
entopy at all. This may be acceptable to folks building
|
||||
embedded systems, but has complications. Carry on reading,
|
||||
and it is assumed you know what you need.
|
||||
|
||||
*PLEASE* read random(4) and random(9) if you are in the
|
||||
habit of tweeking kernel configs, and/or if you are a member
|
||||
of the embedded community, wanting specific and not-usual
|
||||
behaviour from your security subsystems.
|
||||
|
||||
NOTE!! If you use RANDOM_DUMMY and/or have no 'device
|
||||
random', you will NOT have a functioning /dev/random, and
|
||||
many cryptographic features will not work, including SSH.
|
||||
You may also find strange behaviour from the random(3) set
|
||||
of library functions, in particular sranddev(3), srandomdev(3)
|
||||
and arc4random(3). The reason for this is that the KERN_ARND
|
||||
sysctl only returns entropy if it thinks it has some to
|
||||
share, and with RANDOM_DUMMY or no 'device random' this
|
||||
will never happen.
|
||||
|
||||
20150623:
|
||||
An additional fix for the issue described in the 20150614 sendmail
|
||||
entry below has been been committed in revision 284717.
|
||||
|
||||
which is equivalent to previous behavior.
|
||||
|
||||
20150616:
|
||||
FreeBSD's old make (fmake) has been removed from the system. It is
|
||||
available as the devel/fmake port or via pkg install fmake.
|
||||
|
@ -122,7 +122,7 @@ main(int argc, char *argv[])
|
||||
*/
|
||||
if (stat(argv[argc - 1], &sb) || !S_ISDIR(sb.st_mode)) {
|
||||
if (argc > 2)
|
||||
usage();
|
||||
errx(1, "%s is not a directory", argv[argc - 1]);
|
||||
exit(do_move(argv[0], argv[1]));
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ hashalias(const char *p)
|
||||
{
|
||||
unsigned int hashval;
|
||||
|
||||
hashval = *p << 4;
|
||||
hashval = (unsigned char)*p << 4;
|
||||
while (*p)
|
||||
hashval+= *p++;
|
||||
return &atab[hashval % ATABSIZE];
|
||||
|
@ -522,17 +522,16 @@ static struct tblentry **lastcmdentry;
|
||||
static struct tblentry *
|
||||
cmdlookup(const char *name, int add)
|
||||
{
|
||||
int hashval;
|
||||
unsigned int hashval;
|
||||
const char *p;
|
||||
struct tblentry *cmdp;
|
||||
struct tblentry **pp;
|
||||
size_t len;
|
||||
|
||||
p = name;
|
||||
hashval = *p << 4;
|
||||
hashval = (unsigned char)*p << 4;
|
||||
while (*p)
|
||||
hashval += *p++;
|
||||
hashval &= 0x7FFF;
|
||||
pp = &cmdtable[hashval % CMDTABLESIZE];
|
||||
for (cmdp = *pp ; cmdp ; cmdp = cmdp->next) {
|
||||
if (equal(cmdp->cmdname, name))
|
||||
|
139
cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c
Normal file
139
cddl/contrib/opensolaris/lib/libdtrace/aarch64/dt_isadep.c
Normal file
@ -0,0 +1,139 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License, Version 1.0 only
|
||||
* (the "License"). You may not use this file except in compliance
|
||||
* with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
* Copyright 2014 Howard Su
|
||||
* Copyright 2015 George V. Neville-Neil
|
||||
* Copyright 2015 Ruslan Bukin <br@bsdpad.com>
|
||||
*/
|
||||
|
||||
#pragma ident "%Z%%M% %I% %E% SMI"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <libgen.h>
|
||||
|
||||
#include <dt_impl.h>
|
||||
#include <dt_pid.h>
|
||||
|
||||
#if !defined(sun)
|
||||
#include <libproc_compat.h>
|
||||
#endif
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
|
||||
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp)
|
||||
{
|
||||
|
||||
ftp->ftps_type = DTFTP_ENTRY;
|
||||
ftp->ftps_pc = (uintptr_t)symp->st_value;
|
||||
ftp->ftps_size = (size_t)symp->st_size;
|
||||
ftp->ftps_noffs = 1;
|
||||
ftp->ftps_offs[0] = 0;
|
||||
|
||||
if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
|
||||
dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
|
||||
strerror(errno));
|
||||
return (dt_set_errno(dtp, errno));
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
int
|
||||
dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
|
||||
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret)
|
||||
{
|
||||
|
||||
dt_dprintf("%s: unimplemented\n", __func__);
|
||||
|
||||
return (DT_PROC_ERR);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
|
||||
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off)
|
||||
{
|
||||
|
||||
if (!ALIGNED_POINTER(off, 4))
|
||||
return (DT_PROC_ALIGN);
|
||||
|
||||
ftp->ftps_type = DTFTP_OFFSETS;
|
||||
ftp->ftps_pc = (uintptr_t)symp->st_value;
|
||||
ftp->ftps_size = (size_t)symp->st_size;
|
||||
ftp->ftps_noffs = 1;
|
||||
ftp->ftps_offs[0] = off;
|
||||
|
||||
if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
|
||||
dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
|
||||
strerror(errno));
|
||||
return (dt_set_errno(dtp, errno));
|
||||
}
|
||||
|
||||
return (1);
|
||||
}
|
||||
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
|
||||
fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern)
|
||||
{
|
||||
ulong_t i;
|
||||
|
||||
ftp->ftps_type = DTFTP_OFFSETS;
|
||||
ftp->ftps_pc = (uintptr_t)symp->st_value;
|
||||
ftp->ftps_size = (size_t)symp->st_size;
|
||||
ftp->ftps_noffs = 0;
|
||||
|
||||
/*
|
||||
* If we're matching against everything, just iterate through each
|
||||
* instruction in the function, otherwise look for matching offset
|
||||
* names by constructing the string and comparing it against the
|
||||
* pattern.
|
||||
*/
|
||||
if (strcmp("*", pattern) == 0) {
|
||||
for (i = 0; i < symp->st_size; i += 4) {
|
||||
ftp->ftps_offs[ftp->ftps_noffs++] = i;
|
||||
}
|
||||
} else {
|
||||
char name[sizeof (i) * 2 + 1];
|
||||
|
||||
for (i = 0; i < symp->st_size; i += 4) {
|
||||
(void) sprintf(name, "%lx", i);
|
||||
if (gmatch(name, pattern))
|
||||
ftp->ftps_offs[ftp->ftps_noffs++] = i;
|
||||
}
|
||||
}
|
||||
|
||||
if (ioctl(dtp->dt_ftfd, FASTTRAPIOC_MAKEPROBE, ftp) != 0) {
|
||||
dt_dprintf("fasttrap probe creation ioctl failed: %s\n",
|
||||
strerror(errno));
|
||||
return (dt_set_errno(dtp, errno));
|
||||
}
|
||||
|
||||
return (ftp->ftps_noffs);
|
||||
}
|
@ -227,7 +227,10 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf32_t *dep)
|
||||
s = &dofs[dofrh->dofr_tgtsec];
|
||||
|
||||
for (j = 0; j < nrel; j++) {
|
||||
#if defined(__arm__)
|
||||
#if defined(__aarch64__)
|
||||
/* XXX */
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
#elif defined(__arm__)
|
||||
/* XXX */
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
#elif defined(__i386) || defined(__amd64)
|
||||
@ -426,7 +429,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, dof_elf64_t *dep)
|
||||
s = &dofs[dofrh->dofr_tgtsec];
|
||||
|
||||
for (j = 0; j < nrel; j++) {
|
||||
#if defined(__arm__)
|
||||
#if defined(__aarch64__)
|
||||
/* XXX */
|
||||
#elif defined(__arm__)
|
||||
/* XXX */
|
||||
#elif defined(__mips__)
|
||||
/* XXX */
|
||||
@ -822,7 +827,16 @@ dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr_t addr, uint_t shn,
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#if defined(__arm__)
|
||||
#if defined(__aarch64__)
|
||||
/* XXX */
|
||||
static int
|
||||
dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
|
||||
uint32_t *off)
|
||||
{
|
||||
printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__);
|
||||
return (0);
|
||||
}
|
||||
#elif defined(__arm__)
|
||||
/* XXX */
|
||||
static int
|
||||
dt_modtext(dtrace_hdl_t *dtp, char *p, int isenabled, GElf_Rela *rela,
|
||||
|
@ -26,9 +26,9 @@ _libzpool= libzpool
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc" || \
|
||||
${MACHINE_CPUARCH} == "arm"
|
||||
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_ARCH} == "amd64" || \
|
||||
${MACHINE_CPUARCH} == "arm" || ${MACHINE_ARCH} == "i386" || \
|
||||
${MACHINE_CPUARCH} == "mips" || ${MACHINE_CPUARCH} == "powerpc"
|
||||
_drti= drti
|
||||
_libdtrace= libdtrace
|
||||
.endif
|
||||
|
@ -69,27 +69,31 @@ CFLAGS+= -I${.OBJDIR} -I${.CURDIR} \
|
||||
|
||||
#CFLAGS+= -DYYDEBUG
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64"
|
||||
.if ${MACHINE_CPUARCH} == "aarch64"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/aarch64
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/aarch64
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/aarch64
|
||||
.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
|
||||
CFLAGS+= -I${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel -DDIS_MEM
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/i386
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/${MACHINE_ARCH}
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/x86
|
||||
.elif ${MACHINE_CPUARCH} == "sparc64"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc
|
||||
.elif ${MACHINE_CPUARCH} == "mips"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
|
||||
.elif ${MACHINE_CPUARCH} == "arm"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/arm
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/arm
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/arm
|
||||
.elif ${MACHINE_CPUARCH} == "mips"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/mips
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/mips
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/mips
|
||||
.elif ${MACHINE_CPUARCH} == "powerpc"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/powerpc
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/powerpc
|
||||
.PATH: ${.CURDIR}/../../../sys/cddl/dev/dtrace/powerpc
|
||||
.elif ${MACHINE_CPUARCH} == "sparc64"
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
|
||||
.PATH: ${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libdtrace/sparc
|
||||
.else
|
||||
# temporary hack
|
||||
CFLAGS+= -I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
|
||||
|
@ -30,7 +30,7 @@ _plockstat= plockstat
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
|
||||
_dtrace= dtrace
|
||||
_dtruss= dtruss
|
||||
_lockstat= lockstat
|
||||
|
@ -52,7 +52,7 @@
|
||||
# $SB/obj-i386/bsd/gnu/lib/csu
|
||||
# $SB/obj-i386/bsd/gnu/lib/libgcc
|
||||
# $SB/obj-i386/bsd/include
|
||||
# $SB/obj-i386/bsd/lib/csu/i386-elf
|
||||
# $SB/obj-i386/bsd/lib/csu/i386
|
||||
# $SB/obj-i386/bsd/lib/libc
|
||||
# $SB/src/bsd/include
|
||||
# $SB/src/bsd/sys/i386/include
|
||||
|
@ -1055,7 +1055,7 @@ void SCCPSolver::visitLoadInst(LoadInst &I) {
|
||||
|
||||
// load null -> null
|
||||
if (isa<ConstantPointerNull>(Ptr) && I.getPointerAddressSpace() == 0)
|
||||
return markConstant(IV, &I, Constant::getNullValue(I.getType()));
|
||||
return markConstant(IV, &I, UndefValue::get(I.getType()));
|
||||
|
||||
// Transform load (constant global) into the value loaded.
|
||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
|
||||
|
@ -86,7 +86,7 @@ static void ConnectProlog(Loop *L, Value *BECount, unsigned Count,
|
||||
if (L->contains(PN)) {
|
||||
NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH);
|
||||
} else {
|
||||
NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH);
|
||||
NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH);
|
||||
}
|
||||
|
||||
Value *V = PN->getIncomingValueForBlock(Latch);
|
||||
|
@ -0,0 +1,88 @@
|
||||
Pull in r241142 from upstream llvm trunk (by David Majnemer):
|
||||
|
||||
[SCCP] Turn loads of null into undef instead of zero initialized values
|
||||
|
||||
Surprisingly, this is a correctness issue: the mmx type exists for
|
||||
calling convention purposes, LLVM doesn't have a zero representation for
|
||||
them.
|
||||
|
||||
This partially fixes PR23999.
|
||||
|
||||
Pull in r241143 from upstream llvm trunk (by David Majnemer):
|
||||
|
||||
[LoopUnroll] Use undef for phis with no value live
|
||||
|
||||
We would create a phi node with a zero initialized operand instead of
|
||||
undef in the case where no value was originally available. This was
|
||||
problematic for x86_mmx which has no null value.
|
||||
|
||||
These fix a "Cannot create a null constant of that type!" error when
|
||||
compiling the graphics/sdl2_gfx port with MMX enabled.
|
||||
|
||||
Introduced here: http://svnweb.freebsd.org/changeset/base/285149
|
||||
|
||||
Index: lib/Transforms/Scalar/SCCP.cpp
|
||||
===================================================================
|
||||
--- lib/Transforms/Scalar/SCCP.cpp
|
||||
+++ lib/Transforms/Scalar/SCCP.cpp
|
||||
@@ -1054,7 +1054,7 @@
|
||||
|
||||
// load null -> null
|
||||
if (isa<ConstantPointerNull>(Ptr) && I.getPointerAddressSpace() == 0)
|
||||
- return markConstant(IV, &I, Constant::getNullValue(I.getType()));
|
||||
+ return markConstant(IV, &I, UndefValue::get(I.getType()));
|
||||
|
||||
// Transform load (constant global) into the value loaded.
|
||||
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(Ptr)) {
|
||||
Index: lib/Transforms/Utils/LoopUnrollRuntime.cpp
|
||||
===================================================================
|
||||
--- lib/Transforms/Utils/LoopUnrollRuntime.cpp
|
||||
+++ lib/Transforms/Utils/LoopUnrollRuntime.cpp
|
||||
@@ -81,7 +81,7 @@
|
||||
if (L->contains(PN)) {
|
||||
NewPN->addIncoming(PN->getIncomingValueForBlock(NewPH), OrigPH);
|
||||
} else {
|
||||
- NewPN->addIncoming(Constant::getNullValue(PN->getType()), OrigPH);
|
||||
+ NewPN->addIncoming(UndefValue::get(PN->getType()), OrigPH);
|
||||
}
|
||||
|
||||
Value *V = PN->getIncomingValueForBlock(Latch);
|
||||
Index: test/Transforms/LoopUnroll/X86/mmx.ll
|
||||
===================================================================
|
||||
--- test/Transforms/LoopUnroll/X86/mmx.ll
|
||||
+++ test/Transforms/LoopUnroll/X86/mmx.ll
|
||||
@@ -0,0 +1,21 @@
|
||||
+; RUN: opt < %s -S -loop-unroll | FileCheck %s
|
||||
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
||||
+target triple = "x86_64-unknown-linux-gnu"
|
||||
+
|
||||
+define x86_mmx @f() #0 {
|
||||
+entry:
|
||||
+ br label %for.body
|
||||
+
|
||||
+for.body: ; preds = %for.body, %entry
|
||||
+ %phi = phi i32 [ 1, %entry ], [ %add, %for.body ]
|
||||
+ %add = add i32 %phi, 1
|
||||
+ %cmp = icmp eq i32 %phi, 0
|
||||
+ br i1 %cmp, label %exit, label %for.body
|
||||
+
|
||||
+exit: ; preds = %for.body
|
||||
+ %ret = phi x86_mmx [ undef, %for.body ]
|
||||
+ ; CHECK: ret x86_mmx %ret
|
||||
+ ret x86_mmx %ret
|
||||
+}
|
||||
+
|
||||
+attributes #0 = { "target-cpu"="x86-64" }
|
||||
Index: test/Transforms/SCCP/crash.ll
|
||||
===================================================================
|
||||
--- test/Transforms/SCCP/crash.ll
|
||||
+++ test/Transforms/SCCP/crash.ll
|
||||
@@ -27,3 +27,8 @@
|
||||
%B = extractvalue [4 x i32] %A, 1
|
||||
ret i32 %B
|
||||
}
|
||||
+
|
||||
+define x86_mmx @test3() {
|
||||
+ %load = load x86_mmx* null
|
||||
+ ret x86_mmx %load
|
||||
+}
|
@ -125,9 +125,11 @@ By default,
|
||||
.Nm
|
||||
will use
|
||||
.Ar pflog0 .
|
||||
.It Fl p Ar pidfile
|
||||
Writes a file containing the process ID of the program to
|
||||
.Pa /var/run .
|
||||
The file name has the form
|
||||
.Ao Ar pidfile Ac Ns .pid .
|
||||
The default is
|
||||
.Ar pflogd .
|
||||
.It Fl s Ar snaplen
|
||||
|
@ -82,7 +82,7 @@ extern int SIZE_BUF;
|
||||
#include <libcapsicum.h>
|
||||
#include <libcapsicum_dns.h>
|
||||
#include <libcapsicum_service.h>
|
||||
#include <nv.h>
|
||||
#include <sys/nv.h>
|
||||
#include <sys/capability.h>
|
||||
#include <sys/ioccom.h>
|
||||
#include <net/bpf.h>
|
||||
|
@ -630,15 +630,16 @@ kern_securelevel="-1" # range: -1..3 ; `-1' is the most insecure
|
||||
# in the system booting with securelevel set to 1, as
|
||||
# init(8) will raise the level when rc(8) completes.
|
||||
update_motd="YES" # update version info in /etc/motd (or NO)
|
||||
entropy_file="/entropy" # Set to NO to disable caching entropy through reboots.
|
||||
entropy_boot_file="/boot/entropy" # Set to NO to disable very early
|
||||
# (used at early boot time) entropy caching through reboots.
|
||||
entropy_file="/entropy" # Set to NO to disable late (used when going multi-user)
|
||||
# entropy through reboots.
|
||||
# /var/db/entropy-file is preferred if / is not avail.
|
||||
entropy_dir="/var/db/entropy" # Set to NO to disable caching entropy via cron.
|
||||
entropy_save_sz="4096" # Size of the entropy cache files.
|
||||
entropy_save_num="8" # Number of entropy cache files to save.
|
||||
harvest_interrupt="YES" # Entropy device harvests interrupt randomness
|
||||
harvest_ethernet="YES" # Entropy device harvests ethernet randomness
|
||||
harvest_p_to_p="YES" # Entropy device harvests point-to-point randomness
|
||||
harvest_swi="YES" # Entropy device harvests internal SWI randomness
|
||||
harvest_mask="511" # Entropy device harvests all but the very invasive sources.
|
||||
# (See 'sysctl kern.random.harvest' and random(4))
|
||||
dmesg_enable="YES" # Save dmesg(8) to /var/run/dmesg.boot
|
||||
watchdogd_enable="NO" # Start the software watchdog daemon
|
||||
watchdogd_flags="" # Flags to watchdogd (if enabled)
|
||||
|
@ -27,7 +27,7 @@ run_iovctl()
|
||||
|
||||
iovctl_start()
|
||||
{
|
||||
run_iovctl -E
|
||||
run_iovctl -C
|
||||
}
|
||||
|
||||
iovctl_stop()
|
||||
|
@ -41,6 +41,13 @@ feed_dev_random()
|
||||
|
||||
random_start()
|
||||
{
|
||||
|
||||
if [ ${harvest_mask} -gt 0 ]; then
|
||||
echo -n 'Setting up harvesting:'
|
||||
${SYSCTL} kern.random.harvest.mask=${harvest_mask} > /dev/null
|
||||
${SYSCTL_N} kern.random.harvest.mask_symbolic
|
||||
fi
|
||||
|
||||
echo -n 'Feeding entropy:'
|
||||
|
||||
if [ ! -w /dev/random ] ; then
|
||||
@ -68,6 +75,14 @@ random_start()
|
||||
;;
|
||||
esac
|
||||
|
||||
case ${entropy_boot_file:=/boot/entropy} in
|
||||
[Nn][Oo] | '')
|
||||
;;
|
||||
*)
|
||||
save_dev_random "${entropy_boot_file}"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo '.'
|
||||
}
|
||||
|
||||
@ -100,7 +115,33 @@ random_stop()
|
||||
;;
|
||||
*)
|
||||
dd if=/dev/random of=${entropy_file_confirmed} \
|
||||
bs=4096 count=1 2> /dev/null
|
||||
bs=4096 count=1 2> /dev/null ||
|
||||
warn 'write failed (unwriteable file or full fs?)'
|
||||
echo '.'
|
||||
;;
|
||||
esac
|
||||
umask ${oumask}
|
||||
;;
|
||||
esac
|
||||
case ${entropy_boot_file:=/boot/entropy} in
|
||||
[Nn][Oo] | '')
|
||||
;;
|
||||
*)
|
||||
echo -n 'Writing early boot entropy file:'
|
||||
rm -f ${entropy_boot_file} 2> /dev/null
|
||||
oumask=`umask`
|
||||
umask 077
|
||||
if touch ${entropy_boot_file} 2> /dev/null; then
|
||||
entropy_boot_file_confirmed="${entropy_boot_file}"
|
||||
fi
|
||||
case ${entropy_boot_file_confirmed} in
|
||||
'')
|
||||
warn 'write failed (read-only fs?)'
|
||||
;;
|
||||
*)
|
||||
dd if=/dev/random of=${entropy_boot_file_confirmed} \
|
||||
bs=4096 count=1 2> /dev/null ||
|
||||
warn 'write failed (unwriteable file or full fs?)'
|
||||
echo '.'
|
||||
;;
|
||||
esac
|
||||
|
@ -291,14 +291,14 @@ case ${firewall_type} in
|
||||
fi
|
||||
fi
|
||||
|
||||
# define stuff we should never send out or receive in
|
||||
# Define stuff we should never send out or receive in.
|
||||
# Stop RFC1918 nets on the outside interface
|
||||
${fwcmd} table ${BAD_ADDR_TBL} flush
|
||||
${fwcmd} table ${BAD_ADDR_TBL} add 10.0.0.0/8
|
||||
${fwcmd} table ${BAD_ADDR_TBL} add 172.16.0.0/12
|
||||
${fwcmd} table ${BAD_ADDR_TBL} add 192.168.0.0/16
|
||||
|
||||
# Stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
|
||||
# And stop draft-manning-dsua-03.txt (1 May 2000) nets (includes RESERVED-1,
|
||||
# DHCP auto-configuration, NET-TEST, MULTICAST (class D), and class E)
|
||||
# on the outside interface
|
||||
${fwcmd} table ${BAD_ADDR_TBL} add 0.0.0.0/8
|
||||
|
@ -2365,6 +2365,8 @@ prosharerequest 5716/tcp #proshare conf request
|
||||
prosharerequest 5716/udp #proshare conf request
|
||||
prosharenotify 5717/tcp #proshare conf notify
|
||||
prosharenotify 5717/udp #proshare conf notify
|
||||
couchdb 5984/tcp #CouchDB database server
|
||||
couchdb 5984/udp #CouchDB database server
|
||||
cvsup 5999/tcp #CVSup file transfer/John Polstra/FreeBSD
|
||||
x11 6000/tcp #6000-6063 are assigned to X Window System
|
||||
x11 6000/udp
|
||||
|
@ -6727,7 +6727,7 @@ K is for Kate who was struck with an axe, L is for Leo who swallowed some tacks.
|
||||
M is for Maud who was swept out to sea, N is for Neville who died of ennui.
|
||||
O is for Olive, run through with an awl, P is for Prue, trampled flat in a brawl
|
||||
Q is for Quentin who sank in a mire, R is for Rhoda, consumed by a fire.
|
||||
S is for Susan who parished of fits, T is for Titus who flew into bits.
|
||||
S is for Susan who perished of fits, T is for Titus who flew into bits.
|
||||
U is for Una who slipped down a drain, V is for Victor, squashed under a train.
|
||||
W is for Winnie, embedded in ice, X is for Xerxes, devoured by mice.
|
||||
Y is for Yorick whose head was bashed in, Z is for Zillah who drank too much gin.
|
||||
|
@ -76,7 +76,7 @@ kvm_t *kvm;
|
||||
static char kvm_err[_POSIX2_LINE_MAX];
|
||||
|
||||
#define KERNOFF (kgdb_kernbase ())
|
||||
#define INKERNEL(x) ((x) >= KERNOFF)
|
||||
#define PINKERNEL(x) ((x) >= KERNOFF)
|
||||
|
||||
static CORE_ADDR
|
||||
kgdb_kernbase (void)
|
||||
@ -296,7 +296,7 @@ kgdb_set_proc_cmd (char *arg, int from_tty)
|
||||
|
||||
addr = (CORE_ADDR) parse_and_eval_address (arg);
|
||||
|
||||
if (!INKERNEL (addr)) {
|
||||
if (!PINKERNEL (addr)) {
|
||||
thr = kgdb_thr_lookup_pid((int)addr);
|
||||
if (thr == NULL)
|
||||
error ("invalid pid");
|
||||
@ -319,7 +319,7 @@ kgdb_set_tid_cmd (char *arg, int from_tty)
|
||||
|
||||
addr = (CORE_ADDR) parse_and_eval_address (arg);
|
||||
|
||||
if (kvm != NULL && INKERNEL (addr)) {
|
||||
if (kvm != NULL && PINKERNEL (addr)) {
|
||||
thr = kgdb_thr_lookup_taddr(addr);
|
||||
if (thr == NULL)
|
||||
error("invalid thread address");
|
||||
|
@ -396,6 +396,7 @@ int (dprintf)(int, const char * __restrict, ...);
|
||||
int asprintf(char **, const char *, ...) __printflike(2, 3);
|
||||
char *ctermid_r(char *);
|
||||
void fcloseall(void);
|
||||
int fdclose(FILE *, int *);
|
||||
char *fgetln(FILE *, size_t *);
|
||||
const char *fmtcheck(const char *, const char *) __format_arg(2);
|
||||
int fpurge(FILE *);
|
||||
|
@ -215,8 +215,9 @@ _libldns= libldns
|
||||
# sense to build when clang is enabled at all. Furthermore, they can only be
|
||||
# built for certain architectures.
|
||||
.if ${MK_CLANG} != "no" && ${COMPILER_TYPE} == "clang" && \
|
||||
(${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" || \
|
||||
(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb"))
|
||||
(${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
|
||||
(${MACHINE_CPUARCH} == "arm" && ${MACHINE_ARCH} != "armeb") || \
|
||||
(${MACHINE_CPUARCH} == "i386"))
|
||||
_libclang_rt= libclang_rt
|
||||
.endif
|
||||
|
||||
@ -273,7 +274,7 @@ _libsmb= libsmb
|
||||
_libsmb= libsmb
|
||||
.endif
|
||||
|
||||
.if ${MACHINE_CPUARCH} == "arm"
|
||||
.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
|
||||
_libsmb= libsmb
|
||||
_libproc= libproc
|
||||
_librtld_db= librtld_db
|
||||
|
@ -51,6 +51,8 @@ extern int eprol;
|
||||
extern int etext;
|
||||
#endif
|
||||
|
||||
extern long * _end;
|
||||
|
||||
void __start(int, char **, char **, void (*)(void));
|
||||
|
||||
/* The entry function. */
|
||||
@ -79,8 +81,17 @@ __start(int argc, char *argv[], char *env[], void (*cleanup)(void))
|
||||
|
||||
if (&_DYNAMIC != NULL)
|
||||
atexit(cleanup);
|
||||
else
|
||||
else {
|
||||
/*
|
||||
* Hack to resolve _end so we read the correct symbol.
|
||||
* Without this it will resolve to the copy in the library
|
||||
* that firsts requests it. We should fix the toolchain,
|
||||
* however this is is needed until this can take place.
|
||||
*/
|
||||
*(volatile long *)&_end;
|
||||
|
||||
_init_tls();
|
||||
}
|
||||
|
||||
#ifdef GCRT
|
||||
atexit(_mcleanup);
|
||||
|
@ -14,6 +14,9 @@ FBSD_1.0 {
|
||||
_setjmp;
|
||||
_longjmp;
|
||||
fabs;
|
||||
__flt_rounds;
|
||||
fpgetmask;
|
||||
fpsetmask;
|
||||
setjmp;
|
||||
longjmp;
|
||||
sigsetjmp;
|
||||
@ -25,6 +28,7 @@ FBSD_1.0 {
|
||||
|
||||
FBSDprivate_1.0 {
|
||||
_set_tp;
|
||||
_end;
|
||||
curbrk;
|
||||
minbrk;
|
||||
};
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
SRCS+= fabs.S \
|
||||
flt_rounds.c \
|
||||
fpgetmask.c \
|
||||
fpsetmask.c \
|
||||
ldexp.c \
|
||||
_setjmp.S \
|
||||
_set_tp.c \
|
||||
|
@ -59,8 +59,8 @@ ENTRY(_setjmp)
|
||||
/* Return value */
|
||||
mov x0, #0
|
||||
ret
|
||||
.Lmagic:
|
||||
.align 3
|
||||
.Lmagic:
|
||||
.quad _JB_MAGIC__SETJMP
|
||||
END(_setjmp)
|
||||
|
||||
|
47
lib/libc/aarch64/gen/fpgetmask.c
Normal file
47
lib/libc/aarch64/gen/fpgetmask.c
Normal file
@ -0,0 +1,47 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 The FreeBSD Foundation
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed by Andrew Turner under
|
||||
* sponsorship from the FreeBSD Foundation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP)
|
||||
|
||||
fp_except_t
|
||||
fpgetmask(void)
|
||||
{
|
||||
uint64_t mask;
|
||||
|
||||
/* Read the current mask */
|
||||
__asm __volatile("mrs %0, fpcr" : "=&r"(mask));
|
||||
|
||||
return (mask & FP_X_MASK);
|
||||
}
|
52
lib/libc/aarch64/gen/fpsetmask.c
Normal file
52
lib/libc/aarch64/gen/fpsetmask.c
Normal file
@ -0,0 +1,52 @@
|
||||
/*-
|
||||
* Copyright (c) 2015 The FreeBSD Foundation
|
||||
* All rights reserved.
|
||||
*
|
||||
* This software was developed by Andrew Turner under
|
||||
* sponsorship from the FreeBSD Foundation.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <ieeefp.h>
|
||||
|
||||
#define FP_X_MASK (FP_X_INV | FP_X_DZ | FP_X_OFL | FP_X_UFL | FP_X_IMP)
|
||||
|
||||
fp_except_t
|
||||
fpsetmask(fp_except_t mask)
|
||||
{
|
||||
uint64_t old, new;
|
||||
|
||||
mask &= FP_X_MASK;
|
||||
|
||||
/* Read the current mask */
|
||||
__asm __volatile("mrs %0, fpcr" : "=&r"(old));
|
||||
new = old & ~FP_X_MASK;
|
||||
new |= mask;
|
||||
__asm __volatile("msr fpcr, %0" :: "r"(new));
|
||||
|
||||
return ((fp_except_t)old);
|
||||
}
|
@ -69,8 +69,8 @@ ENTRY(setjmp)
|
||||
/* Return value */
|
||||
mov x0, #0
|
||||
ret
|
||||
.Lmagic:
|
||||
.align 3
|
||||
.Lmagic:
|
||||
.quad _JB_MAGIC_SETJMP
|
||||
END(setjmp)
|
||||
|
||||
|
@ -47,7 +47,7 @@ ENTRY(siglongjmp)
|
||||
cmp x2, x3
|
||||
b.eq _C_LABEL(_longjmp)
|
||||
b _C_LABEL(longjmp)
|
||||
.Lmagic:
|
||||
.align 3
|
||||
.Lmagic:
|
||||
.quad _JB_MAGIC__SETJMP
|
||||
END(siglongjmp)
|
||||
|
@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _C_LABEL(_end)
|
||||
|
||||
.data
|
||||
.align 3
|
||||
.globl _C_LABEL(minbrk)
|
||||
@ -47,15 +49,8 @@ ENTRY(_brk)
|
||||
WEAK_REFERENCE(_brk, brk)
|
||||
|
||||
/* Load the address of minbrk */
|
||||
#ifdef __PIC__
|
||||
adrp x2, :got:minbrk
|
||||
ldr x3, [x2, #:got_lo12:minbrk]
|
||||
#else
|
||||
ldr x3, .Lminbrk
|
||||
#endif
|
||||
|
||||
/* Get the minimum allowable brk address */
|
||||
ldr x2, [x3]
|
||||
adrp x3, minbrk
|
||||
ldr x2, [x3, :lo12:minbrk]
|
||||
|
||||
/* Validate the address */
|
||||
cmp x0, x2
|
||||
@ -70,24 +65,12 @@ ENTRY(_brk)
|
||||
_SYSCALL(break)
|
||||
b.cs cerror
|
||||
|
||||
#ifdef __PIC__
|
||||
adrp x2, :got:curbrk
|
||||
ldr x3, [x2, #:got_lo12:curbrk]
|
||||
#else
|
||||
ldr x3, .Lcurbrk
|
||||
#endif
|
||||
|
||||
/* Store the new curbrk value */
|
||||
str x4, [x3]
|
||||
adrp x2, curbrk
|
||||
str x4, [x2, :lo12:curbrk]
|
||||
|
||||
/* Return success */
|
||||
mov x0, #0
|
||||
ret
|
||||
|
||||
#ifndef __PIC__
|
||||
.Lcurbrk:
|
||||
.quad _C_LABEL(curbrk)
|
||||
.Lminbrk:
|
||||
.quad _C_LABEL(minbrk)
|
||||
#endif
|
||||
END(_brk)
|
||||
|
@ -32,6 +32,8 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "SYS.h"
|
||||
|
||||
.globl _C_LABEL(_end)
|
||||
|
||||
.data
|
||||
.align 3
|
||||
.global _C_LABEL(curbrk)
|
||||
@ -47,15 +49,10 @@ ENTRY(_sbrk)
|
||||
WEAK_REFERENCE(_sbrk, sbrk)
|
||||
|
||||
/* Load the address of curbrk */
|
||||
#ifdef __PIC__
|
||||
adrp x2, :got:curbrk
|
||||
ldr x3, [x2, #:got_lo12:curbrk]
|
||||
#else
|
||||
ldr x3, .Lcurbrk
|
||||
#endif
|
||||
adrp x3, curbrk
|
||||
|
||||
/* Get the current brk address */
|
||||
ldr x2, [x3]
|
||||
ldr x2, [x3, :lo12:curbrk]
|
||||
|
||||
/* Calculate the new value */
|
||||
add x0, x2, x0
|
||||
@ -66,14 +63,10 @@ ENTRY(_sbrk)
|
||||
b.cs cerror
|
||||
|
||||
/* Load the old value to return */
|
||||
ldr x0, [x3]
|
||||
ldr x0, [x3, :lo12:curbrk]
|
||||
|
||||
/* Store the new curbrk value */
|
||||
str x4, [x3]
|
||||
str x4, [x3, :lo12:curbrk]
|
||||
|
||||
ret
|
||||
#ifndef __PIC__
|
||||
.Lcurbrk:
|
||||
.quad _C_LABEL(curbrk)
|
||||
#endif
|
||||
END(_sbrk)
|
||||
|
@ -162,6 +162,10 @@ FBSD_1.3 {
|
||||
mkostemps;
|
||||
};
|
||||
|
||||
FBSD_1.4 {
|
||||
fdclose;
|
||||
};
|
||||
|
||||
FBSDprivate_1.0 {
|
||||
_flockfile;
|
||||
_flockfile_debug_stub;
|
||||
|
@ -1,5 +1,6 @@
|
||||
.\" Copyright (c) 1990, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
.\" Copyright (c) 1990, 1991, 1993 The Regents of the University of California.
|
||||
.\" Copyright (c) 2015 Mariusz Zaborski <oshogbo@FreeBSD.org>
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" This code is derived from software contributed to Berkeley by
|
||||
.\" Chris Torek and the American National Standards Committee X3,
|
||||
@ -32,11 +33,12 @@
|
||||
.\" @(#)fclose.3 8.1 (Berkeley) 6/4/93
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd April 22, 2006
|
||||
.Dd July 4, 2015
|
||||
.Dt FCLOSE 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm fclose ,
|
||||
.Nm fdclose ,
|
||||
.Nm fcloseall
|
||||
.Nd close a stream
|
||||
.Sh LIBRARY
|
||||
@ -45,6 +47,8 @@
|
||||
.In stdio.h
|
||||
.Ft int
|
||||
.Fn fclose "FILE *stream"
|
||||
.Ft int
|
||||
.Fn fdclose "FILE *stream" "int *fdp"
|
||||
.Ft void
|
||||
.Fn fcloseall void
|
||||
.Sh DESCRIPTION
|
||||
@ -59,36 +63,77 @@ first, using
|
||||
.Xr fflush 3 .
|
||||
.Pp
|
||||
The
|
||||
.Fn fdclose
|
||||
function is equivalent to
|
||||
.Fn fclose
|
||||
except that it does not close the underlying file descriptor.
|
||||
If
|
||||
.Fa fdp
|
||||
is not
|
||||
.Dv NULL ,
|
||||
the file descriptor will be written to it.
|
||||
If the
|
||||
.Fa fdp
|
||||
argument will be different then NULL the file descriptor will be returned in it,
|
||||
If the stream does not have an associated file descriptor,
|
||||
.Fa fdp
|
||||
will be set to -1.
|
||||
This type of stream is created with functions such as
|
||||
.Xr fmemopen 3 ,
|
||||
.Xr funopen 3 ,
|
||||
or
|
||||
.Xr open_memstream 3 .
|
||||
.Pp
|
||||
The
|
||||
.Fn fcloseall
|
||||
function calls
|
||||
.Fn fclose
|
||||
on all open streams.
|
||||
.Sh RETURN VALUES
|
||||
Upon successful completion 0 is returned.
|
||||
.Fn fcloseall
|
||||
does not return a value.
|
||||
.Pp
|
||||
Upon successful completion the
|
||||
.Fn fclose
|
||||
and
|
||||
.Fn fdclose
|
||||
functions return 0.
|
||||
Otherwise,
|
||||
.Dv EOF
|
||||
is returned and the global variable
|
||||
.Va errno
|
||||
is set to indicate the error.
|
||||
In either case no further access to the stream is possible.
|
||||
.Sh ERRORS
|
||||
.Fn fdclose
|
||||
fails if:
|
||||
.Bl -tag -width Er
|
||||
.It Bq Er EOPNOTSUPP
|
||||
The stream does not have an associated file descriptor.
|
||||
.El
|
||||
.Pp
|
||||
The
|
||||
.Fn fclose
|
||||
function
|
||||
may also fail and set
|
||||
and
|
||||
.Fn fdclose
|
||||
functions may also fail and set
|
||||
.Va errno
|
||||
for any of the errors specified for the routines
|
||||
.Xr close 2
|
||||
or
|
||||
for any of the errors specified for
|
||||
.Xr fflush 3 .
|
||||
.Pp
|
||||
The
|
||||
.Fn fclose
|
||||
function may also fail and set errno for any of the errors specified for
|
||||
.Xr close 2 .
|
||||
.Sh NOTES
|
||||
The
|
||||
.Fn fclose
|
||||
function
|
||||
does not handle NULL arguments; they will result in a segmentation
|
||||
violation.
|
||||
This is intentional - it makes it easier to make sure programs written
|
||||
under
|
||||
and
|
||||
.Fn fdclose
|
||||
functions do not handle NULL arguments in the
|
||||
.Fa stream
|
||||
variable; this will result in a segmentation violation.
|
||||
This is intentional.
|
||||
It makes it easier to make sure programs written under
|
||||
.Fx
|
||||
are bug free.
|
||||
This behaviour is an implementation detail, and programs should not
|
||||
@ -104,8 +149,13 @@ The
|
||||
function
|
||||
conforms to
|
||||
.St -isoC .
|
||||
.Pp
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Fn fcloseall
|
||||
function first appeared in
|
||||
.Fx 7.0 .
|
||||
.Pp
|
||||
The
|
||||
.Fn fdclose
|
||||
function first appeared in
|
||||
.Fx 11.0 .
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*-
|
||||
* Copyright (c) 1990, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* Copyright (c) 1990, 1993 The Regents of the University of California.
|
||||
* Copyright (c) 2013 Mariusz Zaborski <oshogbo@FreeBSD.org>
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to Berkeley by
|
||||
* Chris Torek.
|
||||
@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "namespace.h"
|
||||
#include <errno.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "un-namespace.h"
|
||||
@ -45,19 +47,17 @@ __FBSDID("$FreeBSD$");
|
||||
#include "libc_private.h"
|
||||
#include "local.h"
|
||||
|
||||
int
|
||||
fclose(FILE *fp)
|
||||
static int
|
||||
cleanfile(FILE *fp, bool c)
|
||||
{
|
||||
int r;
|
||||
|
||||
if (fp->_flags == 0) { /* not open! */
|
||||
errno = EBADF;
|
||||
return (EOF);
|
||||
}
|
||||
FLOCKFILE(fp);
|
||||
r = fp->_flags & __SWR ? __sflush(fp) : 0;
|
||||
if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
|
||||
r = EOF;
|
||||
if (c) {
|
||||
if (fp->_close != NULL && (*fp->_close)(fp->_cookie) < 0)
|
||||
r = EOF;
|
||||
}
|
||||
|
||||
if (fp->_flags & __SMBF)
|
||||
free((char *)fp->_bf._base);
|
||||
if (HASUB(fp))
|
||||
@ -80,6 +80,59 @@ fclose(FILE *fp)
|
||||
STDIO_THREAD_LOCK();
|
||||
fp->_flags = 0; /* Release this FILE for reuse. */
|
||||
STDIO_THREAD_UNLOCK();
|
||||
FUNLOCKFILE(fp);
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
int
|
||||
fdclose(FILE *fp, int *fdp)
|
||||
{
|
||||
int r, err;
|
||||
|
||||
if (fdp != NULL)
|
||||
*fdp = -1;
|
||||
|
||||
if (fp->_flags == 0) { /* not open! */
|
||||
errno = EBADF;
|
||||
return (EOF);
|
||||
}
|
||||
|
||||
FLOCKFILE(fp);
|
||||
r = 0;
|
||||
if (fp->_close != __sclose) {
|
||||
r = EOF;
|
||||
errno = EOPNOTSUPP;
|
||||
} else if (fp->_file < 0) {
|
||||
r = EOF;
|
||||
errno = EBADF;
|
||||
}
|
||||
if (r == EOF) {
|
||||
err = errno;
|
||||
(void)cleanfile(fp, true);
|
||||
errno = err;
|
||||
} else {
|
||||
if (fdp != NULL)
|
||||
*fdp = fp->_file;
|
||||
r = cleanfile(fp, false);
|
||||
}
|
||||
FUNLOCKFILE(fp);
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
||||
int
|
||||
fclose(FILE *fp)
|
||||
{
|
||||
int r;
|
||||
|
||||
if (fp->_flags == 0) { /* not open! */
|
||||
errno = EBADF;
|
||||
return (EOF);
|
||||
}
|
||||
|
||||
FLOCKFILE(fp);
|
||||
r = cleanfile(fp, true);
|
||||
FUNLOCKFILE(fp);
|
||||
|
||||
return (r);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
.\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $
|
||||
.\"
|
||||
.\" This file is in the public domain.
|
||||
.Dd July 22, 2013
|
||||
.Dd July 3, 2015
|
||||
.Dt PTRACE 2
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -503,8 +503,163 @@ The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.El
|
||||
.Sh x86 MACHINE-SPECIFIC REQUESTS
|
||||
.Bl -tag -width "Dv PT_GETXSTATE_INFO"
|
||||
.It Dv PT_GETXMMREGS
|
||||
Copy the XMM FPU state into the buffer pointed to by the
|
||||
argument
|
||||
.Fa addr .
|
||||
The buffer has the same layout as the 32-bit save buffer for the
|
||||
machine instruction
|
||||
.Dv FXSAVE .
|
||||
.Pp
|
||||
Additionally, machine-specific requests can exist.
|
||||
This request is only valid for i386 programs, both on native 32-bit
|
||||
systems and on amd64 kernels.
|
||||
For 64-bit amd64 programs, the XMM state is reported as part of
|
||||
the FPU state returned by the
|
||||
.Dv PT_GETFPREGS
|
||||
request.
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.It Dv PT_SETXMMREGS
|
||||
Load the XMM FPU state for the thread from the buffer pointed to
|
||||
by the argument
|
||||
.Fa addr .
|
||||
The buffer has the same layout as the 32-bit load buffer for the
|
||||
machine instruction
|
||||
.Dv FXRSTOR .
|
||||
.Pp
|
||||
As with
|
||||
.Dv PT_GETXMMREGS,
|
||||
this request is only valid for i386 programs.
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.It Dv PT_GETXSTATE_INFO
|
||||
Report which XSAVE FPU extensions are supported by the CPU
|
||||
and allowed in userspace programs.
|
||||
The
|
||||
.Fa addr
|
||||
argument must point to a variable of type
|
||||
.Vt struct ptrace_xstate_info ,
|
||||
which contains the information on the request return.
|
||||
.Vt struct ptrace_xstate_info
|
||||
is defined as follows:
|
||||
.Bd -literal
|
||||
struct ptrace_xstate_info {
|
||||
uint64_t xsave_mask;
|
||||
uint32_t xsave_len;
|
||||
};
|
||||
.Ed
|
||||
The
|
||||
.Dv xsave_mask
|
||||
field is a bitmask of the currently enabled extensions.
|
||||
The meaning of the bits is defined in the Intel and AMD
|
||||
processor documentation.
|
||||
The
|
||||
.Dv xsave_len
|
||||
field reports the length of the XSAVE area for storing the hardware
|
||||
state for currently enabled extensions in the format defined by the x86
|
||||
.Dv XSAVE
|
||||
machine instruction.
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument value must be equal to the size of the
|
||||
.Vt struct ptrace_xstate_info .
|
||||
.It Dv PT_GETXSTATE
|
||||
Return the content of the XSAVE area for the thread.
|
||||
The
|
||||
.Fa addr
|
||||
argument points to the buffer where the content is copied, and the
|
||||
.Fa data
|
||||
argument specifies the size of the buffer.
|
||||
The kernel copies out as much content as allowed by the buffer size.
|
||||
The buffer layout is specified by the layout of the save area for the
|
||||
.Dv XSAVE
|
||||
machine instruction.
|
||||
.It Dv PT_SETXSTATE
|
||||
Load the XSAVE state for the thread from the buffer specified by the
|
||||
.Fa addr
|
||||
pointer.
|
||||
The buffer size is passed in the
|
||||
.Fa data
|
||||
argument.
|
||||
The buffer must be at least as large as the
|
||||
.Vt struct savefpu
|
||||
(defined in
|
||||
.Pa x86/fpu.h )
|
||||
to allow the complete x87 FPU and XMM state load.
|
||||
It must not be larger than the XSAVE state length, as reported by the
|
||||
.Dv xsave_len
|
||||
field from the
|
||||
.Vt struct ptrace_xstate_info
|
||||
of the
|
||||
.Dv PT_GETXSTATE_INFO
|
||||
request.
|
||||
Layout of the buffer is identical to the layout of the load area for the
|
||||
.Dv XRSTOR
|
||||
machine instruction.
|
||||
.It Dv PT_GETFSBASE
|
||||
Return the value of the base used when doing segmented
|
||||
memory addressing using the %fs segment register.
|
||||
The
|
||||
.Fa addr
|
||||
argument points to an
|
||||
.Vt unsigned long
|
||||
variable where the base value is stored.
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.It Dv PT_GETGSBASE
|
||||
Like the
|
||||
.Dv PT_GETFSBASE
|
||||
request, but returns the base for the %gs segment register.
|
||||
.It Dv PT_SETFSBASE
|
||||
Set the base for the %fs segment register to the value pointed to
|
||||
by the
|
||||
.Fa addr
|
||||
argument.
|
||||
.Fa addr
|
||||
must point to the
|
||||
.Vt unsigned long
|
||||
variable containing the new base.
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.It Dv PT_SETGSBASE
|
||||
Like the
|
||||
.Dv PT_SETFSBASE
|
||||
request, but sets the base for the %gs segment register.
|
||||
.El
|
||||
.Sh PowerPC MACHINE-SPECIFIC REQUESTS
|
||||
.Bl -tag -width "Dv PT_SETVRREGS"
|
||||
.It Dv PT_GETVRREGS
|
||||
Return the thread's
|
||||
.Dv ALTIVEC
|
||||
machine state in the buffer pointed to by
|
||||
.Fa addr .
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.It Dv PT_SETVRREGS
|
||||
Set the thread's
|
||||
.Dv ALTIVEC
|
||||
machine state from the buffer pointed to by
|
||||
.Fa addr .
|
||||
.Pp
|
||||
The
|
||||
.Fa data
|
||||
argument is ignored.
|
||||
.El
|
||||
.Pp
|
||||
Additionally, other machine-specific requests can exist.
|
||||
.Sh RETURN VALUES
|
||||
Some requests can cause
|
||||
.Fn ptrace
|
||||
@ -564,6 +719,38 @@ provided to
|
||||
was less than or equal to zero, or larger than the
|
||||
.Vt ptrace_lwpinfo
|
||||
structure known to the kernel.
|
||||
.It
|
||||
The size (in
|
||||
.Fa data )
|
||||
provided to the x86-specific
|
||||
.Dv PT_GETXSTATE_INFO
|
||||
request was not equal to the size of the
|
||||
.Vt struct ptrace_xstate_info .
|
||||
.It
|
||||
The size (in
|
||||
.Fa data )
|
||||
provided to the x86-specific
|
||||
.Dv PT_SETXSTATE
|
||||
request was less than the size of the x87 plus the XMM save area.
|
||||
.It
|
||||
The size (in
|
||||
.Fa data )
|
||||
provided to the x86-specific
|
||||
.Dv PT_SETXSTATE
|
||||
request was larger than returned in the
|
||||
.Dv xsave_len
|
||||
member of the
|
||||
.Vt struct ptrace_xstate_info
|
||||
from the
|
||||
.Dv PT_GETXSTATE_INFO
|
||||
request.
|
||||
.It
|
||||
The base value, provided to the amd64-specific requests
|
||||
.Dv PT_SETFSBASE
|
||||
or
|
||||
.Dv PT_SETGSBASE ,
|
||||
pointed outside of the valid user address space.
|
||||
This error will not occur in 32-bit programs.
|
||||
.El
|
||||
.It Bq Er EBUSY
|
||||
.Bl -bullet -compact
|
||||
|
@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_impl.h"
|
||||
#include "nv.h"
|
||||
|
||||
/*
|
||||
* Structure describing communication channel between two separated processes.
|
||||
|
@ -30,14 +30,14 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <netdb.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_dns.h"
|
||||
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/dnv.h>
|
||||
#include <sys/nv.h>
|
||||
#include <sys/param.h>
|
||||
|
||||
#include <assert.h>
|
||||
@ -39,9 +41,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <dnv.h>
|
||||
#include <nv.h>
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_grp.h"
|
||||
|
||||
|
@ -31,6 +31,7 @@
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
@ -39,8 +40,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_pwd.h"
|
||||
|
||||
|
@ -30,12 +30,12 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_random.h"
|
||||
|
||||
|
@ -30,12 +30,13 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
#include "msgio.h"
|
||||
|
||||
#include "libcapsicum.h"
|
||||
|
@ -30,11 +30,11 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
#include "libcapsicum.h"
|
||||
#include "libcapsicum_sysctl.h"
|
||||
|
||||
|
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
@ -52,7 +53,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <libcapsicum.h>
|
||||
#include <libcasper.h>
|
||||
#include <libcasper_impl.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
/*
|
||||
|
@ -1330,7 +1330,6 @@ static int
|
||||
http_authorize(conn_t *conn, const char *hdr, http_auth_challenges_t *cs,
|
||||
http_auth_params_t *parms, struct url *url)
|
||||
{
|
||||
http_auth_challenge_t *basic = NULL;
|
||||
http_auth_challenge_t *digest = NULL;
|
||||
int i;
|
||||
|
||||
@ -1340,10 +1339,8 @@ http_authorize(conn_t *conn, const char *hdr, http_auth_challenges_t *cs,
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* Look for a Digest and a Basic challenge */
|
||||
/* Look for a Digest */
|
||||
for (i = 0; i < cs->count; i++) {
|
||||
if (cs->challenges[i]->scheme == HTTPAS_BASIC)
|
||||
basic = cs->challenges[i];
|
||||
if (cs->challenges[i]->scheme == HTTPAS_DIGEST)
|
||||
digest = cs->challenges[i];
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 8, 2015
|
||||
.Dd July 1, 2015
|
||||
.Dt GPIO 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -35,6 +35,7 @@
|
||||
.Sh LIBRARY
|
||||
.Lb libgpio
|
||||
.Sh SYNOPSIS
|
||||
.In sys/types.h
|
||||
.In libgpio.h
|
||||
.Ft "gpio_handle_t"
|
||||
.Fn gpio_open "unsigned int unit"
|
||||
@ -161,13 +162,14 @@ are wrappers around
|
||||
The following example shows how to configure pin 16 as output and then
|
||||
drive it high:
|
||||
.Bd -literal
|
||||
#include <sys/types.h>
|
||||
#include <err.h>
|
||||
#include <libgpio.h>
|
||||
|
||||
gpio_handle_t handle;
|
||||
|
||||
handle = gpio_open(0);
|
||||
if (handle == GPIO_HANDLE_INVALID)
|
||||
if (handle == GPIO_INVALID_HANDLE)
|
||||
err(1, "gpio_open failed");
|
||||
gpio_pin_output(handle, 16);
|
||||
gpio_pin_high(handle, 16);
|
||||
|
@ -187,6 +187,9 @@ static struct val2str str_alg_enc[] = {
|
||||
#ifdef SADB_X_EALG_AESCTR
|
||||
{ SADB_X_EALG_AESCTR, "aes-ctr", },
|
||||
#endif
|
||||
#ifdef SADB_X_EALG_AESGCM16
|
||||
{ SADB_X_EALG_AESGCM16, "aes-gcm-16", },
|
||||
#endif
|
||||
#ifdef SADB_X_EALG_CAMELLIACBC
|
||||
{ SADB_X_EALG_CAMELLIACBC, "camellia-cbc", },
|
||||
#endif
|
||||
|
@ -7,81 +7,13 @@ SHLIBDIR?= /lib
|
||||
LIB= nv
|
||||
SHLIB_MAJOR= 0
|
||||
|
||||
.PATH: ${.CURDIR}/../../sys/kern ${.CURDIR}/../../sys/sys
|
||||
.PATH: ${.CURDIR}/../../sys/contrib/libnv ${.CURDIR}/../../sys/sys
|
||||
CFLAGS+=-I${.CURDIR}/../../sys -I${.CURDIR}
|
||||
|
||||
SRCS= subr_dnvlist.c
|
||||
SRCS= dnvlist.c
|
||||
SRCS+= msgio.c
|
||||
SRCS+= subr_nvlist.c
|
||||
SRCS+= subr_nvpair.c
|
||||
|
||||
INCS= dnv.h
|
||||
INCS+= nv.h
|
||||
|
||||
MAN+= nv.3
|
||||
|
||||
MLINKS+=nv.3 libnv.3 \
|
||||
nv.3 nvlist.3
|
||||
MLINKS+=nv.3 nvlist_add_binary.3 \
|
||||
nv.3 nvlist_add_bool.3 \
|
||||
nv.3 nvlist_add_descriptor.3 \
|
||||
nv.3 nvlist_add_null.3 \
|
||||
nv.3 nvlist_add_number.3 \
|
||||
nv.3 nvlist_add_nvlist.3 \
|
||||
nv.3 nvlist_add_string.3 \
|
||||
nv.3 nvlist_add_stringf.3 \
|
||||
nv.3 nvlist_add_stringv.3 \
|
||||
nv.3 nvlist_clone.3 \
|
||||
nv.3 nvlist_create.3 \
|
||||
nv.3 nvlist_destroy.3 \
|
||||
nv.3 nvlist_dump.3 \
|
||||
nv.3 nvlist_empty.3 \
|
||||
nv.3 nvlist_error.3 \
|
||||
nv.3 nvlist_exists.3 \
|
||||
nv.3 nvlist_exists_binary.3 \
|
||||
nv.3 nvlist_exists_bool.3 \
|
||||
nv.3 nvlist_exists_descriptor.3 \
|
||||
nv.3 nvlist_exists_null.3 \
|
||||
nv.3 nvlist_exists_number.3 \
|
||||
nv.3 nvlist_exists_nvlist.3 \
|
||||
nv.3 nvlist_exists_string.3 \
|
||||
nv.3 nvlist_exists_type.3 \
|
||||
nv.3 nvlist_fdump.3 \
|
||||
nv.3 nvlist_flags.3 \
|
||||
nv.3 nvlist_free.3 \
|
||||
nv.3 nvlist_free_binary.3 \
|
||||
nv.3 nvlist_free_bool.3 \
|
||||
nv.3 nvlist_free_descriptor.3 \
|
||||
nv.3 nvlist_free_null.3 \
|
||||
nv.3 nvlist_free_number.3 \
|
||||
nv.3 nvlist_free_nvlist.3 \
|
||||
nv.3 nvlist_free_string.3 \
|
||||
nv.3 nvlist_free_type.3 \
|
||||
nv.3 nvlist_get_binary.3 \
|
||||
nv.3 nvlist_get_bool.3 \
|
||||
nv.3 nvlist_get_descriptor.3 \
|
||||
nv.3 nvlist_get_number.3 \
|
||||
nv.3 nvlist_get_nvlist.3 \
|
||||
nv.3 nvlist_get_parent.3 \
|
||||
nv.3 nvlist_get_string.3 \
|
||||
nv.3 nvlist_move_binary.3 \
|
||||
nv.3 nvlist_move_descriptor.3 \
|
||||
nv.3 nvlist_move_nvlist.3 \
|
||||
nv.3 nvlist_move_string.3 \
|
||||
nv.3 nvlist_next.3 \
|
||||
nv.3 nvlist_pack.3 \
|
||||
nv.3 nvlist_recv.3 \
|
||||
nv.3 nvlist_send.3 \
|
||||
nv.3 nvlist_set_error.3 \
|
||||
nv.3 nvlist_size.3 \
|
||||
nv.3 nvlist_take_binary.3 \
|
||||
nv.3 nvlist_take_bool.3 \
|
||||
nv.3 nvlist_take_descriptor.3 \
|
||||
nv.3 nvlist_take_number.3 \
|
||||
nv.3 nvlist_take_nvlist.3 \
|
||||
nv.3 nvlist_take_string.3 \
|
||||
nv.3 nvlist_unpack.3 \
|
||||
nv.3 nvlist_xfer.3
|
||||
SRCS+= nvlist.c
|
||||
SRCS+= nvpair.c
|
||||
|
||||
WARNS?= 6
|
||||
|
||||
|
@ -27,9 +27,10 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/dnv.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <atf-c++.hpp>
|
||||
#include <dnv.h>
|
||||
#include <nv.h>
|
||||
|
||||
ATF_TEST_CASE_WITHOUT_HEAD(dnvlist_get_bool__present);
|
||||
ATF_TEST_CASE_BODY(dnvlist_get_bool__present)
|
||||
|
@ -27,8 +27,9 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <atf-c++.hpp>
|
||||
#include <nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <limits>
|
||||
|
@ -29,12 +29,12 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -29,11 +29,11 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -29,11 +29,11 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -28,6 +28,7 @@
|
||||
*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@ -35,8 +36,6 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -29,14 +29,14 @@
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <err.h>
|
||||
#include <errno.h>
|
||||
@ -40,8 +41,6 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <nv.h>
|
||||
|
||||
static int ntest = 1;
|
||||
|
||||
#define CHECK(expr) do { \
|
||||
|
@ -42,18 +42,24 @@ __FBSDID("$FreeBSD$");
|
||||
#include <stdio.h>
|
||||
#include "_libproc.h"
|
||||
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
#define BREAKPOINT_INSTR 0xcc /* int 0x3 */
|
||||
#if defined(__aarch64__)
|
||||
#define AARCH64_BRK 0xd4200000
|
||||
#define AARCH64_BRK_IMM16_SHIFT 5
|
||||
#define AARCH64_BRK_IMM16_VAL (0xd << AARCH64_BRK_IMM16_SHIFT)
|
||||
#define BREAKPOINT_INSTR (AARCH64_BRK | AARCH64_BRK_IMM16_VAL)
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#elif defined(__amd64__) || defined(__i386__)
|
||||
#define BREAKPOINT_INSTR 0xcc /* int 0x3 */
|
||||
#define BREAKPOINT_INSTR_SZ 1
|
||||
#elif defined(__arm__)
|
||||
#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#elif defined(__mips__)
|
||||
#define BREAKPOINT_INSTR 0xd /* break */
|
||||
#define BREAKPOINT_INSTR 0xd /* break */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#elif defined(__powerpc__)
|
||||
#define BREAKPOINT_INSTR 0x7fe00008 /* trap */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#elif defined(__arm__)
|
||||
#define BREAKPOINT_INSTR 0xe7ffffff /* bkpt */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#define BREAKPOINT_INSTR 0x7fe00008 /* trap */
|
||||
#define BREAKPOINT_INSTR_SZ 4
|
||||
#else
|
||||
#error "Add support for your architecture"
|
||||
#endif
|
||||
|
@ -54,7 +54,9 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
|
||||
return (-1);
|
||||
switch (reg) {
|
||||
case REG_PC:
|
||||
#if defined(__amd64__)
|
||||
#if defined(__aarch64__)
|
||||
*regvalue = regs.elr;
|
||||
#elif defined(__amd64__)
|
||||
*regvalue = regs.r_rip;
|
||||
#elif defined(__arm__)
|
||||
*regvalue = regs.r_pc;
|
||||
@ -67,7 +69,9 @@ proc_regget(struct proc_handle *phdl, proc_reg_t reg, unsigned long *regvalue)
|
||||
#endif
|
||||
break;
|
||||
case REG_SP:
|
||||
#if defined(__amd64__)
|
||||
#if defined(__aarch64__)
|
||||
*regvalue = regs.sp;
|
||||
#elif defined(__amd64__)
|
||||
*regvalue = regs.r_rsp;
|
||||
#elif defined(__arm__)
|
||||
*regvalue = regs.r_sp;
|
||||
@ -101,7 +105,9 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
|
||||
return (-1);
|
||||
switch (reg) {
|
||||
case REG_PC:
|
||||
#if defined(__amd64__)
|
||||
#if defined(__aarch64__)
|
||||
regs.elr = regvalue;
|
||||
#elif defined(__amd64__)
|
||||
regs.r_rip = regvalue;
|
||||
#elif defined(__arm__)
|
||||
regs.r_pc = regvalue;
|
||||
@ -114,7 +120,9 @@ proc_regset(struct proc_handle *phdl, proc_reg_t reg, unsigned long regvalue)
|
||||
#endif
|
||||
break;
|
||||
case REG_SP:
|
||||
#if defined(__amd64__)
|
||||
#if defined(__aarch64__)
|
||||
regs.sp = regvalue;
|
||||
#elif defined(__amd64__)
|
||||
regs.r_rsp = regvalue;
|
||||
#elif defined(__arm__)
|
||||
regs.r_sp = regvalue;
|
||||
|
@ -1,7 +1,7 @@
|
||||
# $FreeBSD$
|
||||
|
||||
LIB= ugidfw
|
||||
SHLIB_MAJOR= 4
|
||||
SHLIB_MAJOR= 5
|
||||
SRCS= ugidfw.c
|
||||
INCS= ugidfw.h
|
||||
|
||||
|
@ -505,7 +505,7 @@ bsde_rule_to_string(struct mac_bsdextended_rule *rule, char *buf, size_t buflen)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
|
||||
size_t buflen, char *errstr){
|
||||
struct passwd *pwd;
|
||||
@ -554,7 +554,7 @@ bsde_parse_uidrange(char *spec, uid_t *min, uid_t *max,
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
|
||||
size_t buflen, char *errstr){
|
||||
struct group *grp;
|
||||
@ -603,7 +603,7 @@ bsde_parse_gidrange(char *spec, gid_t *min, gid_t *max,
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_subject(int argc, char *argv[],
|
||||
struct mac_bsdextended_subject *subject, size_t buflen, char *errstr)
|
||||
{
|
||||
@ -612,7 +612,7 @@ bsde_parse_subject(int argc, char *argv[],
|
||||
char *endp;
|
||||
uid_t uid_min, uid_max;
|
||||
gid_t gid_min, gid_max;
|
||||
int jid;
|
||||
int jid = 0;
|
||||
size_t len;
|
||||
long value;
|
||||
|
||||
@ -720,7 +720,7 @@ bsde_parse_subject(int argc, char *argv[],
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
|
||||
{
|
||||
size_t len;
|
||||
@ -764,7 +764,7 @@ bsde_parse_type(char *spec, int *type, size_t buflen, char *errstr)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
|
||||
{
|
||||
size_t len;
|
||||
@ -781,15 +781,15 @@ bsde_parse_fsid(char *spec, struct fsid *fsid, size_t buflen, char *errstr)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_parse_object(int argc, char *argv[],
|
||||
struct mac_bsdextended_object *object, size_t buflen, char *errstr)
|
||||
{
|
||||
int not_seen, flags;
|
||||
int current, neg, nextnot;
|
||||
int type;
|
||||
uid_t uid_min, uid_max;
|
||||
gid_t gid_min, gid_max;
|
||||
int type;
|
||||
struct fsid fsid;
|
||||
size_t len;
|
||||
|
||||
@ -797,6 +797,7 @@ bsde_parse_object(int argc, char *argv[],
|
||||
flags = 0;
|
||||
neg = 0;
|
||||
nextnot = 0;
|
||||
type = 0;
|
||||
|
||||
if (strcmp("not", argv[current]) == 0) {
|
||||
not_seen = 1;
|
||||
@ -1101,7 +1102,7 @@ bsde_get_mib(const char *string, int *name, size_t *namelen)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
bsde_check_version(size_t buflen, char *errstr)
|
||||
{
|
||||
size_t len;
|
||||
|
@ -1008,7 +1008,6 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
|
||||
uint16_t iso_packets;
|
||||
uint16_t i;
|
||||
uint8_t status;
|
||||
uint8_t flags;
|
||||
|
||||
status = libusb20_tr_get_status(pxfer);
|
||||
sxfer = libusb20_tr_get_priv_sc1(pxfer);
|
||||
@ -1016,7 +1015,7 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
|
||||
iso_packets = libusb20_tr_get_max_frames(pxfer);
|
||||
|
||||
if (sxfer == NULL)
|
||||
return; /* cancelled - nothing to do */
|
||||
return; /* cancelled - nothing to do */
|
||||
|
||||
uxfer = (struct libusb_transfer *)(
|
||||
((uint8_t *)sxfer) + sizeof(*sxfer));
|
||||
@ -1025,16 +1024,13 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
|
||||
iso_packets = uxfer->num_iso_packets;
|
||||
|
||||
if (iso_packets == 0)
|
||||
return; /* nothing to do */
|
||||
return; /* nothing to do */
|
||||
|
||||
/* make sure that the number of ISOCHRONOUS packets is valid */
|
||||
uxfer->num_iso_packets = iso_packets;
|
||||
|
||||
flags = uxfer->flags;
|
||||
|
||||
switch (status) {
|
||||
case LIBUSB20_TRANSFER_COMPLETED:
|
||||
|
||||
/* update actual length */
|
||||
uxfer->actual_length = actlen;
|
||||
for (i = 0; i != iso_packets; i++) {
|
||||
@ -1043,9 +1039,7 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
|
||||
}
|
||||
libusb10_complete_transfer(pxfer, sxfer, LIBUSB_TRANSFER_COMPLETED);
|
||||
break;
|
||||
|
||||
case LIBUSB20_TRANSFER_START:
|
||||
|
||||
/* setup length(s) */
|
||||
actlen = 0;
|
||||
for (i = 0; i != iso_packets; i++) {
|
||||
@ -1064,7 +1058,6 @@ libusb10_isoc_proxy(struct libusb20_transfer *pxfer)
|
||||
/* fork another USB transfer, if any */
|
||||
libusb10_submit_transfer_sub(libusb20_tr_get_priv_sc0(pxfer), uxfer->endpoint);
|
||||
break;
|
||||
|
||||
default:
|
||||
libusb10_complete_transfer(pxfer, sxfer, libusb10_convert_error(status));
|
||||
break;
|
||||
|
@ -517,9 +517,7 @@ libusb20_me_encode(void *ptr, uint16_t len, const void *pd)
|
||||
* room for the
|
||||
* complete structure:
|
||||
*/
|
||||
uint16_t dummy;
|
||||
|
||||
dummy = libusb20_me_encode(buf,
|
||||
(void) libusb20_me_encode(buf,
|
||||
0xFFFF - 3, ps->ptr);
|
||||
} else {
|
||||
bcopy(src_ptr, buf, src_len);
|
||||
@ -673,7 +671,6 @@ libusb20_me_decode(const void *ptr, uint16_t len, void *pd)
|
||||
~(LIBUSB20_ME_STRUCT_ALIGN - 1)); /* align */
|
||||
while (pd_count--) {
|
||||
uint16_t temp;
|
||||
uint16_t dummy;
|
||||
struct libusb20_me_struct *ps;
|
||||
|
||||
ps = LIBUSB20_ADD_BYTES(pd, pd_offset);
|
||||
@ -763,7 +760,7 @@ libusb20_me_decode(const void *ptr, uint16_t len, void *pd)
|
||||
* Recursivly decode
|
||||
* the next structure
|
||||
*/
|
||||
dummy = libusb20_me_decode(buf,
|
||||
(void) libusb20_me_decode(buf,
|
||||
temp, ps->ptr);
|
||||
} else {
|
||||
/* update type */
|
||||
|
@ -141,7 +141,7 @@ gr_tmp(int mfd)
|
||||
errno = ENAMETOOLONG;
|
||||
return (-1);
|
||||
}
|
||||
if ((tfd = mkstemp(tempname)) == -1)
|
||||
if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
|
||||
return (-1);
|
||||
if (mfd != -1) {
|
||||
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
|
||||
@ -318,10 +318,28 @@ gr_copy(int ffd, int tfd, const struct group *gr, struct group *old_gr)
|
||||
int
|
||||
gr_mkdb(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
if (chmod(tempname, 0644) != 0)
|
||||
return (-1);
|
||||
|
||||
return (rename(tempname, group_file));
|
||||
if (rename(tempname, group_file) != 0)
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* Make sure new group file is safe on disk. To improve performance we
|
||||
* will call fsync() to the directory where file lies
|
||||
*/
|
||||
if ((fd = open(group_dir, O_RDONLY|O_DIRECTORY)) == -1)
|
||||
return (-1);
|
||||
|
||||
if (fsync(fd) != 0) {
|
||||
close(fd);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 06, 2015
|
||||
.Dd July 02, 2015
|
||||
.Dt PW_UTIL 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -233,7 +233,8 @@ function returns 0 in case of success and -1 in case of failure.
|
||||
The
|
||||
.Fn pw_lock
|
||||
function locks the master password file.
|
||||
It returns 0 in case of success and -1 in case of failure.
|
||||
It returns a file descriptor to the master password file on success
|
||||
and -1 on failure.
|
||||
.Pp
|
||||
The
|
||||
.Fn pw_scan
|
||||
|
@ -226,7 +226,7 @@ pw_tmp(int mfd)
|
||||
errno = ENAMETOOLONG;
|
||||
return (-1);
|
||||
}
|
||||
if ((tfd = mkstemp(tempname)) == -1)
|
||||
if ((tfd = mkostemp(tempname, O_SYNC)) == -1)
|
||||
return (-1);
|
||||
if (mfd != -1) {
|
||||
while ((nr = read(mfd, buf, sizeof(buf))) > 0)
|
||||
|
@ -1,8 +1,6 @@
|
||||
# $FreeBSD$
|
||||
# Autogenerated - do NOT edit!
|
||||
|
||||
DEP_RELDIR := ${_PARSEDIR:S,${SRCTOP}/,,}
|
||||
|
||||
DIRDEPS = \
|
||||
gnu/lib/csu \
|
||||
gnu/lib/libgcc \
|
||||
|
@ -7,6 +7,6 @@ SYM_MAPS += ${.CURDIR}/arm/Symbol.map
|
||||
ARCH_SRCS = fenv-softfp.c fenv-vfp.c
|
||||
.endif
|
||||
|
||||
CFLAGS.fenv-vfp.c= -mfloat-abi=softfp
|
||||
CFLAGS.fenv-vfp.c= -mfpu=vfp -mfloat-abi=softfp
|
||||
CFLAGS+= ${CFLAGS.${.IMPSRC:T}}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <assert.h>
|
||||
@ -41,7 +42,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <libcapsicum.h>
|
||||
#include <libcapsicum_dns.h>
|
||||
#include <libcasper.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
static bool
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <grp.h>
|
||||
@ -38,7 +40,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <libcapsicum.h>
|
||||
#include <libcasper.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
static bool
|
||||
|
@ -30,6 +30,8 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <pwd.h>
|
||||
#include <stdlib.h>
|
||||
@ -37,7 +39,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <libcapsicum.h>
|
||||
#include <libcasper.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
static bool
|
||||
|
@ -30,13 +30,14 @@
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <libcapsicum.h>
|
||||
#include <libcasper.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
#define MAXSIZE (1024 * 1024)
|
||||
|
@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/sysctl.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
@ -40,7 +41,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <libcapsicum.h>
|
||||
#include <libcapsicum_sysctl.h>
|
||||
#include <libcasper.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
static int
|
||||
|
@ -70,6 +70,12 @@ ENTRY(_rtld_bind_start)
|
||||
stp x6, x7, [sp, #-16]!
|
||||
stp x8, xzr, [sp, #-16]!
|
||||
|
||||
/* Save any floating-point arguments */
|
||||
stp q0, q1, [sp, #-32]!
|
||||
stp q2, q3, [sp, #-32]!
|
||||
stp q4, q5, [sp, #-32]!
|
||||
stp q6, q7, [sp, #-32]!
|
||||
|
||||
/* Calculate reloff */
|
||||
ldr x2, [x17, #0] /* Get the address of the entry */
|
||||
sub x1, x2, x16 /* Find its offset */
|
||||
@ -85,12 +91,16 @@ ENTRY(_rtld_bind_start)
|
||||
bl _rtld_bind
|
||||
|
||||
/* Restore the registers saved by the plt code */
|
||||
ldp xzr, x30, [sp, #(5 * 16)]
|
||||
ldp xzr, x30, [sp, #(5 * 16 + 4 * 32)]
|
||||
|
||||
/* Backup the address to branch to */
|
||||
mov x16, x0
|
||||
|
||||
/* restore the arguments */
|
||||
ldp q6, q7, [sp], #32
|
||||
ldp q4, q5, [sp], #32
|
||||
ldp q2, q3, [sp], #32
|
||||
ldp q0, q1, [sp], #32
|
||||
ldp x8, xzr, [sp], #16
|
||||
ldp x6, x7, [sp], #16
|
||||
ldp x4, x5, [sp], #16
|
||||
|
@ -16,8 +16,8 @@ AZURE${VAR}!= grep -E ^AZURE${VAR} ${AZURE_UPLOAD_CONF} | awk -F' ' '{print $$2}
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
|
||||
SNAPSHOT_DATE!= date +-%Y-%m-%d-%H:%M
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
|
||||
SNAPSHOT_DATE!= date +-%Y-%m-%d
|
||||
.endif
|
||||
|
||||
AZURE_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.vhd
|
||||
|
@ -5,8 +5,8 @@
|
||||
# Makefile for creating an EC2 AMI from a disk image.
|
||||
#
|
||||
|
||||
.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE"
|
||||
AMINAMESUFFIX!= date +-%Y-%m-%d-%H:%M
|
||||
.if ${BRANCH} == "CURRENT" || ${BRANCH} == "STABLE" || ${BRANCH} == "PRERELEASE"
|
||||
AMINAMESUFFIX!= date +-%Y-%m-%d
|
||||
.endif
|
||||
.if defined(EC2PUBLIC)
|
||||
PUBLISH= --public
|
||||
|
69
release/Makefile.gce
Normal file
69
release/Makefile.gce
Normal file
@ -0,0 +1,69 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
#
|
||||
# Makefile for uploading Google Compute Engine disk images.
|
||||
#
|
||||
|
||||
GCE_IMG?= ${.OBJDIR}/gce.raw
|
||||
GCE_UPLOAD_TGTS= gce-check-depends \
|
||||
gce-do-package \
|
||||
gce-do-upload
|
||||
# I do not yet have a better way to deal with the "must be run interactively"
|
||||
# thing, so this is a fail-safe "do not do anything."
|
||||
.if !defined(GCE_LOGIN_SKIP) || empty(GCE_LOGIN_SKIP)
|
||||
GCE_UPLOAD_TGTS= gce-do-login
|
||||
.endif
|
||||
CLEANFILES+= ${GCE_UPLOAD_TGTS}
|
||||
|
||||
GCE_BUCKET?=
|
||||
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
|
||||
SNAPSHOT_DATE!= date +-%Y-%m-%d
|
||||
.endif
|
||||
|
||||
# Really? Uppercase characters are not allowed? Sigh...
|
||||
# And don't even get me started on the '.'.
|
||||
GCE_TARGET:= ${OSRELEASE:S,.raw,,:tl:S,.,-,g}${SNAPSHOT_DATE}
|
||||
|
||||
gce-upload: ${GCE_UPLOAD_TGTS}
|
||||
|
||||
gce-check-depends:
|
||||
.for VAR in _BUCKET
|
||||
. if !defined(GCE${VAR}) || empty(GCE${VAR})
|
||||
@echo "Variable GCE${VAR} cannot be empty."
|
||||
@false
|
||||
. endif
|
||||
.endfor
|
||||
.if !exists(/usr/local/bin/gcutil)
|
||||
. if !exists(${PORTSDIR}/net/google-cloud-sdk/Makefile)
|
||||
. if !exists(/usr/local/sbin/pkg-static)
|
||||
env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
|
||||
. endif
|
||||
env ASSUME_ALWAYS_YES=yes pkg install -y net/google-cloud-sdk
|
||||
. else
|
||||
make -C ${PORTSDIR}/net/google-cloud-sdk BATCH=1 all install clean
|
||||
. endif
|
||||
.endif
|
||||
|
||||
gce-do-package:
|
||||
@# Yes, really... Sigh.
|
||||
cd ${.OBJDIR} && mv gce.raw disk.raw
|
||||
cd ${.OBJDIR} && tar --format=gnutar -zcf \
|
||||
${GCE_TARGET:S,${.OBJDIR}/,,}.tar.gz disk.raw
|
||||
cd ${.OBJDIR} && mv disk.raw gce.raw
|
||||
touch ${.OBJDIR}/${.TARGET}
|
||||
|
||||
gce-do-login:
|
||||
@echo "This requires human interaction, which is not yet supported."
|
||||
@true
|
||||
|
||||
gce-do-upload:
|
||||
@# Fallthrough in case the bucket already exists.
|
||||
/usr/local/bin/gsutil mb gs://${GCE_BUCKET} || true
|
||||
/usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \
|
||||
gs://${GCE_BUCKET}/
|
||||
/usr/local/bin/gcutil addimage ${GCE_TARGET} \
|
||||
gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
|
||||
touch ${.OBJDIR}/${.TARGET}
|
||||
|
@ -27,7 +27,7 @@ EMBEDDED= 1
|
||||
.endif
|
||||
|
||||
# snapshot
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
|
||||
SNAPSHOT= 1
|
||||
TLD?= ${FTPDIR}/snapshots
|
||||
. if !defined(SVNREVISION) || empty(SVNREVISION)
|
||||
@ -63,7 +63,7 @@ BOARDNAME:= ${KERNCONF}
|
||||
. else
|
||||
OLDNAME:= ${KERNCONF}
|
||||
. endif
|
||||
. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT"
|
||||
. if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
|
||||
SNAPSHOT= 1
|
||||
. endif
|
||||
IMAGES:= img
|
||||
|
94
release/Makefile.vagrant
Normal file
94
release/Makefile.vagrant
Normal file
@ -0,0 +1,94 @@
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
#
|
||||
# Makefile for uploading Vagrant boxes to Hashicorp Atlas
|
||||
#
|
||||
|
||||
VAGRANT_IMG?= ${.OBJDIR}/vagrant.vmdk
|
||||
VAGRANT_UPLOAD_TGTS= vagrant-check-depends \
|
||||
atlas-do-upload
|
||||
CLEANFILES+= ${VAGRANT_UPLOAD_TGTS}
|
||||
|
||||
.if defined(VAGRANT_UPLOAD_CONF) && !empty(VAGRANT_UPLOAD_CONF)
|
||||
. for VAR in _KEY _USERNAME
|
||||
VAGRANT${VAR}!= grep -E ^VAGRANT${VAR} ${VAGRANT_UPLOAD_CONF} | awk -F' ' '{print $$2}'
|
||||
ATLAS${VAR}:= ${VAGRANT${VAR}}
|
||||
. endfor
|
||||
.endif
|
||||
|
||||
.if ${BRANCH} == "STABLE" || ${BRANCH} == "CURRENT" || ${BRANCH} == "PRERELEASE"
|
||||
SNAPSHOT_DATE!= date +-%Y-%m-%d
|
||||
.endif
|
||||
|
||||
VAGRANT_VERSION?= ${REVISION}-${BRANCH}${SNAPSHOT_DATE}
|
||||
|
||||
VAGRANT_TARGET:= ${OSRELEASE}${SNAPSHOT_DATE}.box
|
||||
VAGRANT_PROVIDERS?= vmware_desktop
|
||||
#VAGRANT_PROVIDERS+= virtualbox
|
||||
|
||||
vagrant-upload: ${VAGRANT_UPLOAD_TGTS}
|
||||
|
||||
vagrant-check-depends:
|
||||
.for VAR in _KEY _USERNAME _VERSION
|
||||
. if !defined(VAGRANT${VAR}) || empty(VAGRANT${VAR})
|
||||
@echo "Variable VAGRANT${VAR} cannot be empty."
|
||||
@false
|
||||
. endif
|
||||
.endfor
|
||||
.if !exists(/usr/local/bin/curl)
|
||||
. if !exists(${PORTSDIR}/ftp/curl/Makefile)
|
||||
. if !exists(/usr/local/sbin/pkg-static)
|
||||
env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
|
||||
. endif
|
||||
env ASSUME_ALWAYS_YES=yes pkg install -y curl
|
||||
. else
|
||||
make -C ${PORTSDIR}/ftp/curl BATCH=1 all install clean
|
||||
. endif
|
||||
.endif
|
||||
|
||||
vagrant-do-package: cw-vagrant
|
||||
|
||||
vagrant-do-package-vmware: vagrant-create-vmware-vmx vagrant-do-package
|
||||
@cd ${.OBJDIR} && echo '{"provider":"vmware_desktop"}' > metadata.json
|
||||
cd ${.OBJDIR} && tar -czf ${VAGRANT_TARGET} metadata.json vagrant.vmx vagrant.vmdk
|
||||
touch ${.OBJDIR}/${.TARGET}
|
||||
|
||||
atlas-do-upload: vagrant-do-package-vmware
|
||||
.for PROVIDER in ${VAGRANT_PROVIDERS}
|
||||
${.CURDIR}/scripts/atlas-upload.sh -b FreeBSD-${REVISION}-${BRANCH} -f ${VAGRANT_TARGET} -p ${PROVIDER} -k ${VAGRANT_KEY} -u ${VAGRANT_USERNAME} -v ${VAGRANT_VERSION}
|
||||
.endfor
|
||||
touch ${.OBJDIR}/${.TARGET}
|
||||
|
||||
vagrant-create-vmware-vmx:
|
||||
@cd ${.OBJDIR} && echo '.encoding = "UTF-8"' > vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'bios.bootorder = "hdd,CDROM"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'checkpoint.vmstate = ""' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'cleanshutdown = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'config.version = "8"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'displayname = "${VAGRANT_TARGET}"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.addresstype = "generated"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.bsdname = "en0"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.connectiontype = "nat"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.displayname = "Ethernet"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.linkstatepropagation.enable = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.pcislotnumber = "33"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.present = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.virtualdev = "e1000"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'ethernet0.wakeonpcktrcv = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'floppy0.present = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'guestos = "freebsd-64"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'gui.fullscreenatpoweron = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'gui.viewmodeatpoweron = "windowed"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'memsize = "512"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'sound.startconnected = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'softpoweroff = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'scsi0.pcislotnumber = "16"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'scsi0.present = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'scsi0.virtualdev = "lsilogic"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'scsi0:0.filename = "vagrant.vmdk"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'scsi0:0.present = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'tools.synctime = "TRUE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'usb.present = "FALSE"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'virtualhw.productcompatibility = "hosted"' >> vagrant.vmx
|
||||
@cd ${.OBJDIR} && echo 'virtualhw.version = "9"' >> vagrant.vmx
|
@ -18,7 +18,8 @@ RAW_DESC= Unformatted raw disk image
|
||||
CLOUDWARE?= AZURE \
|
||||
EC2 \
|
||||
GCE \
|
||||
OPENSTACK
|
||||
OPENSTACK \
|
||||
VAGRANT
|
||||
AZURE_FORMAT= vhdf
|
||||
AZURE_DESC= Microsoft Azure platform image
|
||||
AZURE_DISK= ${OSRELEASE}.${AZURE_FORMAT}
|
||||
@ -31,6 +32,9 @@ GCE_DISK= disk.${GCE_FORMAT}
|
||||
OPENSTACK_FORMAT=qcow2
|
||||
OPENSTACK_DESC= OpenStack platform image
|
||||
OPENSTACK_DISK= ${OSRELEASE}.${OPENSTACK_FORMAT}
|
||||
VAGRANT_FORMAT= vmdk
|
||||
VAGRANT_DESC= Vagrant Image
|
||||
VAGRANT_DISK= ${OSRELEASE}.${VAGRANT_FORMAT}
|
||||
|
||||
.if defined(WITH_CLOUDWARE) && !empty(WITH_CLOUDWARE) && !empty(CLOUDWARE)
|
||||
. for _CW in ${CLOUDWARE}
|
||||
@ -155,3 +159,5 @@ cloudware-install:
|
||||
|
||||
.include "${.CURDIR}/Makefile.ec2"
|
||||
.include "${.CURDIR}/Makefile.azure"
|
||||
.include "${.CURDIR}/Makefile.gce"
|
||||
.include "${.CURDIR}/Makefile.vagrant"
|
||||
|
@ -22,7 +22,7 @@
|
||||
|
||||
<pubdate>$FreeBSD$</pubdate>
|
||||
|
||||
<!-- Last rev: 282482 -->
|
||||
<!-- Last rev: 284814 -->
|
||||
|
||||
<copyright>
|
||||
<year>2015</year>
|
||||
@ -220,10 +220,6 @@
|
||||
to filter by &man.jail.8; ID or name, in followup to the
|
||||
&man.ps.1; change in <literal>r265229</literal>.</para>
|
||||
|
||||
<para revision="265995">The Blowfish &man.crypt.3; default
|
||||
format has been changed to
|
||||
<literal>$2b$</literal>.</para>
|
||||
|
||||
<para revision="266209">The &man.pmcstat.8; utility has been
|
||||
updated to include a new flag, <literal>-l</literal>, which
|
||||
ends event collection after the specified number of
|
||||
@ -345,6 +341,37 @@
|
||||
would cause final results to be sent to &man.stderr.4; when
|
||||
receiving the <literal>SIGINFO</literal> signal has been
|
||||
fixed.</para>
|
||||
|
||||
<para revision="284297" contrib="sponsor"
|
||||
sponsor="&clusterhq;">The &man.lockstat.1; utility has been
|
||||
updated with several improvements:</para>
|
||||
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>Spin locks are now reported as the amount of time
|
||||
spinning, instead of loop iterations.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Reader locks are now recognized as adaptive that can
|
||||
spin on &os;.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Lock aquisition events for successful reader try-lock
|
||||
events are now reported.</para>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>Spin and block events are now reported before lock
|
||||
acquisition events.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<para revision="284589" contrib="sponsor"
|
||||
sponsor="&scaleengine;">The &man.fstyp.8; utility has been
|
||||
updated to be able to detect &man.zfs.8; and &man.geli.8;
|
||||
filesystems.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-contrib">
|
||||
@ -417,9 +444,6 @@
|
||||
<para revision="278433">The &man.xz.1; utility has been updated
|
||||
to support multi-threaded compression.</para>
|
||||
|
||||
<para revision="280297"><application>OpenSSL</application> has
|
||||
been updated to version 1.0.1m.</para>
|
||||
|
||||
<para revision="280932" contrib="sponsor" sponsor="&ff;">The
|
||||
<application>elftoolchain</application> utilities have been
|
||||
updated to version 3179.</para>
|
||||
@ -430,22 +454,28 @@
|
||||
<para revision="281373">The &man.nvi.1; utility has been updated
|
||||
to version 2.1.3.</para>
|
||||
|
||||
<para revision="281396">The &man.acpi.4; subsystem has been
|
||||
updated to version 20150410.</para>
|
||||
|
||||
<para revision="281806">The &man.wpa.supplicant.8; and
|
||||
&man.hostapd.8; utilities have been updated to version
|
||||
2.4.</para>
|
||||
|
||||
<para revision="281812"><application>bmake</application> has
|
||||
been updated to version 20150418.</para>
|
||||
|
||||
<para revision="282089">The &man.unbound.8; utility has been
|
||||
updated to version 1.5.3.</para>
|
||||
|
||||
<para revision="282434" contrib="sponsor" sponsor="&ff;">The
|
||||
&man.resolvconf.8; utility has been updated to version
|
||||
3.7.0.</para>
|
||||
|
||||
<para revision="284254"><application>bmake</application> has
|
||||
been updated to version 20150606.</para>
|
||||
|
||||
<para revision="284329"><application>OpenSSL</application> has
|
||||
been updated to version 1.0.1o.</para>
|
||||
|
||||
<para revision="283092">The &man.acpi.4; subsystem has been
|
||||
updated to version 20150515.</para>
|
||||
|
||||
<para revision="284237">The &man.file.1; utility has been
|
||||
updated to version 5.23.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-installer">
|
||||
@ -512,6 +542,10 @@
|
||||
<sect2 xml:id="userland-libraries">
|
||||
<title>Runtime Libraries and API</title>
|
||||
|
||||
<para revision="265995">The Blowfish &man.crypt.3; default
|
||||
format has been changed to
|
||||
<literal>$2b$</literal>.</para>
|
||||
|
||||
<para revision="268461">The &man.readline.3; library is now
|
||||
statically linked in software within the base system, and the
|
||||
shared library is no longer installed, allowing the Ports
|
||||
@ -569,6 +603,22 @@
|
||||
|
||||
<para revision="281845">Support for file verification in
|
||||
<acronym>MAC</acronym> has been added.</para>
|
||||
|
||||
<para revision="282973" contrib="sponsor" sponsor="&ff;">The
|
||||
<literal>libgomp</literal> library is now only built when
|
||||
building <acronym>GCC</acronym> from the base system. An
|
||||
up-to-date version is available in the Ports Collection as
|
||||
<filename
|
||||
role="package">devel/libiomp5-devel</filename>.</para>
|
||||
|
||||
<para revision="282988">The <filename>stdlib.h</filename> and
|
||||
<filename>malloc.h</filename> headers have been updated to
|
||||
make use of the <application>gcc</application>
|
||||
<literal>alloc_align()</literal> attribute.</para>
|
||||
|
||||
<para revision="284483" contrib="sponsor"
|
||||
sponsor="&scaleengine;">The Blowfish &man.crypt.3; library
|
||||
has been updated to support $2y$ hashes.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="userland-abi">
|
||||
@ -675,6 +725,16 @@
|
||||
arch="powerpc">The &man.pmap.9; implementation for 64-bit
|
||||
&powerpc; processors has been overhaulded to improve
|
||||
concurrency.</para>
|
||||
|
||||
<para revision="283959" contrib="sponsor"
|
||||
sponsor="&limelight;">A new kernel configuration option,
|
||||
<literal>EM_MULTIQUEUE</literal>, has been added which enables
|
||||
multi-queue support in the &man.em.4; driver.</para>
|
||||
|
||||
<note>
|
||||
<para>Multi-queue support in the &man.em.4; driver is not
|
||||
officially supported by &intel;.</para>
|
||||
</note>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="kernel-sysctl">
|
||||
@ -703,6 +763,26 @@
|
||||
&man.rctl.8; with the <literal>GENERIC</literal> kernel.
|
||||
A new kernel configuration option,
|
||||
<literal>RACCT_DISABLED</literal> has also been added.</para>
|
||||
|
||||
<para revision="282901" contrib="sponsor" sponsor="&ff;">The
|
||||
<literal>GENERIC</literal> kernel configuration now includes
|
||||
<literal>RACCT</literal> and <literal>RCTL</literal> by
|
||||
default.</para>
|
||||
|
||||
<note>
|
||||
<para>To enable <literal>RACCT</literal> and
|
||||
<literal>RCTL</literal> on a system using the
|
||||
<literal>GENERIC</literal> kernel configuration, add
|
||||
<literal>kern.racct.enable=1</literal> to
|
||||
&man.loader.conf.5;, and reboot the system.</para>
|
||||
</note>
|
||||
|
||||
<para revision="283136" contrib="sponsor"
|
||||
sponsor="&limelight;">A new &man.sysctl.8;,
|
||||
<literal>net.inet.tcp.hostcache.purgenow</literal>, has
|
||||
been added, which when set to <literal>1</literal> during
|
||||
runtime will flush all
|
||||
<literal>net.inet.tcp.hostcache</literal> entries.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
@ -744,6 +824,10 @@
|
||||
|
||||
<para revision="280183">The <literal>drm</literal> code has
|
||||
been updated to match &linux; version 3.8.13.</para>
|
||||
|
||||
<para revision="282783" arch="powerpc">Support for the Freescale
|
||||
<acronym>PCI</acronym> Root Complex device has been
|
||||
added.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="drivers-storage">
|
||||
@ -838,6 +922,10 @@
|
||||
&man.gre.4; driver has been significantly overhauled, and has
|
||||
been split into two separate modules, &man.gre.4; and
|
||||
&man.me.4;.</para>
|
||||
|
||||
<para revision="283766" contrib="sponsor"
|
||||
sponsor="&limelight;">The &man.em.4; driver has been updated
|
||||
with improved transmission queue hang detection.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
@ -883,6 +971,13 @@
|
||||
updated to include <literal>AES-ICM</literal> and
|
||||
<literal>AES-GCM</literal> modes, both of which have also been
|
||||
added to the &man.aesni.4; driver.</para>
|
||||
|
||||
<para revision="283766">The &man.ig4.4; driver has been added,
|
||||
providing support for the fourth generation &intel;
|
||||
<acronym>I2C</acronym> SMBus.</para>
|
||||
|
||||
<para>The &man.uart.4; driver has been updated to support
|
||||
<acronym>AMT</acronym> devices on newer systems.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="hardware-virtualization">
|
||||
@ -938,7 +1033,7 @@
|
||||
has been added.</para>
|
||||
|
||||
<para revision="282212" contrib="sponsor" sponsor="&msostc;">The
|
||||
HyperV™ drivers have been updated with several
|
||||
Hyper-V™ drivers have been updated with several
|
||||
enhancements:</para>
|
||||
|
||||
<itemizedlist>
|
||||
@ -960,6 +1055,10 @@
|
||||
|
||||
<para revision="282274">Support for &man.xen.4; para-virtualized
|
||||
<literal>domU</literal> kernels has been removed.</para>
|
||||
|
||||
<para revision="284746" contrib="sponsor" sponsor="&msostc;">The
|
||||
&man.hv.netvsc.4; driver has been updated to support checksum
|
||||
offloading and <acronym>TSO</acronym>.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="hardware-arm">
|
||||
@ -980,6 +1079,17 @@
|
||||
<para revision="280259" contrib="sponsor" sponsor="&ff;">Initial
|
||||
support for the ARM AArch64 architecture has been
|
||||
added.</para>
|
||||
|
||||
<para revision="282779" arch="arm">Kernel support for Thumb-2
|
||||
userland has been added.</para>
|
||||
|
||||
<para revision="282827">Support for the hardware power button
|
||||
on the BeagleBone Black system has been added.</para>
|
||||
|
||||
<para revision="284273" contrib="sponsor"
|
||||
sponsor="&ff;">Initial
|
||||
<acronym>ACPI</acronym> support has been added for
|
||||
&os;/&arch.arm64;.</para>
|
||||
</sect2>
|
||||
</sect1>
|
||||
|
||||
@ -1000,6 +1110,19 @@
|
||||
<para revision="278354" contrib="sponsor" sponsor="&ix;">The
|
||||
&man.ctld.8; utility has been updated to allow controlling
|
||||
non-<acronym>iSCSI</acronym> &man.ctl.4; ports.</para>
|
||||
|
||||
<para revision="275681" contrib="sponsor" sponsor="&ff;">The
|
||||
&man.autofs.5; subsystem has been updated to include a new
|
||||
&man.auto.master.5; map, <literal>-media</literal>, which
|
||||
allows automatically mounting removable media, such as
|
||||
<acronym>CD</acronym> drives or <acronym>USB</acronym> flash
|
||||
drives.</para>
|
||||
|
||||
<para revision="279955" contrib="sponsor" sponsor="&ff;">The
|
||||
&man.autofs.5; subsystem has been updated to include a new
|
||||
&man.auto.master.5; map, <literal>-noauto</literal>, which
|
||||
handles &man.fstab.5; entries set to
|
||||
<literal>noauto</literal>.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="storage-net">
|
||||
@ -1059,6 +1182,10 @@
|
||||
loading the kernel. To enable this behavior, add
|
||||
<literal>geom_eli_passphrase_prompt="YES"</literal> to
|
||||
&man.loader.conf.5;.</para>
|
||||
|
||||
<para revision="258431" contrib="sponsor" sponsor="&ff;">The
|
||||
memory test run at boot time on &os;/&arch.amd64; platforms
|
||||
has been disabled by default.</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 xml:id="boot-menu">
|
||||
|
@ -15,6 +15,8 @@
|
||||
<!ENTITY citrix "Citrix Systems">
|
||||
<!ENTITY citrix.rd "Citrix Systems R&D">
|
||||
|
||||
<!ENTITY clusterhq "ClusterHQ">
|
||||
|
||||
<!ENTITY darpa "DARPA">
|
||||
<!ENTITY darpa_afrl "DARPA, AFRL">
|
||||
|
||||
|
155
release/scripts/atlas-upload.sh
Executable file
155
release/scripts/atlas-upload.sh
Executable file
@ -0,0 +1,155 @@
|
||||
#!/bin/sh
|
||||
#-
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
# 1. Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
# 2. Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
# SUCH DAMAGE.
|
||||
#
|
||||
# Upload a Vagrant image to Hashicorp's Atlas service
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
ATLAS_API_URL=''
|
||||
ATLAS_UPLOAD_URL='https://binstore.hashicorp.com'
|
||||
VERSION_DESCRIPTION="FreeBSD Snapshot Build"
|
||||
|
||||
usage() {
|
||||
echo "${0} usage:"
|
||||
echo "-b box-name -f box-to-upload -k api-key -p provider -u user -v version"
|
||||
return 1
|
||||
}
|
||||
|
||||
main () {
|
||||
while getopts "b:f:k:p:u:v:" arg; do
|
||||
case "${arg}" in
|
||||
b)
|
||||
BOX="${OPTARG}"
|
||||
;;
|
||||
f)
|
||||
FILE="${OPTARG}"
|
||||
;;
|
||||
k)
|
||||
KEY="${OPTARG}"
|
||||
;;
|
||||
p)
|
||||
PROVIDER="${OPTARG}"
|
||||
;;
|
||||
u)
|
||||
USERNAME="${OPTARG}"
|
||||
;;
|
||||
v)
|
||||
VERSION="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -z "${BOX}" -o \
|
||||
-z "${FILE}" -o \
|
||||
-z "${KEY}" -o \
|
||||
-z "${PROVIDER}" -o \
|
||||
-z "${USERNAME}" -o \
|
||||
-z "${VERSION}" ];
|
||||
then
|
||||
usage || exit 0
|
||||
fi
|
||||
|
||||
# Check to see if the box exists or create it
|
||||
BOXRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}?access_token=${KEY}")
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to connect to the API"
|
||||
exit 2;
|
||||
fi
|
||||
echo $BOXRESULT | grep "\"name\":\"${BOX}\"" > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "Creating box: ${BOX}"
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/boxes -X POST -d "box[name]=${BOX}" -d "access_token=${KEY}" > /dev/null
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX} -X PUT -d "box[is_private]=false" -d "access_token=${KEY}" > /dev/null
|
||||
else
|
||||
echo "Box already exists"
|
||||
fi
|
||||
|
||||
# Check to see if the version exists or create it
|
||||
VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}")
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to connect to the API"
|
||||
exit 2;
|
||||
fi
|
||||
echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "Creating version: ${VERSION}"
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/versions -X POST -d "version[version]=${VERSION}" -d "access_token=${KEY}" > /dev/null
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION} -X PUT -d "version[description]=${VERSION_DESCRIPTION}" -d "access_token=${KEY}" > /dev/null
|
||||
VERSIONRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}?access_token=${KEY}")
|
||||
echo $VERSIONRESULT | grep "\"version\":\"${VERSION}\"" > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to create version"
|
||||
exit 2
|
||||
fi
|
||||
else
|
||||
echo "Version already exists"
|
||||
fi
|
||||
|
||||
# Check to see if the provider exists or create it
|
||||
PROVIDERRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}")
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to connect to the API"
|
||||
exit 2;
|
||||
fi
|
||||
echo $PROVIDERRESULT | grep "\"name\":\"${PROVIDER}\"" > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "Creating provider: ${PROVIDER}"
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/providers -X POST -d "provider[name]=${PROVIDER}" -d "access_token=${KEY}" > /dev/null
|
||||
else
|
||||
echo "Provider already exists"
|
||||
fi
|
||||
|
||||
# Request an upload token
|
||||
TOKENRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}/upload?access_token=${KEY}")
|
||||
if [ $? != 0 ]; then
|
||||
echo "Failed to get the token from the API"
|
||||
exit 2;
|
||||
fi
|
||||
echo ${TOKENRESULT} | grep "\"token\":" > /dev/null
|
||||
if [ $? != 0 ]; then
|
||||
echo "No token found from the API"
|
||||
exit 2
|
||||
else
|
||||
TOKEN=$(echo $TOKENRESULT | sed -e 's/.*token":"//' -e 's/".*//')
|
||||
echo "Uploading to Atlas"
|
||||
UPLOADRESULT=$(/usr/local/bin/curl -s -X PUT --upload-file ${FILE} ${ATLAS_UPLOAD_URL}/${TOKEN})
|
||||
|
||||
# Validate the Upload
|
||||
echo "Validating"
|
||||
VALIDRESULT=$(/usr/local/bin/curl -s "https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/provider/${PROVIDER}?access_token=${KEY}")
|
||||
HOSTED_TOKEN=$(echo $VALIDRESULT | sed -e 's/.*hosted_token":"//' -e 's/".*//')
|
||||
if [ ! -z ${HOSTED_TOKEN} -a ! -z ${TOKEN} -a ${HOSTED_TOKEN} != ${TOKEN} ]; then
|
||||
echo "Upload failed, try again."
|
||||
exit 2
|
||||
fi
|
||||
|
||||
# Release the version
|
||||
echo "Releasing ${VERSION} of ${BOX} in Atlas"
|
||||
/usr/local/bin/curl -s https://atlas.hashicorp.com/api/v1/box/${USERNAME}/${BOX}/version/${VERSION}/release -X PUT -d "access_token=${KEY}" > /dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
main "$@"
|
@ -32,7 +32,7 @@ vm_extra_pre_umount() {
|
||||
# catalogue and install or update pkg when the instance first
|
||||
# launches, so these files would just be replaced anyway; removing
|
||||
# them from the image allows it to boot faster.
|
||||
pkg -c ${DESTDIR} delete -f -y pkg
|
||||
env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
|
||||
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
|
||||
|
||||
# The size of the EC2 root disk can be configured at instance launch
|
||||
|
@ -1,47 +0,0 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
# Script to handle packaging cloud images for GCE.
|
||||
#
|
||||
# XXX:
|
||||
# This script only exists to help in automating image creation,
|
||||
# and reimplementing this is intended (in other words, this is
|
||||
# temporary).
|
||||
|
||||
usage() {
|
||||
echo "Usage:"
|
||||
echo "$(basename ${0}) -D <destdir> -I <input_file> -S <src_tree>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
main() {
|
||||
while getopts "D:I:W:" opt; do
|
||||
case ${opt} in
|
||||
D)
|
||||
DESTDIR="${OPTARG}"
|
||||
;;
|
||||
I)
|
||||
INFILE="${OPTARG}"
|
||||
;;
|
||||
S)
|
||||
WORLDDIR="${OPTARG}"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(( ${OPTIND} - 1 ))
|
||||
|
||||
if [ -z "${DESTDIR}" -o -z "${INFILE}" -o -z "${WORLDDIR}" ]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
OUTFILE="$(make -C ${WORLDDIR}/release -V OSRELEASE).tar.gz"
|
||||
|
||||
cd ${DESTDIR} && tar --format=gnutar -zcf ${OUTFILE} ${INFILE}
|
||||
}
|
||||
|
||||
main "$@"
|
81
release/tools/vagrant.conf
Normal file
81
release/tools/vagrant.conf
Normal file
@ -0,0 +1,81 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
# Packages to install into the image we're creating. This is a deliberately
|
||||
# minimalist set, providing only the packages necessary to bootstrap.
|
||||
export VM_EXTRA_PACKAGES="firstboot-freebsd-update firstboot-pkgs"
|
||||
|
||||
# Set to a list of third-party software to enable in rc.conf(5).
|
||||
export VM_RC_LIST="firstboot_freebsd_update firstboot_pkgs"
|
||||
|
||||
vm_extra_pre_umount() {
|
||||
# The firstboot_pkgs rc.d script will download the repository
|
||||
# catalogue and install or update pkg when the instance first
|
||||
# launches, so these files would just be replaced anyway; removing
|
||||
# them from the image allows it to boot faster.
|
||||
env ASSUME_ALWAYS_YES=yes pkg -c ${DESTDIR} delete -f -y pkg
|
||||
rm ${DESTDIR}/var/db/pkg/repo-*.sqlite
|
||||
|
||||
# The size of the EC2 root disk can be configured at instance launch
|
||||
# time; expand our filesystem to fill the disk.
|
||||
echo 'growfs_enable="YES"' >> ${DESTDIR}/etc/rc.conf
|
||||
|
||||
# Vagrant instances use DHCP to get their network configuration.
|
||||
echo 'ifconfig_DEFAULT="SYNCDHCP"' >> ${DESTDIR}/etc/rc.conf
|
||||
|
||||
# Enable sshd by default
|
||||
echo 'sshd_enable="YES"' >> ${DESTDIR}/etc/rc.conf
|
||||
# Disable DNS lookups by default to make SSH connect quickly
|
||||
echo 'UseDNS no' >> ${DESTDIR}/etc/ssh/sshd_config
|
||||
|
||||
# Disable sendmail
|
||||
echo 'sendmail_enable="NO"' >> ${DESTDIR}/etc/rc.conf
|
||||
echo 'sendmail_submit_enable="NO"' >> ${DESTDIR}/etc/rc.conf
|
||||
echo 'sendmail_outbound_enable="NO"' >> ${DESTDIR}/etc/rc.conf
|
||||
echo 'sendmail_msp_queue_enable="NO"' >> ${DESTDIR}/etc/rc.conf
|
||||
|
||||
# sudo is required
|
||||
echo 'firstboot_pkgs_list="sudo rsync"' >> ${DESTDIR}/etc/rc.conf
|
||||
|
||||
# Create the vagrant user with a password of vagrant
|
||||
/usr/sbin/pw -R ${DESTDIR} \
|
||||
groupadd vagrant -g 1001
|
||||
chroot ${DESTDIR} mkdir -p /home/vagrant
|
||||
/usr/sbin/pw -R ${DESTDIR} \
|
||||
useradd vagrant \
|
||||
-m -M 0755 -w yes -n vagrant -u 1001 -g 1001 -G 0 \
|
||||
-c 'Vagrant User' -d '/home/vagrant' -s '/bin/csh'
|
||||
|
||||
# Change root's password to vagrant
|
||||
echo 'vagrant' | /usr/sbin/pw -R ${DESTDIR} \
|
||||
usermod root -h 0
|
||||
|
||||
# Configure sudo to allow the vagrant user
|
||||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> ${DESTDIR}/usr/local/etc/sudoers
|
||||
|
||||
# Configure the vagrant ssh key
|
||||
mkdir ${DESTDIR}/home/vagrant/.ssh
|
||||
chmod 700 ${DESTDIR}/home/vagrant/.ssh
|
||||
echo "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key" > ${DESTDIR}/home/vagrant/.ssh/authorized_keys
|
||||
chown -R 1001 ${DESTDIR}/home/vagrant/.ssh
|
||||
chmod 600 ${DESTDIR}/home/vagrant/.ssh/authorized_keys
|
||||
|
||||
# Reboot quickly, Don't wait at the panic screen
|
||||
echo 'debug.trace_on_panic=1' >> ${DESTDIR}/etc/sysctl.conf
|
||||
echo 'debug.debugger_on_panic=0' >> ${DESTDIR}/etc/sysctl.conf
|
||||
echo 'kern.panic_reboot_wait_time=0' >> ${DESTDIR}/etc/sysctl.conf
|
||||
|
||||
# The console is not interactive, so we might as well boot quickly.
|
||||
echo 'autoboot_delay="-1"' >> ${DESTDIR}/boot/loader.conf
|
||||
|
||||
# The first time the VM boots, the installed "first boot" scripts
|
||||
# should be allowed to run:
|
||||
# * growfs (expand the filesystem to fill the provided disk)
|
||||
# * firstboot_freebsd_update (install critical updates)
|
||||
# * firstboot_pkgs (install packages)
|
||||
touch ${DESTDIR}/firstboot
|
||||
|
||||
return 0
|
||||
}
|
@ -8058,7 +8058,7 @@ usage(int printlong)
|
||||
|
||||
fprintf(printlong ? stdout : stderr,
|
||||
"usage: camcontrol <command> [device id][generic args][command args]\n"
|
||||
" camcontrol devlist [-v]\n"
|
||||
" camcontrol devlist [-b] [-v]\n"
|
||||
#ifndef MINIMALISTIC
|
||||
" camcontrol periphlist [dev_id][-n dev_name] [-u unit]\n"
|
||||
" camcontrol tur [dev_id][generic args]\n"
|
||||
|
@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/socket.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/un.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dirent.h>
|
||||
@ -56,7 +57,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <libcasper.h>
|
||||
#include <libcasper_impl.h>
|
||||
#include <msgio.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
#include "msgio.h"
|
||||
@ -253,7 +253,7 @@ casper_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin,
|
||||
return (error);
|
||||
}
|
||||
|
||||
if (zygote_clone(service_external_execute, 0, &chanfd, &procfd) == -1) {
|
||||
if (zygote_clone(service_external_execute, &chanfd, &procfd) == -1) {
|
||||
error = errno;
|
||||
close(execfd);
|
||||
return (error);
|
||||
|
@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <sys/capsicum.h>
|
||||
#include <sys/procdesc.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/nv.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <err.h>
|
||||
@ -46,7 +47,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <libcapsicum.h>
|
||||
#include <libcapsicum_impl.h>
|
||||
#include <nv.h>
|
||||
#include <pjdlog.h>
|
||||
|
||||
#include "zygote.h"
|
||||
@ -77,7 +77,7 @@ stdnull(void)
|
||||
}
|
||||
|
||||
int
|
||||
zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
|
||||
zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp)
|
||||
{
|
||||
nvlist_t *nvl;
|
||||
int error;
|
||||
@ -90,7 +90,6 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
|
||||
|
||||
nvl = nvlist_create(0);
|
||||
nvlist_add_number(nvl, "func", (uint64_t)(uintptr_t)func);
|
||||
nvlist_add_number(nvl, "flags", (uint64_t)flags);
|
||||
nvl = nvlist_xfer(zygote_sock, nvl, 0);
|
||||
if (nvl == NULL)
|
||||
return (-1);
|
||||
@ -117,7 +116,7 @@ zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp)
|
||||
static void
|
||||
zygote_main(int sock)
|
||||
{
|
||||
int error, fd, flags, procfd;
|
||||
int error, fd, procfd;
|
||||
int chanfd[2];
|
||||
nvlist_t *nvlin, *nvlout;
|
||||
zygote_func_t *func;
|
||||
@ -144,7 +143,6 @@ zygote_main(int sock)
|
||||
}
|
||||
func = (zygote_func_t *)(uintptr_t)nvlist_get_number(nvlin,
|
||||
"func");
|
||||
flags = (int)nvlist_get_number(nvlin, "flags");
|
||||
nvlist_destroy(nvlin);
|
||||
|
||||
/*
|
||||
|
@ -35,6 +35,6 @@
|
||||
typedef void zygote_func_t(int);
|
||||
|
||||
int zygote_init(void);
|
||||
int zygote_clone(zygote_func_t *func, int flags, int *chanfdp, int *procfdp);
|
||||
int zygote_clone(zygote_func_t *func, int *chanfdp, int *procfdp);
|
||||
|
||||
#endif /* !_ZYGOTE_H_ */
|
||||
|
@ -24,7 +24,7 @@
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd June 18, 2014
|
||||
.Dd June 2, 2015
|
||||
.Dt GELI 8
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -893,6 +893,13 @@ geli_da1s3a_keyfile0_type="da1s3a:geli_keyfile0"
|
||||
geli_da1s3a_keyfile0_name="/boot/keys/da1s3a.key"
|
||||
.Ed
|
||||
.Pp
|
||||
If there is only one keyfile, the index might be omitted:
|
||||
.Bd -literal -offset indent
|
||||
geli_da1s3a_keyfile_load="YES"
|
||||
geli_da1s3a_keyfile_type="da1s3a:geli_keyfile"
|
||||
geli_da1s3a_keyfile_name="/boot/keys/da1s3a.key"
|
||||
.Ed
|
||||
.Pp
|
||||
Not only configure encryption, but also data integrity verification using
|
||||
.Nm HMAC/SHA256 .
|
||||
.Bd -literal -offset indent
|
||||
|
@ -897,7 +897,7 @@ check_parameters(void)
|
||||
NANDFS_SEG_MIN_BLOCKS);
|
||||
|
||||
/* check reserved segment percentage */
|
||||
if ((rsv_segment_percent < 1) && (rsv_segment_percent > 99))
|
||||
if ((rsv_segment_percent < 1) || (rsv_segment_percent > 99))
|
||||
errx(1, "Bad reserved segment percentage. "
|
||||
"Must in range 1..99.");
|
||||
|
||||
|
@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/altq/altq_cbq.h>
|
||||
#include <net/altq/altq_priq.h>
|
||||
#include <net/altq/altq_hfsc.h>
|
||||
#include <net/altq/altq_fairq.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@ -300,6 +301,7 @@ struct pool_opts {
|
||||
|
||||
|
||||
struct node_hfsc_opts hfsc_opts;
|
||||
struct node_fairq_opts fairq_opts;
|
||||
struct node_state_opt *keep_state_defaults = NULL;
|
||||
|
||||
int disallow_table(struct node_host *, const char *);
|
||||
@ -422,6 +424,7 @@ typedef struct {
|
||||
struct table_opts table_opts;
|
||||
struct pool_opts pool_opts;
|
||||
struct node_hfsc_opts hfsc_opts;
|
||||
struct node_fairq_opts fairq_opts;
|
||||
} v;
|
||||
int lineno;
|
||||
} YYSTYPE;
|
||||
@ -446,8 +449,8 @@ int parseport(char *, struct range *r, int);
|
||||
%token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID
|
||||
%token ANTISPOOF FOR INCLUDE
|
||||
%token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY
|
||||
%token ALTQ CBQ PRIQ HFSC BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT
|
||||
%token QUEUE PRIORITY QLIMIT RTABLE
|
||||
%token ALTQ CBQ PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME UPPERLIMIT
|
||||
%token QUEUE PRIORITY QLIMIT HOGS BUCKETS RTABLE
|
||||
%token LOAD RULESET_OPTIMIZATION
|
||||
%token STICKYADDRESS MAXSRCSTATES MAXSRCNODES SOURCETRACK GLOBAL RULE
|
||||
%token MAXSRCCONN MAXSRCCONNRATE OVERLOAD FLUSH SLOPPY
|
||||
@ -495,6 +498,7 @@ int parseport(char *, struct range *r, int);
|
||||
%type <v.number> cbqflags_list cbqflags_item
|
||||
%type <v.number> priqflags_list priqflags_item
|
||||
%type <v.hfsc_opts> hfscopts_list hfscopts_item hfsc_opts
|
||||
%type <v.fairq_opts> fairqopts_list fairqopts_item fairq_opts
|
||||
%type <v.queue_bwspec> bandwidth
|
||||
%type <v.filter_opts> filter_opts filter_opt filter_opts_l
|
||||
%type <v.antispoof_opts> antispoof_opts antispoof_opt antispoof_opts_l
|
||||
@ -1659,6 +1663,15 @@ scheduler : CBQ {
|
||||
$$.qtype = ALTQT_HFSC;
|
||||
$$.data.hfsc_opts = $3;
|
||||
}
|
||||
| FAIRQ {
|
||||
$$.qtype = ALTQT_FAIRQ;
|
||||
bzero(&$$.data.fairq_opts,
|
||||
sizeof(struct node_fairq_opts));
|
||||
}
|
||||
| FAIRQ '(' fairq_opts ')' {
|
||||
$$.qtype = ALTQT_FAIRQ;
|
||||
$$.data.fairq_opts = $3;
|
||||
}
|
||||
;
|
||||
|
||||
cbqflags_list : cbqflags_item { $$ |= $1; }
|
||||
@ -1807,6 +1820,61 @@ hfscopts_item : LINKSHARE bandwidth {
|
||||
}
|
||||
;
|
||||
|
||||
fairq_opts : {
|
||||
bzero(&fairq_opts,
|
||||
sizeof(struct node_fairq_opts));
|
||||
}
|
||||
fairqopts_list {
|
||||
$$ = fairq_opts;
|
||||
}
|
||||
;
|
||||
|
||||
fairqopts_list : fairqopts_item
|
||||
| fairqopts_list comma fairqopts_item
|
||||
;
|
||||
|
||||
fairqopts_item : LINKSHARE bandwidth {
|
||||
if (fairq_opts.linkshare.used) {
|
||||
yyerror("linkshare already specified");
|
||||
YYERROR;
|
||||
}
|
||||
fairq_opts.linkshare.m2 = $2;
|
||||
fairq_opts.linkshare.used = 1;
|
||||
}
|
||||
| LINKSHARE '(' bandwidth number bandwidth ')' {
|
||||
if (fairq_opts.linkshare.used) {
|
||||
yyerror("linkshare already specified");
|
||||
YYERROR;
|
||||
}
|
||||
fairq_opts.linkshare.m1 = $3;
|
||||
fairq_opts.linkshare.d = $4;
|
||||
fairq_opts.linkshare.m2 = $5;
|
||||
fairq_opts.linkshare.used = 1;
|
||||
}
|
||||
| HOGS bandwidth {
|
||||
fairq_opts.hogs_bw = $2;
|
||||
}
|
||||
| BUCKETS number {
|
||||
fairq_opts.nbuckets = $2;
|
||||
}
|
||||
| STRING {
|
||||
if (!strcmp($1, "default"))
|
||||
fairq_opts.flags |= FARF_DEFAULTCLASS;
|
||||
else if (!strcmp($1, "red"))
|
||||
fairq_opts.flags |= FARF_RED;
|
||||
else if (!strcmp($1, "ecn"))
|
||||
fairq_opts.flags |= FARF_RED|FARF_ECN;
|
||||
else if (!strcmp($1, "rio"))
|
||||
fairq_opts.flags |= FARF_RIO;
|
||||
else {
|
||||
yyerror("unknown fairq flag \"%s\"", $1);
|
||||
free($1);
|
||||
YYERROR;
|
||||
}
|
||||
free($1);
|
||||
}
|
||||
;
|
||||
|
||||
qassign : /* empty */ { $$ = NULL; }
|
||||
| qassign_item { $$ = $1; }
|
||||
| '{' optnl qassign_list '}' { $$ = $3; }
|
||||
@ -5226,6 +5294,7 @@ lookup(char *s)
|
||||
{ "bitmask", BITMASK},
|
||||
{ "block", BLOCK},
|
||||
{ "block-policy", BLOCKPOLICY},
|
||||
{ "buckets", BUCKETS},
|
||||
{ "cbq", CBQ},
|
||||
{ "code", CODE},
|
||||
{ "crop", FRAGCROP},
|
||||
@ -5235,6 +5304,7 @@ lookup(char *s)
|
||||
{ "drop", DROP},
|
||||
{ "drop-ovl", FRAGDROP},
|
||||
{ "dup-to", DUPTO},
|
||||
{ "fairq", FAIRQ},
|
||||
{ "fastroute", FASTROUTE},
|
||||
{ "file", FILENAME},
|
||||
{ "fingerprints", FINGERPRINTS},
|
||||
@ -5247,6 +5317,7 @@ lookup(char *s)
|
||||
{ "global", GLOBAL},
|
||||
{ "group", GROUP},
|
||||
{ "hfsc", HFSC},
|
||||
{ "hogs", HOGS},
|
||||
{ "hostid", HOSTID},
|
||||
{ "icmp-type", ICMPTYPE},
|
||||
{ "icmp6-type", ICMP6TYPE},
|
||||
|
@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
|
||||
#include <net/altq/altq_cbq.h>
|
||||
#include <net/altq/altq_priq.h>
|
||||
#include <net/altq/altq_hfsc.h>
|
||||
#include <net/altq/altq_fairq.h>
|
||||
|
||||
#include "pfctl_parser.h"
|
||||
#include "pfctl.h"
|
||||
@ -68,6 +69,11 @@ static int check_commit_hfsc(int, int, struct pf_altq *);
|
||||
static int print_hfsc_opts(const struct pf_altq *,
|
||||
const struct node_queue_opt *);
|
||||
|
||||
static int eval_pfqueue_fairq(struct pfctl *, struct pf_altq *);
|
||||
static int print_fairq_opts(const struct pf_altq *,
|
||||
const struct node_queue_opt *);
|
||||
static int check_commit_fairq(int, int, struct pf_altq *);
|
||||
|
||||
static void gsc_add_sc(struct gen_sc *, struct service_curve *);
|
||||
static int is_gsc_under_sc(struct gen_sc *,
|
||||
struct service_curve *);
|
||||
@ -88,6 +94,8 @@ int eval_queue_opts(struct pf_altq *, struct node_queue_opt *,
|
||||
u_int32_t eval_bwspec(struct node_queue_bw *, u_int32_t);
|
||||
void print_hfsc_sc(const char *, u_int, u_int, u_int,
|
||||
const struct node_hfsc_sc *);
|
||||
void print_fairq_sc(const char *, u_int, u_int, u_int,
|
||||
const struct node_fairq_sc *);
|
||||
|
||||
void
|
||||
pfaltq_store(struct pf_altq *a)
|
||||
@ -173,6 +181,10 @@ print_altq(const struct pf_altq *a, unsigned int level,
|
||||
if (!print_hfsc_opts(a, qopts))
|
||||
printf("hfsc ");
|
||||
break;
|
||||
case ALTQT_FAIRQ:
|
||||
if (!print_fairq_opts(a, qopts))
|
||||
printf("fairq ");
|
||||
break;
|
||||
}
|
||||
|
||||
if (bw != NULL && bw->bw_percent > 0) {
|
||||
@ -203,7 +215,8 @@ print_queue(const struct pf_altq *a, unsigned int level,
|
||||
printf("%s ", a->qname);
|
||||
if (print_interface)
|
||||
printf("on %s ", a->ifname);
|
||||
if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC) {
|
||||
if (a->scheduler == ALTQT_CBQ || a->scheduler == ALTQT_HFSC ||
|
||||
a->scheduler == ALTQT_FAIRQ) {
|
||||
if (bw != NULL && bw->bw_percent > 0) {
|
||||
if (bw->bw_percent < 100)
|
||||
printf("bandwidth %u%% ", bw->bw_percent);
|
||||
@ -224,6 +237,9 @@ print_queue(const struct pf_altq *a, unsigned int level,
|
||||
case ALTQT_HFSC:
|
||||
print_hfsc_opts(a, qopts);
|
||||
break;
|
||||
case ALTQT_FAIRQ:
|
||||
print_fairq_opts(a, qopts);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,6 +310,9 @@ check_commit_altq(int dev, int opts)
|
||||
case ALTQT_HFSC:
|
||||
error = check_commit_hfsc(dev, opts, altq);
|
||||
break;
|
||||
case ALTQT_FAIRQ:
|
||||
error = check_commit_fairq(dev, opts, altq);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -342,7 +361,8 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
|
||||
if (pa->qlimit == 0)
|
||||
pa->qlimit = DEFAULT_QLIMIT;
|
||||
|
||||
if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC) {
|
||||
if (pa->scheduler == ALTQT_CBQ || pa->scheduler == ALTQT_HFSC ||
|
||||
pa->scheduler == ALTQT_FAIRQ) {
|
||||
pa->bandwidth = eval_bwspec(bw,
|
||||
parent == NULL ? 0 : parent->bandwidth);
|
||||
|
||||
@ -388,6 +408,9 @@ eval_pfqueue(struct pfctl *pf, struct pf_altq *pa, struct node_queue_bw *bw,
|
||||
case ALTQT_HFSC:
|
||||
error = eval_pfqueue_hfsc(pf, pa);
|
||||
break;
|
||||
case ALTQT_FAIRQ:
|
||||
error = eval_pfqueue_fairq(pf, pa);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -807,6 +830,85 @@ eval_pfqueue_hfsc(struct pfctl *pf, struct pf_altq *pa)
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/*
|
||||
* FAIRQ support functions
|
||||
*/
|
||||
static int
|
||||
eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa)
|
||||
{
|
||||
struct pf_altq *altq, *parent;
|
||||
struct fairq_opts *opts;
|
||||
struct service_curve sc;
|
||||
|
||||
opts = &pa->pq_u.fairq_opts;
|
||||
|
||||
if (pa->parent[0] == 0) {
|
||||
/* root queue */
|
||||
opts->lssc_m1 = pa->ifbandwidth;
|
||||
opts->lssc_m2 = pa->ifbandwidth;
|
||||
opts->lssc_d = 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
LIST_INIT(&lssc);
|
||||
|
||||
/* if link_share is not specified, use bandwidth */
|
||||
if (opts->lssc_m2 == 0)
|
||||
opts->lssc_m2 = pa->bandwidth;
|
||||
|
||||
/*
|
||||
* admission control:
|
||||
* for the real-time service curve, the sum of the service curves
|
||||
* should not exceed 80% of the interface bandwidth. 20% is reserved
|
||||
* not to over-commit the actual interface bandwidth.
|
||||
* for the link-sharing service curve, the sum of the child service
|
||||
* curve should not exceed the parent service curve.
|
||||
* for the upper-limit service curve, the assigned bandwidth should
|
||||
* be smaller than the interface bandwidth, and the upper-limit should
|
||||
* be larger than the real-time service curve when both are defined.
|
||||
*/
|
||||
parent = qname_to_pfaltq(pa->parent, pa->ifname);
|
||||
if (parent == NULL)
|
||||
errx(1, "parent %s not found for %s", pa->parent, pa->qname);
|
||||
|
||||
TAILQ_FOREACH(altq, &altqs, entries) {
|
||||
if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
|
||||
continue;
|
||||
if (altq->qname[0] == 0) /* this is for interface */
|
||||
continue;
|
||||
|
||||
if (strncmp(altq->parent, pa->parent, PF_QNAME_SIZE) != 0)
|
||||
continue;
|
||||
|
||||
/* if the class has a link-sharing service curve, add it. */
|
||||
if (opts->lssc_m2 != 0 && altq->pq_u.fairq_opts.lssc_m2 != 0) {
|
||||
sc.m1 = altq->pq_u.fairq_opts.lssc_m1;
|
||||
sc.d = altq->pq_u.fairq_opts.lssc_d;
|
||||
sc.m2 = altq->pq_u.fairq_opts.lssc_m2;
|
||||
gsc_add_sc(&lssc, &sc);
|
||||
}
|
||||
}
|
||||
|
||||
/* check the link-sharing service curve. */
|
||||
if (opts->lssc_m2 != 0) {
|
||||
sc.m1 = parent->pq_u.fairq_opts.lssc_m1;
|
||||
sc.d = parent->pq_u.fairq_opts.lssc_d;
|
||||
sc.m2 = parent->pq_u.fairq_opts.lssc_m2;
|
||||
if (!is_gsc_under_sc(&lssc, &sc)) {
|
||||
warnx("link-sharing sc exceeds parent's sc");
|
||||
goto err_ret;
|
||||
}
|
||||
}
|
||||
|
||||
gsc_destroy(&lssc);
|
||||
|
||||
return (0);
|
||||
|
||||
err_ret:
|
||||
gsc_destroy(&lssc);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
static int
|
||||
check_commit_hfsc(int dev, int opts, struct pf_altq *pa)
|
||||
{
|
||||
@ -846,6 +948,43 @@ check_commit_hfsc(int dev, int opts, struct pf_altq *pa)
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
check_commit_fairq(int dev __unused, int opts __unused, struct pf_altq *pa)
|
||||
{
|
||||
struct pf_altq *altq, *def = NULL;
|
||||
int default_class;
|
||||
int error = 0;
|
||||
|
||||
/* check if fairq has one default queue for this interface */
|
||||
default_class = 0;
|
||||
TAILQ_FOREACH(altq, &altqs, entries) {
|
||||
if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
|
||||
continue;
|
||||
if (altq->qname[0] == 0) /* this is for interface */
|
||||
continue;
|
||||
if (altq->pq_u.fairq_opts.flags & FARF_DEFAULTCLASS) {
|
||||
default_class++;
|
||||
def = altq;
|
||||
}
|
||||
}
|
||||
if (default_class != 1) {
|
||||
warnx("should have one default queue on %s", pa->ifname);
|
||||
return (1);
|
||||
}
|
||||
/* make sure the default queue is a leaf */
|
||||
TAILQ_FOREACH(altq, &altqs, entries) {
|
||||
if (strncmp(altq->ifname, pa->ifname, IFNAMSIZ) != 0)
|
||||
continue;
|
||||
if (altq->qname[0] == 0) /* this is for interface */
|
||||
continue;
|
||||
if (strncmp(altq->parent, def->qname, PF_QNAME_SIZE) == 0) {
|
||||
warnx("default queue is not a leaf");
|
||||
error++;
|
||||
}
|
||||
}
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
print_hfsc_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
|
||||
{
|
||||
@ -892,6 +1031,43 @@ print_hfsc_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
print_fairq_opts(const struct pf_altq *a, const struct node_queue_opt *qopts)
|
||||
{
|
||||
const struct fairq_opts *opts;
|
||||
const struct node_fairq_sc *loc_lssc;
|
||||
|
||||
opts = &a->pq_u.fairq_opts;
|
||||
if (qopts == NULL)
|
||||
loc_lssc = NULL;
|
||||
else
|
||||
loc_lssc = &qopts->data.fairq_opts.linkshare;
|
||||
|
||||
if (opts->flags ||
|
||||
(opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth ||
|
||||
opts->lssc_d != 0))) {
|
||||
printf("fairq(");
|
||||
if (opts->flags & FARF_RED)
|
||||
printf(" red");
|
||||
if (opts->flags & FARF_ECN)
|
||||
printf(" ecn");
|
||||
if (opts->flags & FARF_RIO)
|
||||
printf(" rio");
|
||||
if (opts->flags & FARF_CLEARDSCP)
|
||||
printf(" cleardscp");
|
||||
if (opts->flags & FARF_DEFAULTCLASS)
|
||||
printf(" default");
|
||||
if (opts->lssc_m2 != 0 && (opts->lssc_m2 != a->bandwidth ||
|
||||
opts->lssc_d != 0))
|
||||
print_fairq_sc("linkshare", opts->lssc_m1, opts->lssc_d,
|
||||
opts->lssc_m2, loc_lssc);
|
||||
printf(" ) ");
|
||||
|
||||
return (1);
|
||||
} else
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*
|
||||
* admission control using generalized service curve
|
||||
*/
|
||||
@ -1211,6 +1387,23 @@ eval_queue_opts(struct pf_altq *pa, struct node_queue_opt *opts,
|
||||
opts->data.hfsc_opts.upperlimit.d;
|
||||
}
|
||||
break;
|
||||
case ALTQT_FAIRQ:
|
||||
pa->pq_u.fairq_opts.flags = opts->data.fairq_opts.flags;
|
||||
pa->pq_u.fairq_opts.nbuckets = opts->data.fairq_opts.nbuckets;
|
||||
pa->pq_u.fairq_opts.hogs_m1 =
|
||||
eval_bwspec(&opts->data.fairq_opts.hogs_bw, ref_bw);
|
||||
|
||||
if (opts->data.fairq_opts.linkshare.used) {
|
||||
pa->pq_u.fairq_opts.lssc_m1 =
|
||||
eval_bwspec(&opts->data.fairq_opts.linkshare.m1,
|
||||
ref_bw);
|
||||
pa->pq_u.fairq_opts.lssc_m2 =
|
||||
eval_bwspec(&opts->data.fairq_opts.linkshare.m2,
|
||||
ref_bw);
|
||||
pa->pq_u.fairq_opts.lssc_d =
|
||||
opts->data.fairq_opts.linkshare.d;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
warnx("eval_queue_opts: unknown scheduler type %u",
|
||||
opts->qtype);
|
||||
@ -1256,3 +1449,27 @@ print_hfsc_sc(const char *scname, u_int m1, u_int d, u_int m2,
|
||||
if (d != 0)
|
||||
printf(")");
|
||||
}
|
||||
|
||||
void
|
||||
print_fairq_sc(const char *scname, u_int m1, u_int d, u_int m2,
|
||||
const struct node_fairq_sc *sc)
|
||||
{
|
||||
printf(" %s", scname);
|
||||
|
||||
if (d != 0) {
|
||||
printf("(");
|
||||
if (sc != NULL && sc->m1.bw_percent > 0)
|
||||
printf("%u%%", sc->m1.bw_percent);
|
||||
else
|
||||
printf("%s", rate2str((double)m1));
|
||||
printf(" %u", d);
|
||||
}
|
||||
|
||||
if (sc != NULL && sc->m2.bw_percent > 0)
|
||||
printf(" %u%%", sc->m2.bw_percent);
|
||||
else
|
||||
printf(" %s", rate2str((double)m2));
|
||||
|
||||
if (d != 0)
|
||||
printf(")");
|
||||
}
|
||||
|
@ -150,12 +150,27 @@ struct node_hfsc_opts {
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct node_fairq_sc {
|
||||
struct node_queue_bw m1; /* slope of 1st segment; bps */
|
||||
u_int d; /* x-projection of m1; msec */
|
||||
struct node_queue_bw m2; /* slope of 2nd segment; bps */
|
||||
u_int8_t used;
|
||||
};
|
||||
|
||||
struct node_fairq_opts {
|
||||
struct node_fairq_sc linkshare;
|
||||
struct node_queue_bw hogs_bw;
|
||||
u_int nbuckets;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct node_queue_opt {
|
||||
int qtype;
|
||||
union {
|
||||
struct cbq_opts cbq_opts;
|
||||
struct priq_opts priq_opts;
|
||||
struct node_hfsc_opts hfsc_opts;
|
||||
struct node_fairq_opts fairq_opts;
|
||||
} data;
|
||||
};
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user