macppc, powerpc64: dec_rearm: no need to disable interrupts

2023-01-28 Thread Scott Cheloha
On macppc and powerpc64, I don't think we need to disable interrupts
during dec_rearm().  ppc_mtdec() and mtdec() are just:

mtspr   dec,

or

mtdec   

which is atomic.

Tested on macpcc (my G4).  Kernel boots, system has been up for over
24 hours doing a parallel `make build`.

When I wrote dec_rearm() I think I was just imitating dec_trigger().
In that case, we *do* need to disable interrupts because we're doing
mtspr twice.

ok?

Index: macppc/macppc/clock.c
===
RCS file: /cvs/src/sys/arch/macppc/macppc/clock.c,v
retrieving revision 1.52
diff -u -p -r1.52 clock.c
--- macppc/macppc/clock.c   27 Jan 2023 22:13:48 -  1.52
+++ macppc/macppc/clock.c   28 Jan 2023 23:20:06 -
@@ -248,16 +248,13 @@ void
 dec_rearm(void *unused, uint64_t nsecs)
 {
uint32_t cycles;
-   int s;
 
if (nsecs > dec_nsec_max)
nsecs = dec_nsec_max;
cycles = (nsecs * dec_nsec_cycle_ratio) >> 32;
if (cycles > UINT32_MAX >> 1)
cycles = UINT32_MAX >> 1;
-   s = ppc_intr_disable();
ppc_mtdec(cycles);
-   ppc_intr_enable(s);
 }
 
 void
Index: powerpc64/powerpc64/clock.c
===
RCS file: /cvs/src/sys/arch/powerpc64/powerpc64/clock.c,v
retrieving revision 1.8
diff -u -p -r1.8 clock.c
--- powerpc64/powerpc64/clock.c 27 Jan 2023 22:14:43 -  1.8
+++ powerpc64/powerpc64/clock.c 28 Jan 2023 23:20:06 -
@@ -59,7 +59,6 @@ void  cpu_startclock(void);
 void
 dec_rearm(void *unused, uint64_t nsecs)
 {
-   u_long s;
uint32_t cycles;
 
if (nsecs > dec_nsec_max)
@@ -67,9 +66,7 @@ dec_rearm(void *unused, uint64_t nsecs)
cycles = (nsecs * dec_nsec_cycle_ratio) >> 32;
if (cycles > UINT32_MAX >> 1)
cycles = UINT32_MAX >> 1;
-   s = intr_disable();
mtdec(cycles);
-   intr_restore(s);
 }
 
 void



update xterm to version 378

2023-01-28 Thread Matthieu Herrb
Hi,

The patch below updates xterm to version 378. As always testing
(especially for specific use cases) is welcome.

Apply in /usr/xenocara/app/xterm and rebuild xterm

