Merge branch 'freebsd/current/main' into hardened/current/master

This commit is contained in:
HardenedBSD Sync Services 2024-11-04 18:01:17 -07:00
commit 91089cc4f6
No known key found for this signature in database
7 changed files with 105 additions and 43 deletions

View File

@ -31,6 +31,11 @@
# If the '-o' flag is given, tracing is turned off unless there
# was a matched "tag", useful for functions too noisy to tace.
#
# Further; when we set "DEBUG_ON" if we find
# "$DEBUG_ON:debug_add:tag" in "DEBUG_SH" we will
# add the new "tag" to "DEBUG_SH" so it only has effect after that
# point.
#
# DebugOff turns tracing on if any "tag" matches "DEBUG_OFF" or
# off if any "tag" matches "DEBUG_ON". This allows nested
# functions to not interfere with each other.
@ -78,7 +83,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
# $Id: debug.sh,v 1.41 2024/10/22 17:57:22 sjg Exp $
# $Id: debug.sh,v 1.42 2024/10/30 18:23:19 sjg Exp $
#
# @(#) Copyright (c) 1994-2024 Simon J. Gerraty
#
@ -97,30 +102,82 @@ _DEBUG_SH=:
Myname=${Myname:-`basename $0 .sh`}
# We want to use local if we can
# if isposix-shell.sh has been sourced isPOSIX_SHELL will be set
# as will local
case "$local" in
local|:) ;;
*)
if (echo ${PATH%:*}) > /dev/null 2>&1; then
local=local
else
local=:
fi
;;
esac
DEBUGGING=
DEBUG_DO=:
DEBUG_SKIP=
export DEBUGGING DEBUG_DO DEBUG_SKIP
case "$isPOSIX_SHELL,$local" in
:,:|:,local|false,:) ;; # sane
*) # this is the bulk of isposix-shell.sh
if (echo ${PATH%:*}) > /dev/null 2>&1; then
# true should be a builtin, : certainly is
isPOSIX_SHELL=:
# you need to eval $local var
local=local
: KSH_VERSION=$KSH_VERSION
case "$KSH_VERSION" in
Version*) local=: ;; # broken
esac
else
isPOSIX_SHELL=false
local=:
false() {
return 1
}
fi
;;
esac
is_posix_shell() {
$isPOSIX_SHELL
return
}
##
# _debugAdd match
#
# Called from _debugOn when $match also appears in $DEBUG_SH with
# a suffix of :debug_add:tag we will add tag to DEBUG_SH
#
_debugAdd() {
eval $local tag
for tag in `IFS=,; echo $DEBUG_SH`
do
: tag=$tag
case "$tag" in
$1:debug_add:*)
if is_posix_shell; then
tag=${tag#$1:debug_add:}
else
tag=`expr $tag : '.*:debug_add:\(.*\)'`
fi
case ",$DEBUG_SH," in
*,$tag,*) ;;
*) set -x
: _debugAdd $1
DEBUG_SH=$DEBUG_SH,$tag
set +x
;;
esac
;;
esac
done
export DEBUG_SH
}
##
# _debugOn match first
#
# Actually turn on tracing, set $DEBUG_ON=$match
#
# Check if $DEBUG_SH contains $match:debug_add:* and call _debugAdd
# to add the suffix to DEBUG_SH. This useful when we only want
# to trace some script when run under specific circumstances.
#
# If we have included hooks.sh $_HOOKS_SH will be set
# and if $first (the first arg to DebugOn) is suitable as a variable
# name we will run ${first}_debugOn_hooks.
@ -133,6 +190,11 @@ _debugOn() {
DEBUG_DO=
DEBUG_SKIP=:
DEBUG_X=-x
# do this firt to reduce noise
case ",$DEBUG_SH," in
*,$1:debug_add:*) _debugAdd $1;;
*,$2:debug_add:*) _debugAdd $2;;
esac
set -x
DEBUG_ON=$1
case "$_HOOKS_SH,$2" in

View File

