aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/blocklist/bin/blocklistctl.82
-rw-r--r--contrib/blocklist/bin/blocklistd.c8
-rw-r--r--contrib/blocklist/bin/state.c6
-rw-r--r--lib/libc/posix1e/mac_free.34
-rw-r--r--lib/libc/posix1e/mac_text.38
-rw-r--r--lib/libsys/write.220
-rw-r--r--sbin/ipfw/ipfw2.c2
-rw-r--r--sbin/nvmecontrol/perftest.c2
-rw-r--r--sbin/pfctl/parse.y2
-rw-r--r--share/man/man3/queue.36
-rw-r--r--share/man/man3/siginfo.32
-rw-r--r--share/man/man4/acpi_battery.44
-rw-r--r--share/man/man4/ahc.42
-rw-r--r--share/man/man4/bce.42
-rw-r--r--share/man/man4/iwlwifi.42
-rw-r--r--share/man/man4/mac_do.42
-rw-r--r--share/man/man4/p9fs.42
-rw-r--r--share/man/man5/pf.conf.52
-rw-r--r--share/man/man5/rc.conf.54
-rw-r--r--share/man/man7/arch.72
-rw-r--r--share/man/man7/build.74
-rw-r--r--share/man/man8/debug.sh.84
-rw-r--r--share/man/man8/rc.subr.82
-rw-r--r--share/man/man9/PCI_IOV_ADD_VF.92
-rw-r--r--share/man/man9/atomic.92
-rw-r--r--share/man/man9/bhnd.92
-rw-r--r--share/man/man9/bus_dma.94
-rw-r--r--share/man/man9/copy.92
-rw-r--r--share/man/man9/crypto_request.92
-rw-r--r--share/man/man9/domain.92
-rw-r--r--share/man/man9/efirt.92
-rw-r--r--share/man/man9/g_bio.93
-rw-r--r--share/man/man9/g_geom.92
-rw-r--r--share/man/man9/gone_in.94
-rw-r--r--share/man/man9/ifnet.92
-rw-r--r--share/man/man9/nvmem.98
-rw-r--r--share/man/man9/ofw_bus_is_compatible.92
-rw-r--r--share/man/man9/pci.92
-rw-r--r--share/man/man9/refcount.92
-rw-r--r--share/man/man9/seqc.92
-rw-r--r--share/man/man9/style.94
-rw-r--r--share/man/man9/vn_fullpath.94
-rw-r--r--sys/arm64/arm64/db_disasm.c1
-rw-r--r--sys/arm64/include/_armreg.h57
-rw-r--r--sys/arm64/include/armreg.h20
-rw-r--r--sys/arm64/include/cpu.h2
-rw-r--r--sys/arm64/include/db_machdep.h1
-rw-r--r--sys/arm64/include/hypervisor.h2
-rw-r--r--sys/arm64/vmm/io/vgic_v3.c1
-rw-r--r--sys/arm64/vmm/io/vtimer.c1
-rw-r--r--sys/arm64/vmm/vmm.c1
-rw-r--r--sys/arm64/vmm/vmm_arm64.c1
-rw-r--r--sys/arm64/vmm/vmm_hyp.c1
-rw-r--r--sys/arm64/vmm/vmm_reset.c1
-rw-r--r--sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c199
-rw-r--r--sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c8
-rw-r--r--sys/dev/ofw/ofw_cpu.c7
-rw-r--r--sys/dev/sound/dummy.c5
-rw-r--r--sys/fs/fuse/fuse_device.c7
-rw-r--r--sys/isa/isa_common.c4
-rw-r--r--sys/modules/thunderbolt/Makefile2
-rw-r--r--sys/netgraph/ng_device.c126
-rw-r--r--sys/netinet/udp_usrreq.c29
-rw-r--r--tests/sys/fs/fusefs/mockfs.cc4
-rw-r--r--tests/sys/fs/fusefs/mockfs.hh4
-rw-r--r--tests/sys/fs/fusefs/notify.cc56
-rw-r--r--usr.sbin/bhyve/bhyve.821
-rw-r--r--usr.sbin/bhyve/net_backends.c19
-rw-r--r--usr.sbin/bluetooth/rtlbtfw/main.c2
-rw-r--r--usr.sbin/cxgbetool/tcbshowt7.c2
-rw-r--r--usr.sbin/fwcontrol/fwcontrol.c2
-rw-r--r--usr.sbin/pmcstat/pmcstat.c2
72 files changed, 524 insertions, 211 deletions
diff --git a/contrib/blocklist/bin/blocklistctl.8 b/contrib/blocklist/bin/blocklistctl.8
index 75228599a9de..d241f2844471 100644
--- a/contrib/blocklist/bin/blocklistctl.8
+++ b/contrib/blocklist/bin/blocklistctl.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: blocklistctl.8,v 1.5 2025/10/25 16:56:27 christos Exp $
+.\" $NetBSD: blocklistctl.8,v 1.6 2025/10/26 13:49:22 christos Exp $
.\"
.\" Copyright (c) 2015 The NetBSD Foundation, Inc.
.\" All rights reserved.
diff --git a/contrib/blocklist/bin/blocklistd.c b/contrib/blocklist/bin/blocklistd.c
index c78c560613fc..47c145c7aae1 100644
--- a/contrib/blocklist/bin/blocklistd.c
+++ b/contrib/blocklist/bin/blocklistd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $ */
+/* $NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: blocklistd.c,v 1.11 2025/10/25 16:55:23 christos Exp $");
+__RCSID("$NetBSD: blocklistd.c,v 1.12 2025/10/25 18:43:51 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -329,8 +329,8 @@ again:
(*lfun)(LOG_INFO, "released %s/%d:%d after %d seconds",
buf, c.c_lmask, c.c_port, c.c_duration);
}
- state_del(state, &c);
- goto again;
+ if (state_del(state, &c) == 0)
+ goto again;
}
}
diff --git a/contrib/blocklist/bin/state.c b/contrib/blocklist/bin/state.c
index 08e2622e223f..bb93904f3489 100644
--- a/contrib/blocklist/bin/state.c
+++ b/contrib/blocklist/bin/state.c
@@ -1,4 +1,4 @@
-/* $NetBSD: state.c,v 1.2 2025/02/11 17:48:30 christos Exp $ */
+/* $NetBSD: state.c,v 1.3 2025/10/25 18:43:51 christos Exp $ */
/*-
* Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#ifdef HAVE_SYS_CDEFS_H
#include <sys/cdefs.h>
#endif
-__RCSID("$NetBSD: state.c,v 1.2 2025/02/11 17:48:30 christos Exp $");
+__RCSID("$NetBSD: state.c,v 1.3 2025/10/25 18:43:51 christos Exp $");
#include <sys/types.h>
#include <sys/socket.h>
@@ -131,7 +131,7 @@ state_del(DB *db, const struct conf *c)
(*lfun)(LOG_DEBUG, "%s: returns %d", __func__, rv);
(*db->sync)(db, 0);
}
- return 0;
+ return rv;
default:
(*lfun)(LOG_ERR, "%s: failed (%m)", __func__);
return -1;
diff --git a/lib/libc/posix1e/mac_free.3 b/lib/libc/posix1e/mac_free.3
index 4ed68b70f3a3..6674ca2e9094 100644
--- a/lib/libc/posix1e/mac_free.3
+++ b/lib/libc/posix1e/mac_free.3
@@ -31,7 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 21, 2023
+.Dd October 26, 2025
.Dt MAC_FREE 3
.Os
.Sh NAME
@@ -85,7 +85,7 @@ is a complex structure in the
implementation,
.Fn mac_free
is specific to
-.Vt mac_3 ,
+.Vt mac_t ,
and must not be used to free the character strings returned from
.Fn mac_to_text .
Doing so may result in undefined behavior.
diff --git a/lib/libc/posix1e/mac_text.3 b/lib/libc/posix1e/mac_text.3
index 29c1aacca485..7633f4b0da64 100644
--- a/lib/libc/posix1e/mac_text.3
+++ b/lib/libc/posix1e/mac_text.3
@@ -28,7 +28,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 21, 2023
+.Dd October 26, 2025
.Dt MAC_TEXT 3
.Os
.Sh NAME
@@ -52,14 +52,16 @@ into the internal policy label format
and places it in
.Fa *mac ,
which must later be freed with
-.Xr free 3 .
+.Xr mac_free 3 .
.Pp
The
.Fn mac_to_text
function allocates storage for
.Fa *text ,
which will be set to the text representation of
-.Fa label .
+.Fa label
+and must later be freed with
+.Xr free 3 .
.Pp
Refer to
.Xr maclabel 7
diff --git a/lib/libsys/write.2 b/lib/libsys/write.2
index d2ff41ceead9..77067893ab4c 100644
--- a/lib/libsys/write.2
+++ b/lib/libsys/write.2
@@ -132,6 +132,26 @@ and
may write fewer bytes than requested;
the return value must be noted,
and the remainder of the operation should be retried when possible.
+.Sh ATOMICITY OF WRITES
+When operating on regular files on local file systems, the effects of
+.Fn write
+are atomic.
+As required by the POSIX standard,
+the
+.Fn read ,
+.Fn write ,
+and
+.Fn ftruncate
+functions and their variations are atomic with respect to
+each other on the file data and metadata for regular files.
+See for instance
+.St -p1003.1-2024
+Volume 2, Section 2.9.7 for more information.
+.Pp
+.Fx
+implements the requirement by taking
+a read/write range lock on the file byte range
+affected by the corresponding function.
.Sh RETURN VALUES
Upon successful completion the number of bytes which were written
is returned.
diff --git a/sbin/ipfw/ipfw2.c b/sbin/ipfw/ipfw2.c
index eed390ba5bec..a2b3e121e5df 100644
--- a/sbin/ipfw/ipfw2.c
+++ b/sbin/ipfw/ipfw2.c
@@ -5802,7 +5802,7 @@ ipfw_add(char *av[])
sz = default_off + sizeof(ipfw_obj_ctlv) + tlen + rlen;
if ((tbuf = calloc(1, sz)) == NULL)
- err(EX_UNAVAILABLE, "malloc() failed for IP_FW_ADD");
+ err(EX_UNAVAILABLE, "malloc() failed for IP_FW_XADD");
op3 = (ip_fw3_opheader *)tbuf;
/* Tables first */
ctlv = (ipfw_obj_ctlv *)(op3 + 1);
diff --git a/sbin/nvmecontrol/perftest.c b/sbin/nvmecontrol/perftest.c
index 59439d3ed2a9..da75afc64d8d 100644
--- a/sbin/nvmecontrol/perftest.c
+++ b/sbin/nvmecontrol/perftest.c
@@ -171,7 +171,7 @@ perftest(const struct cmd *f, int argc, char *argv[])
arg_help(argc, argv, f);
}
if (opt.time == 0) {
- fprintf(stderr, "No time speciifed\n");
+ fprintf(stderr, "No time specified\n");
arg_help(argc, argv, f);
}
io_test.time = opt.time;
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index 0f7702fc4630..127e2c257d69 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -6246,7 +6246,7 @@ check_binat_redirspec(struct node_host *src_host, struct pfctl_rule *r,
}
if (PF_AZERO(&r->src.addr.v.a.mask, af) ||
PF_AZERO(&(nat_pool->addr.v.a.mask), af)) {
- yyerror ("source and redir addresess must have "
+ yyerror ("source and redir addresses must have "
"a matching network mask in binat-rule");
error++;
}
diff --git a/share/man/man3/queue.3 b/share/man/man3/queue.3
index 79c8d92decbe..535358ae82d5 100644
--- a/share/man/man3/queue.3
+++ b/share/man/man3/queue.3
@@ -1420,13 +1420,13 @@ while in userland builds it prints the diagnostic message on
.Dv stderr
and then calls
.Fn abort .
-These behaviors can be overriden by defining a custom
+These behaviors can be overridden by defining a custom
.Fn QMD_PANIC
macro before first inclusion of
.In sys/queue.h .
The diagnostic messages automatically include the source file, line and function
-where the failing check occured.
-This behavior can be overriden by defining a custom
+where the failing check occurred.
+This behavior can be overridden by defining a custom
.Fn QMD_ASSERT
macro before first inclusion of
.In sys/queue.h .
diff --git a/share/man/man3/siginfo.3 b/share/man/man3/siginfo.3
index f57cf5f7d706..59e3ecf8f3e8 100644
--- a/share/man/man3/siginfo.3
+++ b/share/man/man3/siginfo.3
@@ -224,7 +224,7 @@ raised by a hardware watchpoint exception may report the data address that
triggered the watchpoint in
.Va si_addr .
.Pp
-Sychronous signals set
+Synchronous signals set
.Va si_trapno
to a machine-dependent trap number.
.Pp
diff --git a/share/man/man4/acpi_battery.4 b/share/man/man4/acpi_battery.4
index 3707cd125678..49fed625ea31 100644
--- a/share/man/man4/acpi_battery.4
+++ b/share/man/man4/acpi_battery.4
@@ -158,8 +158,8 @@ Typically this will decrease every charging cycle.
.It btech
Battery technology:
.Bl -tag -width indent
-.It 0x00000000 Primary cell Pq non-rechargable
-.It 0x00000001 Secondary cell Pq rechargable
+.It 0x00000000 Primary cell Pq non-rechargeable
+.It 0x00000001 Secondary cell Pq rechargeable
.El
.It Va dvol
Design voltage in mV,
diff --git a/share/man/man4/ahc.4 b/share/man/man4/ahc.4
index 72a1e092f1bc..a2aa911c0646 100644
--- a/share/man/man4/ahc.4
+++ b/share/man/man4/ahc.4
@@ -144,7 +144,7 @@ system hang if memory mapped I/O is attempted.
.Pp
Most modern motherboards perform the initialization correctly and work fine
with this option enabled and it is the default. This option can also be
-dynamically configued through a device hint documented below.
+dynamically configured through a device hint documented below.
.Ed
.Pp
To statically configure one or more controllers to assume the target role:
diff --git a/share/man/man4/bce.4 b/share/man/man4/bce.4
index ab979f371b66..aab9eaebd505 100644
--- a/share/man/man4/bce.4
+++ b/share/man/man4/bce.4
@@ -240,7 +240,7 @@ Values from 0-256 are valid.
A value of 0 disables this status block update (default 6).
.It Va hw.bce.tx_ticks
Time in microsecond ticks to wait before a status block
-update is generated due to TX activitiy.
+update is generated due to TX activity.
Values from 0-100 are valid.
A value of 0 disables this status block update.
Cannot be set to 0 if hw.bce.tx_quick_cons_trip is also 0
diff --git a/share/man/man4/iwlwifi.4 b/share/man/man4/iwlwifi.4
index 660f6a9bf57c..411af54be9fb 100644
--- a/share/man/man4/iwlwifi.4
+++ b/share/man/man4/iwlwifi.4
@@ -284,7 +284,7 @@ module parameters and are mapped automatically by
.Sy linuxkpi .
They were not adjusted so that they stay consistent with upstream
Linux, e.g., for documentation available and problem investigations.
-This left their names inconsistent between themselves and incosistent to
+This left their names inconsistent between themselves and inconsistent to
.Fx
style.
.Pp
diff --git a/share/man/man4/mac_do.4 b/share/man/man4/mac_do.4
index 39bfafd95474..d02932070e25 100644
--- a/share/man/man4/mac_do.4
+++ b/share/man/man4/mac_do.4
@@ -246,7 +246,7 @@ nor contradictory ones.
In practice, no two clauses may display the same ID except for group IDs but
only if, each time the same ID appears, it does so with a different flag, or no
flags only once.
-Additionally, the specified flags in multiple occurences must not be
+Additionally, the specified flags in multiple occurrences must not be
contradictory.
For example, the same group ID appearing with both
.Ql +
diff --git a/share/man/man4/p9fs.4 b/share/man/man4/p9fs.4
index 04f27abd2545..a49053d461d4 100644
--- a/share/man/man4/p9fs.4
+++ b/share/man/man4/p9fs.4
@@ -96,7 +96,7 @@ may not work correctly.
If
.Nm
is the root filesystem,
-it is recommented to use with
+it is recommended to use with
.Xr tmpfs 5
to ensure that temporary files created in
.Pa /tmp
diff --git a/share/man/man5/pf.conf.5 b/share/man/man5/pf.conf.5
index 41410d6bc0fa..be46b1a47291 100644
--- a/share/man/man5/pf.conf.5
+++ b/share/man/man5/pf.conf.5
@@ -1490,7 +1490,7 @@ options and both implicitly and explicitly in the case of
ones.
A
.Ar rdr-to
-opion may cause the source port to be modified if doing so avoids a conflict
+option may cause the source port to be modified if doing so avoids a conflict
with an existing connection.
A random source port in the range 50001-65535 is chosen in this case.
Port numbers are never translated with a
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index edbfa937f8df..6274c1ee5b94 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -4950,7 +4950,7 @@ can be used in jails) depending on the content of the
.Ao Ar name Ac Ns Va _svcj_options
variable.
Typically this variable is set inside rc scripts, but it can be
-overriden in the rc config.
+overridden in the rc config.
Valid options for
.Ao Ar name Ac Ns Va _svcj_options
are:
@@ -5041,7 +5041,7 @@ service at all, or may set it to
if it is not set in the
rc config, to exclude it from
.Va svcj_all_enable
-but allow to explicitely enable it.
+but allow to explicitly enable it.
The sshd service for example would not see other jails, if
it would run as a service jail.
This may or may not be what is needed, and as such it is
diff --git a/share/man/man7/arch.7 b/share/man/man7/arch.7
index 668f5aa23155..5170a27768b8 100644
--- a/share/man/man7/arch.7
+++ b/share/man/man7/arch.7
@@ -76,7 +76,7 @@ Pointers should not be cast to
or
.Vt size_t
if they will later be cast back to a pointer that is expected to be
-dereferencable as they remain bare integer types on all architectures.
+dereferenceable as they remain bare integer types on all architectures.
.Pp
On some architectures, e.g.,
AIM variants of
diff --git a/share/man/man7/build.7 b/share/man/man7/build.7
index 5e15a528246b..9adfd4bc8a63 100644
--- a/share/man/man7/build.7
+++ b/share/man/man7/build.7
@@ -202,7 +202,7 @@ package or port provides a more generic solution.
.It Cm buildenvvars
Print the shell variables that are set for a
.Cm buildenv
-envirnoment and exit.
+environment and exit.
.It Cm buildworld
Build everything but the kernel, configure files in
.Pa etc ,
@@ -732,7 +732,7 @@ See
.Xr src.conf 5
.It Va REPODIR
The root directory used to create the package repository for building
-.Xr packges 7 .
+.Xr packages 7 .
Defaults to
.Pa ${OBJROOT}/repo/ .
This can also be set in
diff --git a/share/man/man8/debug.sh.8 b/share/man/man8/debug.sh.8
index bf0fdbd6bcf5..3b59d6ae2e78 100644
--- a/share/man/man8/debug.sh.8
+++ b/share/man/man8/debug.sh.8
@@ -143,7 +143,7 @@ and defaults to
.It Ic DebugTrace Ar message
Debug output can be very noisy, and it can be tricky
to align with the script.
-This function outputs a very noticable banner indicating the value of
+This function outputs a very noticeable banner indicating the value of
.Va DEBUG_ON ,
and
.Ar message
@@ -168,7 +168,7 @@ skipped/run when debugging is turned on.
.Va DEBUGGING
is the same as
.Va DEBUG_SKIP
-for backwards compatability and is only set by
+for backwards compatibility and is only set by
.Fn Debug .
.Pp
The use of
diff --git a/share/man/man8/rc.subr.8 b/share/man/man8/rc.subr.8
index 1fd5041cecd8..45a9e9a684cd 100644
--- a/share/man/man8/rc.subr.8
+++ b/share/man/man8/rc.subr.8
@@ -1010,7 +1010,7 @@ However, if
fails, just return.
.Pp
.Ic DebugOn
-will be called with tags derrived from
+will be called with tags derived from
.Va name
and
.Va rc_arg
diff --git a/share/man/man9/PCI_IOV_ADD_VF.9 b/share/man/man9/PCI_IOV_ADD_VF.9
index 512b0b8668cc..95bf5a218e8e 100644
--- a/share/man/man9/PCI_IOV_ADD_VF.9
+++ b/share/man/man9/PCI_IOV_ADD_VF.9
@@ -41,7 +41,7 @@ The
.Fn PCI_IOV_ADD_VF
method is called by the PCI Single-Root I/O Virtualization
.Pq SR-IOV
-infrastructure when it is initializating a new Virtual Function (VF) as a child
+infrastructure when it is initializing a new Virtual Function (VF) as a child
of the given Physical Function (PF) device.
This method will not be called until a successful call to
.Xr PCI_IOV_INIT 9
diff --git a/share/man/man9/atomic.9 b/share/man/man9/atomic.9
index df24cd4a4d2b..c9133c6311a5 100644
--- a/share/man/man9/atomic.9
+++ b/share/man/man9/atomic.9
@@ -272,7 +272,7 @@ In C11, a release fence by one thread synchronizes with an acquire fence by
another thread when an atomic load that is prior to the acquire fence (by
program order) reads the value written by an atomic store that is subsequent
to the release fence.
-In constrast, in
+In contrast, in
.Fx ,
because of the atomicity of ordinary, naturally
aligned loads and stores, fences can also be synchronized by ordinary loads
diff --git a/share/man/man9/bhnd.9 b/share/man/man9/bhnd.9
index 722ae6b6a393..ed3007ea748d 100644
--- a/share/man/man9/bhnd.9
+++ b/share/man/man9/bhnd.9
@@ -2350,7 +2350,7 @@ function retains and returns a reference to the provider registered for
.Fa service
with the parent
.Xr bhnd 4
-bus of devce
+bus of device
.Fa dev ,
if available.
On success, the caller is responsible for releasing this provider reference
diff --git a/share/man/man9/bus_dma.9 b/share/man/man9/bus_dma.9
index b644eeb2a476..0bf27eb5eb22 100644
--- a/share/man/man9/bus_dma.9
+++ b/share/man/man9/bus_dma.9
@@ -197,7 +197,7 @@ in addition to restrictions that differ between unrelated groups of
transactions,
the driver can first create a
.Dq parent
-tag that decribes the common restrictions.
+tag that describes the common restrictions.
The per-group tags can then inherit these restrictions from this
.Dq parent
tag rather than having to list them explicitly when creating the per-group tags.
@@ -733,7 +733,7 @@ Fills in the selected fields of the template with a variable number of
key-value parameters.
The macros listed below take an argument of the specified type and encapsulate
it into a key-value structure that is directly usable as a parameter argument.
-Muliple parameters may be provided at once.
+Multiple parameters may be provided at once.
.Bd -literal
BD_PARENT() void *
BD_ALIGNMENT() uintmax_t
diff --git a/share/man/man9/copy.9 b/share/man/man9/copy.9
index 8b2d0dc67727..3a3105ddf644 100644
--- a/share/man/man9/copy.9
+++ b/share/man/man9/copy.9
@@ -43,7 +43,7 @@
.Nm copyout_nofault ,
.Nm copystr ,
.Nm copyinstr
-.Nd heterogenous address space copy functions
+.Nd heterogeneous address space copy functions
.Sh SYNOPSIS
.In sys/types.h
.In sys/systm.h
diff --git a/share/man/man9/crypto_request.9 b/share/man/man9/crypto_request.9
index af62b9089561..77e6a60b46de 100644
--- a/share/man/man9/crypto_request.9
+++ b/share/man/man9/crypto_request.9
@@ -383,7 +383,7 @@ depending on whether the driver is implemented by software or hardware.
dispatches the request asynchronously.
If the driver is inherently synchronous, the request is queued to a taskqueue
backed by a pool of worker threads.
-This can increase througput by allowing requests from a single producer to be
+This can increase throughput by allowing requests from a single producer to be
processed in parallel.
By default the pool is sized to provide one thread for each CPU.
Worker threads dequeue requests and pass them to the driver asynchronously.
diff --git a/share/man/man9/domain.9 b/share/man/man9/domain.9
index dab8cff89e12..d7e743eaf247 100644
--- a/share/man/man9/domain.9
+++ b/share/man/man9/domain.9
@@ -173,7 +173,7 @@ Once a domain is added it cannot be completely unloaded.
This is because there is
no reference counting system in place to determine if there are any
active references from sockets within that domain.
-However, the exprimental
+However, the experimental
.Fn domain_remove
exists, and unloadable domains may be supported in the future.
.Pp
diff --git a/share/man/man9/efirt.9 b/share/man/man9/efirt.9
index c31f52bf2245..e085916801d5 100644
--- a/share/man/man9/efirt.9
+++ b/share/man/man9/efirt.9
@@ -183,7 +183,7 @@ is NULL.
.It Dv EIO
The variable could not be retrieved due to a hardware error.
.It Dv EDOOFUS
-The variable could not be retireved due to an authentication failure.
+The variable could not be retrieved due to an authentication failure.
.El
.Pp
The
diff --git a/share/man/man9/g_bio.9 b/share/man/man9/g_bio.9
index 407c38e6ca70..fc278cd229a9 100644
--- a/share/man/man9/g_bio.9
+++ b/share/man/man9/g_bio.9
@@ -22,7 +22,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd August 7, 2019
+.Dd October 26, 2025
.Dt G_BIO 9
.Os
.Sh NAME
@@ -309,6 +309,7 @@ example_start(struct bio *bp)
}
.Ed
.Sh SEE ALSO
+.Xr dtrace_io 4 ,
.Xr geom 4 ,
.Xr DECLARE_GEOM_CLASS 9 ,
.Xr g_access 9 ,
diff --git a/share/man/man9/g_geom.9 b/share/man/man9/g_geom.9
index c5b0c0aded2d..99d0ba074e89 100644
--- a/share/man/man9/g_geom.9
+++ b/share/man/man9/g_geom.9
@@ -66,7 +66,7 @@ function is very similar to
.Fn g_new_geomf
except that it accepts a regular string instead of a
.Xr printf 3 Ns
--like format strng as the geom's name.
+-like format string as the geom's name.
.Pp
The
.Fn g_destroy_geom
diff --git a/share/man/man9/gone_in.9 b/share/man/man9/gone_in.9
index 7521adfda204..ebdc1ab19bfa 100644
--- a/share/man/man9/gone_in.9
+++ b/share/man/man9/gone_in.9
@@ -1,6 +1,6 @@
.\" Copyright (c) 2021 The FreeBSD Foundation
.\"
-.\" This document was written by Ed Maste under sponsorhip from
+.\" This document was written by Ed Maste under sponsorship from
.\" The FreeBSD Foundation.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -72,7 +72,7 @@ Obsolete code will be removed soon:
void
sample_init(void)
{
- /* Initializaiton code omitted. */
+ /* Initialization code omitted. */
gone_in(14, "Giant-locked filesystem");
}
diff --git a/share/man/man9/ifnet.9 b/share/man/man9/ifnet.9
index 3c45e4f29e2d..e81c2990c13c 100644
--- a/share/man/man9/ifnet.9
+++ b/share/man/man9/ifnet.9
@@ -482,7 +482,7 @@ This is initialized by driver at attach.
.It Fn if_getaddrlen
.It Fn if_gethwaddr
.It Fn if_getbroadcastaddr Fn if_setbroadcastaddr
-Access the interface broadcast addess.
+Access the interface broadcast address.
.It Fn if_setmtu
.It Fn if_getmtu
Access the interface MTU.
diff --git a/share/man/man9/nvmem.9 b/share/man/man9/nvmem.9
index 812cd09a5e35..fa88cbb91854 100644
--- a/share/man/man9/nvmem.9
+++ b/share/man/man9/nvmem.9
@@ -59,19 +59,19 @@ Get the size of the cell base on the reg property on the node.
Return the size or ENOENT if the cell name wasn't found
.It Fn nvmem_read_cell_by_name "phandle_t node" "const char *name" "void *cell" "size_t buflen"
Get the cell content based on the name.
-Return 0 on sucess or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
+Return 0 on success or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
EINVAL if the size isn't correct.
.It Fn nvmem_read_cell_by_idx "phandle_t node" "int idx" "void *cell" "size_t buflen"
Get the cell content based on the id.
-Return 0 on sucess or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
+Return 0 on success or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
EINVAL if the size isn't correct.
.It Fn nvmem_write_cell_by_name "phandle_t node" "const char *name" "void *cell" "size_t buflen"
Write the cell content based on the name.
-Return 0 on sucess or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
+Return 0 on success or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
EINVAL if the size isn't correct.
.It Fn nvmem_write_cell_by_idx "phandle_t node" "int idx" "void *cell" "size_t buflen"
Write the cell content based on the id.
-Return 0 on sucess or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
+Return 0 on success or ENOENT if the cell doesn't exists, ENXIO if no provider device was found,
EINVAL if the size isn't correct.
.El
.Sh DEVICE METHODS
diff --git a/share/man/man9/ofw_bus_is_compatible.9 b/share/man/man9/ofw_bus_is_compatible.9
index 1b44807e84e8..fcfe8755cf86 100644
--- a/share/man/man9/ofw_bus_is_compatible.9
+++ b/share/man/man9/ofw_bus_is_compatible.9
@@ -61,7 +61,7 @@ older revisions of the driver.
If hardware revision B is backward compatible with revision
A device tree node can signal this compatibility by
providing both "vndr,hrdwrA" and "vndr,hrdwrB" strings in
-the "compatibile" property value.
+the "compatible" property value.
This way older driver can use features available only in
revision A, and the new version of the driver can take
advantage of revision B feature set.
diff --git a/share/man/man9/pci.9 b/share/man/man9/pci.9
index eeb62a63a2bd..871f69f887a6 100644
--- a/share/man/man9/pci.9
+++ b/share/man/man9/pci.9
@@ -523,7 +523,7 @@ device is not a PCI-express device,
returns zero.
When completion timeouts are disabled for
.Fa dev ,
-this function returns the maxmimum timeout that would be used if timeouts
+this function returns the maximum timeout that would be used if timeouts
were enabled.
.Pp
The
diff --git a/share/man/man9/refcount.9 b/share/man/man9/refcount.9
index 78631f9a865a..7375f429a607 100644
--- a/share/man/man9/refcount.9
+++ b/share/man/man9/refcount.9
@@ -106,7 +106,7 @@ but additionally checks that the
value does not overflow as result of the operation.
It returns
.Dv true
-if the reference was sucessfully obtained, and
+if the reference was successfully obtained, and
.Dv false
if it was not, due to the overflow.
.Pp
diff --git a/share/man/man9/seqc.9 b/share/man/man9/seqc.9
index e13d73ecb5d7..b1e59b6b7af1 100644
--- a/share/man/man9/seqc.9
+++ b/share/man/man9/seqc.9
@@ -81,7 +81,7 @@ repeated.
In case when sequence number is odd the object change is in progress and the
reader will wait until the write will the sequence number will become even.
.Sh EXAMPLES
-The following example for a writer changees the
+The following example for a writer changes the
.Va var1
and
.Va var2
diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index 26c7a3b2aa64..c9c3af23864a 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -816,7 +816,7 @@ If no local variables are declared, the first line should be a statement.
Older versions of this
.Nm
document required a blank line before code.
-Such lines should be removed when signficant changes are made to the code.
+Such lines should be removed when significant changes are made to the code.
.Pp
Use
.Xr printf 3 ,
@@ -947,7 +947,7 @@ namespace foo::bar {
.Ed
.Pp
Member function declarations should follow the same style used for standalone
-function protoypes except that a space should be used between a function's
+function prototypes except that a space should be used between a function's
return type and name.
.Pp
Function definitions at the top level should use a newline after the function
diff --git a/share/man/man9/vn_fullpath.9 b/share/man/man9/vn_fullpath.9
index 9815abc3c86c..af459ed281c0 100644
--- a/share/man/man9/vn_fullpath.9
+++ b/share/man/man9/vn_fullpath.9
@@ -107,7 +107,7 @@ than one name (hard links), not all file systems use the name cache
be used for more than one file (in the context of file systems covering
other file systems); a file may have no name (if deleted but still
open or referenced).
-However, the resulting string may still be more useable to a user than
+However, the resulting string may still be more usable to a user than
a vnode pointer value, or a device number and inode number.
Code consuming the results of this function should anticipate (and
properly handle) failure.
@@ -187,7 +187,7 @@ otherwise, an error number is returned.
.Xr free 9
.Sh AUTHORS
.An -nosplit
-This manual page was initally written by
+This manual page was initially written by
.An Robert Watson Aq Mt rwatson@FreeBSD.org
to describe the
.Fn vn_fullpath
diff --git a/sys/arm64/arm64/db_disasm.c b/sys/arm64/arm64/db_disasm.c
index ab1002560b20..14ae2acc2ce6 100644
--- a/sys/arm64/arm64/db_disasm.c
+++ b/sys/arm64/arm64/db_disasm.c
@@ -31,6 +31,7 @@
#include <ddb/db_access.h>
#include <ddb/db_sym.h>
+#include <machine/armreg.h>
#include <machine/disassem.h>
static u_int db_disasm_read_word(vm_offset_t);
diff --git a/sys/arm64/include/_armreg.h b/sys/arm64/include/_armreg.h
new file mode 100644
index 000000000000..0f5134e5a978
--- /dev/null
+++ b/sys/arm64/include/_armreg.h
@@ -0,0 +1,57 @@
+/*-
+ * Copyright (c) 2013, 2014 Andrew Turner
+ * Copyright (c) 2015,2021 The FreeBSD Foundation
+ *
+ * Portions of this software were 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.
+ */
+
+#if !defined(_MACHINE_ARMREG_H_) && \
+ !defined(_MACHINE_CPU_H_) && \
+ !defined(_MACHINE_HYPERVISOR_H_)
+#error Do not include this file directly
+#endif
+
+#ifndef _MACHINE__ARMREG_H_
+#define _MACHINE__ARMREG_H_
+
+#define __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \
+ S##op0##_##op1##_C##crn##_C##crm##_##op2
+#define _MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \
+ __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2)
+#define MRS_REG_ALT_NAME(reg) \
+ _MRS_REG_ALT_NAME(reg##_op0, reg##_op1, reg##_CRn, reg##_CRm, reg##_op2)
+
+
+#define READ_SPECIALREG(reg) \
+({ uint64_t _val; \
+ __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (_val)); \
+ _val; \
+})
+#define WRITE_SPECIALREG(reg, _val) \
+ __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)_val))
+
+#define UL(x) UINT64_C(x)
+
+#endif /* !_MACHINE__ARMREG_H_ */
diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h
index aca3d4c07450..aa9b672ad85a 100644
--- a/sys/arm64/include/armreg.h
+++ b/sys/arm64/include/armreg.h
@@ -34,25 +34,9 @@
#ifndef _MACHINE_ARMREG_H_
#define _MACHINE_ARMREG_H_
-#define INSN_SIZE 4
-
-#define __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \
- S##op0##_##op1##_C##crn##_C##crm##_##op2
-#define _MRS_REG_ALT_NAME(op0, op1, crn, crm, op2) \
- __MRS_REG_ALT_NAME(op0, op1, crn, crm, op2)
-#define MRS_REG_ALT_NAME(reg) \
- _MRS_REG_ALT_NAME(reg##_op0, reg##_op1, reg##_CRn, reg##_CRm, reg##_op2)
-
+#include <machine/_armreg.h>
-#define READ_SPECIALREG(reg) \
-({ uint64_t _val; \
- __asm __volatile("mrs %0, " __STRING(reg) : "=&r" (_val)); \
- _val; \
-})
-#define WRITE_SPECIALREG(reg, _val) \
- __asm __volatile("msr " __STRING(reg) ", %0" : : "r"((uint64_t)_val))
-
-#define UL(x) UINT64_C(x)
+#define INSN_SIZE 4
/* AFSR0_EL1 - Auxiliary Fault Status Register 0 */
#define AFSR0_EL1_REG MRS_REG_ALT_NAME(AFSR0_EL1)
diff --git a/sys/arm64/include/cpu.h b/sys/arm64/include/cpu.h
index 124da8c215ed..b15210633d37 100644
--- a/sys/arm64/include/cpu.h
+++ b/sys/arm64/include/cpu.h
@@ -43,10 +43,10 @@
#define _MACHINE_CPU_H_
#if !defined(__ASSEMBLER__)
+#include <machine/_armreg.h>
#include <machine/atomic.h>
#include <machine/frame.h>
#endif
-#include <machine/armreg.h>
#define TRAPF_PC(tfp) ((tfp)->tf_elr)
#define TRAPF_USERMODE(tfp) (((tfp)->tf_spsr & PSR_M_MASK) == PSR_M_EL0t)
diff --git a/sys/arm64/include/db_machdep.h b/sys/arm64/include/db_machdep.h
index 5dc496ca851d..3ef95f7802ea 100644
--- a/sys/arm64/include/db_machdep.h
+++ b/sys/arm64/include/db_machdep.h
@@ -31,7 +31,6 @@
#ifndef _MACHINE_DB_MACHDEP_H_
#define _MACHINE_DB_MACHDEP_H_
-#include <machine/armreg.h>
#include <machine/frame.h>
#include <machine/trap.h>
diff --git a/sys/arm64/include/hypervisor.h b/sys/arm64/include/hypervisor.h
index 8feabd2b981b..7d405e63cd8d 100644
--- a/sys/arm64/include/hypervisor.h
+++ b/sys/arm64/include/hypervisor.h
@@ -30,6 +30,8 @@
#ifndef _MACHINE_HYPERVISOR_H_
#define _MACHINE_HYPERVISOR_H_
+#include <machine/_armreg.h>
+
/*
* These registers are only useful when in hypervisor context,
* e.g. specific to EL2, or controlling the hypervisor.
diff --git a/sys/arm64/vmm/io/vgic_v3.c b/sys/arm64/vmm/io/vgic_v3.c
index 67afb3374815..023406c64182 100644
--- a/sys/arm64/vmm/io/vgic_v3.c
+++ b/sys/arm64/vmm/io/vgic_v3.c
@@ -47,7 +47,6 @@
#include <dev/ofw/openfirm.h>
-#include <machine/armreg.h>
#include <machine/atomic.h>
#include <machine/bus.h>
#include <machine/cpufunc.h>
diff --git a/sys/arm64/vmm/io/vtimer.c b/sys/arm64/vmm/io/vtimer.c
index da0f0d96c431..7c7fbb49e691 100644
--- a/sys/arm64/vmm/io/vtimer.c
+++ b/sys/arm64/vmm/io/vtimer.c
@@ -44,7 +44,6 @@
#include <machine/bus.h>
#include <machine/machdep.h>
#include <machine/vmm.h>
-#include <machine/armreg.h>
#include <arm64/vmm/arm64.h>
diff --git a/sys/arm64/vmm/vmm.c b/sys/arm64/vmm/vmm.c
index 14ea26c3668c..e7b2b5d8c360 100644
--- a/sys/arm64/vmm/vmm.c
+++ b/sys/arm64/vmm/vmm.c
@@ -51,7 +51,6 @@
#include <vm/vm_extern.h>
#include <vm/vm_param.h>
-#include <machine/armreg.h>
#include <machine/cpu.h>
#include <machine/fpu.h>
#include <machine/machdep.h>
diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c
index 618f4afaf8ee..006239431f29 100644
--- a/sys/arm64/vmm/vmm_arm64.c
+++ b/sys/arm64/vmm/vmm_arm64.c
@@ -47,7 +47,6 @@
#include <vm/vm_page.h>
#include <vm/vm_param.h>
-#include <machine/armreg.h>
#include <machine/vm.h>
#include <machine/cpufunc.h>
#include <machine/cpu.h>
diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c
index b8c6d2ab7a9a..0ad7930e9a87 100644
--- a/sys/arm64/vmm/vmm_hyp.c
+++ b/sys/arm64/vmm/vmm_hyp.c
@@ -32,7 +32,6 @@
#include <sys/types.h>
#include <sys/proc.h>
-#include <machine/armreg.h>
#include "arm64.h"
#include "hyp.h"
diff --git a/sys/arm64/vmm/vmm_reset.c b/sys/arm64/vmm/vmm_reset.c
index 1240c3ed16ec..0e4910ea87b4 100644
--- a/sys/arm64/vmm/vmm_reset.c
+++ b/sys/arm64/vmm/vmm_reset.c
@@ -31,7 +31,6 @@
#include <sys/kernel.h>
#include <sys/lock.h>
-#include <machine/armreg.h>
#include <machine/cpu.h>
#include <machine/hypervisor.h>
diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c
index 2e30dd7dc3de..e7459a5553e4 100644
--- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c
+++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_core.c
@@ -392,9 +392,9 @@ make_service_callback(VCHIQ_SERVICE_T *service, VCHIQ_REASON_T reason,
VCHIQ_HEADER_T *header, void *bulk_userdata)
{
VCHIQ_STATUS_T status;
- vchiq_log_trace(vchiq_core_log_level, "%d: callback:%d (%s, %x, %x)",
+ vchiq_log_trace(vchiq_core_log_level, "%d: callback:%d (%s, %p, %p)",
service->state->id, service->localport, reason_names[reason],
- (unsigned int)header, (unsigned int)bulk_userdata);
+ header, bulk_userdata);
status = service->base.callback(reason, header, service->handle,
bulk_userdata);
if (status == VCHIQ_ERROR) {
@@ -640,8 +640,8 @@ process_free_queue(VCHIQ_STATE_T *state)
rmb();
- vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%x %x %x",
- state->id, slot_index, (unsigned int)data,
+ vchiq_log_trace(vchiq_core_log_level, "%d: pfq %d=%p %x %x",
+ state->id, slot_index, data,
local->slot_queue_recycle, slot_queue_available);
/* Initialise the bitmask for services which have used this
@@ -675,13 +675,13 @@ process_free_queue(VCHIQ_STATE_T *state)
vchiq_log_error(vchiq_core_log_level,
"service %d "
"message_use_count=%d "
- "(header %x, msgid %x, "
+ "(header %p, msgid %x, "
"header->msgid %x, "
"header->size %x)",
port,
service_quota->
message_use_count,
- (unsigned int)header, msgid,
+ header, msgid,
header->msgid,
header->size);
WARN(1, "invalid message use count\n");
@@ -704,24 +704,24 @@ process_free_queue(VCHIQ_STATE_T *state)
up(&service_quota->quota_event);
vchiq_log_trace(
vchiq_core_log_level,
- "%d: pfq:%d %x@%x - "
+ "%d: pfq:%d %x@%p - "
"slot_use->%d",
state->id, port,
header->size,
- (unsigned int)header,
+ header,
count - 1);
} else {
vchiq_log_error(
vchiq_core_log_level,
"service %d "
"slot_use_count"
- "=%d (header %x"
+ "=%d (header %p"
", msgid %x, "
"header->msgid"
" %x, header->"
"size %x)",
port, count,
- (unsigned int)header,
+ header,
msgid,
header->msgid,
header->size);
@@ -735,9 +735,9 @@ process_free_queue(VCHIQ_STATE_T *state)
pos += calc_stride(header->size);
if (pos > VCHIQ_SLOT_SIZE) {
vchiq_log_error(vchiq_core_log_level,
- "pfq - pos %x: header %x, msgid %x, "
+ "pfq - pos %x: header %p, msgid %x, "
"header->msgid %x, header->size %x",
- pos, (unsigned int)header, msgid,
+ pos, header, msgid,
header->msgid, header->size);
WARN(1, "invalid slot position\n");
}
@@ -885,17 +885,16 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
int slot_use_count;
vchiq_log_info(vchiq_core_log_level,
- "%d: qm %s@%x,%x (%d->%d)",
+ "%d: qm %s@%p,%x (%d->%d)",
state->id,
msg_type_str(VCHIQ_MSG_TYPE(msgid)),
- (unsigned int)header, size,
+ header, size,
VCHIQ_MSG_SRCPORT(msgid),
VCHIQ_MSG_DSTPORT(msgid));
BUG_ON(!service);
BUG_ON((flags & (QMFLAGS_NO_MUTEX_LOCK |
QMFLAGS_NO_MUTEX_UNLOCK)) != 0);
-
for (i = 0, pos = 0; i < (unsigned int)count;
pos += elements[i++].size)
if (elements[i].size) {
@@ -951,9 +950,9 @@ queue_message(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size);
} else {
vchiq_log_info(vchiq_core_log_level,
- "%d: qm %s@%x,%x (%d->%d)", state->id,
+ "%d: qm %s@%p,%x (%d->%d)", state->id,
msg_type_str(VCHIQ_MSG_TYPE(msgid)),
- (unsigned int)header, size,
+ header, size,
VCHIQ_MSG_SRCPORT(msgid),
VCHIQ_MSG_DSTPORT(msgid));
if (size != 0) {
@@ -1036,9 +1035,9 @@ queue_message_sync(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
int i, pos;
vchiq_log_info(vchiq_sync_log_level,
- "%d: qms %s@%x,%x (%d->%d)", state->id,
+ "%d: qms %s@%p,%x (%d->%d)", state->id,
msg_type_str(VCHIQ_MSG_TYPE(msgid)),
- (unsigned int)header, size,
+ header, size,
VCHIQ_MSG_SRCPORT(msgid),
VCHIQ_MSG_DSTPORT(msgid));
@@ -1065,9 +1064,9 @@ queue_message_sync(VCHIQ_STATE_T *state, VCHIQ_SERVICE_T *service,
VCHIQ_SERVICE_STATS_ADD(service, ctrl_tx_bytes, size);
} else {
vchiq_log_info(vchiq_sync_log_level,
- "%d: qms %s@%x,%x (%d->%d)", state->id,
+ "%d: qms %s@%p,%x (%d->%d)", state->id,
msg_type_str(VCHIQ_MSG_TYPE(msgid)),
- (unsigned int)header, size,
+ header, size,
VCHIQ_MSG_SRCPORT(msgid),
VCHIQ_MSG_DSTPORT(msgid));
if (size != 0) {
@@ -1368,26 +1367,26 @@ resolve_bulks(VCHIQ_SERVICE_T *service, VCHIQ_BULK_QUEUE_T *queue)
"Send Bulk to" : "Recv Bulk from";
if (bulk->actual != VCHIQ_BULK_ACTUAL_ABORTED)
vchiq_log_info(SRVTRACE_LEVEL(service),
- "%s %c%c%c%c d:%d len:%d %x<->%x",
+ "%s %c%c%c%c d:%d len:%d %p<->%p",
header,
VCHIQ_FOURCC_AS_4CHARS(
service->base.fourcc),
service->remoteport,
bulk->size,
- (unsigned int)bulk->data,
- (unsigned int)bulk->remote_data);
+ bulk->data,
+ bulk->remote_data);
else
vchiq_log_info(SRVTRACE_LEVEL(service),
"%s %c%c%c%c d:%d ABORTED - tx len:%d,"
- " rx len:%d %x<->%x",
+ " rx len:%d %p<->%p",
header,
VCHIQ_FOURCC_AS_4CHARS(
service->base.fourcc),
service->remoteport,
bulk->size,
bulk->remote_size,
- (unsigned int)bulk->data,
- (unsigned int)bulk->remote_data);
+ bulk->data,
+ bulk->remote_data);
}
vchiq_complete_bulk(bulk);
@@ -1522,8 +1521,8 @@ parse_open(VCHIQ_STATE_T *state, VCHIQ_HEADER_T *header)
fourcc = payload->fourcc;
vchiq_log_info(vchiq_core_log_level,
- "%d: prs OPEN@%x (%d->'%c%c%c%c')",
- state->id, (unsigned int)header,
+ "%d: prs OPEN@%p (%d->'%c%c%c%c')",
+ state->id, header,
localport,
VCHIQ_FOURCC_AS_4CHARS(fourcc));
@@ -1661,7 +1660,7 @@ parse_rx_slots(VCHIQ_STATE_T *state)
header = (VCHIQ_HEADER_T *)(state->rx_data +
(state->rx_pos & VCHIQ_SLOT_MASK));
- DEBUG_VALUE(PARSE_HEADER, (int)header);
+ DEBUG_VALUE(PARSE_HEADER, (size_t)header);
msgid = header->msgid;
DEBUG_VALUE(PARSE_MSGID, msgid);
size = header->size;
@@ -1695,20 +1694,20 @@ parse_rx_slots(VCHIQ_STATE_T *state)
remoteport);
if (service)
vchiq_log_warning(vchiq_core_log_level,
- "%d: prs %s@%x (%d->%d) - "
+ "%d: prs %s@%p (%d->%d) - "
"found connected service %d",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport,
service->localport);
}
if (!service) {
vchiq_log_error(vchiq_core_log_level,
- "%d: prs %s@%x (%d->%d) - "
+ "%d: prs %s@%p (%d->%d) - " /* XXX */
"invalid/closed service %d",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport, localport);
goto skip_message;
}
@@ -1734,12 +1733,12 @@ parse_rx_slots(VCHIQ_STATE_T *state)
min(16, size));
}
- if (((unsigned int)header & VCHIQ_SLOT_MASK) + calc_stride(size)
+ if (((size_t)header & VCHIQ_SLOT_MASK) + calc_stride(size)
> VCHIQ_SLOT_SIZE) {
vchiq_log_error(vchiq_core_log_level,
- "header %x (msgid %x) - size %x too big for "
+ "header %p (msgid %x) - size %x too big for "
"slot",
- (unsigned int)header, (unsigned int)msgid,
+ header, (unsigned int)msgid,
(unsigned int)size);
WARN(1, "oversized for slot\n");
}
@@ -1758,8 +1757,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
service->peer_version = payload->version;
}
vchiq_log_info(vchiq_core_log_level,
- "%d: prs OPENACK@%x,%x (%d->%d) v:%d",
- state->id, (unsigned int)header, size,
+ "%d: prs OPENACK@%p,%x (%d->%d) v:%d",
+ state->id, header, size,
remoteport, localport, service->peer_version);
if (service->srvstate ==
VCHIQ_SRVSTATE_OPENING) {
@@ -1776,8 +1775,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
WARN_ON(size != 0); /* There should be no data */
vchiq_log_info(vchiq_core_log_level,
- "%d: prs CLOSE@%x (%d->%d)",
- state->id, (unsigned int)header,
+ "%d: prs CLOSE@%p (%d->%d)",
+ state->id, header,
remoteport, localport);
mark_service_closing_internal(service, 1);
@@ -1794,8 +1793,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
break;
case VCHIQ_MSG_DATA:
vchiq_log_info(vchiq_core_log_level,
- "%d: prs DATA@%x,%x (%d->%d)",
- state->id, (unsigned int)header, size,
+ "%d: prs DATA@%p,%x (%d->%d)",
+ state->id, header, size,
remoteport, localport);
if ((service->remoteport == remoteport)
@@ -1819,8 +1818,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
break;
case VCHIQ_MSG_CONNECT:
vchiq_log_info(vchiq_core_log_level,
- "%d: prs CONNECT@%x",
- state->id, (unsigned int)header);
+ "%d: prs CONNECT@%p",
+ state->id, header);
state->version_common = ((VCHIQ_SLOT_ZERO_T *)
state->slot_data)->version;
up(&state->connect);
@@ -1854,12 +1853,12 @@ parse_rx_slots(VCHIQ_STATE_T *state)
wmb();
vchiq_log_info(vchiq_core_log_level,
- "%d: prs %s@%x (%d->%d) %x@%x",
+ "%d: prs %s@%p (%d->%d) %x@%p",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport,
bulk->remote_size,
- (unsigned int)bulk->remote_data);
+ bulk->remote_data);
queue->remote_insert++;
@@ -1912,10 +1911,10 @@ parse_rx_slots(VCHIQ_STATE_T *state)
if ((int)(queue->remote_insert -
queue->local_insert) >= 0) {
vchiq_log_error(vchiq_core_log_level,
- "%d: prs %s@%x (%d->%d) "
+ "%d: prs %s@%p (%d->%d) "
"unexpected (ri=%d,li=%d)",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport,
queue->remote_insert,
queue->local_insert);
@@ -1932,11 +1931,11 @@ parse_rx_slots(VCHIQ_STATE_T *state)
queue->remote_insert++;
vchiq_log_info(vchiq_core_log_level,
- "%d: prs %s@%x (%d->%d) %x@%x",
+ "%d: prs %s@%p (%d->%d) %x@%p",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport,
- bulk->actual, (unsigned int)bulk->data);
+ bulk->actual, bulk->data);
vchiq_log_trace(vchiq_core_log_level,
"%d: prs:%d %cx li=%x ri=%x p=%x",
@@ -1958,14 +1957,14 @@ parse_rx_slots(VCHIQ_STATE_T *state)
break;
case VCHIQ_MSG_PADDING:
vchiq_log_trace(vchiq_core_log_level,
- "%d: prs PADDING@%x,%x",
- state->id, (unsigned int)header, size);
+ "%d: prs PADDING@%p,%x",
+ state->id, header, size);
break;
case VCHIQ_MSG_PAUSE:
/* If initiated, signal the application thread */
vchiq_log_trace(vchiq_core_log_level,
- "%d: prs PAUSE@%x,%x",
- state->id, (unsigned int)header, size);
+ "%d: prs PAUSE@%p,%x",
+ state->id, header, size);
if (state->conn_state == VCHIQ_CONNSTATE_PAUSED) {
vchiq_log_error(vchiq_core_log_level,
"%d: PAUSE received in state PAUSED",
@@ -1988,8 +1987,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
break;
case VCHIQ_MSG_RESUME:
vchiq_log_trace(vchiq_core_log_level,
- "%d: prs RESUME@%x,%x",
- state->id, (unsigned int)header, size);
+ "%d: prs RESUME@%p,%x",
+ state->id, header, size);
/* Release the slot mutex */
lmutex_unlock(&state->slot_mutex);
if (state->is_master)
@@ -2010,8 +2009,8 @@ parse_rx_slots(VCHIQ_STATE_T *state)
default:
vchiq_log_error(vchiq_core_log_level,
- "%d: prs invalid msgid %x@%x,%x",
- state->id, msgid, (unsigned int)header, size);
+ "%d: prs invalid msgid %x@%p,%x",
+ state->id, msgid, header, size);
WARN(1, "invalid message\n");
break;
}
@@ -2179,10 +2178,10 @@ sync_func(void *v)
if (!service) {
vchiq_log_error(vchiq_sync_log_level,
- "%d: sf %s@%x (%d->%d) - "
+ "%d: sf %s@%p (%d->%d) - "
"invalid/closed service %d",
state->id, msg_type_str(type),
- (unsigned int)header,
+ header,
remoteport, localport, localport);
release_message_sync(state, header);
continue;
@@ -2213,8 +2212,8 @@ sync_func(void *v)
service->peer_version = payload->version;
}
vchiq_log_info(vchiq_sync_log_level,
- "%d: sf OPENACK@%x,%x (%d->%d) v:%d",
- state->id, (unsigned int)header, size,
+ "%d: sf OPENACK@%p,%x (%d->%d) v:%d",
+ state->id, header, size,
remoteport, localport, service->peer_version);
if (service->srvstate == VCHIQ_SRVSTATE_OPENING) {
service->remoteport = remoteport;
@@ -2228,8 +2227,8 @@ sync_func(void *v)
case VCHIQ_MSG_DATA:
vchiq_log_trace(vchiq_sync_log_level,
- "%d: sf DATA@%x,%x (%d->%d)",
- state->id, (unsigned int)header, size,
+ "%d: sf DATA@%p,%x (%d->%d)",
+ state->id, header, size,
remoteport, localport);
if ((service->remoteport == remoteport) &&
@@ -2248,8 +2247,8 @@ sync_func(void *v)
default:
vchiq_log_error(vchiq_sync_log_level,
- "%d: sf unexpected msgid %x@%x,%x",
- state->id, msgid, (unsigned int)header, size);
+ "%d: sf unexpected msgid %x@%p,%x",
+ state->id, msgid, header, size);
release_message_sync(state, header);
break;
}
@@ -2334,8 +2333,8 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
if (slot_zero->magic != VCHIQ_MAGIC) {
vchiq_loud_error_header();
vchiq_loud_error("Invalid VCHIQ magic value found.");
- vchiq_loud_error("slot_zero=%x: magic=%x (expected %x)",
- (unsigned int)slot_zero, slot_zero->magic, VCHIQ_MAGIC);
+ vchiq_loud_error("slot_zero=%p: magic=%x (expected %x)",
+ slot_zero, slot_zero->magic, VCHIQ_MAGIC);
vchiq_loud_error_footer();
return VCHIQ_ERROR;
}
@@ -2348,9 +2347,9 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
if (slot_zero->version < VCHIQ_VERSION_MIN) {
vchiq_loud_error_header();
vchiq_loud_error("Incompatible VCHIQ versions found.");
- vchiq_loud_error("slot_zero=%x: VideoCore version=%d "
+ vchiq_loud_error("slot_zero=%p: VideoCore version=%d "
"(minimum %d)",
- (unsigned int)slot_zero, slot_zero->version,
+ slot_zero, slot_zero->version,
VCHIQ_VERSION_MIN);
vchiq_loud_error("Restart with a newer VideoCore image.");
vchiq_loud_error_footer();
@@ -2360,9 +2359,9 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
if (VCHIQ_VERSION < slot_zero->version_min) {
vchiq_loud_error_header();
vchiq_loud_error("Incompatible VCHIQ versions found.");
- vchiq_loud_error("slot_zero=%x: version=%d (VideoCore "
+ vchiq_loud_error("slot_zero=%p: version=%d (VideoCore "
"minimum %d)",
- (unsigned int)slot_zero, VCHIQ_VERSION,
+ slot_zero, VCHIQ_VERSION,
slot_zero->version_min);
vchiq_loud_error("Restart with a newer kernel.");
vchiq_loud_error_footer();
@@ -2375,25 +2374,25 @@ vchiq_init_state(VCHIQ_STATE_T *state, VCHIQ_SLOT_ZERO_T *slot_zero,
(slot_zero->max_slots_per_side != VCHIQ_MAX_SLOTS_PER_SIDE)) {
vchiq_loud_error_header();
if (slot_zero->slot_zero_size != sizeof(VCHIQ_SLOT_ZERO_T))
- vchiq_loud_error("slot_zero=%x: slot_zero_size=%x "
+ vchiq_loud_error("slot_zero=%p: slot_zero_size=%x "
"(expected %zx)",
- (unsigned int)slot_zero,
+ slot_zero,
slot_zero->slot_zero_size,
sizeof(VCHIQ_SLOT_ZERO_T));
if (slot_zero->slot_size != VCHIQ_SLOT_SIZE)
- vchiq_loud_error("slot_zero=%x: slot_size=%d "
+ vchiq_loud_error("slot_zero=%p: slot_size=%d "
"(expected %d",
- (unsigned int)slot_zero, slot_zero->slot_size,
+ slot_zero, slot_zero->slot_size,
VCHIQ_SLOT_SIZE);
if (slot_zero->max_slots != VCHIQ_MAX_SLOTS)
- vchiq_loud_error("slot_zero=%x: max_slots=%d "
+ vchiq_loud_error("slot_zero=%p: max_slots=%d "
"(expected %d)",
- (unsigned int)slot_zero, slot_zero->max_slots,
+ slot_zero, slot_zero->max_slots,
VCHIQ_MAX_SLOTS);
if (slot_zero->max_slots_per_side != VCHIQ_MAX_SLOTS_PER_SIDE)
- vchiq_loud_error("slot_zero=%x: max_slots_per_side=%d "
+ vchiq_loud_error("slot_zero=%p: max_slots_per_side=%d "
"(expected %d)",
- (unsigned int)slot_zero,
+ slot_zero,
slot_zero->max_slots_per_side,
VCHIQ_MAX_SLOTS_PER_SIDE);
vchiq_loud_error_footer();
@@ -2775,18 +2774,18 @@ release_service_messages(VCHIQ_SERVICE_T *service)
if ((port == service->localport) &&
(msgid & VCHIQ_MSGID_CLAIMED)) {
vchiq_log_info(vchiq_core_log_level,
- " fsi - hdr %x",
- (unsigned int)header);
+ " fsi - hdr %p",
+ header);
release_slot(state, slot_info, header,
NULL);
}
pos += calc_stride(header->size);
if (pos > VCHIQ_SLOT_SIZE) {
vchiq_log_error(vchiq_core_log_level,
- "fsi - pos %x: header %x, "
+ "fsi - pos %x: header %p, "
"msgid %x, header->msgid %x, "
"header->size %x",
- pos, (unsigned int)header,
+ pos, header,
msgid, header->msgid,
header->size);
WARN(1, "invalid slot position\n");
@@ -3360,10 +3359,10 @@ vchiq_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle,
wmb();
vchiq_log_info(vchiq_core_log_level,
- "%d: bt (%d->%d) %cx %x@%x %x",
+ "%d: bt (%d->%d) %cx %x@%p %p",
state->id,
service->localport, service->remoteport, dir_char,
- size, (unsigned int)bulk->data, (unsigned int)userdata);
+ size, bulk->data, userdata);
/* The slot mutex must be held when the service is being closed, so
claim it here to ensure that isn't happening */
@@ -3710,12 +3709,12 @@ vchiq_dump_state(void *dump_context, VCHIQ_STATE_T *state)
vchiq_dump(dump_context, buf, len + 1);
len = snprintf(buf, sizeof(buf),
- " tx_pos=%x(@%x), rx_pos=%x(@%x)",
+ " tx_pos=%x(@%p), rx_pos=%x(@%p)",
state->local->tx_pos,
- (uint32_t)state->tx_data +
+ state->tx_data +
(state->local_tx_pos & VCHIQ_SLOT_MASK),
state->rx_pos,
- (uint32_t)state->rx_data +
+ state->rx_data +
(state->rx_pos & VCHIQ_SLOT_MASK));
vchiq_dump(dump_context, buf, len + 1);
@@ -3817,21 +3816,21 @@ vchiq_dump_service_state(void *dump_context, VCHIQ_SERVICE_T *service)
vchiq_dump(dump_context, buf, len + 1);
len = snprintf(buf, sizeof(buf),
- " Ctrl: tx_count=%d, tx_bytes=%llu, "
- "rx_count=%d, rx_bytes=%llu",
+ " Ctrl: tx_count=%d, tx_bytes=%ju, "
+ "rx_count=%d, rx_bytes=%ju",
service->stats.ctrl_tx_count,
- service->stats.ctrl_tx_bytes,
+ (uintmax_t) service->stats.ctrl_tx_bytes,
service->stats.ctrl_rx_count,
- service->stats.ctrl_rx_bytes);
+ (uintmax_t) service->stats.ctrl_rx_bytes);
vchiq_dump(dump_context, buf, len + 1);
len = snprintf(buf, sizeof(buf),
- " Bulk: tx_count=%d, tx_bytes=%llu, "
- "rx_count=%d, rx_bytes=%llu",
+ " Bulk: tx_count=%d, tx_bytes=%ju, "
+ "rx_count=%d, rx_bytes=%ju",
service->stats.bulk_tx_count,
- service->stats.bulk_tx_bytes,
+ (uintmax_t) service->stats.bulk_tx_bytes,
service->stats.bulk_rx_count,
- service->stats.bulk_rx_bytes);
+ (uintmax_t) service->stats.bulk_rx_bytes);
vchiq_dump(dump_context, buf, len + 1);
len = snprintf(buf, sizeof(buf),
diff --git a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c
index 1f849a09d854..4eddcf3b43b2 100644
--- a/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c
+++ b/sys/contrib/vchiq/interface/vchiq_arm/vchiq_kern_lib.c
@@ -151,9 +151,9 @@ VCHIQ_STATUS_T vchiq_shutdown(VCHIQ_INSTANCE_T instance)
list);
list_del(pos);
vchiq_log_info(vchiq_arm_log_level,
- "bulk_waiter - cleaned up %x "
+ "bulk_waiter - cleaned up %p "
"for pid %d",
- (unsigned int)waiter, waiter->pid);
+ waiter, waiter->pid);
_sema_destroy(&waiter->bulk_waiter.event);
kfree(waiter);
@@ -454,8 +454,8 @@ vchiq_blocking_bulk_transfer(VCHIQ_SERVICE_HANDLE_T handle, void *data,
list_add(&waiter->list, &instance->bulk_waiter_list);
lmutex_unlock(&instance->bulk_waiter_list_mutex);
vchiq_log_info(vchiq_arm_log_level,
- "saved bulk_waiter %x for pid %d",
- (unsigned int)waiter, current->p_pid);
+ "saved bulk_waiter %p for pid %d",
+ waiter, current->p_pid);
}
return status;
diff --git a/sys/dev/ofw/ofw_cpu.c b/sys/dev/ofw/ofw_cpu.c
index 888af0440746..4b12f2e994e3 100644
--- a/sys/dev/ofw/ofw_cpu.c
+++ b/sys/dev/ofw/ofw_cpu.c
@@ -85,7 +85,8 @@ static driver_t ofw_cpulist_driver = {
sizeof(struct ofw_cpulist_softc)
};
-DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, 0, 0);
+EARLY_DRIVER_MODULE(ofw_cpulist, ofwbus, ofw_cpulist_driver, 0, 0,
+ BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE);
static int
ofw_cpulist_probe(device_t dev)
@@ -180,7 +181,8 @@ static driver_t ofw_cpu_driver = {
sizeof(struct ofw_cpu_softc)
};
-DRIVER_MODULE(ofw_cpu, cpulist, ofw_cpu_driver, 0, 0);
+EARLY_DRIVER_MODULE(ofw_cpu, cpulist, ofw_cpu_driver, 0, 0,
+ BUS_PASS_CPU + BUS_PASS_ORDER_MIDDLE);
static bool
ofw_cpu_is_runnable(phandle_t node)
@@ -330,6 +332,7 @@ ofw_cpu_attach(device_t dev)
device_printf(dev, "Nominal frequency %dMhz\n",
sc->sc_nominal_mhz);
+ OF_device_register_xref(OF_xref_from_node(node), dev);
bus_identify_children(dev);
bus_attach_children(dev);
return (0);
diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c
index 1f2d69708eec..39214a141bf9 100644
--- a/sys/dev/sound/dummy.c
+++ b/sys/dev/sound/dummy.c
@@ -104,9 +104,10 @@ dummy_chan_io(void *arg)
ch = &sc->chans[i];
if (!ch->run)
continue;
- if (ch->dir == PCMDIR_PLAY)
+ if (ch->dir == PCMDIR_PLAY) {
ch->ptr += sndbuf_getblksz(ch->buf);
- else
+ ch->ptr %= sndbuf_getsize(ch->buf);
+ } else
sndbuf_fillsilence(ch->buf);
snd_mtxunlock(sc->lock);
chn_intr(ch->chan);
diff --git a/sys/fs/fuse/fuse_device.c b/sys/fs/fuse/fuse_device.c
index 75bc0357571f..cee477865c42 100644
--- a/sys/fs/fuse/fuse_device.c
+++ b/sys/fs/fuse/fuse_device.c
@@ -550,6 +550,13 @@ fuse_device_write(struct cdev *dev, struct uio *uio, int ioflag)
} else if (ohead.unique == 0){
/* unique == 0 means asynchronous notification */
SDT_PROBE1(fusefs, , device, fuse_device_write_notify, &ohead);
+ if (data->mp == NULL) {
+ SDT_PROBE2(fusefs, , device, trace, 1,
+ "asynchronous notification before mount"
+ " or after unmount");
+ return (EXTERROR(ENODEV,
+ "This FUSE session is not mounted"));
+ }
mp = data->mp;
vfs_ref(mp);
err = vfs_busy(mp, 0);
diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c
index 41a63a3c676c..91a0ee1f2f3d 100644
--- a/sys/isa/isa_common.c
+++ b/sys/isa/isa_common.c
@@ -569,8 +569,8 @@ isa_probe_children(device_t dev)
if (err == 0 && idev->id_vendorid == 0 &&
strcmp(kern_ident, "GENERIC") == 0 &&
device_is_attached(child))
- device_printf(child,
- "non-PNP ISA device will be removed from GENERIC in FreeBSD 16.\n");
+ gone_in_dev(child, 16,
+ "WARNING: non-PNP ISA device will be removed from GENERIC\n");
}
/*
diff --git a/sys/modules/thunderbolt/Makefile b/sys/modules/thunderbolt/Makefile
index 3b279f4352d4..ba7c7cab6e6b 100644
--- a/sys/modules/thunderbolt/Makefile
+++ b/sys/modules/thunderbolt/Makefile
@@ -5,7 +5,7 @@ SRCS= nhi_pci.c nhi.c tb_pcib.c tb_acpi_pcib.c tb_debug.c nhi_wmi.c
SRCS+= router.c hcm.c tb_dev.c
SRCS+= opt_thunderbolt.h
SRCS+= device_if.h bus_if.h pci_if.h pcib_if.h tb_if.c tb_if.h
-SRCS+= opt_acpi.h opt_acpi_wmi.h acpi_if.h acpi_wmi_if.h
+SRCS+= opt_acpi.h acpi_if.h acpi_wmi_if.h
opt_thunderbolt.h:
echo "#define THUNDERBOLT_DEBUG 1" > ${.TARGET}
diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c
index 582f877ff3ed..066e3be29694 100644
--- a/sys/netgraph/ng_device.c
+++ b/sys/netgraph/ng_device.c
@@ -3,6 +3,7 @@
*
* Copyright (c) 2002 Mark Santcroos <marks@ripe.net>
* Copyright (c) 2004-2005 Gleb Smirnoff <glebius@FreeBSD.org>
+ * Copyright (c) 2025 Quentin Thébault <quentin.thebault@defenso.fr>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -50,6 +51,7 @@
#include <sys/poll.h>
#include <sys/proc.h>
#include <sys/queue.h>
+#include <sys/selinfo.h>
#include <sys/socket.h>
#include <sys/syslog.h>
#include <sys/uio.h>
@@ -117,12 +119,15 @@ struct ngd_private {
struct ng_node *node;
struct ng_hook *hook;
struct cdev *ngddev;
+ struct selinfo rsel;
+ struct selinfo wsel;
struct mtx ngd_mtx;
int unit;
int ether_align;
uint16_t flags;
#define NGDF_OPEN 0x0001
#define NGDF_RWAIT 0x0002
+#define NGDF_DYING 0x0004
};
typedef struct ngd_private *priv_p;
@@ -138,6 +143,24 @@ static d_read_t ngdread;
static d_write_t ngdwrite;
static d_ioctl_t ngdioctl;
static d_poll_t ngdpoll;
+static d_kqfilter_t ngdkqfilter;
+
+static int ngd_kqread_event(struct knote *, long);
+static int ngd_kqwrite_event(struct knote *, long);
+static void ngd_kqread_detach(struct knote *);
+static void ngd_kqwrite_detach(struct knote *);
+
+static const struct filterops ngd_read_filterops = {
+ .f_isfd = 1,
+ .f_detach = ngd_kqread_detach,
+ .f_event = ngd_kqread_event
+};
+
+static const struct filterops ngd_write_filterops = {
+ .f_isfd = 1,
+ .f_detach = ngd_kqwrite_detach,
+ .f_event = ngd_kqwrite_event
+};
static struct cdevsw ngd_cdevsw = {
.d_version = D_VERSION,
@@ -146,6 +169,7 @@ static struct cdevsw ngd_cdevsw = {
.d_read = ngdread,
.d_write = ngdwrite,
.d_ioctl = ngdioctl,
+ .d_kqfilter = ngdkqfilter,
.d_poll = ngdpoll,
.d_name = NG_DEVICE_DEVNAME,
};
@@ -198,6 +222,9 @@ ng_device_constructor(node_p node)
mtx_init(&priv->readq.ifq_mtx, "ng_device queue", NULL, MTX_DEF);
IFQ_SET_MAXLEN(&priv->readq, ifqmaxlen);
+ knlist_init_mtx(&priv->rsel.si_note, &priv->ngd_mtx);
+ knlist_init_mtx(&priv->wsel.si_note, &priv->ngd_mtx);
+
/* Link everything together */
NG_NODE_SET_PRIVATE(node, priv);
priv->node = node;
@@ -206,6 +233,8 @@ ng_device_constructor(node_p node)
GID_WHEEL, 0600, NG_DEVICE_DEVNAME "%d", priv->unit);
if (priv->ngddev == NULL) {
printf("%s(): make_dev() failed\n", __func__);
+ knlist_destroy(&priv->rsel.si_note);
+ knlist_destroy(&priv->wsel.si_note);
mtx_destroy(&priv->ngd_mtx);
mtx_destroy(&priv->readq.ifq_mtx);
free_unr(ngd_unit, priv->unit);
@@ -319,6 +348,8 @@ ng_device_rcvdata(hook_p hook, item_p item)
priv->flags &= ~NGDF_RWAIT;
wakeup(priv);
}
+ selwakeup(&priv->rsel);
+ KNOTE_LOCKED(&priv->rsel.si_note, 0);
mtx_unlock(&priv->ngd_mtx);
return (0);
@@ -334,9 +365,22 @@ ng_device_disconnect(hook_p hook)
DBG;
+ mtx_lock(&priv->ngd_mtx);
+ priv->flags |= NGDF_DYING;
+ wakeup(priv);
+ mtx_unlock(&priv->ngd_mtx);
+
destroy_dev(priv->ngddev);
+
+ knlist_clear(&priv->rsel.si_note, 0);
+ knlist_clear(&priv->wsel.si_note, 0);
+ knlist_destroy(&priv->rsel.si_note);
+ knlist_destroy(&priv->wsel.si_note);
mtx_destroy(&priv->ngd_mtx);
+ seldrain(&priv->rsel);
+ seldrain(&priv->wsel);
+
IF_DRAIN(&priv->readq);
mtx_destroy(&(priv)->readq.ifq_mtx);
@@ -493,9 +537,13 @@ ngdread(struct cdev *dev, struct uio *uio, int flag)
return (EWOULDBLOCK);
mtx_lock(&priv->ngd_mtx);
priv->flags |= NGDF_RWAIT;
- if ((error = msleep(priv, &priv->ngd_mtx,
- PDROP | PCATCH | PZERO,
- "ngdread", 0)) != 0)
+ if (priv->flags & NGDF_DYING) {
+ mtx_unlock(&priv->ngd_mtx);
+ error = ENXIO;
+ } else
+ error = mtx_sleep(priv, &priv->ngd_mtx,
+ PDROP | PCATCH, "ngdread", 0);
+ if (error != 0)
return (error);
}
} while (m == NULL);
@@ -538,9 +586,12 @@ ngdwrite(struct cdev *dev, struct uio *uio, int flag)
if (m == NULL)
return (ENOBUFS);
+ /* Setting VNET is required if connecting to a ng_bridge. */
+ CURVNET_SET(priv->node->nd_vnet);
NET_EPOCH_ENTER(et);
NG_SEND_DATA_ONLY(error, priv->hook, m);
NET_EPOCH_EXIT(et);
+ CURVNET_RESTORE();
return (error);
}
@@ -561,3 +612,72 @@ ngdpoll(struct cdev *dev, int events, struct thread *td)
return (revents);
}
+
+static void
+ngd_kqread_detach(struct knote *kn)
+{
+ priv_p priv = (priv_p)kn->kn_hook;
+
+ knlist_remove(&priv->rsel.si_note, kn, 0);
+}
+
+static int
+ngd_kqread_event(struct knote *kn, long hint)
+{
+ priv_p priv = (priv_p)kn->kn_hook;
+ struct mbuf *m;
+
+ IFQ_LOCK(&priv->readq);
+ if (IFQ_IS_EMPTY(&priv->readq)) {
+ kn->kn_data = 0;
+ } else {
+ /*
+ * Since the queue does not store the total number of bytes that
+ * could be read across all packets and we do not want to
+ * traverse the whole queue, we only report the number of bytes
+ * for the first packet in the queue.
+ */
+ IF_POLL(&priv->readq, m);
+ kn->kn_data = m->m_len;
+ }
+ IFQ_UNLOCK(&priv->readq);
+
+ return (kn->kn_data > 0);
+}
+
+static void
+ngd_kqwrite_detach(struct knote *kn)
+{
+ priv_p priv = (priv_p)kn->kn_hook;
+
+ knlist_remove(&priv->wsel.si_note, kn, 0);
+}
+
+static int
+ngd_kqwrite_event(struct knote *kn, long hint)
+{
+ kn->kn_data = IP_MAXPACKET;
+
+ return (1);
+}
+
+static int
+ngdkqfilter(struct cdev *dev, struct knote *kn)
+{
+ priv_p priv = (priv_p)dev->si_drv1;
+
+ switch (kn->kn_filter) {
+ case EVFILT_READ:
+ kn->kn_fop = &ngd_read_filterops;
+ kn->kn_hook = priv;
+ knlist_add(&priv->rsel.si_note, kn, 0);
+ return (0);
+ case EVFILT_WRITE:
+ kn->kn_fop = &ngd_write_filterops;
+ kn->kn_hook = priv;
+ knlist_add(&priv->wsel.si_note, kn, 0);
+ return (0);
+ default:
+ return (EINVAL);
+ }
+}
diff --git a/sys/netinet/udp_usrreq.c b/sys/netinet/udp_usrreq.c
index 04d01099d54a..f1d952037d5a 100644
--- a/sys/netinet/udp_usrreq.c
+++ b/sys/netinet/udp_usrreq.c
@@ -1172,7 +1172,19 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
else
INP_RLOCK(inp);
NET_EPOCH_ENTER(et);
+#ifdef INET6
+ if ((flags & PRUS_IPV6) != 0) {
+ if ((inp->in6p_outputopts != NULL) &&
+ (inp->in6p_outputopts->ip6po_tclass != -1))
+ tos = (u_char)inp->in6p_outputopts->ip6po_tclass;
+ else
+ tos = 0;
+ } else {
+ tos = inp->inp_ip_tos;
+ }
+#else
tos = inp->inp_ip_tos;
+#endif
if (control != NULL) {
/*
* XXX: Currently, we assume all the optional information is
@@ -1196,6 +1208,23 @@ udp_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr,
error = udp_v4mapped_pktinfo(cm, &src, inp, flags);
if (error != 0)
break;
+ if (((flags & PRUS_IPV6) != 0) &&
+ (cm->cmsg_level == IPPROTO_IPV6) &&
+ (cm->cmsg_type == IPV6_TCLASS)) {
+ int tclass;
+
+ if (cm->cmsg_len != CMSG_LEN(sizeof(int))) {
+ error = EINVAL;
+ break;
+ }
+ tclass = *(int *)CMSG_DATA(cm);
+ if (tclass < -1 || tclass > 255) {
+ error = EINVAL;
+ break;
+ }
+ if (tclass != -1)
+ tos = (u_char)tclass;
+ }
#endif
if (cm->cmsg_level != IPPROTO_IP)
continue;
diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc
index e8081dea9604..55c191716629 100644
--- a/tests/sys/fs/fusefs/mockfs.cc
+++ b/tests/sys/fs/fusefs/mockfs.cc
@@ -827,10 +827,12 @@ void MockFS::loop() {
}
}
-int MockFS::notify_inval_entry(ino_t parent, const char *name, size_t namelen)
+int MockFS::notify_inval_entry(ino_t parent, const char *name, size_t namelen,
+ int expected_errno)
{
std::unique_ptr<mockfs_buf_out> out(new mockfs_buf_out);
+ out->expected_errno = expected_errno;
out->header.unique = 0; /* 0 means asynchronous notification */
out->header.error = FUSE_NOTIFY_INVAL_ENTRY;
out->body.inval_entry.parent = parent;
diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh
index ba6f7fded9d0..4b0628d34dd7 100644
--- a/tests/sys/fs/fusefs/mockfs.hh
+++ b/tests/sys/fs/fusefs/mockfs.hh
@@ -390,8 +390,10 @@ class MockFS {
* @param parent Parent directory's inode number
* @param name name of dirent to invalidate
* @param namelen size of name, including the NUL
+ * @param expected_errno The error that write() should return
*/
- int notify_inval_entry(ino_t parent, const char *name, size_t namelen);
+ int notify_inval_entry(ino_t parent, const char *name, size_t namelen,
+ int expected_errno = 0);
/*
* Send an asynchronous notification to invalidate an inode's cached
diff --git a/tests/sys/fs/fusefs/notify.cc b/tests/sys/fs/fusefs/notify.cc
index 1e22bde13db7..d370a1e6e706 100644
--- a/tests/sys/fs/fusefs/notify.cc
+++ b/tests/sys/fs/fusefs/notify.cc
@@ -385,6 +385,27 @@ TEST_F(Notify, inval_inode_with_clean_cache)
leak(fd);
}
+/*
+ * Attempting to invalidate an entry or inode after unmounting should fail, but
+ * nothing bad should happen.
+ * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290519
+ */
+TEST_F(Notify, notify_after_unmount)
+{
+ const static char *name = "foo";
+ struct inval_entry_args iea;
+
+ expect_destroy(0);
+
+ m_mock->unmount();
+
+ iea.mock = m_mock;
+ iea.parent = FUSE_ROOT_ID;
+ iea.name = name;
+ iea.namelen = strlen(name);
+ iea.mock->notify_inval_entry(iea.parent, iea.name, iea.namelen, ENODEV);
+}
+
/* FUSE_NOTIFY_STORE with a file that's not in the entry cache */
/* disabled because FUSE_NOTIFY_STORE is not yet implemented */
TEST_F(Notify, DISABLED_store_nonexistent)
@@ -544,3 +565,38 @@ TEST_F(NotifyWriteback, inval_inode_attrs_only)
leak(fd);
}
+
+/*
+ * Attempting asynchronous invalidation of an Entry before mounting the file
+ * system should fail, but nothing bad should happen.
+ *
+ * Note that invalidating an inode before mount goes through the same path, and
+ * is not separately tested.
+ *
+ * https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290519
+ */
+TEST(PreMount, inval_entry_before_mount)
+{
+ const static char name[] = "foo";
+ size_t namelen = strlen(name);
+ struct mockfs_buf_out *out;
+ int r;
+ int fuse_fd;
+
+ fuse_fd = open("/dev/fuse", O_CLOEXEC | O_RDWR);
+ ASSERT_GE(fuse_fd, 0) << strerror(errno);
+
+ out = new mockfs_buf_out;
+ out->header.unique = 0; /* 0 means asynchronous notification */
+ out->header.error = FUSE_NOTIFY_INVAL_ENTRY;
+ out->body.inval_entry.parent = FUSE_ROOT_ID;
+ out->body.inval_entry.namelen = namelen;
+ strlcpy((char*)&out->body.bytes + sizeof(out->body.inval_entry),
+ name, sizeof(out->body.bytes) - sizeof(out->body.inval_entry));
+ out->header.len = sizeof(out->header) + sizeof(out->body.inval_entry) +
+ namelen;
+ r = write(fuse_fd, out, out->header.len);
+ EXPECT_EQ(-1, r);
+ EXPECT_EQ(ENODEV, errno);
+ delete out;
+}
diff --git a/usr.sbin/bhyve/bhyve.8 b/usr.sbin/bhyve/bhyve.8
index c902c265da9e..3df9f79c3b2c 100644
--- a/usr.sbin/bhyve/bhyve.8
+++ b/usr.sbin/bhyve/bhyve.8
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd August 21, 2024
+.Dd September 16, 2025
.Dt BHYVE 8
.Os
.Sh NAME
@@ -518,6 +518,8 @@ considered unconnected.
.Op Cm \&,mtu= Ar N
.Xc
.It
+.Cm ngd Ar N
+.It
.Xo
.Cm netgraph,path= Ar ADDRESS Cm \&,peerhook= Ar HOOK
.Op Cm \&,socket= Ar NAME
@@ -542,6 +544,19 @@ The MAC address is an ASCII string in
.Xr ethers 5
format.
.Pp
+A
+.Cm ngd
+device can be used to connect a guest to a
+.Xr netgraph 4
+through a
+.Xr ng_device 4
+node.
+This can be used to run bhyve in a
+.Xr VNET 9
+jail, and give it access to the host's netgraph, that cannot be reached
+directly, by exposing the ng_device through
+.Xr devfs 8 .
+.Pp
With
.Cm virtio-net
devices, the
@@ -572,7 +587,9 @@ must comply with
.Xr netgraph 4
addressing rules.
.Pp
-The slirp backend can be used to provide a NATed network to the guest.
+The
+.Cm slirp
+backend can be used to provide a NATed network to the guest.
This backend has poor performance but does not require any network
configuration on the host system.
It depends on the
diff --git a/usr.sbin/bhyve/net_backends.c b/usr.sbin/bhyve/net_backends.c
index 2d11c45f217a..95909d1f8ea2 100644
--- a/usr.sbin/bhyve/net_backends.c
+++ b/usr.sbin/bhyve/net_backends.c
@@ -119,7 +119,8 @@ tap_init(struct net_backend *be, const char *devname,
goto error;
}
- if (ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) {
+ if (strncmp("ngd", be->prefix, 3) &&
+ ioctl(be->fd, VMIO_SIOCSIFFLAGS, up)) {
EPRINTLN("tap device link up failed");
goto error;
}
@@ -273,8 +274,24 @@ static struct net_backend vmnet_backend = {
.set_cap = tap_set_cap,
};
+/* A clone of the tap backend, with a different prefix. */
+static struct net_backend ngd_backend = {
+ .prefix = "ngd",
+ .priv_size = sizeof(struct tap_priv),
+ .init = tap_init,
+ .cleanup = tap_cleanup,
+ .send = tap_send,
+ .peek_recvlen = tap_peek_recvlen,
+ .recv = tap_recv,
+ .recv_enable = tap_recv_enable,
+ .recv_disable = tap_recv_disable,
+ .get_cap = tap_get_cap,
+ .set_cap = tap_set_cap,
+};
+
DATA_SET(net_backend_set, tap_backend);
DATA_SET(net_backend_set, vmnet_backend);
+DATA_SET(net_backend_set, ngd_backend);
int
netbe_legacy_config(nvlist_t *nvl, const char *opts)
diff --git a/usr.sbin/bluetooth/rtlbtfw/main.c b/usr.sbin/bluetooth/rtlbtfw/main.c
index 280045a6aa25..58503b8087b5 100644
--- a/usr.sbin/bluetooth/rtlbtfw/main.c
+++ b/usr.sbin/bluetooth/rtlbtfw/main.c
@@ -479,7 +479,7 @@ main(int argc, char *argv[])
} else
r = rtlbt_parse_fwfile_v1(&fw, rom_version);
if (r < 0) {
- rtlbt_err("Parseing firmware file failed");
+ rtlbt_err("Parsing firmware file failed");
goto shutdown;
}
diff --git a/usr.sbin/cxgbetool/tcbshowt7.c b/usr.sbin/cxgbetool/tcbshowt7.c
index a3397960b26b..1d4be0fbcc91 100644
--- a/usr.sbin/cxgbetool/tcbshowt7.c
+++ b/usr.sbin/cxgbetool/tcbshowt7.c
@@ -190,7 +190,7 @@ void t7_display_tcb_aux_0 (_TCBVAR *tvp, int aux)
val("rx_flow_control_ddp"));
- PR("MISCELANEOUS:\n"); /* *************************** */
+ PR("MISCELLANEOUS:\n"); /* *************************** */
PR(" pend_ctl: 0x%1x, core_bypass: 0x%x, main_slush: 0x%x\n",
((val("pend_ctl2")<<2) | (val("pend_ctl1")<<1) |
val("pend_ctl0")),
diff --git a/usr.sbin/fwcontrol/fwcontrol.c b/usr.sbin/fwcontrol/fwcontrol.c
index ce908341a42a..195697475973 100644
--- a/usr.sbin/fwcontrol/fwcontrol.c
+++ b/usr.sbin/fwcontrol/fwcontrol.c
@@ -440,7 +440,7 @@ show_crom(u_int32_t *crom_buf)
if (hdr->info_len == 1) {
/* minimum ROM */
reg = (struct csrreg *)hdr;
- printf("verndor ID: 0x%06x\n", reg->val);
+ printf("vendor ID: 0x%06x\n", reg->val);
return;
}
printf("info_len=%d crc_len=%d crc=0x%04x",
diff --git a/usr.sbin/pmcstat/pmcstat.c b/usr.sbin/pmcstat/pmcstat.c
index 98e14dfb9113..ac9169f3e008 100644
--- a/usr.sbin/pmcstat/pmcstat.c
+++ b/usr.sbin/pmcstat/pmcstat.c
@@ -215,7 +215,7 @@ pmcstat_find_targets(const char *spec)
SLIST_INSERT_HEAD(&args.pa_targets, pt, pt_next);
} else if (rv != REG_NOMATCH) {
regerror(rv, &reg, errbuf, sizeof(errbuf));
- errx(EX_SOFTWARE, "ERROR: Regex evalation failed: %s",
+ errx(EX_SOFTWARE, "ERROR: Regex evaluation failed: %s",
errbuf);
}
}