doas make obj
doas make build

 Patch #378 - 2023/01/09

 * improve descriptions of XTQMODKEYS and XTQALLOWED features in
   ctlseqs.ms (reports by Bram Moolenaar, Thomas Wolff).
 * add bracketed+paste and report+version building blocks to terminfo,
   from ncurses 6.4
 * improve check for unsupported formatting characters, e.g.,
   zero-width space, to properly ignore them (report by Thomas Wolff).
 * improve/document error-checking for some of the controls which
   return responses: DECRQSS, XTGETXRES, XTSETTCAP, XTGETTCAP
   (prompted by discussion with David Leadbeater).
 * improve limit-checks for fallback font cache (report by Dimitrije
   Erdeljan).
 * improve check for too-wide glyph in fallback font by allowing
   xterm to continue searching for a suitable font rather than just
   failing on the first. Also add limitFontWidth to allow changing
   the amount by which a glyph must extend outside the font's bounding
   box to disallow it.

 Patch #377 - 2022/11/25

 * add control sequences for reporting the current state of the
   modified keys options (XTQMODKEYS) and allowed/disallowed
   operations (XTQALLOWED), (prompted by discussion with Bram Moolenaar).
 * amend modifyOtherKeys case 2 to distinguish the escape character
   with modifiers, e.g., shift-escape, from a plain escape character
   (suggested by Bram Moolenaar).
 * improve parsing and error-recovery in the case where a list of X11
   bitmap fonts is given in the -fn and related options.
 * change default for xftTrackMemUsage to false, because libXft does
   not handle certain fonts.

 Patch #376 - 2022/11/16

 * modify configure script to always check for gcc attributes,
 * update install-sh.
 * fix parsing of result -u in vttests/halves.pl.
 * add a note in ctlseqs.ms about compatibility of TBC.
 * fix a copy/paste error in manual (patch by Grady Martin).
 * add null-pointer checks in x_strcasecmp and x_strncasecmp, to help
   with error-recovery for a missing font (Debian #1022942).

Index: COPYING
===
RCS file: /cvs/OpenBSD/xenocara/app/xterm/COPYING,v
retrieving revision 1.4
diff -u -p -u -r1.4 COPYING
--- COPYING 25 Apr 2022 19:20:37 -  1.4
+++ COPYING 28 Jan 2023 17:16:53 -
@@ -1,7 +1,7 @@
 $XTermId: COPYING,v 1.5 2022/01/30 19:30:32 tom Exp $
+--- $XTermId: COPYING,v 1.6 2023/01/02 15:46:55 tom Exp $
 ---
 
-Copyright 1996-2021,2022 by Thomas E. Dickey
+Copyright 1996-2022,2023 by Thomas E. Dickey
 
 All Rights Reserved
 
Index: MANIFEST
===
RCS file: /cvs/OpenBSD/xenocara/app/xterm/MANIFEST,v
retrieving revision 1.52
diff -u -p -u -r1.52 MANIFEST
--- MANIFEST9 Nov 2022 21:55:14 -   1.52
+++ MANIFEST28 Jan 2023 17:16:53 -
@@ -1,4 +1,4 @@
-MANIFEST for xterm, version xterm-375
+MANIFEST for xterm, version xterm-378
 

 MANIFESTthis file
 256colres.h resource-definitions for 256-color mode
Index: NEWS
===
RCS file: /cvs/OpenBSD/xenocara/app/xterm/NEWS,v
retrieving revision 1.12
diff -u -p -u -r1.12 NEWS
--- NEWS9 Nov 2022 21:55:15 -   1.12
+++ NEWS28 Jan 2023 17:16:53 -
@@ -1,13 +1,22 @@
 The NEWS file was generated from xterm.log.html, which serves as the changelog
 for xterm.
 

-Patch #375 - 2022/10/23
+Patch #378 - 2023/01/09
 
- * improve  error-recovery  when  setting  a bitmap font for the VT100
-   window,  e.g.,  in  case  OSC 50  failed, restoring the most recent
-   valid  font  so  that  a  subsequent  OSC 50 reports this correctly
-   (report by David Leadbeater).
- * exclude  MC_XDG_OPEN  from environment variables trimmed on startup
-   (report by Gabor Hauzer).
- * check for null pointer in isSelect() (report by Column Paget).
+ * improve  descriptions  of  XTQMODKEYS  and  XTQALLOWED  features in
+   ctlseqs.ms (reports by Bram Moolenaar, Thomas Wolff).
+ * add bracketed+paste and report+version building blocks to terminfo,
+   from ncurses 6.4
+ * improve   check   for   unsupported  formatting  characters,  e.g.,
+   zero-width space, to properly ignore them (report by Thomas Wolff).
+ * improve/document  error-checking  for  some  of  

Do not call (*pr_ctloutput)() after success sosplice()

2023-01-28 Thread Vitaliy Makkoveev
It will be null op in any cases. I want to do this, because it allows
to push solock() down to sosplice() and make future sblock()/solock()
dances easier with standalone sblock().

Index: sys/kern/uipc_socket.c
===
RCS file: /cvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.299
diff -u -p -r1.299 uipc_socket.c
--- sys/kern/uipc_socket.c  27 Jan 2023 21:01:59 -  1.299
+++ sys/kern/uipc_socket.c  28 Jan 2023 10:59:50 -
@@ -1932,7 +1932,8 @@ sosetopt(struct socket *so, int level, i
mtod(m, struct splice *)->sp_max,
   (m, struct splice *)->sp_idle);
}
-   break;
+
+   return (error);
 #endif /* SOCKET_SPLICE */
 
default: