Verified Commit 3c6850f3 authored by Shawn Webb's avatar Shawn Webb
Browse files

Merge remote-tracking branch 'freebsd/main' into hardened/current/master

parents c0a7c121 da52fc46
......@@ -1323,10 +1323,6 @@ __installcheck_sh_check: .PHONY
#
# Required install tools to be saved in a scratch dir for safety.
#
.if ${MK_ZONEINFO} != "no"
_zoneinfo= zic tzsetup
.endif
.if !defined(CROSSBUILD_HOST)
_sysctl=sysctl
.endif
......@@ -1334,14 +1330,19 @@ _sysctl=sysctl
ITOOLS= [ awk cap_mkdb cat chflags chmod chown cmp cp \
date echo egrep find grep id install ${_install-info} \
ln make mkdir mtree mv pwd_mkdb \
rm sed services_mkdb sh sort strip ${_sysctl} test time true uname wc \
${_zoneinfo} ${LOCAL_ITOOLS}
rm sed services_mkdb sh sort strip ${_sysctl} test time true uname wc
.if ${MK_ZONEINFO} != "no"
ITOOLS+=tzsetup
.endif
# Needed for share/man
.if ${MK_MAN_UTILS} != "no"
ITOOLS+=makewhatis
.endif
ITOOLS+=${LOCAL_ITOOLS}
#
# distributeworld
#
......@@ -2236,6 +2237,11 @@ _strfile= usr.bin/fortune/strfile
# C source for loader built in font (8x16.c).
_vtfontcvt= usr.bin/vtfontcvt
# zic is used to compile timezone data
.if ${MK_ZONEINFO} != "no"
_zic= usr.sbin/zic
.endif
# If we are not building the bootstrap because BOOTSTRAPPING is sufficient
# we symlink the host version to $WORLDTMP instead. By doing this we can also
# detect when a bootstrap tool is being used without the required MK_FOO.
......@@ -2438,10 +2444,6 @@ _basic_bootstrap_tools+=usr.bin/jot
_basic_bootstrap_tools+=sbin/md5
.endif
.if ${MK_ZONEINFO} != "no"
_basic_bootstrap_tools+=usr.sbin/zic usr.sbin/tzsetup
.endif
.if defined(BOOTSTRAP_ALL_TOOLS)
_other_bootstrap_tools+=${_basic_bootstrap_tools}
.for _subdir _links in ${_basic_bootstrap_tools_multilink}
......@@ -2526,6 +2528,7 @@ bootstrap-tools: ${_bt}-links .PHONY
${_localedef} \
${_mkcsmapper} \
${_mkesdb} \
${_zic} \
${LOCAL_BSTOOL_DIRS}
${_bt}-${_tool}: ${_bt}-links .PHONY .MAKE
${_+_}@${ECHODIR} "===> ${_tool} (obj,all,install)"; \
......
......@@ -77,7 +77,12 @@ static void __libcpp_platform_wake_by_address(__cxx_atomic_contention_t const vo
const_cast<__cxx_atomic_contention_t*>(__ptr), 0);
}
#elif defined(__FreeBSD__) && defined(__LP64__)
#elif defined(__FreeBSD__) && __SIZEOF_LONG__ == 8
/*
* Since __cxx_contention_t is int64_t even on 32bit FreeBSD
* platforms, we have to use umtx ops that work on the long type, and
* limit its use to architectures where long and int64_t are synonyms.
*/
static void __libcpp_platform_wait_on_address(__cxx_atomic_contention_t const volatile* __ptr,
__cxx_contention_t __val)
......
/* $NetBSD: t_mktime.c,v 1.5 2012/03/18 07:33:58 jruoho Exp $ */
/* $NetBSD: t_mktime.c,v 1.6 2017/10/27 00:55:27 kre Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
......@@ -64,18 +64,16 @@ ATF_TC_HEAD(mktime_negyear, tc)
ATF_TC_BODY(mktime_negyear, tc)
{
#ifdef __FreeBSD__
atf_tc_expect_fail("needs work");
#endif
struct tm tms;
time_t t;
(void)memset(&tms, 0, sizeof(tms));
tms.tm_year = ~0;
tms.tm_year = -1;
tms.tm_mday = 1;
errno = 0;
t = mktime(&tms);
ATF_REQUIRE_ERRNO(0, t != (time_t)-1);
ATF_REQUIRE(t != (time_t)-1);
}
ATF_TC(timegm_epoch);
......@@ -95,7 +93,7 @@ ATF_TC_BODY(timegm_epoch, tc)
tms.tm_year = 1970 - 1900;
tms.tm_mday = 1;
t = timegm(&tms);
ATF_REQUIRE_ERRNO(0, t == (time_t)0);
ATF_REQUIRE(t == (time_t)0);
/* one second after midnight on 1 Jan 1970 */
(void)memset(&tms, 0, sizeof(tms));
......@@ -104,7 +102,7 @@ ATF_TC_BODY(timegm_epoch, tc)
tms.tm_mday = 1;
tms.tm_sec = 1;
t = timegm(&tms);
ATF_REQUIRE_ERRNO(0, t == (time_t)1);
ATF_REQUIRE(t == (time_t)1);
/*
* 1969-12-31 23:59:59 = one second before the epoch.
......@@ -119,7 +117,8 @@ ATF_TC_BODY(timegm_epoch, tc)
tms.tm_min = 59;
tms.tm_sec = 59;
t = timegm(&tms);
ATF_REQUIRE_ERRNO(0, t == (time_t)-1);
ATF_REQUIRE(t == (time_t)-1);
/* ATF_REQUIRE(errno == 0); does not work, errno is kept clear */
/*
* Another way of getting one second before the epoch:
......@@ -131,7 +130,7 @@ ATF_TC_BODY(timegm_epoch, tc)
tms.tm_mday = 1;
tms.tm_sec = -1;
t = timegm(&tms);
ATF_REQUIRE_ERRNO(0, t == (time_t)-1);
ATF_REQUIRE(t == (time_t)-1);
/*
* Two seconds before the epoch.
......@@ -142,7 +141,7 @@ ATF_TC_BODY(timegm_epoch, tc)
tms.tm_mday = 1;
tms.tm_sec = -2;
t = timegm(&tms);
ATF_REQUIRE_ERRNO(0, t == (time_t)-2);
ATF_REQUIRE(t == (time_t)-2);
}
......
......@@ -3,7 +3,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd December 15, 2022
.Dd January 21, 2023
.Dt ZIC 8
.Os
.Sh NAME
......@@ -71,6 +71,8 @@ mishandles timestamps after the year 2038 anyway.
Also see the
.Fl r
option for another way to alter output size.
.It Fl D
Do not create directories.
.It Fl d Ar directory
Create time conversion information files in the named directory rather than
in the standard directory named below.
......
......@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd October 28, 2022
.Dd January 25, 2023
.Dt STRFMON 3
.Os
.Sh NAME
......@@ -37,13 +37,15 @@
.In monetary.h
.Ft ssize_t
.Fn strfmon "char * restrict s" "size_t maxsize" "const char * restrict format" "..."
.In monetary.h
.In xlocale.h
.Ft ssize_t
.Fn strfmon_l "char * restrict s" "size_t maxsize" "locale_t loc" "const char * restrict format" "..."
.Sh DESCRIPTION
The
.Fn strfmon
function places characters into the array pointed to by
.Fa s
.Fa s ,
as controlled by the string pointed to by
.Fa format .
No more than
......@@ -52,9 +54,9 @@ bytes are placed into the array.
.Pp
The
.Fn strfmon_l
function does the same as
function takes an explicit locale argument, whereas the
.Fn strfmon
but takes an explicit locale rather than using the current locale.
function uses the current global or per-thread locale.
.Pp
The format string is composed of zero or more directives:
ordinary characters (not
......@@ -129,12 +131,14 @@ character is written.
.El
.El
.Sh RETURN VALUES
If the total number of resulting bytes including the terminating
If the total number of resulting bytes, including the terminating
.Dv NUL
byte is not more than
byte, is not more than
.Fa maxsize ,
.Fn strfmon
returns the number of bytes placed into the array pointed to by
and
.Fn strfmon_l
return the number of bytes placed into the array pointed to by
.Fa s ,
not including the terminating
.Dv NUL
......@@ -144,11 +148,31 @@ the contents of the array are indeterminate,
and
.Va errno
is set to indicate the error.
.Pp
The
.Fn strfmon_l
function returns the same values as
.Fn strfmon .
.Sh EXAMPLES
The following example will format the value
.Dq Li 1234567.89
to the string
.Dq Li $1,234,567.89 :
.Bd -literal -offset indent
#include <stdio.h>
#include <monetary.h>
#include <xlocale.h>
int
main()
{
char string[100];
double money = 1234567.89;
if (setlocale(LC_MONETARY, "en_US.UTF-8") == NULL) {
fprintf(stderr, "Unable to setlocale().\\n");
return (1);
}
strfmon(string, sizeof(string) - 1, "%n", money);
printf("%s\\n", string);
}
.Ed
.Sh ERRORS
The
.Fn strfmon
......
......@@ -645,7 +645,7 @@ ssize_t
strfmon(char * __restrict s, size_t maxsize, const char * __restrict format,
...)
{
size_t ret;
ssize_t ret;
va_list ap;
va_start(ap, format);
......@@ -659,7 +659,7 @@ ssize_t
strfmon_l(char * __restrict s, size_t maxsize, locale_t loc,
const char * __restrict format, ...)
{
size_t ret;
ssize_t ret;
va_list ap;
va_start(ap, format);
......
......@@ -22,7 +22,7 @@
.\" $FreeBSD$
.\"
.Dd March 19, 2022
.Dd January 19, 2023
.Dt MIXER 3
.Os
.Sh NAME
......@@ -108,7 +108,7 @@ a simple way.
A mixer is described by the following structure:
.Bd -literal
struct mixer {
TAILQ_HEAD(, mix_dev) devs; /* device list */
TAILQ_HEAD(mix_devhead, mix_dev) devs; /* device list */
struct mix_dev *dev; /* selected device */
oss_mixerinfo mi; /* mixer info */
oss_card_info ci; /* audio card info */
......@@ -212,7 +212,7 @@ struct mix_dev {
float right; /* right volume */
} vol;
int nctl; /* number of controls */
TAILQ_HEAD(, mix_ctl) ctls; /* control list */
TAILQ_HEAD(mix_ctlhead, mix_ctl) ctls; /* control list */
TAILQ_ENTRY(mix_dev) devs;
};
.Ed
......
.\"
.\" $FreeBSD$
.\"
.Dd January 13, 2023
.Dd January 25, 2023
.Dt IPFW 8
.Os
.Sh NAME
......@@ -4631,7 +4631,7 @@ Bear in mind that this is example only and it is not very useful by itself.
.Pp
On way out, after all checks place this rules:
.Pp
.Dl "ipfw add allow record-state skip-action"
.Dl "ipfw add allow record-state defer-action"
.Dl "ipfw add nat 1"
.Pp
And on way in there should be something like this:
......
.\" SPDX-License-Identifier: BSD-3-Clause
.\" Copyright(c) 2007-2022 Intel Corporation
.\" $FreeBSD$
.Dd June 30, 2022
.Dd September 1, 2022
.Dt QAT 4
.Os
.Sh NAME
......@@ -30,6 +30,8 @@ qat_c62x_fw_load="YES"
.It
qat_dh895xcc_fw_load="YES"
.It
qat_4xxx_fw_load="YES"
.It
qat_load="YES"
.El
.Sh DESCRIPTION
......@@ -53,6 +55,8 @@ Intel (R) QuickAssist Adapter 8960/Intel (R) QuickAssist Adapter 8970
Intel (R) Communications Chipset 8925 to 8955 Series
.It
Intel (R) Atom P5300 processor product family
.It
Intel (R) QAT 4xxx Series
.El
.Pp
The
......
This diff is collapsed.
......@@ -51,7 +51,6 @@ LEAPFILE=
TZFILES= africa antarctica asia australasia etcetera europe \
factory northamerica southamerica
TZFILES+= backward
POSIXRULES= America/New_York
TZFILES:= ${TZFILES:S/^/${CONTRIBDIR}/}
......@@ -78,11 +77,16 @@ all: zoneinfo
.endif
META_TARGETS+= zoneinfo install-zoneinfo
#
# Produce “fat” zoneinfo files for backward compatibility.
#
ZICFLAGS?= -b fat
zoneinfo: ${TDATA}
mkdir -p ${TZBUILDDIR}
cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
umask 022; cd ${.CURDIR}; \
zic -D -d ${TZBUILDDIR} -p ${POSIXRULES} -m ${NOBINMODE} \
zic -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
${LEAPFILE} ${TZFILES}
#
......
......@@ -62,8 +62,6 @@ SRCS+= metadata.c
.include "${BOOTSRC}/fdt.mk"
CFLAGS+= -fPIC
# Pick up the bootstrap header for some interface items
CFLAGS+= -I${LDRSRC}
......
......@@ -89,7 +89,7 @@ __FBSDID("$FreeBSD$");
#include "a10_sramc.h"
struct emac_softc {
struct ifnet *emac_ifp;
if_t emac_ifp;
device_t emac_dev;
device_t emac_miibus;
bus_space_handle_t emac_handle;
......@@ -118,11 +118,11 @@ static int emac_sys_setup(struct emac_softc *);
static void emac_reset(struct emac_softc *);
static void emac_init_locked(struct emac_softc *);
static void emac_start_locked(struct ifnet *);
static void emac_start_locked(if_t);
static void emac_init(void *);
static void emac_stop_locked(struct emac_softc *);
static void emac_intr(void *);
static int emac_ioctl(struct ifnet *, u_long, caddr_t);
static int emac_ioctl(if_t, u_long, caddr_t);
static void emac_rxeof(struct emac_softc *, int);
static void emac_txeof(struct emac_softc *, uint32_t);
......@@ -131,8 +131,8 @@ static int emac_miibus_readreg(device_t, int, int);
static int emac_miibus_writereg(device_t, int, int, int);
static void emac_miibus_statchg(device_t);
static int emac_ifmedia_upd(struct ifnet *);
static void emac_ifmedia_sts(struct ifnet *, struct ifmediareq *);
static int emac_ifmedia_upd(if_t);
static void emac_ifmedia_sts(if_t, struct ifmediareq *);
static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int);
static int sysctl_hw_emac_proc_limit(SYSCTL_HANDLER_ARGS);
......@@ -232,7 +232,7 @@ emac_hash_maddr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
static void
emac_set_rx_mode(struct emac_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
uint32_t hashes[2];
uint32_t rcr = 0;
......@@ -248,7 +248,7 @@ emac_set_rx_mode(struct emac_softc *sc)
hashes[0] = 0;
hashes[1] = 0;
if (ifp->if_flags & IFF_ALLMULTI) {
if (if_getflags(ifp) & IFF_ALLMULTI) {
hashes[0] = 0xffffffff;
hashes[1] = 0xffffffff;
} else
......@@ -258,12 +258,12 @@ emac_set_rx_mode(struct emac_softc *sc)
EMAC_WRITE_REG(sc, EMAC_RX_HASH0, hashes[0]);
EMAC_WRITE_REG(sc, EMAC_RX_HASH1, hashes[1]);
if (ifp->if_flags & IFF_BROADCAST) {
if (if_getflags(ifp) & IFF_BROADCAST) {
rcr |= EMAC_RX_BCO;
rcr |= EMAC_RX_MCO;
}
if (ifp->if_flags & IFF_PROMISC)
if (if_getflags(ifp) & IFF_PROMISC)
rcr |= EMAC_RX_PA;
else
rcr |= EMAC_RX_UCAD;
......@@ -292,7 +292,7 @@ emac_drain_rxfifo(struct emac_softc *sc)
static void
emac_txeof(struct emac_softc *sc, uint32_t status)
{
struct ifnet *ifp;
if_t ifp;
EMAC_ASSERT_LOCKED(sc);
......@@ -303,7 +303,7 @@ emac_txeof(struct emac_softc *sc, uint32_t status)
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 2);
else
if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
/* Unarm watchdog timer if no TX */
sc->emac_watchdog_timer = 0;
......@@ -312,7 +312,7 @@ emac_txeof(struct emac_softc *sc, uint32_t status)
static void
emac_rxeof(struct emac_softc *sc, int count)
{
struct ifnet *ifp;
if_t ifp;
struct mbuf *m, *m0;
uint32_t reg_val, rxcount;
int16_t len;
......@@ -321,7 +321,7 @@ emac_rxeof(struct emac_softc *sc, int count)
ifp = sc->emac_ifp;
for (; count > 0 &&
(ifp->if_drv_flags & IFF_DRV_RUNNING) != 0; count--) {
(if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0; count--) {
/*
* Race warning: The first packet might arrive with
* the interrupts disabled, but the second will fix
......@@ -443,7 +443,7 @@ emac_rxeof(struct emac_softc *sc, int count)
}
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
EMAC_UNLOCK(sc);
(*ifp->if_input)(ifp, m);
if_input(ifp, m);
EMAC_LOCK(sc);
}
}
......@@ -451,7 +451,7 @@ emac_rxeof(struct emac_softc *sc, int count)
static void
emac_watchdog(struct emac_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
EMAC_ASSERT_LOCKED(sc);
......@@ -468,9 +468,9 @@ emac_watchdog(struct emac_softc *sc)
if_printf(sc->emac_ifp, "watchdog timeout -- resetting\n");
if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
if_setdrvflagbits(ifp, 0, IFF_DRV_RUNNING);
emac_init_locked(sc);
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
if (!if_sendq_empty(ifp))
emac_start_locked(ifp);
}
......@@ -502,7 +502,7 @@ emac_init(void *xcs)
static void
emac_init_locked(struct emac_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
struct mii_data *mii;
uint32_t reg_val;
uint8_t *eaddr;
......@@ -510,7 +510,7 @@ emac_init_locked(struct emac_softc *sc)
EMAC_ASSERT_LOCKED(sc);
ifp = sc->emac_ifp;
if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0)
if ((if_getdrvflags(ifp) & IFF_DRV_RUNNING) != 0)
return;
/* Flush RX FIFO */
......@@ -575,7 +575,7 @@ emac_init_locked(struct emac_softc *sc)
EMAC_WRITE_REG(sc, EMAC_MAC_MAXF, EMAC_MAC_MFL);
/* Setup ethernet address */
eaddr = IF_LLADDR(ifp);
eaddr = if_getlladdr(ifp);
EMAC_WRITE_REG(sc, EMAC_MAC_A1, eaddr[0] << 16 |
eaddr[1] << 8 | eaddr[2]);
EMAC_WRITE_REG(sc, EMAC_MAC_A0, eaddr[3] << 16 |
......@@ -589,8 +589,8 @@ emac_init_locked(struct emac_softc *sc)
reg_val |= EMAC_INT_EN;
EMAC_WRITE_REG(sc, EMAC_INT_CTL, reg_val);
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
if_setdrvflagbits(ifp, IFF_DRV_RUNNING, 0);
if_setdrvflagbits(ifp, 0, IFF_DRV_OACTIVE);
sc->emac_link = 0;
......@@ -602,31 +602,31 @@ emac_init_locked(struct emac_softc *sc)
}
static void
emac_start(struct ifnet *ifp)
emac_start(if_t ifp)
{
struct emac_softc *sc;
sc = ifp->if_softc;
sc = if_getsoftc(ifp);
EMAC_LOCK(sc);
emac_start_locked(ifp);
EMAC_UNLOCK(sc);
}
static void
emac_start_locked(struct ifnet *ifp)
emac_start_locked(if_t ifp)
{
struct emac_softc *sc;
struct mbuf *m, *m0;
uint32_t fifo, reg;
sc = ifp->if_softc;
if (ifp->if_drv_flags & IFF_DRV_OACTIVE)
sc = if_getsoftc(ifp);
if (if_getdrvflags(ifp) & IFF_DRV_OACTIVE)
return;
if (sc->emac_fifo_mask == (EMAC_TX_FIFO0 | EMAC_TX_FIFO1))
return;
if (sc->emac_link == 0)
return;
IFQ_DRV_DEQUEUE(&ifp->if_snd, m);
m = if_dequeue(ifp);
if (m == NULL)
return;
......@@ -637,7 +637,7 @@ emac_start_locked(struct ifnet *ifp)
fifo = 0;
sc->emac_fifo_mask |= (1 << fifo);
if (sc->emac_fifo_mask == (EMAC_TX_FIFO0 | EMAC_TX_FIFO1))
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
if_setdrvflagbits(ifp, IFF_DRV_OACTIVE, 0);
EMAC_WRITE_REG(sc, EMAC_TX_INS, fifo);
/*
......@@ -677,13 +677,13 @@ emac_start_locked(struct ifnet *ifp)
static void
emac_stop_locked(struct emac_softc *sc)
{
struct ifnet *ifp;
if_t ifp;
uint32_t reg_val;
EMAC_ASSERT_LOCKED(sc);
ifp = sc->emac_ifp;
ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE);
if_setdrvflagbits(ifp, 0, (IFF_DRV_RUNNING | IFF_DRV_OACTIVE));
sc->emac_link = 0;
/* Disable all interrupt and clear interrupt status */
......@@ -703,7 +703,7 @@ static void
emac_intr(void *arg)
{
struct emac_softc *sc;
struct ifnet *ifp;
if_t ifp;
uint32_t reg_val;
sc = (struct emac_softc *)arg;
......@@ -724,7 +724,7 @@ emac_intr(void *arg)
if (reg_val & EMAC_INT_STA_TX) {
emac_txeof(sc, reg_val);
ifp = sc->emac_ifp;
if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd))
if (!if_sendq_empty(ifp))
emac_start_locked(ifp);
}
......@@ -736,37 +736,37 @@ emac_intr(void *arg)
}