From ddc9562b799cfd1cb8ab441ce07ca5facbc885a7 Mon Sep 17 00:00:00 2001 From: purplerain Date: Sun, 6 Oct 2024 20:38:55 +0000 Subject: [PATCH] sync with OpenBSD -current --- sbin/wsconsctl/mouse.c | 8 +++++--- sbin/wsconsctl/mousecfg.c | 3 ++- share/man/man4/wsmouse.4 | 14 ++++++++------ share/man/man5/bsd.port.mk.5 | 10 ++++++++-- sys/arch/amd64/amd64/cpu.c | 6 +++--- sys/arch/amd64/amd64/genassym.cf | 9 ++------- sys/arch/i386/i386/genassym.cf | 13 ++----------- sys/dev/fdt/axppmic.c | 6 +----- sys/dev/ic/atw.c | 3 +-- sys/dev/usb/if_wi_usb.c | 6 +----- sys/dev/videomode/edid.c | 2 +- sys/kern/kern_sched.c | 3 +-- usr.bin/tmux/mode-tree.c | 11 ++++++++--- usr.bin/tmux/server-client.c | 4 +++- usr.bin/tmux/window.c | 5 +++-- usr.sbin/config/sem.c | 22 ++++++++++++++++------ 16 files changed, 65 insertions(+), 60 deletions(-) diff --git a/sbin/wsconsctl/mouse.c b/sbin/wsconsctl/mouse.c index c880c92b5..84cd656e9 100644 --- a/sbin/wsconsctl/mouse.c +++ b/sbin/wsconsctl/mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mouse.c,v 1.21 2023/07/02 21:44:04 bru Exp $ */ +/* $OpenBSD: mouse.c,v 1.22 2024/10/05 13:27:16 chrisz Exp $ */ /* $NetBSD: mouse.c,v 1.3 1999/11/15 13:47:30 ad Exp $ */ /*- @@ -58,13 +58,14 @@ struct field mouse_field_tab[] = { /* touchpad-specific options: */ { "tp.tapping", &cfg_tapping, FMT_CFG, FLG_NORDBACK }, { "tp.mtbuttons", &cfg_mtbuttons, FMT_CFG, FLG_NORDBACK }, - { "tp.scaling", &cfg_scaling, FMT_CFG, FLG_NORDBACK }, + { "tp.scaling", &cfg_scaling, FMT_CFG, FLG_NORDBACK | FLG_WRONLY }, { "tp.swapsides", &cfg_swapsides, FMT_CFG, FLG_NORDBACK }, { "tp.disable", &cfg_disable, FMT_CFG, FLG_NORDBACK }, { "tp.edges", &cfg_edges, FMT_CFG, FLG_NORDBACK }, { "tp.param", &cfg_param, FMT_CFG, FLG_WRONLY }, - /* Add an alias. This field is valid for all wsmouse devices. */ + /* Add aliases. These fields are valid for all wsmouse devices. */ { "param", &cfg_param, FMT_CFG, FLG_WRONLY }, + { "scaling", &cfg_scaling, FMT_CFG, FLG_NORDBACK }, { NULL } }; @@ -106,6 +107,7 @@ mouse_init(int devfd, int devidx) { for (f = mouse_field_tab; f->name != NULL; f++) if (f->format == FMT_CFG) { if (f->valp != &cfg_param + && f->valp != &cfg_scaling && f->valp != &cfg_revscroll) f->flags |= FLG_DEAD; else diff --git a/sbin/wsconsctl/mousecfg.c b/sbin/wsconsctl/mousecfg.c index 3b9d0da28..b813e1305 100644 --- a/sbin/wsconsctl/mousecfg.c +++ b/sbin/wsconsctl/mousecfg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mousecfg.c,v 1.11 2024/09/25 19:56:33 bru Exp $ */ +/* $OpenBSD: mousecfg.c,v 1.12 2024/10/05 13:27:16 chrisz Exp $ */ /* * Copyright (c) 2017 Ulf Brosziewski @@ -356,6 +356,7 @@ mousecfg_pr_field(struct wsmouse_parameters *field) if (field == &cfg_scaling) { value = get_value(field, WSMOUSECFG_DX_SCALE); + value = value == 0 ? 4096 : value; f = (float) value / 4096; printf("%.3f", f); return; diff --git a/share/man/man4/wsmouse.4 b/share/man/man4/wsmouse.4 index 549d52e51..50e100f52 100644 --- a/share/man/man4/wsmouse.4 +++ b/share/man/man4/wsmouse.4 @@ -1,4 +1,4 @@ -.\" $OpenBSD: wsmouse.4,v 1.23 2023/07/02 21:44:04 bru Exp $ +.\" $OpenBSD: wsmouse.4,v 1.24 2024/10/05 13:27:16 chrisz Exp $ .\" $NetBSD: wsmouse.4,v 1.3 1999/12/06 14:52:08 augustss Exp $ .\" .\" Copyright (c) 2018 Ulf Brosziewski @@ -26,7 +26,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd $Mdocdate: July 2 2023 $ +.Dd $Mdocdate: October 5 2024 $ .Dt WSMOUSE 4 .Os .Sh NAME @@ -86,6 +86,12 @@ If is omitted, commands apply to .Pa /dev/wsmouse0 . .Bl -tag -width Ds +.It Cm mouse.reverse_scrolling +Reverse direction of scrolling. +.It Cm mouse.scaling +The value is a scale coefficient that is applied to the relative +coordinates. +It determines the base speed of the pointer. .It Cm mouse.tp.tapping Contacts on the touchpad that are immediately released again can be mapped to mouse button clicks. @@ -110,10 +116,6 @@ until that touch ends This feature is supported for some clickpads. If enabled, two-finger clicks - with the fingers side by side - generate left-button events, and three-finger clicks generate middle-button events. -.It Cm mouse.tp.scaling -The value is a scale coefficient that is applied to the relative -coordinates. -It determines the base speed of the pointer. .It Cm mouse.tp.swapsides If this parameter has a non-zero value, the order of software button areas is inverted. diff --git a/share/man/man5/bsd.port.mk.5 b/share/man/man5/bsd.port.mk.5 index a78740249..c581df742 100644 --- a/share/man/man5/bsd.port.mk.5 +++ b/share/man/man5/bsd.port.mk.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: bsd.port.mk.5,v 1.647 2024/09/04 09:07:03 sthen Exp $ +.\" $OpenBSD: bsd.port.mk.5,v 1.648 2024/10/06 10:24:52 kn Exp $ .\" .\" Copyright (c) 2000-2008 Marc Espie .\" @@ -24,7 +24,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 $Mdocdate: September 4 2024 $ +.Dd $Mdocdate: October 6 2024 $ .Dt BSD.PORT.MK 5 .Os .Sh NAME @@ -2719,6 +2719,12 @@ PATCH_LIST=${PORTSDIR}/x11/kde/libs2/patches/p-* patch-* But beware that minor variations will result in .Cm update-patches creating useless churn ! +.It Ev PATCH_QUIET +User settings. +If set to +.Sq Yes , +.Ev PATCH +will work quietly. .It Ev PATCH_STRIP Patch option used to strip directory levels while applying port's patches. Defaults to -p0. diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c index 265afdc7c..e79412127 100644 --- a/sys/arch/amd64/amd64/cpu.c +++ b/sys/arch/amd64/amd64/cpu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.c,v 1.193 2024/09/26 13:18:25 dv Exp $ */ +/* $OpenBSD: cpu.c,v 1.194 2024/10/06 16:24:02 semarie Exp $ */ /* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */ /*- @@ -904,8 +904,8 @@ cpu_init_vmm(struct cpu_info *ci) ci->ci_vmcs_pa = VMX_VMCS_PA_CLEAR; rw_init(&ci->ci_vmcs_lock, "vmcslock"); - msr = rdmsr(IA32_VMX_EPT_VPID_CAP); - if (msr & IA32_EPT_VPID_CAP_INVEPT_CONTEXT) + if (rdmsr_safe(IA32_VMX_EPT_VPID_CAP, &msr) == 0 && + msr & IA32_EPT_VPID_CAP_INVEPT_CONTEXT) ci->ci_vmm_cap.vcc_vmx.vmx_invept_mode = IA32_VMX_INVEPT_SINGLE_CTX; else diff --git a/sys/arch/amd64/amd64/genassym.cf b/sys/arch/amd64/amd64/genassym.cf index 42e77d782..dc73641a8 100644 --- a/sys/arch/amd64/amd64/genassym.cf +++ b/sys/arch/amd64/amd64/genassym.cf @@ -1,21 +1,16 @@ -# $OpenBSD: genassym.cf,v 1.45 2024/02/12 01:18:17 guenther Exp $ +# $OpenBSD: genassym.cf,v 1.46 2024/10/05 09:54:39 jsg Exp $ # Written by Artur Grabowski art@openbsd.org, Public Domain include include -include -include -include -include include -include +include include include include include -include include include diff --git a/sys/arch/i386/i386/genassym.cf b/sys/arch/i386/i386/genassym.cf index 068773b5f..731677f5e 100644 --- a/sys/arch/i386/i386/genassym.cf +++ b/sys/arch/i386/i386/genassym.cf @@ -1,4 +1,4 @@ -# $OpenBSD: genassym.cf,v 1.48 2019/06/11 15:23:41 mpi Exp $ +# $OpenBSD: genassym.cf,v 1.49 2024/10/05 09:54:39 jsg Exp $ # # Copyright (c) 1982, 1990 The Regents of the University of California. # All rights reserved. @@ -32,19 +32,13 @@ include include -include -include -include -include include -include include include -include include -include +include include include @@ -53,9 +47,6 @@ include endif include "isa.h" -if NISA > 0 -include -endif export SONPROC diff --git a/sys/dev/fdt/axppmic.c b/sys/dev/fdt/axppmic.c index cbbcfda9f..c52984540 100644 --- a/sys/dev/fdt/axppmic.c +++ b/sys/dev/fdt/axppmic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: axppmic.c,v 1.20 2023/08/02 11:52:18 uaa Exp $ */ +/* $OpenBSD: axppmic.c,v 1.21 2024/10/06 03:46:48 jsg Exp $ */ /* * Copyright (c) 2017 Mark Kettenis * @@ -514,10 +514,6 @@ const struct cfattach axppmic_rsb_ca = { NULL, axppmic_activate }; -struct cfdriver axppmic_rsb_cd = { - NULL, "axppmic", DV_DULL -}; - uint8_t axppmic_rsb_read(struct axppmic_softc *, uint8_t); void axppmic_rsb_write(struct axppmic_softc *, uint8_t, uint8_t); diff --git a/sys/dev/ic/atw.c b/sys/dev/ic/atw.c index 239bc37b7..0dc0d7269 100644 --- a/sys/dev/ic/atw.c +++ b/sys/dev/ic/atw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atw.c,v 1.101 2024/05/13 01:15:50 jsg Exp $ */ +/* $OpenBSD: atw.c,v 1.102 2024/10/06 01:12:15 jsg Exp $ */ /* $NetBSD: atw.c,v 1.69 2004/07/23 07:07:55 dyoung Exp $ */ /*- @@ -127,7 +127,6 @@ int atw_bbp_io_enable_delay = 20 * 1000; int atw_bbp_io_disable_delay = 2 * 1000; int atw_writewep_delay = 1000; -int atw_beacon_len_adjust = 4; int atw_dwelltime = 200; int atw_xindiv2 = 0; diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c index 5752685b7..2efa788a2 100644 --- a/sys/dev/usb/if_wi_usb.c +++ b/sys/dev/usb/if_wi_usb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_usb.c,v 1.77 2024/05/23 03:21:09 jsg Exp $ */ +/* $OpenBSD: if_wi_usb.c,v 1.78 2024/10/06 01:28:39 jsg Exp $ */ /* * Copyright (c) 2003 Dale Rahn. All rights reserved. @@ -246,10 +246,6 @@ int wi_usb_match(struct device *, void *, void *); void wi_usb_attach(struct device *, struct device *, void *); int wi_usb_detach(struct device *, int); -struct cfdriver wi_usb_cd = { - NULL, "wi_usb", DV_IFNET -}; - const struct cfattach wi_usb_ca = { sizeof(struct wi_usb_softc), wi_usb_match, wi_usb_attach, wi_usb_detach }; diff --git a/sys/dev/videomode/edid.c b/sys/dev/videomode/edid.c index 015f764af..afb50454a 100644 --- a/sys/dev/videomode/edid.c +++ b/sys/dev/videomode/edid.c @@ -190,7 +190,7 @@ edid_print(struct edid_info *edid) if (edid->edid_video_input & EDID_VIDEO_INPUT_BLANK_TO_BLACK) printf("\tBlank-to-black setup\n"); if (edid->edid_video_input & EDID_VIDEO_INPUT_SEPARATE_SYNCS) - printf("\tSeperate syncs\n"); + printf("\tSeparate syncs\n"); if (edid->edid_video_input & EDID_VIDEO_INPUT_COMPOSITE_SYNC) printf("\tComposite sync\n"); if (edid->edid_video_input & EDID_VIDEO_INPUT_SYNC_ON_GRN) diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c index 4fe5b2e7e..d3c0dc273 100644 --- a/sys/kern/kern_sched.c +++ b/sys/kern/kern_sched.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sched.c,v 1.100 2024/07/09 08:44:36 claudio Exp $ */ +/* $OpenBSD: kern_sched.c,v 1.101 2024/10/06 01:50:56 jsg Exp $ */ /* * Copyright (c) 2007, 2008 Artur Grabowski * @@ -580,7 +580,6 @@ log2(unsigned int i) * Just total guesstimates for now. */ -int sched_cost_load = 1; int sched_cost_priority = 1; int sched_cost_runnable = 3; int sched_cost_resident = 1; diff --git a/usr.bin/tmux/mode-tree.c b/usr.bin/tmux/mode-tree.c index 0bd42b324..0a9051508 100644 --- a/usr.bin/tmux/mode-tree.c +++ b/usr.bin/tmux/mode-tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mode-tree.c,v 1.70 2024/10/01 10:10:29 nicm Exp $ */ +/* $OpenBSD: mode-tree.c,v 1.71 2024/10/06 09:30:22 nicm Exp $ */ /* * Copyright (c) 2017 Nicholas Marriott @@ -356,8 +356,13 @@ mode_tree_set_current(struct mode_tree_data *mtd, uint64_t tag) mtd->offset = 0; return (1); } - mtd->current = 0; - mtd->offset = 0; + if (mtd->current >= mtd->line_size) { + mtd->current = mtd->line_size - 1; + if (mtd->current > mtd->height - 1) + mtd->offset = mtd->current - mtd->height + 1; + else + mtd->offset = 0; + } return (0); } diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 6e63416e9..c63c76289 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.410 2024/10/01 06:15:47 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.411 2024/10/05 12:10:16 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -121,6 +121,7 @@ server_client_set_overlay(struct client *c, u_int delay, c->tty.flags |= TTY_FREEZE; if (c->overlay_mode == NULL) c->tty.flags |= TTY_NOCURSOR; + window_update_focus(c->session->curw->window); server_redraw_client(c); } @@ -145,6 +146,7 @@ server_client_clear_overlay(struct client *c) c->overlay_data = NULL; c->tty.flags &= ~(TTY_FREEZE|TTY_NOCURSOR); + window_update_focus(c->session->curw->window); server_redraw_client(c); } diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index 2c92c4f86..ab0b49e9a 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.294 2024/10/01 08:01:19 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.295 2024/10/05 12:10:16 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -482,7 +482,8 @@ window_pane_update_focus(struct window_pane *wp) if (c->session != NULL && c->session->attached != 0 && (c->flags & CLIENT_FOCUSED) && - c->session->curw->window == wp->window) { + c->session->curw->window == wp->window && + c->overlay_draw == NULL) { focused = 1; break; } diff --git a/usr.sbin/config/sem.c b/usr.sbin/config/sem.c index db3962716..d71b61473 100644 --- a/usr.sbin/config/sem.c +++ b/usr.sbin/config/sem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sem.c,v 1.38 2021/11/28 19:26:03 deraadt Exp $ */ +/* $OpenBSD: sem.c,v 1.39 2024/10/05 01:07:38 jsg Exp $ */ /* $NetBSD: sem.c,v 1.10 1996/11/11 23:40:11 gwr Exp $ */ /* @@ -83,7 +83,7 @@ static int lresolve(struct nvlist **, const char *, const char *, static struct devi *newdevi(const char *, int, struct devbase *d); static struct devi *getdevi(const char *); static const char *concat(const char *, int); -static char *extend(char *, const char *); +static char *extend(char *, size_t, char *, const char *); static int split(const char *, size_t, char *, size_t, int *); static void selectbase(struct devbase *, struct deva *); static int onlist(struct nvlist *, void *); @@ -1061,11 +1061,20 @@ onlist(struct nvlist *nv, void *ptr) } static char * -extend(char *p, const char *name) +extend(char *dst, size_t dstsize, char *p, const char *name) { int l; + if (p < dst) + panic("extend invalid pointer"); + l = strlen(name); + + if (((p - dst) + l + 2) > dstsize) { + error("extend buffer length exceeded"); + exit(1); + } + bcopy(name, p, l); p += l; *p++ = ','; @@ -1112,7 +1121,7 @@ fixloc(const char *name, struct attr *attr, struct nvlist *got) } if (n == NULL && m->nv_int == 0) { nmissing++; - mp = extend(mp, m->nv_name); + mp = extend(missing, sizeof(missing), mp, m->nv_name); } lp[ord] = m->nv_str; } @@ -1129,11 +1138,12 @@ fixloc(const char *name, struct attr *attr, struct nvlist *got) lp[n->nv_int] = n->nv_str; else if (lp[n->nv_int] == NULL) { nnodefault++; - ndp = extend(ndp, n->nv_name); + ndp = extend(nodefault, sizeof(nodefault), ndp, + n->nv_name); } } else { nextra++; - ep = extend(ep, n->nv_name); + ep = extend(extra, sizeof(extra), ep, n->nv_name); } } if (nextra) {