aboutsummaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/examples/Makefile14
-rw-r--r--share/examples/mdoc/example.42
-rw-r--r--share/examples/sound/kqueue.c79
-rw-r--r--share/examples/sound/oss.h222
-rw-r--r--share/examples/sound/oss/README66
-rw-r--r--share/examples/sound/oss/audio.c310
-rw-r--r--share/examples/sound/poll.c70
-rw-r--r--share/examples/sound/select.c70
-rw-r--r--share/examples/sound/simple.c147
-rw-r--r--share/keys/Makefile2
-rw-r--r--share/keys/pkgbase-15/Makefile3
-rw-r--r--share/keys/pkgbase-15/trusted/Makefile9
-rw-r--r--share/keys/pkgbase-15/trusted/awskms-152
-rw-r--r--share/keys/pkgbase-15/trusted/backup-signing-152
-rw-r--r--share/man/man3/Makefile4
-rw-r--r--share/man/man4/Makefile5
-rw-r--r--share/man/man4/ath.41
-rw-r--r--share/man/man4/cardbus.41
-rw-r--r--share/man/man4/crypto.41
-rw-r--r--share/man/man4/dtrace_priv.459
-rw-r--r--share/man/man4/exca.43
-rw-r--r--share/man/man4/fdc.418
-rw-r--r--share/man/man4/geom_zero.4174
-rw-r--r--share/man/man4/hgame.492
-rw-r--r--share/man/man4/isp.42
-rw-r--r--share/man/man4/iwx.425
-rw-r--r--share/man/man4/ix.433
-rw-r--r--share/man/man4/mgb.42
-rw-r--r--share/man/man4/muge.42
-rw-r--r--share/man/man4/mx25l.424
-rw-r--r--share/man/man4/pccard.478
-rw-r--r--share/man/man4/pccbb.43
-rw-r--r--share/man/man4/pcic.4100
-rw-r--r--share/man/man4/random.41
-rw-r--r--share/man/man4/sbp.423
-rw-r--r--share/man/man4/snd_dummy.42
-rw-r--r--share/man/man4/vt.49
-rw-r--r--share/man/man4/xl.41
-rw-r--r--share/man/man4/zero.43
-rw-r--r--share/man/man5/boot.config.58
-rw-r--r--share/man/man5/rc.conf.514
-rw-r--r--share/man/man9/DEVICE_DETACH.95
-rw-r--r--share/man/man9/Makefile1
-rw-r--r--share/man/man9/bus_alloc_resource.95
-rw-r--r--share/man/man9/exterror.9219
-rw-r--r--share/man/man9/priv.93
46 files changed, 1254 insertions, 665 deletions
diff --git a/share/examples/Makefile b/share/examples/Makefile
index 0a65b8c40d39..09bbf820e574 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -319,13 +319,13 @@ SE_SCSI_TARGET= \
SE_DIRS+= sound
SE_SOUND= \
- sndstat_nv.c \
- midi.c
-
-SE_DIRS+= sound/oss
-SE_SOUND_OSS= \
- README \
- audio.c
+ kqueue.c \
+ midi.c \
+ oss.h \
+ poll.c \
+ select.c \
+ simple.c \
+ sndstat_nv.c
SE_DIRS+= sunrpc
SE_SUNRPC= Makefile
diff --git a/share/examples/mdoc/example.4 b/share/examples/mdoc/example.4
index 6983fb75fada..a51d9ca9262b 100644
--- a/share/examples/mdoc/example.4
+++ b/share/examples/mdoc/example.4
@@ -28,7 +28,7 @@ example_load="YES"
.Ed
.Sh DEPRECATION NOTICE
This driver is scheduled for removal prior to the release of
-.Fx 13.0 .
+.Fx 17.0 .
.Sh DESCRIPTION
This is an example device driver manual page for the
.Nm
diff --git a/share/examples/sound/kqueue.c b/share/examples/sound/kqueue.c
new file mode 100644
index 000000000000..9117d7a389bb
--- /dev/null
+++ b/share/examples/sound/kqueue.c
@@ -0,0 +1,79 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Goran Mekić
+ *
+ * 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/event.h>
+
+#include "oss.h"
+
+int
+main(int argc, char *argv[])
+{
+ struct config config = {
+ .device = "/dev/dsp",
+ .mode = O_RDWR,
+ .format = AFMT_S32_NE,
+ .sample_rate = 48000,
+ };
+ struct kevent event = {};
+ int rc, bytes, kq;
+
+ oss_init(&config);
+ bytes = config.buffer_info.bytes;
+
+ if ((kq = kqueue()) < 0)
+ err(1, "Failed to allocate kqueue");
+ EV_SET(&event, config.fd, EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0);
+ if (kevent(kq, &event, 1, NULL, 0, NULL) < 0)
+ err(1, "Failed to register kevent");
+ for (;;) {
+ if (kevent(kq, NULL, 0, &event, 1, NULL) < 0) {
+ warn("Event error");
+ break;
+ }
+ if (event.flags & EV_ERROR) {
+ warn("Event error: %s", strerror(event.data));
+ break;
+ }
+ if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but read %d!\n", bytes, rc);
+ break;
+ }
+ if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but wrote %d!\n", bytes, rc);
+ break;
+ }
+ }
+ EV_SET(&event, config.fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0);
+ if (kevent(kq, &event, 1, NULL, 0, NULL) < 0)
+ err(1, "Failed to unregister kevent");
+ close(kq);
+
+ free(config.buf);
+ close(config.fd);
+
+ return (0);
+}
diff --git a/share/examples/sound/oss.h b/share/examples/sound/oss.h
new file mode 100644
index 000000000000..437c6d69d454
--- /dev/null
+++ b/share/examples/sound/oss.h
@@ -0,0 +1,222 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Goran Mekić
+ *
+ * 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/soundcard.h>
+
+#include <err.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/*
+ * Minimal configuration for OSS. For real world applications, this structure
+ * will probably contain many more fields
+ */
+struct config {
+ char *device;
+ int mode;
+ int fd;
+ int format;
+ int sample_count;
+ int sample_rate;
+ int sample_size;
+ int chsamples;
+ int mmap;
+ void *buf;
+ oss_audioinfo audio_info;
+ audio_buf_info buffer_info;
+};
+
+/*
+ * The buffer size used by OSS is (2 ^ exponent) * number_of_fragments.
+ * Exponent values range between 4 and 16, so this function looks for the
+ * smallest exponent which can fit a buffer of size "x". The fragments
+ * determine in how many chunks the buffer will be sliced into, hence if the
+ * exponent is 4, and number of fragments is 2, the requested size will be 2^4
+ * * 2 = 32. Please note that the buffer size is in bytes, not samples. For
+ * example, a 24-bit sample will be represented with 3 bytes. If you're porting
+ * an audio application from Linux, you should be aware that 24-bit samples on
+ * it are represented with 4 bytes (usually int). The idea of a total buffer
+ * size that holds number of fragments is to allow application to be
+ * number_of_fragments - 1 late. That's called jitter tolerance.
+ *
+ * Official OSS development howto:
+ * http://manuals.opensound.com/developer/DSP.html
+ */
+static inline int
+size2exp(int x)
+{
+ int exp = 0;
+
+ while ((1 << exp) < x)
+ exp++;
+
+ return (exp);
+}
+
+static void
+oss_init(struct config *config)
+{
+ unsigned long request = SNDCTL_DSP_GETOSPACE;
+ int tmp = 0;
+
+ if ((config->fd = open(config->device, config->mode)) < 0)
+ err(1, "Error opening the device %s", config->device);
+
+ /* Get device information */
+ if (ioctl(config->fd, SNDCTL_ENGINEINFO, &config->audio_info) < 0)
+ err(1, "Unable to get device info");
+
+ /* Get device capabilities */
+ if (ioctl(config->fd, SNDCTL_DSP_GETCAPS, &config->audio_info.caps) < 0)
+ err(1, "Unable to get capabilities");
+
+ /* Check if device supports triggering */
+ if (!(config->audio_info.caps & PCM_CAP_TRIGGER))
+ errx(1, "Device doesn't support triggering!\n");
+
+ /* Handle memory mapped mode */
+ if (config->mmap) {
+ if (!(config->audio_info.caps & PCM_CAP_MMAP))
+ errx(1, "Device doesn't support mmap mode!\n");
+ tmp = 0;
+ if (ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp) < 0)
+ err(1, "Unable to set cooked mode");
+ }
+
+ /* Set sample format */
+ if (ioctl(config->fd, SNDCTL_DSP_SETFMT, &config->format) < 0)
+ err(1, "Unable to set sample format");
+
+ /* Set sample channels */
+ if (ioctl(config->fd, SNDCTL_DSP_CHANNELS, &config->audio_info.max_channels) < 0)
+ err(1, "Unable to set channels");
+
+ /* Set sample rate */
+ if (ioctl(config->fd, SNDCTL_DSP_SPEED, &config->sample_rate) < 0)
+ err(1, "Unable to set sample rate");
+
+ /* Calculate sample size */
+ switch (config->format) {
+ case AFMT_S8:
+ case AFMT_U8:
+ config->sample_size = 1;
+ break;
+ case AFMT_S16_BE:
+ case AFMT_S16_LE:
+ case AFMT_U16_BE:
+ case AFMT_U16_LE:
+ config->sample_size = 2;
+ break;
+ case AFMT_S24_BE:
+ case AFMT_S24_LE:
+ case AFMT_U24_BE:
+ case AFMT_U24_LE:
+ config->sample_size = 3;
+ break;
+ case AFMT_S32_BE:
+ case AFMT_S32_LE:
+ case AFMT_U32_BE:
+ case AFMT_U32_LE:
+ case AFMT_F32_BE:
+ case AFMT_F32_LE:
+ config->sample_size = 4;
+ break;
+ default:
+ errx(1, "Invalid audio format %d", config->format);
+ break;
+ }
+
+ /*
+ * Set fragment and sample size. This part is optional as OSS has
+ * default values. From the kernel's perspective, there are few things
+ * OSS developers should be aware of:
+ *
+ * - For each sound(4)-created channel, there is a software-facing
+ * buffer, and a hardware-facing one.
+ * - The sizes of the buffers can be listed in the console with "sndctl
+ * swbuf hwbuf".
+ * - OSS ioctls only concern software-facing buffer fragments, not
+ * hardware.
+ *
+ * For USB sound cards, the block size is set according to the
+ * hw.usb.uaudio.buffer_ms sysctl, meaning 2ms at 48kHz gives 0.002 *
+ * 48000 = 96 samples per block. Block size should be set as multiple
+ * of 96, in this case. The OSS driver insists on reading/writing a
+ * certain number of samples at a time, one fragment full of samples.
+ * It is bound to do so at a fixed time frame, to avoid under- and
+ * overruns during communication with the hardware.
+ */
+ config->buffer_info.fragments = 2;
+ tmp = size2exp(config->sample_size * config->audio_info.max_channels);
+ tmp = ((config->buffer_info.fragments) << 16) | tmp;
+ if (ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp) < 0)
+ err(1, "Unable to set fragment size");
+
+ /* Get buffer info */
+ if ((config->mode & O_ACCMODE) == O_RDONLY)
+ request = SNDCTL_DSP_GETISPACE;
+ if (ioctl(config->fd, request, &config->buffer_info) < 0)
+ err(1, "Unable to get buffer info");
+ if (config->buffer_info.fragments < 1)
+ config->buffer_info.fragments = config->buffer_info.fragstotal;
+ if (config->buffer_info.bytes < 1)
+ config->buffer_info.bytes = config->buffer_info.fragstotal * config->buffer_info.fragsize;
+ if (config->buffer_info.bytes < 1) {
+ errx(1, "OSS buffer error: buffer size can not be %d\n",
+ config->buffer_info.bytes);
+ }
+ config->sample_count = config->buffer_info.bytes / config->sample_size;
+ config->chsamples = config->sample_count / config->audio_info.max_channels;
+ config->buf = malloc(config->buffer_info.bytes);
+
+ printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, "
+ "samples: %d\n",
+ config->buffer_info.bytes, config->buffer_info.fragments,
+ config->buffer_info.fragsize, config->buffer_info.fragstotal,
+ config->sample_count);
+
+ /* Set the trigger */
+ switch (config->mode & O_ACCMODE) {
+ case O_RDONLY:
+ tmp = PCM_ENABLE_INPUT;
+ break;
+ case O_WRONLY:
+ tmp = PCM_ENABLE_OUTPUT;
+ break;
+ case O_RDWR:
+ tmp = PCM_ENABLE_INPUT | PCM_ENABLE_OUTPUT;
+ break;
+ default:
+ errx(1, "Invalid mode %d", config->mode);
+ break;
+ }
+ if (ioctl(config->fd, SNDCTL_DSP_SETTRIGGER, &tmp) < 0)
+ err(1, "Failed to set trigger");
+}
diff --git a/share/examples/sound/oss/README b/share/examples/sound/oss/README
deleted file mode 100644
index 0188a26348c8..000000000000
--- a/share/examples/sound/oss/README
+++ /dev/null
@@ -1,66 +0,0 @@
-Briefly summarised, a general audio application will:
-- open(2)
-- ioctl(2)
-- read(2)
-- write(2)
-- close(2)
-
-In this example, read/write will be called in a loop for a duration of
-record/playback. Usually, /dev/dsp is the device you want to open, but it can
-be any OSS compatible device, even user space one created with virtual_oss. For
-configuring sample rate, bit depth and all other configuring of the device
-ioctl is used. As devices can support multiple sample rates and formats, what
-specific application should do in case there's an error issuing ioctl, as not
-all errors are fatal, is upon the developer to decide. As a general guideline
-Official OSS development howto should be used. FreeBSD OSS and virtual_oss are
-different to a small degree.
-
-For more advanced OSS and real-time applications, developers need to handle
-buffers more carefully. The size of the buffer in OSS is selected using fragment
-size size_selector and the buffer size is 2^size_selector for values between 4
-and 16. The formula on the official site is:
-
-int frag = (max_fragments << 16) | (size_selector);
-ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &frag);
-
-The max_fragments determines in how many fragments the buffer will be, hence if
-the size_selector is 4, the requested size is 2^4 = 16 and for the
-max_fragments of 2, the total buffer size will be
-
-(2 ^ size_selector) * max_fragments
-
-or in this case 32 bytes. Please note that size of buffer is in bytes not
-samples. For example, 24bit sample will be represented with 3 bytes. If you're
-porting audio app from Linux, you should be aware that 24 bit samples are
-represented with 4 bytes (usually int).
-
-FreeBSD kernel will round up max_fragments and size of fragment/buffer, so the
-last thing any OSS code should do is get info about buffer with audio_buf_info
-and SNDCTL_DSP_GETOSPACE. That also means that not all values of max_fragments
-are permitted.
-
-From kernel perspective, there are few points OSS developers should be aware of:
-- There is a software facing buffer (bs) and a hardware driver buffer (b)
-- The sizes can be seen with cat /dev/sndstat as [b:_/_/_] [bs:_/_/_] (needed:
- sysctl hw.snd.verbose=2)
-- OSS ioctl only concern software buffer fragments, not hardware
-
-For USB the block size is according to hw.usb.uaudio.buffer_ms sysctl, meaning
-2ms at 48kHz gives 0.002 * 48000 = 96 samples per block, all multiples of this
-work well. Block size for virtual_oss, if used, should be set accordingly.
-
-OSS driver insists on reading / writing a certain number of samples at a time,
-one fragment full of samples. It is bound to do so in a fixed time frame, to
-avoid under- and overruns in communication with the hardware.
-
-The idea of a total buffer size that holds max_fragments fragments is to give
-some slack and allow application to be about max_fragments - 1 fragments late.
-Let's call this the jitter tolerance. The jitter tolerance may be much less if
-there is a slight mismatch between the period and the samples per fragment.
-
-Jitter tolerance gets better if we can make either the period or the samples
-per fragment considerably smaller than the other. In our case that means we
-divide the total buffer size into smaller fragments, keeping overall latency at
-the same level.
-
-Official OSS development howto: http://manuals.opensound.com/developer/DSP.html
diff --git a/share/examples/sound/oss/audio.c b/share/examples/sound/oss/audio.c
deleted file mode 100644
index 4dd3c8b82575..000000000000
--- a/share/examples/sound/oss/audio.c
+++ /dev/null
@@ -1,310 +0,0 @@
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (c) 2021 Goran Mekić
- * Copyright (c) 2024 The FreeBSD Foundation
- *
- * Portions of this software were developed by Christos Margiolis
- * <christos@FreeBSD.org> 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/soundcard.h>
-
-#include <err.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#ifndef SAMPLE_SIZE
-#define SAMPLE_SIZE 16
-#endif
-
-/* Format can be unsigned, in which case replace S with U */
-#if SAMPLE_SIZE == 32
-typedef int32_t sample_t;
-int format = AFMT_S32_NE; /* Signed 32bit native endian format */
-#elif SAMPLE_SIZE == 16
-typedef int16_t sample_t;
-int format = AFMT_S16_NE; /* Signed 16bit native endian format */
-#elif SAMPLE_SIZE == 8
-typedef int8_t sample_t;
-int format = AFMT_S8_NE; /* Signed 8bit native endian format */
-#else
-#error Unsupported sample format!
-typedef int32_t sample_t;
-int format = AFMT_S32_NE; /* Not a real value, just silencing
- * compiler errors */
-#endif
-
-/*
- * Minimal configuration for OSS
- * For real world applications, this structure will probably contain many
- * more fields
- */
-typedef struct config {
- char *device;
- int channels;
- int fd;
- int format;
- int frag;
- int sample_count;
- int sample_rate;
- int sample_size;
- int chsamples;
- int mmap;
- oss_audioinfo audio_info;
- audio_buf_info buffer_info;
-} config_t;
-
-/*
- * Error state is indicated by value=-1 in which case application exits with
- * error
- */
-static inline void
-check_error(const int value, const char *message)
-{
- if (value == -1)
- err(1, "OSS error: %s\n", message);
-}
-
-
-/* Calculate frag by giving it minimal size of buffer */
-static inline int
-size2frag(int x)
-{
- int frag = 0;
-
- while ((1 << frag) < x)
- ++frag;
-
- return (frag);
-}
-
-/*
- * Split input buffer into channels. Input buffer is in interleaved format
- * which means if we have 2 channels (L and R), this is what the buffer of 8
- * samples would contain: L,R,L,R,L,R,L,R. The result are two channels
- * containing: L,L,L,L and R,R,R,R.
- */
-static void
-oss_split(config_t *config, sample_t *input, sample_t *output)
-{
- int channel, index, i;
-
- for (i = 0; i < config->sample_count; ++i) {
- channel = i % config->channels;
- index = i / config->channels;
- output[channel * index] = input[i];
- }
-}
-
-/*
- * Convert channels into interleaved format and place it in output
- * buffer
- */
-static void
-oss_merge(config_t *config, sample_t *input, sample_t *output)
-{
- int channel, index;
-
- for (channel = 0; channel < config->channels; ++channel) {
- for (index = 0; index < config->chsamples; ++index) {
- output[index * config->channels + channel] =
- input[channel * index];
- }
- }
-}
-
-static void
-oss_init(config_t *config)
-{
- int error, tmp, min_frag;
-
- /* Open the device for read and write */
- config->fd = open(config->device, O_RDWR);
- check_error(config->fd, "open");
-
- /* Get device information */
- config->audio_info.dev = -1;
- error = ioctl(config->fd, SNDCTL_ENGINEINFO, &(config->audio_info));
- check_error(error, "SNDCTL_ENGINEINFO");
- printf("min_channels: %d\n", config->audio_info.min_channels);
- printf("max_channels: %d\n", config->audio_info.max_channels);
- printf("latency: %d\n", config->audio_info.latency);
- printf("handle: %s\n", config->audio_info.handle);
- if (config->audio_info.min_rate > config->sample_rate ||
- config->sample_rate > config->audio_info.max_rate) {
- errx(1, "%s doesn't support chosen samplerate of %dHz!\n",
- config->device, config->sample_rate);
- }
- if (config->channels < 1)
- config->channels = config->audio_info.max_channels;
-
- /*
- * If device is going to be used in mmap mode, disable all format
- * conversions. Official OSS documentation states error code should not
- * be checked.
- * http://manuals.opensound.com/developer/mmap_test.c.html#LOC10
- */
- if (config->mmap) {
- tmp = 0;
- ioctl(config->fd, SNDCTL_DSP_COOKEDMODE, &tmp);
- }
-
- /*
- * Set number of channels. If number of channels is chosen to the value
- * near the one wanted, save it in config
- */
- tmp = config->channels;
- error = ioctl(config->fd, SNDCTL_DSP_CHANNELS, &tmp);
- check_error(error, "SNDCTL_DSP_CHANNELS");
- /* Or check if tmp is close enough? */
- if (tmp != config->channels) {
- errx(1, "%s doesn't support chosen channel count of %d set "
- "to %d!\n", config->device, config->channels, tmp);
- }
- config->channels = tmp;
-
- /* Set format, or bit size: 8, 16, 24 or 32 bit sample */
- tmp = config->format;
- error = ioctl(config->fd, SNDCTL_DSP_SETFMT, &tmp);
- check_error(error, "SNDCTL_DSP_SETFMT");
- if (tmp != config->format) {
- errx(1, "%s doesn't support chosen sample format!\n",
- config->device);
- }
-
- /* Most common values for samplerate (in kHz): 44.1, 48, 88.2, 96 */
- tmp = config->sample_rate;
- error = ioctl(config->fd, SNDCTL_DSP_SPEED, &tmp);
- check_error(error, "SNDCTL_DSP_SPEED");
-
- /* Get and check device capabilities */
- error = ioctl(config->fd, SNDCTL_DSP_GETCAPS, &(config->audio_info.caps));
- check_error(error, "SNDCTL_DSP_GETCAPS");
- if (!(config->audio_info.caps & PCM_CAP_DUPLEX))
- errx(1, "Device doesn't support full duplex!\n");
-
- if (config->mmap) {
- if (!(config->audio_info.caps & PCM_CAP_TRIGGER))
- errx(1, "Device doesn't support triggering!\n");
- if (!(config->audio_info.caps & PCM_CAP_MMAP))
- errx(1, "Device doesn't support mmap mode!\n");
- }
-
- /*
- * If desired frag is smaller than minimum, based on number of channels
- * and format (size in bits: 8, 16, 24, 32), set that as frag. Buffer
- * size is 2^frag, but the real size of the buffer will be read when
- * the configuration of the device is successful
- */
- min_frag = size2frag(config->sample_size * config->channels);
-
- if (config->frag < min_frag)
- config->frag = min_frag;
-
- /*
- * Allocate buffer in fragments. Total buffer will be split in number
- * of fragments (2 by default)
- */
- if (config->buffer_info.fragments < 0)
- config->buffer_info.fragments = 2;
- tmp = ((config->buffer_info.fragments) << 16) | config->frag;
- error = ioctl(config->fd, SNDCTL_DSP_SETFRAGMENT, &tmp);
- check_error(error, "SNDCTL_DSP_SETFRAGMENT");
-
- /* When all is set and ready to go, get the size of buffer */
- error = ioctl(config->fd, SNDCTL_DSP_GETOSPACE, &(config->buffer_info));
- check_error(error, "SNDCTL_DSP_GETOSPACE");
- if (config->buffer_info.bytes < 1) {
- errx(1, "OSS buffer error: buffer size can not be %d\n",
- config->buffer_info.bytes);
- }
- config->sample_count = config->buffer_info.bytes / config->sample_size;
- config->chsamples = config->sample_count / config->channels;
-}
-
-int
-main(int argc, char *argv[])
-{
- int ret, bytes;
- int8_t *ibuf, *obuf;
- config_t config = {
- .device = "/dev/dsp",
- .channels = -1,
- .format = format,
- .frag = -1,
- .sample_rate = 48000,
- .sample_size = sizeof(sample_t),
- .buffer_info.fragments = -1,
- .mmap = 0,
- };
-
- /* Initialize device */
- oss_init(&config);
-
- /*
- * Allocate input and output buffers so that their size match frag_size
- */
- bytes = config.buffer_info.bytes;
- ibuf = malloc(bytes);
- obuf = malloc(bytes);
- sample_t *channels = malloc(bytes);
-
- printf("bytes: %d, fragments: %d, fragsize: %d, fragstotal: %d, "
- "samples: %d\n",
- bytes, config.buffer_info.fragments,
- config.buffer_info.fragsize, config.buffer_info.fragstotal,
- config.sample_count);
-
- /* Minimal engine: read input and copy it to the output */
- for (;;) {
- ret = read(config.fd, ibuf, bytes);
- if (ret < bytes) {
- fprintf(stderr, "Requested %d bytes, but read %d!\n",
- bytes, ret);
- break;
- }
- oss_split(&config, (sample_t *)ibuf, channels);
- /* All processing will happen here */
- oss_merge(&config, channels, (sample_t *)obuf);
- ret = write(config.fd, obuf, bytes);
- if (ret < bytes) {
- fprintf(stderr, "Requested %d bytes, but wrote %d!\n",
- bytes, ret);
- break;
- }
- }
-
- /* Cleanup */
- free(channels);
- free(obuf);
- free(ibuf);
- close(config.fd);
-
- return (0);
-}
diff --git a/share/examples/sound/poll.c b/share/examples/sound/poll.c
new file mode 100644
index 000000000000..53bdf572e991
--- /dev/null
+++ b/share/examples/sound/poll.c
@@ -0,0 +1,70 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Goran Mekić
+ *
+ * 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/poll.h>
+
+#include "oss.h"
+
+int
+main(int argc, char *argv[])
+{
+ struct config config = {
+ .device = "/dev/dsp",
+ .mode = O_RDWR,
+ .format = AFMT_S32_NE,
+ .sample_rate = 48000,
+ };
+ struct pollfd pfds[1];
+ int rc, bytes;
+
+ oss_init(&config);
+ bytes = config.buffer_info.bytes;
+
+ for (;;) {
+ pfds[0].fd = config.fd;
+ pfds[0].events = POLLOUT;
+ if (poll(pfds, sizeof(pfds) / sizeof(struct pollfd), -1) < 0)
+ err(1, "poll");
+ if (pfds[0].revents != 0) {
+ if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but read %d!\n",
+ bytes, rc);
+ break;
+ }
+ if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
+ err(1, "Requested %d bytes, but wrote %d!\n",
+ bytes, rc);
+ break;
+ }
+ }
+ }
+
+ free(config.buf);
+ close(config.fd);
+
+ return (0);
+}
diff --git a/share/examples/sound/select.c b/share/examples/sound/select.c
new file mode 100644
index 000000000000..762d0b2b86a7
--- /dev/null
+++ b/share/examples/sound/select.c
@@ -0,0 +1,70 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2025 Goran Mekić
+ *
+ * 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/poll.h>
+
+#include "oss.h"
+
+int
+main(int argc, char *argv[])
+{
+ struct config config = {
+ .device = "/dev/dsp",
+ .mode = O_RDWR,
+ .format = AFMT_S32_NE,
+ .sample_rate = 48000,
+ };
+ fd_set fds;
+ int rc, bytes;
+
+ oss_init(&config);
+ bytes = config.buffer_info.bytes;
+
+ for (;;) {
+ FD_ZERO(&fds);
+ FD_SET(config.fd, &fds);
+ if (select(config.fd + 1, &fds, NULL, NULL, NULL) < 0)
+ err(1, "select");
+ if (FD_ISSET(config.fd, &fds)) {
+ if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but read %d!\n",
+ bytes, rc);
+ break;
+ }
+ if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but wrote %d!\n",
+ bytes, rc);
+ break;
+ }
+ }
+ }
+
+ free(config.buf);
+ close(config.fd);
+
+ return (0);
+}
diff --git a/share/examples/sound/simple.c b/share/examples/sound/simple.c
new file mode 100644
index 000000000000..e458841f596a
--- /dev/null
+++ b/share/examples/sound/simple.c
@@ -0,0 +1,147 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2024 The FreeBSD Foundation
+ * Copyright (c) 2025 Goran Mekić
+ *
+ * Portions of this software were developed by Christos Margiolis
+ * <christos@FreeBSD.org> 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 "oss.h"
+
+/*
+ * Split input buffer into channels. The input buffer is in interleaved format,
+ * which means if we have 2 channels (L and R), this is what the buffer of 8
+ * samples would contain: L,R,L,R,L,R,L,R. The result of this function is a
+ * buffer containing: L,L,L,L,R,R,R,R.
+ */
+static void
+to_channels(struct config *config, void *output)
+{
+ uint8_t *in = config->buf;
+ uint8_t *out = output;
+ int i, channel, index, offset, byte;
+
+ /* Iterate over bytes in the input buffer */
+ for (byte = 0; byte < config->buffer_info.bytes;
+ byte += config->sample_size) {
+ /*
+ * Get index of a sample in the input buffer measured in
+ * samples
+ */
+ i = byte / config->sample_size;
+
+ /* Get which channel is being processed */
+ channel = i % config->audio_info.max_channels;
+
+ /* Get offset of the sample inside a single channel */
+ offset = i / config->audio_info.max_channels;
+
+ /* Get index of a sample in the output buffer */
+ index = (channel * config->chsamples + offset) *
+ config->sample_size;
+
+ /* Copy singe sample from input to output */
+ memcpy(out+index, in+byte, config->sample_size);
+ }
+}
+
+/*
+ * Convert channels into interleaved format and put into output buffer
+ */
+static void
+to_interleaved(struct config *config, void *input)
+{
+ uint8_t *out = config->buf;
+ uint8_t *in = input;
+ int i, index, offset, channel, byte;
+
+ /* Iterate over bytes in the input buffer */
+ for (byte = 0; byte < config->buffer_info.bytes;
+ byte += config->sample_size) {
+ /*
+ * Get index of a sample in the input buffer measured in
+ * samples
+ */
+ index = byte / config->sample_size;
+
+ /* Get which channel is being processed */
+ channel = index / config->chsamples;
+
+ /* Get offset of the sample inside a single channel */
+ offset = index % config->chsamples;
+
+ /* Get index of a sample in the output buffer */
+ i = (config->audio_info.max_channels * offset + channel) *
+ config->sample_size;
+
+ /* Copy singe sample from input to output */
+ memcpy(out+i, in+byte, config->sample_size);
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ struct config config = {
+ .device = "/dev/dsp",
+ .mode = O_RDWR,
+ .format = AFMT_S32_NE,
+ .sample_rate = 48000,
+ };
+ int32_t *channels;
+ int rc, bytes;
+
+ oss_init(&config);
+ bytes = config.buffer_info.bytes;
+ channels = malloc(bytes);
+
+ for (;;) {
+ if ((rc = read(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but read %d!\n", bytes, rc);
+ break;
+ }
+ /*
+ * Strictly speaking, we could omit "channels" and operate only
+ * using config->buf, but this example tries to show the real
+ * world application usage. The problem is that the buffer is
+ * in interleaved format, and if you'd like to do any
+ * processing and/or mixing, it is easier to do that if samples
+ * are grouped per channel.
+ */
+ to_channels(&config, channels);
+ to_interleaved(&config, channels);
+ if ((rc = write(config.fd, config.buf, bytes)) < bytes) {
+ warn("Requested %d bytes, but wrote %d!\n", bytes, rc);
+ break;
+ }
+ }
+
+ free(channels);
+ free(config.buf);
+ close(config.fd);
+
+ return (0);
+}
diff --git a/share/keys/Makefile b/share/keys/Makefile
index f4bab152d8cb..98e17356e75a 100644
--- a/share/keys/Makefile
+++ b/share/keys/Makefile
@@ -1,3 +1,3 @@
-SUBDIR= pkg
+SUBDIR= pkg pkgbase-15
.include <bsd.subdir.mk>
diff --git a/share/keys/pkgbase-15/Makefile b/share/keys/pkgbase-15/Makefile
new file mode 100644
index 000000000000..665bcf389da1
--- /dev/null
+++ b/share/keys/pkgbase-15/Makefile
@@ -0,0 +1,3 @@
+SUBDIR= trusted
+
+.include <bsd.subdir.mk>
diff --git a/share/keys/pkgbase-15/trusted/Makefile b/share/keys/pkgbase-15/trusted/Makefile
new file mode 100644
index 000000000000..32db72ae368a
--- /dev/null
+++ b/share/keys/pkgbase-15/trusted/Makefile
@@ -0,0 +1,9 @@
+PACKAGE= pkg-bootstrap
+
+FILES= awskms-15 \
+ backup-signing-15
+
+FILESDIR= ${SHAREDIR}/keys/pkgbase-15/trusted
+FILESMODE= 644
+
+.include <bsd.prog.mk>
diff --git a/share/keys/pkgbase-15/trusted/awskms-15 b/share/keys/pkgbase-15/trusted/awskms-15
new file mode 100644
index 000000000000..e951b6f9e2d5
--- /dev/null
+++ b/share/keys/pkgbase-15/trusted/awskms-15
@@ -0,0 +1,2 @@
+function: "sha256"
+fingerprint: "1d7b45d20fa8d6ed26f9b4a13ac81a6b5df860b9fe644d07b87e92298ba72595"
diff --git a/share/keys/pkgbase-15/trusted/backup-signing-15 b/share/keys/pkgbase-15/trusted/backup-signing-15
new file mode 100644
index 000000000000..a147d6788cf2
--- /dev/null
+++ b/share/keys/pkgbase-15/trusted/backup-signing-15
@@ -0,0 +1,2 @@
+function: "sha256"
+fingerprint: "56a77bdcb6c3cf7984729c6138bd5617c24aa0d466b3b604c96205b2c5629f3c"
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index 18e439491793..bce57291f073 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -203,6 +203,7 @@ MLINKS+= Q_SIGNSHFT.3 Q_SSIGN.3 \
MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \
queue.3 LIST_CLASS_HEAD.3 \
queue.3 LIST_EMPTY.3 \
+ queue.3 LIST_EMPTY_ATOMIC.3 \
queue.3 LIST_ENTRY.3 \
queue.3 LIST_FIRST.3 \
queue.3 LIST_FOREACH.3 \
@@ -224,6 +225,7 @@ MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \
queue.3 SLIST_CLASS_ENTRY.3 \
queue.3 SLIST_CLASS_HEAD.3 \
queue.3 SLIST_EMPTY.3 \
+ queue.3 SLIST_EMPTY_ATOMIC.3 \
queue.3 SLIST_ENTRY.3 \
queue.3 SLIST_FIRST.3 \
queue.3 SLIST_FOREACH.3 \
@@ -246,6 +248,7 @@ MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \
queue.3 STAILQ_CLASS_HEAD.3 \
queue.3 STAILQ_CONCAT.3 \
queue.3 STAILQ_EMPTY.3 \
+ queue.3 STAILQ_EMPTY_ATOMIC.3 \
queue.3 STAILQ_ENTRY.3 \
queue.3 STAILQ_FIRST.3 \
queue.3 STAILQ_FOREACH.3 \
@@ -270,6 +273,7 @@ MLINKS+= queue.3 LIST_CLASS_ENTRY.3 \
queue.3 TAILQ_CLASS_HEAD.3 \
queue.3 TAILQ_CONCAT.3 \
queue.3 TAILQ_EMPTY.3 \
+ queue.3 TAILQ_EMPTY_ATOMIC.3 \
queue.3 TAILQ_ENTRY.3 \
queue.3 TAILQ_FIRST.3 \
queue.3 TAILQ_FOREACH.3 \
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index fe1d285aec96..722ee2bc9334 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -189,6 +189,7 @@ MAN= aac.4 \
geom.4 \
geom_linux_lvm.4 \
geom_uzip.4 \
+ geom_zero.4 \
gif.4 \
${_gve.4} \
gpio.4 \
@@ -458,7 +459,6 @@ MAN= aac.4 \
p9fs.4 \
pass.4 \
pca954x.4 \
- pccard.4 \
pccbb.4 \
pcf.4 \
pcf8574.4 \
@@ -466,7 +466,6 @@ MAN= aac.4 \
${_pchtherm.4} \
pci.4 \
pcib.4 \
- pcic.4 \
pcm.4 \
${_pf.4} \
${_pflog.4} \
@@ -1013,6 +1012,7 @@ _dtrace_provs= dtrace_audit.4 \
dtrace_kinst.4 \
dtrace_lockstat.4 \
dtrace_pid.4 \
+ dtrace_priv.4 \
dtrace_proc.4 \
dtrace_profile.4 \
dtrace_sched.4 \
@@ -1123,6 +1123,7 @@ MAN+= \
veriexec.4 \
zyd.4
+MLINKS+=geom_zero.4 gzero.4
MLINKS+=mtw.4 if_mtw.4
MLINKS+=otus.4 if_otus.4
MLINKS+=rsu.4 if_rsu.4
diff --git a/share/man/man4/ath.4 b/share/man/man4/ath.4
index e731277e4e75..b40ccbd16f09 100644
--- a/share/man/man4/ath.4
+++ b/share/man/man4/ath.4
@@ -258,7 +258,6 @@ This should not happen.
.Xr ath_hal 4 ,
.Xr cardbus 4 ,
.Xr intro 4 ,
-.Xr pcic 4 ,
.Xr wlan 4 ,
.Xr wlan_ccmp 4 ,
.Xr wlan_tkip 4 ,
diff --git a/share/man/man4/cardbus.4 b/share/man/man4/cardbus.4
index 3b422b44c464..fa4bce65e095 100644
--- a/share/man/man4/cardbus.4
+++ b/share/man/man4/cardbus.4
@@ -52,5 +52,4 @@ Non-zero value causes the CIS parsing of the 32-bit CardBus card to be
much more verbose and include a complete CIS dump.
.El
.Sh SEE ALSO
-.Xr pccard 4 ,
.Xr pccbb 4
diff --git a/share/man/man4/crypto.4 b/share/man/man4/crypto.4
index b1423752718e..4242a6631352 100644
--- a/share/man/man4/crypto.4
+++ b/share/man/man4/crypto.4
@@ -346,7 +346,6 @@ Destroys the session identified by
.El
.Sh SEE ALSO
.Xr aesni 4 ,
-.Xr hifn 4 ,
.Xr ipsec 4 ,
.Xr padlock 4 ,
.Xr safe 4 ,
diff --git a/share/man/man4/dtrace_priv.4 b/share/man/man4/dtrace_priv.4
new file mode 100644
index 000000000000..97bd4c20eb2c
--- /dev/null
+++ b/share/man/man4/dtrace_priv.4
@@ -0,0 +1,59 @@
+.\"
+.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org>
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.Dd November 12, 2025
+.Dt DTRACE_PRIV 4
+.Os
+.Sh NAME
+.Nm dtrace_priv
+.Nd a DTrace provider for the kernel privilege checking API
+.Sh SYNOPSIS
+.Nm priv Ns Cm :kernel:priv_check:priv-ok
+.Nm priv Ns Cm :kernel:priv_check:priv-err
+.Sh DESCRIPTION
+The
+.Nm priv
+provider allows for tracing the
+.Xr priv 9
+API.
+.Pp
+The
+.Nm priv Ns Cm :kernel:priv_check:priv-ok
+probe fires upon a successful kernel privilege check.
+.Pp
+The
+.Nm priv Ns Cm :kernel:priv_check:priv-err
+probe fires upon a failed kernel privilege check.
+.Pp
+The only argument to the
+.Nm priv
+probes,
+.Fa args[0] ,
+is the requested privilege number
+.Ft int priv .
+.Sh EXAMPLES
+.Ss Example 1: Tracing Kernel Privilege Check Failures
+The following script captures an array of counters,
+one for each stack trace leading to a failed kernel privilege check:
+.Bd -literal -offset 2n
+priv:::priv-err
+{
+ @traces[stack()] = count();
+}
+.Ed
+.Sh SEE ALSO
+.Xr dtrace 1 ,
+.Xr tracing 7 ,
+.Xr priv 9 ,
+.Xr SDT 9
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm priv
+provider was written by
+.An Robert N. M. Watson Aq Mt rwatson@FreeBSD.org .
+.Pp
+This manual page was written by
+.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org .
diff --git a/share/man/man4/exca.4 b/share/man/man4/exca.4
index 555e459b7db4..d43d359bfb25 100644
--- a/share/man/man4/exca.4
+++ b/share/man/man4/exca.4
@@ -33,5 +33,4 @@ The
module is used to implement the Intel ExCA interface to
PC Cards.
.Sh SEE ALSO
-.Xr pccbb 4 ,
-.Xr pcic 4
+.Xr pccbb 4
diff --git a/share/man/man4/fdc.4 b/share/man/man4/fdc.4
index 929baf3a234b..937be2077b26 100644
--- a/share/man/man4/fdc.4
+++ b/share/man/man4/fdc.4
@@ -25,7 +25,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 October 10, 2023
+.Dd November 16, 2025
.Dt FDC 4
.Os
.Sh NAME
@@ -47,6 +47,12 @@ In
.Cd hint.fd.1.at="fdc0"
.Cd hint.fd.1.drive="1"
.Cd hint.fd.1.flags="0x0"
+.Sh DEPRECATION NOTICE
+The
+.Nm
+driver is deprecated and may not be present in
+.Fx 16.0
+and later.
.Sh DESCRIPTION
.Ss Device Usage
This driver provides access to floppy disk drives.
@@ -350,13 +356,15 @@ Print when an unknown IOCTL is used.
.El
.It Dv debug.fdc.fifo
For enhanced controllers, allows a non-default FIFO
-threshold setting. The default is 8 bytes.
+threshold setting.
+The default is 8 bytes.
.It Dv debug.fdc.retries
-Maximum number of retries to attempt. The default is 10.
+Maximum number of retries to attempt.
+The default is 10.
.It Dv debug.fdc.spec1
Specification byte one (step-rate + head unload).
-The default step rate is 6 ms. The default head unload
-time is 240 ms.
+The default step rate is 6 ms.
+The default head unload time is 240 ms.
.It Dv debug.fdc.spec2
Specification byte two (head load time + no-dma).
The default head load time is 16 ms, and no-dma is 0
diff --git a/share/man/man4/geom_zero.4 b/share/man/man4/geom_zero.4
new file mode 100644
index 000000000000..82e74618515f
--- /dev/null
+++ b/share/man/man4/geom_zero.4
@@ -0,0 +1,174 @@
+.\"
+.\" Copyright (c) 2019 Greg White <gkwhite@gmail.com>. All rights reserved.
+.\" Copyright (c) 2025 Mateusz Piotrowski <0mp@FreeBSD.org>
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.Dd November 9, 2025
+.Dt GEOM_ZERO 4
+.Os
+.Sh NAME
+.Nm gzero ,
+.Nm geom_zero
+.Nd GEOM-based zero disk/block device
+.Sh SYNOPSIS
+.Cd "options GEOM_ZERO"
+.Pp
+In
+.Xr loader.conf 5
+or
+.Xr sysctl.conf 5 :
+.Cd kern.geom.zero.byte
+.Cd kern.geom.zero.clear
+.Sh DESCRIPTION
+.Nm
+is a
+.Xr GEOM 4
+device simulating a one-exabyte disk.
+It throws away any data written to it,
+and returns the value of
+.Va kern.geom.zero.byte
+for every byte read from it.
+.Pp
+.Nm
+differs from
+.Xr zero 4 ,
+which is a regular character device and has an infinite length,
+while
+.Pa /dev/gzero
+is a
+.Xr GEOM 4
+provider of large, but limited, size.
+.Pp
+Consult
+.Xr geom 8
+for instructions on how to use the supported commands of the
+.Xr GEOM 4
+.Nm ZERO
+class.
+.Pp
+.Nm
+is useful for benchmarking performance of GEOM and GEOM classes
+where compression of the data does not affect the results
+.Po blocks from
+.Pa /dev/gzero
+compress exceptionally well
+.Pc .
+Examples of such benchmarks include
+comparing the speed of two disk encryption algorithms and
+comparing a hardware versus software implementation
+of a single encryption algorithm.
+.Sh MIB VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width "kern.geom.zero.clear"
+.It Va kern.geom.zero.byte
+This variable sets the fill byte of the
+.Nm
+device.
+Default:
+.Ql 0 .
+.It Va kern.geom.zero.clear
+This variable controls the clearing of the read data buffer.
+If set to
+.Ql 0 ,
+.Nm
+will not copy any data into the read data buffers
+and just return the read data buffers as they are without modifying them.
+In particular, it will not fill the read buffer with the value of
+.Va kern.geom.zero.byte .
+This is useful for read benchmarking to reduce the measurement noise
+caused by extra memory initialization.
+Default:
+.Ql 1 .
+.El
+.Sh FILES
+.Bl -tag -width /dev/gzero
+.It Pa /dev/gzero
+The
+.Nm
+device.
+.El
+.Sh EXAMPLES
+Create the
+.Pa /dev/gzero
+device by loading the
+.Nm geom_zero
+kernel module:
+.Bd -literal -offset indent
+# geom zero load
+.Ed
+.Pp
+Show information about the
+.Nm
+device:
+.Bd -literal -offset indent
+# geom zero list
+Geom name: gzero
+Providers:
+1. Name: gzero
+ Mediasize: 1152921504606846976 (1.0E)
+ Sectorsize: 512
+ Mode: r0w0egzero0
+.Ed
+.Pp
+Set the fill byte of the
+.Nm
+device to 70
+.Po decimal for letter
+.Dq F
+in
+.Xr ascii 7
+.Pc :
+.Bd -literal -offset indent
+# sysctl kern.geom.zero.byte=70
+kern.geom.zero.byte: 0 -> 70
+# head -c 1 /dev/gzero
+F
+.Ed
+.Pp
+Benchmark read and write throughput of
+.Xr geli 8 Ap s
+default encryption algorithm with a 4-KiB sector size:
+.Bd -literal -offset indent
+# geom zero load
+# geli onetime -s 4096 gzero
+# sysctl kern.geom.zero.clear=0
+# dd if=/dev/gzero.eli of=/dev/zero bs=4k count=$((1024 * 256))
+262144+0 records in
+262144+0 records out
+1073741824 bytes transferred in 1.258195 secs (853398307 bytes/sec)
+# dd if=/dev/zero of=/dev/gzero.eli bs=4k count=$((1024 * 256))
+262144+0 records in
+262144+0 records out
+1073741824 bytes transferred in 1.663118 secs (645619658 bytes/sec)
+.Ed
+.Sh SEE ALSO
+.Xr GEOM 4 ,
+.Xr zero 4 ,
+.Xr geom 8 ,
+.Xr sysctl 8 ,
+.Xr bio 9
+.Sh HISTORY
+A
+.Nm
+device first appeared in
+.Fx 6 .
+.Sh AUTHORS
+.An -nosplit
+The
+.Nm
+device was written by
+.An Paweł Jakub Dawidek Aq Mt pjd@FreeBSD.org .
+.Pp
+The
+.Nm
+manual page was originally written by
+.An Greg White Aq Mt gkwhite@gmail.com
+and rewritten by
+.An Mateusz Piotrowski Aq Mt 0mp@FreeBSD.org
+before landing in
+.Fx .
diff --git a/share/man/man4/hgame.4 b/share/man/man4/hgame.4
index 3309833c1720..94ad4f5ff4a4 100644
--- a/share/man/man4/hgame.4
+++ b/share/man/man4/hgame.4
@@ -1,3 +1,6 @@
+.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
.\" Copyright (c) 2020 Vladimir Kondratyev <wulf@FreeBSD.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -21,45 +24,62 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 14, 2020
+.Dd November 12, 2025
.Dt HGAME 4
.Os
.Sh NAME
.Nm hgame
-.Nd Generic HID game controller (joystick/gamepad) driver
+.Nd generic HID gamepad, joystick, and controller evdev driver
.Sh SYNOPSIS
-To compile this driver into the kernel,
-place the following lines in your
-kernel configuration file:
-.Bd -ragged -offset indent
-.Cd "device hgame"
-.Cd "device hid"
-.Cd "device hidbus"
-.Cd "device hidmap"
-.Cd "device evdev"
-.Ed
+.Cd device hgame
+.Cd device hid
+.Cd device hidbus
+.Cd device hidmap
+.Cd device evdev
+.Pp
+In
+.Xr sysctl.conf 5 :
+.Cd dev.hgame.X.debug
.Pp
-Alternatively, to load the driver as a
-module at boot time, place the following line in
+In
.Xr loader.conf 5 :
-.Bd -literal -offset indent
-hgame_load="YES"
-.Ed
+.Cd hw.hid.hgame.debug
+.Cd hgame_load
.Sh DESCRIPTION
The
.Nm
-driver provides support for generic game controllers (joysticks/gamepads)
-that attach to the HID transport backend.
-See
-.Xr iichid 4
-or
-.Xr usbhid 4 .
+driver supports generic game controllers
+that attach to the HID transport backend,
+and presents them to applications over the
+.Sy evdev
+interface.
.Pp
-The
+If the appropriate hardware is detected,
+the driver will be loaded automatically by
+.Xr devmatch 8 .
+To load the driver manually at boot time, set the
+.Va hgame_load
+variable to
+.Ar YES
+at the
+.Xr loader 8
+prompt, or add it to
+.Xr loader.conf 5 .
+.Pp
+To give user applications access to the game controllers,
+allow user access to the
.Pa /dev/input/event*
-device presents the game controller as a
-.Ar evdev
-type device.
+nodes with
+.Xr devfs.rules 5 .
+.Sh HARDWARE
+The
+.Nm
+driver supports HID gamepads, joysticks, and controllers such as:
+.Pp
+.Bl -bullet -compact
+.It
+8bitdo USB Wireless Adapter 2
+.El
.Sh SYSCTL VARIABLES
The following variable is available as both
.Xr sysctl 8
@@ -68,25 +88,31 @@ variable and
tunable:
.Bl -tag -width indent
.It Va dev.hgame.X.debug
-Debug output level, where 0 is debugging disabled and larger values increase
-debug message verbosity.
+Debug output level,
+where 0 is debugging disabled and
+larger values increase debug message verbosity.
Default is 0.
.El
.Pp
-It's default value is set with
+Its default value is set with
.Xr loader 8
tunable:
.Bl -tag -width indent
.It Va hw.hid.hgame.debug
.El
.Sh FILES
-.Bl -tag -width /dev/input/event* -compact
+.Bl -tag -width "/dev/input/event*" -compact
.It Pa /dev/input/event*
-input event device node.
+input event device
+.Pq Sy evdev
+node
.El
.Sh SEE ALSO
.Xr iichid 4 ,
-.Xr usbhid 4
+.Xr ps4dshock 4 ,
+.Xr usbhid 4 ,
+.Xr xb360gp 4 ,
+.Xr devfs.rules 5
.Sh HISTORY
The
.Nm
diff --git a/share/man/man4/isp.4 b/share/man/man4/isp.4
index 6fea63fdd5d5..a8f985a59d09 100644
--- a/share/man/man4/isp.4
+++ b/share/man/man4/isp.4
@@ -85,7 +85,7 @@ It may be disabled using configuration and hint options described below.
.Sh HARDWARE
The
.Nm
-driver supports the following optical Fibre Chanel adapters:
+driver supports the following optical Fibre Channel adapters:
.Bl -column "Qlogic 2690/2692/2694 (2684/2692)" "Speed" "PCI-X"
.It Model: Ta Speed: Ta Bus:
.It Qlogic QLE2874 (2814) Ta 64Gb Ta PCIe
diff --git a/share/man/man4/iwx.4 b/share/man/man4/iwx.4
index 295a5f318afa..5f978b210f78 100644
--- a/share/man/man4/iwx.4
+++ b/share/man/man4/iwx.4
@@ -17,24 +17,27 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd May 2, 2025
+.Dd November 14, 2025
.Dt IWX 4 amd64
.Os
.Sh NAME
.Nm iwx
.Nd Intel WiFi 6 IEEE 802.11ax wireless network driver
.Sh SYNOPSIS
-.Cd device iwx
-.Cd device wlan
+To compile this driver into the kernel,
+include the following lines in your kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device iwx"
+.Cd "device pci"
+.Cd "device wlan"
+.Ed
.Pp
-In
-.Xr rc.conf 5 :
-.Cd devmatch_blocklist="if_iwlwifi"
-.Cd kld_list="if_iwx"
-.Pp
-In
-.Xr sysctl.conf 5 :
-.Cd dev.iwx.?.debug=0xffffffff
+Alternatively, to load the driver as a
+module at boot time, place the following lines in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+if_iwx_load="YES"
+.Ed
.Sh DESCRIPTION
The
.Nm
diff --git a/share/man/man4/ix.4 b/share/man/man4/ix.4
index 418b6e1188ab..09af85f5c4a7 100644
--- a/share/man/man4/ix.4
+++ b/share/man/man4/ix.4
@@ -29,7 +29,7 @@
.\"
.\" * Other names and brands may be claimed as the property of others.
.\"
-.Dd October 26, 2024
+.Dd November 10, 2025
.Dt IX 4
.Os
.Sh NAME
@@ -78,6 +78,8 @@ including:
.Pp
.Bl -bullet -compact
.It
+Intel(R) Ethernet E610
+.It
Intel(R) Ethernet X553
.It
Intel(R) Ethernet X552
@@ -130,6 +132,35 @@ Enable Adaptive Interrupt Moderation (AIM).
Vary the interrupt rate over time based on the traffic for
that interrupt vector.
.El
+.Sh SYSCTL VARIABLES
+The
+.Nm
+driver supports the following
+.Xr sysctl 8
+variables:
+.Bl -tag -width "dev.ix.?.debug.dump.clusters"
+.It Va dev.ix.?.debug.dump.clusters
+Specify a bitmask to select firmware event clusters
+to be included in the debug dump.
+Possible values include:
+.Pp
+.Bl -tag -compact
+.It 0
+All clusters excluding Manageability Transactions
+.It 0x1
+Link cluster
+.It 0x2
+Full CSR Space excluding RCW registers
+.El
+.Pp
+This feature is only supported on E610 devices.
+.It Va dev.ix.?.debug.dump.dump
+Specify 1 to generate a per-device debugging snapshot.
+Output must be redirected to a file
+and decoded by Intel Customer Support.
+.Pp
+This feature is only supported on E610.
+.El
.Sh DIAGNOSTICS
.Bl -diag
.It "ix%d: Unable to allocate bus resource: memory"
diff --git a/share/man/man4/mgb.4 b/share/man/man4/mgb.4
index cf0f7aaa688d..0d26951d1b1e 100644
--- a/share/man/man4/mgb.4
+++ b/share/man/man4/mgb.4
@@ -49,7 +49,7 @@ For more information on configuring this device, see
.Sh HARDWARE
The
.Nm
-driver supports:
+driver supports Microchip PCIe Gigabit Ethernet interfaces, including:
.Pp
.Bl -bullet -compact
.It
diff --git a/share/man/man4/muge.4 b/share/man/man4/muge.4
index 598106bf1855..2a1b0f600955 100644
--- a/share/man/man4/muge.4
+++ b/share/man/man4/muge.4
@@ -44,7 +44,7 @@ For more information on configuring this device, see
.Sh HARDWARE
The
.Nm
-driver supports:
+driver supports Microchip USB Gigabit Ethernet interfaces, including:
.Pp
.Bl -bullet -compact
.It
diff --git a/share/man/man4/mx25l.4 b/share/man/man4/mx25l.4
index 5dffdebcf43e..a48b153e91ec 100644
--- a/share/man/man4/mx25l.4
+++ b/share/man/man4/mx25l.4
@@ -1,4 +1,6 @@
.\"
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
.\" Copyright (c) 2019 Ian Lepore <ian@freebsd.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,26 +24,18 @@
.\" (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 June 11, 2024
+.Dd November 11, 2025
.Dt MX25L 4
.Os
.Sh NAME
.Nm mx25l
-.Nd driver for SpiFlash(tm) compatible non-volatile storage devices
+.Nd SpiFlash compatible non-volatile storage devices driver
.Sh SYNOPSIS
-To compile this driver into the kernel,
-place the following line in your
-kernel configuration file:
-.Bd -ragged -offset indent
-.Cd "device mx25l"
-.Ed
+.Cd device mx25l
.Pp
-Alternatively, to load the driver as a
-module at boot time, place the following line in
+In
.Xr loader.conf 5 :
-.Bd -literal -offset indent
-mx25l_load="YES"
-.Ed
+.Cd mx25l_load="YES"
.Sh DESCRIPTION
The
.Nm
@@ -67,7 +61,7 @@ modules as with any disk device.
.Sh HARDWARE
The
.Nm
-driver provides support for the following devices:
+driver supports the following spi flash memory devices:
.Pp
.Bl -bullet -compact
.It
@@ -99,6 +93,8 @@ MX25LL32
.It
MX25LL64
.It
+N25Q64
+.It
S25FL032
.It
S25FL064
diff --git a/share/man/man4/pccard.4 b/share/man/man4/pccard.4
deleted file mode 100644
index cec07b2336cb..000000000000
--- a/share/man/man4/pccard.4
+++ /dev/null
@@ -1,78 +0,0 @@
-.\"
-.\" Copyright (c) 2002 M. Warner Losh <imp@FreeBSD.org>
-.\"
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
-.\"
-.\" 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.
-.\"
-.Dd August 18, 2020
-.Dt PCCARD 4
-.Os
-.Sh NAME
-.Nm pccard
-.Nd PC Card bus driver
-.Sh SYNOPSIS
-.Cd device pccard
-.Sh DEPRECATION NOTICE
-This driver is scheduled for removal prior to the release of
-.Fx 13.0 .
-.Sh DESCRIPTION
-The
-.Nm
-driver implements the PC Card bus.
-The
-.Nm
-driver supports all PC Card bridges in the system.
-.Sh TUNABLES
-The driver supports the following tunable parameters, which may be
-added to
-.Pa /boot/loader.conf
-or set via the
-.Xr sysctl 8
-command:
-.Bl -tag -width ".Cm hw.pccard.cis_debug" -compact
-.It Cm hw.pccard.debug
-Non-zero values cause more verbose information to be printed when a
-16-bit PC Card is inserted or removed.
-.It Cm hw.pccard.cis_debug
-Non-zero value causes the CIS parsing of the 16-bit PC Card to be much
-more verbose and include a complete CIS dump.
-.El
-.Sh FILES
-.Bl -tag -width ".Pa /dev/pccard0.cis" -compact
-.It Pa /dev/pccard0.cis
-This exclusive-use device will report all the CIS chains present in a
-PC Card, if a 16-bit PC Card is inserted in the slot.
-Only one user at a time may access the CIS.
-The CIS is presented as the relevant byte stream from the PC Card.
-For CIS tuples in Attribute Memory (the default), only the even
-locations are presented (the ODD locations are undefined per the
-standard).
-For CIS tuples in Common Memory, every byte is presented to the user.
-Decoding of the CIS tuples is done via a userland program.
-All tuples are presented to the user.
-.El
-.Sh SEE ALSO
-.Xr cardbus 4 ,
-.\" .Xr mecia 4 ,
-.Xr pccbb 4
-.\" .Xr tcic 4
-.Rs
-.%T "PC Card Standard, Release 8"
-.Re
diff --git a/share/man/man4/pccbb.4 b/share/man/man4/pccbb.4
index 3200e8b2d2e2..1c6cb2045033 100644
--- a/share/man/man4/pccbb.4
+++ b/share/man/man4/pccbb.4
@@ -176,5 +176,4 @@ debugging problems with the bridge chipset.
.El
.Sh SEE ALSO
.Xr cardbus 4 ,
-.Xr exca 4 ,
-.Xr pccard 4
+.Xr exca 4
diff --git a/share/man/man4/pcic.4 b/share/man/man4/pcic.4
deleted file mode 100644
index 1c5b0fc35554..000000000000
--- a/share/man/man4/pcic.4
+++ /dev/null
@@ -1,100 +0,0 @@
-.\"
-.\" Copyright (c) 2001-2002 M. Warner Losh <imp@FreeBSD.org>
-.\"
-.\" 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. The name of the author may not be used to endorse or promote products
-.\" derived from this software without specific prior written permission.
-.\"
-.\" 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.
-.\"
-.Dd July 9, 2002
-.Dt PCIC 4
-.Os
-.Sh NAME
-.Nm pcic
-.Nd PC Card bridge driver
-.Sh SYNOPSIS
-.Cd device pcic
-.Cd device pccard
-.Sh DESCRIPTION
-The
-.Nm
-driver provides support for older ISA and non-Yenta PCI PC Card bridges.
-The
-.Nm
-driver supports most
-.Tn ExCA
-devices attached to the
-.Tn ISA
-bus or
-.Tn PCI
-devices that do not conform to the Yenta specification.
-.Pp
-The following
-.Tn ISA
-devices, or true clones, are supported in the current code.
-.Pp
-.Bl -tag -width "Intel i82365SL Step A" -compact
-.It Intel i82365SL Step A
-.It Intel i82365SL Step B
-.It Intel i82365SL Step C
-.Tn Intel Ns 's
-original 16-bit PC Card controller.
-.It Intel i82365SL-DF
-.Tn Intel Ns 's
-last version of this device.
-3.3V support was added.
-.It VLSI 82C146
-An older VLSI part with some issues on some machines.
-.It Cirrus Logic PD-6710
-.It Cirrus Logic PD-6720
-.It Cirrus Logic PD-6722
-Cirrus Logic's pcic controller.
-Compatible with the i82365SL Step C with the addition of a different
-3.3V control.
-.It Ricoh RF5C296
-.It Ricoh RF5C396
-Ricoh's PC Card bridge chips.
-These are compatible with the i82365SL Step C, but with yet another
-different 3.3V control.
-.It Vadem 365
-.It Vadem 465
-Compatible with i82365SL Step C.
-.It Vadem 468
-.It Vadem 469
-Like the earlier Vadem models, but with Vadem's own, incompatible, 3.3V
-control system.
-.It IBM PCIC
-.Tn IBM
-clone of the original i82365SL part, with its own ID register value.
-Has no 3.3V ability.
-.El
-.Pp
-Many other vendors made parts in this arena, but most of them were
-compatible with one of the above chipsets.
-.Pp
-The following PCI pcmcia bridges are supported:
-.Pp
-.Bl -tag -width "Intel i82365SL Step A" -compact
-.It Cirrus Logic PD6729
-.It Cirrus Logic PD6730
-.Pp
-.It O2micro OZ6729
-.It O2micro OZ6730
-.El
-.Sh BUGS
-This does not work at all at the moment.
diff --git a/share/man/man4/random.4 b/share/man/man4/random.4
index 04d46e4d32aa..457f49f3d3ce 100644
--- a/share/man/man4/random.4
+++ b/share/man/man4/random.4
@@ -30,6 +30,7 @@
.Sh SYNOPSIS
.Cd "options RANDOM_LOADABLE"
.Cd "options RANDOM_ENABLE_ETHER"
+.Cd "options RANDOM_ENABLE_TPM"
.Cd "options RANDOM_ENABLE_UMA"
.Sh DESCRIPTION
The
diff --git a/share/man/man4/sbp.4 b/share/man/man4/sbp.4
index 2255fa2993ae..1daffd104a2c 100644
--- a/share/man/man4/sbp.4
+++ b/share/man/man4/sbp.4
@@ -1,3 +1,6 @@
+.\"
+.\" SPDX-License-Identifier: BSD-4-Clause
+.\"
.\" Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
.\" All rights reserved.
.\"
@@ -29,7 +32,7 @@
.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd February 8, 2012
+.Dd November 11, 2025
.Dt SBP 4
.Os
.Sh NAME
@@ -62,19 +65,27 @@ might wonder why the device is not detached at the CAM layer when the device
is unplugged.
It is detached only if the device has not been plugged again
during several bus resets.
-This is for preventing to detach an active file system
-even when the device cannot be probed correctly for some reason after a bus reset
+This is for preventing to detach an active file system even when the
+device cannot be probed correctly for some reason after a bus reset
or when the device is temporary disconnected because the user changes the bus
topology.
If you want to force to detach the device, run
-.Dq Nm fwcontrol Fl r
-several times or set hw.firewire.hold_count=0 by
+.Ql fwcontrol -r
+several times or set
+.Va hw.firewire.hold_count=0
+by
.Xr sysctl 8 .
.Pp
Some (broken) HDDs do not work well with tagged queuing.
If you have problems with such drives, try
-.Dq Nm camcontrol [device id] tags -N 1
+.Ql camcontrol [device id] tags -N 1
to disable tagged queuing.
+.Sh HARDWARE
+The
+.Nm
+driver supports FireWire Serial Bus Protocol 2
+.Pq SBP-2
+storage devices.
.Sh SEE ALSO
.Xr cam 4 ,
.Xr firewire 4 ,
diff --git a/share/man/man4/snd_dummy.4 b/share/man/man4/snd_dummy.4
index 172b8ed70729..5e9d8aa5dd89 100644
--- a/share/man/man4/snd_dummy.4
+++ b/share/man/man4/snd_dummy.4
@@ -60,7 +60,7 @@ Alias to the device's
.Pa /dev/dsp%d
file created by
.Xr sound 4 .
-This makes it easy for tests to open the dummy devic when there are more
+This makes it easy for tests to open the dummy device when there are more
devices present in the system.
.El
.Sh SEE ALSO
diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4
index 21d69bf9d495..6176c8c3093e 100644
--- a/share/man/man4/vt.4
+++ b/share/man/man4/vt.4
@@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd July 7, 2024
+.Dd November 21, 2025
.Dt VT 4
.Os
.Sh NAME
@@ -352,6 +352,12 @@ Notification that the console bell has rung.
.It Li hz Ta Tone that was requested in Hz.
.El
.Sh EXAMPLES
+To increase the scrollback buffer size to 22500 lines,
+add the following line to
+.Pa /etc/rc.conf :
+.Pp
+.Dl allscreens_flags="-h 22500"
+.Pp
This example changes the default color of normal text to green on a
black background, or black on a green background when reversed.
Note that white space cannot be used inside the attribute string
@@ -414,6 +420,7 @@ at boot:
.Xr getty 8 ,
.Xr kldload 8 ,
.Xr moused 8 ,
+.Xr vidcontrol 8 ,
.Xr vtfontcvt 8
.Sh HISTORY
The
diff --git a/share/man/man4/xl.4 b/share/man/man4/xl.4
index 309434154f4e..591703ac93cb 100644
--- a/share/man/man4/xl.4
+++ b/share/man/man4/xl.4
@@ -253,7 +253,6 @@ It is probably safe to ignore them.
.Xr miibus 4 ,
.Xr netintro 4 ,
.Xr ng_ether 4 ,
-.Xr pccard 4 ,
.Xr polling 4 ,
.Xr ifconfig 8
.Sh HISTORY
diff --git a/share/man/man4/zero.4 b/share/man/man4/zero.4
index f1cd52d455d1..85651d53d342 100644
--- a/share/man/man4/zero.4
+++ b/share/man/man4/zero.4
@@ -29,7 +29,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 7, 1996
+.Dd November 9, 2025
.Dt ZERO 4
.Os
.Sh NAME
@@ -48,6 +48,7 @@ supply of null bytes when read.
.El
.Sh SEE ALSO
.Xr full 4 ,
+.Xr gzero 4 ,
.Xr null 4
.Sh HISTORY
A
diff --git a/share/man/man5/boot.config.5 b/share/man/man5/boot.config.5
index 0b6d4c7b34e9..ddc232952f10 100644
--- a/share/man/man5/boot.config.5
+++ b/share/man/man5/boot.config.5
@@ -21,12 +21,12 @@
.\" 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.
-.Dd October 12, 2020
+.Dd November 14, 2025
.Dt BOOT.CONFIG 5
.Os
.Sh NAME
.Nm boot.config
-.Nd "Configuration file for the boot blocks"
+.Nd "Configuration file for the legacy boot blocks"
.Sh DESCRIPTION
The
.Nm
@@ -34,9 +34,9 @@ file contains options for the
.Fx
boot block code.
.Pp
-When the
+When the first- and second-stage
.Fx
-boot loader runs, it searches the
+boot loaders run, they search the
.Dq Li a
slice of the boot partition for a
.Nm
diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5
index 6274c1ee5b94..fa8d8aab8c4e 100644
--- a/share/man/man5/rc.conf.5
+++ b/share/man/man5/rc.conf.5
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd October 5, 2025
+.Dd November 14, 2025
.Dt RC.CONF 5
.Os
.Sh NAME
@@ -190,6 +190,17 @@ Setting this option will bypass that check at boot time and
always test whether or not the service is actually running.
Enabling this option is likely to increase your boot time if
services are enabled that utilize the force_depend check.
+.It Ao Ar name Ac Ns Va _audit_user
+.Pq Vt str
+A user name or UID to use as the
+.Xr audit 4
+user for the service.
+Run the chrooted service under this system group.
+By default, when an unprvileged user restarts a service using a utility
+such as sudo or doas, the service's will audit session will point to the
+unprivileged user, which may be undesirable.
+In that case, this variable can be used to override the audit user using
+.Xr setaudit 8 .
.It Ao Ar name Ac Ns Va _chroot
.Pq Vt str
.Xr chroot 8
@@ -209,7 +220,6 @@ The
value to run the service under.
.It Ao Ar name Ac Ns Va _group
.Pq Vt str
-Run the chrooted service under this system group.
Unlike the
.Ao Ar name Ac Ns Va _user
setting, this setting has no effect if the service is not chrooted.
diff --git a/share/man/man9/DEVICE_DETACH.9 b/share/man/man9/DEVICE_DETACH.9
index 5f1bf7a3295f..856c6138ed4c 100644
--- a/share/man/man9/DEVICE_DETACH.9
+++ b/share/man/man9/DEVICE_DETACH.9
@@ -41,9 +41,7 @@
Detach a device.
This can be called if the user is replacing the
driver software or if a device is about to be physically removed from
-the system (e.g.\& for
-.Xr pccard 4
-devices).
+the system.
.Pp
The method should deallocate any system resources allocated during the
.Xr DEVICE_ATTACH 9
@@ -52,7 +50,6 @@ etc.)
.Sh RETURN VALUES
Zero is returned on success, otherwise an appropriate error is returned.
.Sh SEE ALSO
-.Xr pccard 4 ,
.Xr device 9 ,
.Xr DEVICE_ATTACH 9 ,
.Xr DEVICE_IDENTIFY 9 ,
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index fecde7152f80..22358e8d033a 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -150,6 +150,7 @@ MAN= accept_filter.9 \
EVENTHANDLER.9 \
eventtimers.9 \
extattr.9 \
+ exterror.9 \
fail.9 \
fdt_pinctrl.9 \
fetch.9 \
diff --git a/share/man/man9/bus_alloc_resource.9 b/share/man/man9/bus_alloc_resource.9
index 5d309229a34e..210abb3074e1 100644
--- a/share/man/man9/bus_alloc_resource.9
+++ b/share/man/man9/bus_alloc_resource.9
@@ -157,11 +157,6 @@ resource permits contemporaneous sharing.
It should always be set unless you know that the resource cannot be shared.
It is the bus driver's task to filter out the flag if the bus does not
support sharing.
-For example,
-.Xr pccard 4
-cannot share IRQs while
-.Xr cardbus 4
-can.
.It Dv RF_UNMAPPED
do not establish implicit mapping when activated via
.Xr bus_activate_resource 9 .
diff --git a/share/man/man9/exterror.9 b/share/man/man9/exterror.9
new file mode 100644
index 000000000000..fd4b732b8213
--- /dev/null
+++ b/share/man/man9/exterror.9
@@ -0,0 +1,219 @@
+.\" SPDX-License-Identifier: BSD-2-Clause
+.\"
+.\" Copyright (c) 2025 The FreeBSD Foundation
+.\"
+.\" This documentation was written by
+.\" Konstantin Belousov <kib@FreeBSD.org> under sponsorship
+.\" from the FreeBSD Foundation.
+.\"
+.Dd November 5, 2025
+.Dt EXTERROR 9
+.Os
+.Sh NAME
+.Nm exterror
+.Nd provide extended error information to userspace
+.Sh SYNOPSIS
+.Bd -literal -offset left -compact
+#define EXTERR_CATEGORY EXTERR_CAT_MYCATEGORY
+.Ed
+.In sys/exterrvar.h
+.Vt struct kexterr;
+.Ft void
+.Fn exterr_clear "struct kexterr *ke"
+.Ft int
+.Fn exterr_set_from "const struct kexterr *ke"
+.Ft int
+.Fn EXTERROR "int error" "const char *msg" ...
+.Ft void
+.Fn EXTERROR_KE "struct kexterr *ke" "int error" "const char *msg" ...
+.Sh DESCRIPTION
+The
+.Nm
+framework allows the kernel to return additional information about an error
+along with the standard
+.Xr errno 3
+error code, which is terse and often lacking context.
+.Pp
+The terseness is especially visible with commonly overloaded error codes like
+.Er EINVAL
+or
+.Er EIO ,
+which occur at many places for a given syscall, or even
+outside the context of the current kernel call.
+Identifying the specific cause for the returned error using only the
+.Va errno
+value requires searching for all instances that the error is returned
+in the kernel and trying to guess which is the most likely code path
+to have returned the error.
+.Nm
+attaches additional data to the error itself
+and records the error category and
+the kernel source code file line number.
+The intent of
+.Nm
+is to make it easier for a user to identify the cause of the error.
+.Sh USAGE
+Before
+.Nm
+can be used in the given source .c file, the category of extended errors
+should be allocated in the
+.In sys/exterr_cat.h
+file.
+The category is the unique integer, that, together with the source
+line number, uniquely identifies the extended error occurrence.
+Then, the
+.Va EXTERR_CATEGORY
+symbol should be defined as an alias for the allocated category, as
+shown in the summary.
+.Pp
+A typical code fragment to report an error is just
+.D1 return (EINVAL);
+An extended error can augment the error code with additional information:
+.D1 return (EXTERROR(EINVAL, \[dq]Invalid length\[dq]));
+The error data and metadata is saved in the current thread storage.
+The metadata includes the category and the source file line number.
+.Pp
+Arguments to the
+.Fn EXTERROR
+macro:
+.Bl -dash
+.It
+The first argument to
+.Fn EXTERROR
+is the errno error code.
+.It
+The second argument is a constant string with the unbound lifetime,
+which should tersely provide enough human-readable details about
+the error.
+.It
+The
+.Fn EXTERROR
+macro can take two optional 64-bit integer arguments,
+whose meaning is specific to the subsystem.
+.El
+.Pp
+The strings passed as the second argument are only retained
+in the kernel text if the
+.Cd option EXTERR_STRINGS
+was enabled in the kernel config.
+Otherwise they are stripped at compile time and are not available
+to userspace at runtime.
+.Pp
+The
+.Fn EXTERROR
+macro can be used in any context where the current thread is defined.
+Specifically,
+.Fn EXTERROR
+cannot be used in interrupt contexts and context switch code.
+Additionally, use of
+.Fn EXTERROR
+in kernel threads is not sensible as there is no userspace to retrieve
+the extended error data.
+.Pp
+The
+.Fn EXTERROR_KE
+macro is similar to
+.Fn EXTERROR ,
+but it takes an explicit pointer
+.Fa kep
+to the
+.Vt struct kexterr
+to fill with the extended error information.
+The macro expression value is
+.Vt void .
+See below for description of the asynchronous i/o error facilities.
+.Pp
+The
+.Fn exterr_clear
+function clears the content of the
+.Vt struct kexterr
+pointed to by the argument
+.Fa ke .
+.Pp
+The
+.Fn exterr_set_from
+function sets the current thread extended error data from the
+.Fa struct kexterr
+pointed to by the argument
+.Fa ke .
+.Sh USERSPACE ACCESS TO EXTENDED ERROR DATA
+There is no syscall overhead for using
+.Nm
+in the non-error case.
+When an error occurs that has supplied extended information,
+the kernel copies out that information into the userspace
+per-thread area that was registered with the kernel, typically on
+image activation, or later at thread startup.
+The area is controlled by the
+.Xr exterrctl 2
+internal syscall, normally done by the userspace C runtime.
+.Pp
+Userspace programs do not need to access the extended information
+area directly.
+There is no field that is stable for the specific error condition.
+Instead, the base
+.Lb c
+functions
+.Xr err 3
+and
+.Xr warn 3
+were modified to print the extended information if it is available
+in addition to the usual
+.Va errno
+decoding.
+.Sh ASYNCHRONOUS INPUT/OUTPUT
+Due to the nature of the
+.Fx
+i/o subsystem, most input/output requests, presented as buffers (as in
+.Vt struct buf )
+and geom bio's (
+.Vt struct bio )
+are processed asynchronously in filesystem- and geom-private threads.
+This makes it challenging to pass any extended error information
+from the geom providers and drivers, where an error typically occurs,
+back to the thread that initiated the request, and is the consumer of
+the result.
+.Pp
+To alleviate the mismatch, both
+.Vt struct buf
+and
+.Vt struct bio
+have member of the
+.Vt struct kexterr
+type.
+For buffers, the
+.Va b_exterr
+for
+.Vt struct buf ,
+and
+.Va bio_exterr
+for
+.Vt struct bio .
+Asynchronous i/o code can use the
+.Fn EXTERROR_KE
+macro, passing the pointer to the current request's embedded
+.Vt struct kexterr ,
+to record the extended error.
+In both cases, the
+.Va BIO_EXTERR
+flag should be set to indicate that whole extended error is valid,
+not only the
+.Va b_error
+or
+.Va bio_error
+values.
+.Pp
+Both VFS and geom generic layers, and several geom providers that generate
+subordinate bio's from the original request, are aware of the extended
+errors.
+They pass
+.Vt kexterr
+from the failed request back to the thread that create the request.
+.Sh SEE ALSO
+.Xr errno 3 ,
+.Xr err 3
+.Sh HISTORY
+The
+.Nm
+facility was introduced in
+.Fx 15.0 .
diff --git a/share/man/man9/priv.9 b/share/man/man9/priv.9
index 80d0542e9bdf..6343940c89fb 100644
--- a/share/man/man9/priv.9
+++ b/share/man/man9/priv.9
@@ -26,7 +26,7 @@
.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd December 19, 2018
+.Dd November 12, 2025
.Dt PRIV 9
.Os
.Sh NAME
@@ -106,6 +106,7 @@ privilege checks, and the caller is unable to tell if an access control
failure occurred.
.Sh SEE ALSO
.Xr jail 2 ,
+.Xr dtrace_priv 4 ,
.Xr mac 9 ,
.Xr ucred 9
.Sh AUTHORS