@ -214,7 +214,7 @@ natd_flags="" # Additional flags for natd.
ipfilter_enable="NO" # Set to YES to enable ipfilter functionality
ipfilter_program="/sbin/ipf" # where the ipfilter program lives
ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see
# /usr/src/contrib/ipfilter/rules for examples
# /usr/src/share/examples/ipfilter for examples
ipfilter_flags="" # additional flags for ipfilter
ipfilter_optionlist="" # optionlist for ipf(8) -T
ippool_enable="NO" # Set to YES to enable ip filter pools

View File

@ -312,7 +312,7 @@ or changed at runtime with
Enable the terminal bell.
.El
.Sh FILES
.Bl -tag -width /usr/share/vt/keymaps/* -compact
.Bl -tag -width "/usr/share/vt/keymaps/*.kbd" -compact
.It Pa /dev/console
.It Pa /dev/consolectl
.It Pa /dev/ttyv*
@ -325,13 +325,12 @@ console fonts
keyboard layouts
.El
.Sh DEVCTL MESSAGES
.Bl -column "System" "Subsystem" "1234567" -compact
.Bl -column "System" "Subsystem" "Type" "Description"
.Sy "System" Ta Sy "Subsystem" Ta Sy "Type" Ta Sy "Description"
.It Li VT Ta BELL Ta RING Ta
Notification that the console bell has rung.
.El
.Pp
.Bl -column "Variable" "Meaning" -compact
.Bl -column "duration_ms" "Meaning"
.Sy "Variable" Ta Sy "Meaning"
.It Li duration_ms Ta Length of time the bell was requested to ring in milliseconds.
.It Li enabled Ta true or false indicating whether or not the bell was administratively enabled when rung.
@ -357,7 +356,8 @@ To set a 1024x768 mode on all output connectors, put the following line in
.Pp
.Dl kern.vt.fb.default_mode="1024x768"
.Pp
To set a 800x600 only on a laptop builtin screen, use the following line instead:
To set a 800x600 only on a laptop builtin screen,
use the following line instead:
.Pp
.Dl kern.vt.fb.modes.LVDS-1="800x600"
.Pp

View File

@ -57,7 +57,9 @@ MODULE_VERSION(snd_driver, 1);
MODULE_DEPEND(snd_driver, snd_als4000, 1, 1, 1);
MODULE_DEPEND(snd_driver, snd_atiixp, 1, 1, 1);
#if defined(__i386__) || defined(__amd64__)
MODULE_DEPEND(snd_driver, snd_cmi, 1, 1, 1);
#endif
MODULE_DEPEND(snd_driver, snd_cs4281, 1, 1, 1);
MODULE_DEPEND(snd_driver, snd_csa, 1, 1, 1);
MODULE_DEPEND(snd_driver, snd_csapcm, 1, 1, 1);

View File

@ -167,23 +167,22 @@ pctrie_node_store(smr_pctnode_t *p, void *v, enum pctrie_access access)
}
}
/*
* Get the root address, cast to proper type for load/store.
*/
static __inline smr_pctnode_t *
pctrie_root(struct pctrie *ptree)
{
return ((smr_pctnode_t *)&ptree->pt_root);
}
/*
* Get the root node for a tree.
*/
static __inline struct pctrie_node *
pctrie_root_load(struct pctrie *ptree, smr_t smr, enum pctrie_access access)
{
return (pctrie_node_load((smr_pctnode_t *)&ptree->pt_root, smr, access));
}
/*
* Set the root node for a tree.
*/
static __inline void
pctrie_root_store(struct pctrie *ptree, struct pctrie_node *node,
enum pctrie_access access)
{
pctrie_node_store((smr_pctnode_t *)&ptree->pt_root, node, access);
return (pctrie_node_load(pctrie_root(ptree), smr, access));
}
/*
@ -304,7 +303,7 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val,
if (pctrie_isleaf(node)) {
if (node == PCTRIE_NULL) {
if (parent == NULL)
pctrie_root_store(ptree,
pctrie_node_store(pctrie_root(ptree),
pctrie_toleaf(val), PCTRIE_LOCKED);
else
pctrie_addnode(parent, index,
@ -354,8 +353,7 @@ pctrie_insert_lookup_compound(struct pctrie *ptree, uint64_t *val,
* children 'node' and 'val'. Return the place that points to 'node'
* now, and will point to to the new branching node later.
*/
return ((parent != NULL) ? &parent->pn_child[slot]:
(smr_pctnode_t *)&ptree->pt_root);
return ((parent == NULL) ? pctrie_root(ptree): &parent->pn_child[slot]);
}
/*
@ -608,7 +606,7 @@ pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val)
node = _pctrie_iter_lookup_node(it, *val, NULL, PCTRIE_LOCKED);
if (node == PCTRIE_NULL) {
if (it->top == 0)
pctrie_root_store(it->ptree,
pctrie_node_store(pctrie_root(it->ptree),
pctrie_toleaf(val), PCTRIE_LOCKED);
else
pctrie_addnode(it->path[it->top - 1], it->index,
@ -625,7 +623,7 @@ pctrie_iter_insert_lookup(struct pctrie_iter *it, uint64_t *val)
* now, and will point to to the new branching node later.
*/
if (it->top == 0)
return ((smr_pctnode_t *)&it->ptree->pt_root);
return (pctrie_root(it->ptree));
node = it->path[it->top - 1];
return (&node->pn_child[pctrie_slot(node, it->index)]);
}
@ -1037,7 +1035,8 @@ pctrie_remove(struct pctrie *ptree, uint64_t index, struct pctrie_node *parent,
int slot;
if (node == NULL) {
pctrie_root_store(ptree, PCTRIE_NULL, PCTRIE_LOCKED);
pctrie_node_store(pctrie_root(ptree),
PCTRIE_NULL, PCTRIE_LOCKED);
return;
}
slot = pctrie_slot(node, index);
@ -1054,7 +1053,7 @@ pctrie_remove(struct pctrie *ptree, uint64_t index, struct pctrie_node *parent,
KASSERT(child != PCTRIE_NULL,
("%s: bad popmap slot %d in node %p", __func__, slot, node));
if (parent == NULL)
pctrie_root_store(ptree, child, PCTRIE_LOCKED);
pctrie_node_store(pctrie_root(ptree), child, PCTRIE_LOCKED);
else {
slot = pctrie_slot(parent, index);
KASSERT(node ==
@ -1218,7 +1217,7 @@ pctrie_reclaim_begin_compound(struct pctrie_node **pnode,
struct pctrie_node *node;
node = pctrie_root_load(ptree, NULL, PCTRIE_UNSERIALIZED);
pctrie_root_store(ptree, PCTRIE_NULL, PCTRIE_UNSERIALIZED);
pctrie_node_store(pctrie_root(ptree), PCTRIE_NULL, PCTRIE_UNSERIALIZED);
if (pctrie_isleaf(node)) {
if (callback != NULL && node != PCTRIE_NULL)
callback(pctrie_toptr(node, keyoff), arg);
@ -1275,7 +1274,7 @@ pctrie_replace(struct pctrie *ptree, uint64_t *newval)
if (pctrie_isleaf(node)) {
if ((m = pctrie_toval(node)) != NULL && *m == index) {
if (parent == NULL)
pctrie_root_store(ptree,
pctrie_node_store(pctrie_root(ptree),
leaf, PCTRIE_LOCKED);
else
pctrie_node_store(

View File

@ -186,7 +186,7 @@ struct file {
volatile u_int f_flag; /* see fcntl.h */
volatile u_int f_count; /* reference count */
void *f_data; /* file descriptor specific data */
struct fileops *f_ops; /* File operations */
const struct fileops *f_ops; /* File operations */
struct vnode *f_vnode; /* NULL or applicable vnode */
struct ucred *f_cred; /* associated credentials. */
short f_type; /* descriptor type */

View File

@ -76,7 +76,6 @@ static void dmar_unref_domain_locked(struct dmar_unit *dmar,
static void dmar_domain_destroy(struct dmar_domain *domain);
static void dmar_free_ctx_locked(struct dmar_unit *dmar, struct dmar_ctx *ctx);
static void dmar_free_ctx(struct dmar_ctx *ctx);
static void
dmar_ensure_ctx_page(struct dmar_unit *dmar, int bus)