CVS commit: src/sys/arch/sparc64/sparc64

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:22 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: pmap.c

Log Message:
sparc64/pmap: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 src/sys/arch/sparc64/sparc64/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/sparc64/pmap.c
diff -u src/sys/arch/sparc64/sparc64/pmap.c:1.314 src/sys/arch/sparc64/sparc64/pmap.c:1.315
--- src/sys/arch/sparc64/sparc64/pmap.c:1.314	Sat Mar 12 15:32:31 2022
+++ src/sys/arch/sparc64/sparc64/pmap.c	Wed Apr  6 22:48:21 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.314 2022/03/12 15:32:31 riastradh Exp $	*/
+/*	$NetBSD: pmap.c,v 1.315 2022/04/06 22:48:21 riastradh Exp $	*/
 /*
  *
  * Copyright (C) 1996-1999 Eduardo Horvath.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.314 2022/03/12 15:32:31 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.315 2022/04/06 22:48:21 riastradh Exp $");
 
 #undef	NO_VCACHE /* Don't forget the locked TLB in dostart */
 #define	HWREF
@@ -163,6 +163,7 @@ static void ctx_free(struct pmap *, stru
 static __inline void
 dmmu_set_secondary_context(uint ctx)
 {
+
 	if (!CPU_ISSUN4V)
 		__asm volatile(
 			"stxa %0,[%1]%2;	"
@@ -175,7 +176,6 @@ dmmu_set_secondary_context(uint ctx)
 			"membar #Sync		"
 			: : "r" (ctx), "r" (CTX_SECONDARY), "n" (ASI_MMU_CONTEXTID)
 			: "memory");
-		
 }
 
 /*
@@ -564,7 +564,7 @@ pmap_mp_init(void)
 			if (CPU_ISSUN4V)
 tp[i].data |= SUN4V_TLB_X;
 		}
-			
+
 		DPRINTF(PDB_BOOT1, ("xtlb[%d]: Tag: %" PRIx64 " Data: %"
 PRIx64 "\n", i, tp[i].tag, tp[i].data));
 	}



CVS commit: src/sys/arch/sparc64/sparc64

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:22 UTC 2022

Modified Files:
src/sys/arch/sparc64/sparc64: pmap.c

Log Message:
sparc64/pmap: Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.314 -r1.315 src/sys/arch/sparc64/sparc64/pmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/marvell

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:09 UTC 2022

Modified Files:
src/sys/dev/marvell: mvxpsec.c

Log Message:
mvxpsec(4): Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/marvell/mvxpsec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/marvell/mvxpsec.c
diff -u src/sys/dev/marvell/mvxpsec.c:1.11 src/sys/dev/marvell/mvxpsec.c:1.12
--- src/sys/dev/marvell/mvxpsec.c:1.11	Sat Mar 12 15:32:32 2022
+++ src/sys/dev/marvell/mvxpsec.c	Wed Apr  6 22:48:09 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: mvxpsec.c,v 1.11 2022/03/12 15:32:32 riastradh Exp $	*/
+/*	$NetBSD: mvxpsec.c,v 1.12 2022/04/06 22:48:09 riastradh Exp $	*/
 /*
  * Copyright (c) 2015 Internet Initiative Japan Inc.
  * All rights reserved.
@@ -401,7 +401,7 @@ mvxpsec_attach(device_t parent, device_t
 	/* INTR */
 	MVXPSEC_WRITE(sc, MVXPSEC_INT_MASK, MVXPSEC_DEFAULT_INT);
 	MVXPSEC_WRITE(sc, MV_TDMA_ERR_MASK, MVXPSEC_DEFAULT_ERR);
-	sc->sc_done_ih = 
+	sc->sc_done_ih =
 	marvell_intr_establish(mva->mva_irq, IPL_NET, mvxpsec_intr, sc);
 	/* XXX: sould pass error IRQ using mva */
 	sc->sc_error_ih = marvell_intr_establish(MVXPSEC_ERR_INT(sc),
@@ -434,7 +434,7 @@ mvxpsec_attach(device_t parent, device_t
 	MVXPSEC_WRITE(sc, MV_ACC_COMMAND, MV_ACC_COMMAND_STOP);
 
 	/* Session */
-	sc->sc_session_pool = 
+	sc->sc_session_pool =
 	pool_cache_init(sizeof(struct mvxpsec_session), 0, 0, 0,
 	"mvxpsecpl", NULL, IPL_NET,
 	mvxpsec_session_ctor, mvxpsec_session_dtor, sc);
@@ -577,7 +577,7 @@ mvxpsec_timer(void *aux)
 #ifdef MVXPSEC_DEBUG
 	mvxpsec_dump_reg(sc);
 #endif
-	
+
 	s = splnet();
 	/* stop security accelerator */
 	MVXPSEC_WRITE(sc, MV_ACC_COMMAND, MV_ACC_COMMAND_STOP);
@@ -771,7 +771,6 @@ mvxpsec_dma_setup(struct mvxpsec_descrip
 #ifdef MVXPSEC_DEBUG
 	mvxpsec_dump_dmaq(dh);
 #endif
-
 }
 
 /*
@@ -889,7 +888,7 @@ mvxpsec_dma_copy_packet(struct mvxpsec_s
 	 *   ||
 	 *   vv
 	 *   ++...
-	 *   |IV  |DATA
+	 *   |IV  |DATA
 	 *   ++...
 	 */
 	pkt_off = 0;
@@ -909,7 +908,7 @@ mvxpsec_dma_copy_packet(struct mvxpsec_s
 	if (__predict_false(err))
 		return err;
 
-	/* 
+	/*
 	 * make DMA descriptors to copy session header: DRAM -> SRAM
 	 * we can reuse session header on SRAM if session is not changed.
 	 */
@@ -1268,7 +1267,7 @@ STATIC uint32_t
 mvxpsec_eintr_ack(struct mvxpsec_softc *sc)
 {
 	uint32_t reg;
- 
+
 	reg  = MVXPSEC_READ(sc, MV_TDMA_ERR_CAUSE);
 	reg &= MVXPSEC_DEFAULT_ERR;
 	MVXPSEC_WRITE(sc, MV_TDMA_ERR_CAUSE, ~reg);
@@ -1445,7 +1444,7 @@ mvxpsec_packet_ctor(void *arg, void *obj
 		log(LOG_ERR, "%s: cannot create DMA map\n", __func__);
 		goto fail;
 	}
-	if (bus_dmamap_load(sc->sc_dmat, mv_p->pkt_header_map, 
+	if (bus_dmamap_load(sc->sc_dmat, mv_p->pkt_header_map,
 	&mv_p->pkt_header, sizeof(mv_p->pkt_header),
 	NULL, BUS_DMA_NOWAIT)) {
 		log(LOG_ERR, "%s: cannot load header\n", __func__);
@@ -1533,7 +1532,7 @@ mvxpsec_session_ref(struct mvxpsec_sessi
 
 	refs = atomic_inc_32_nv(&mv_s->refs);
 	if (refs == 1) {
-		/* 
+		/*
 		 * a session with refs == 0 is
 		 * already invalidated. revert it.
 		 * XXX: use CAS ?
@@ -1543,7 +1542,7 @@ mvxpsec_session_ref(struct mvxpsec_sessi
 		"%s: session is already invalidated.\n", __func__);
 		return -1;
 	}
-	
+
 	return 0;
 }
 
@@ -2128,7 +2127,7 @@ mvxpsec_dispatch(void *arg, struct crypt
 	err = mvxpsec_packet_setcrp(mv_p, crp);
 	if (__predict_false(err))
 		goto fail;
-	
+
 	/*
 	 * Setup DMA descriptor chains
 	 */
@@ -2660,7 +2659,7 @@ STATIC int
 mvxpsec_packet_write_iv(struct mvxpsec_packet *mv_p, void *iv, int ivlen)
 {
 	uint8_t ivbuf[16];
-	
+
 	KASSERT(ivlen == 8 || ivlen == 16);
 
 	if (iv == NULL) {
@@ -2924,7 +2923,7 @@ static uint8_t AES_SBOX[256] = {
	  7,  18, 128, 226, 235,  39, 178, 117,   9, 131,  44,  26,  27, 110,
 	 90, 160,  82,  59, 214, 179,  41, 227,  47, 132,  83, 209,   0, 237,
	 32, 252, 177,  91, 106, 203, 190,  57,  74,  76,  88, 207, 208, 239,
-	170, 251,  67,  77,  51, 133,  69, 249,   2, 127,  80,  60, 159, 168, 
+	170, 251,  67,  77,  51, 133,  69, 249,   2, 127,  80,  60, 159, 168,
 	 81, 163,  64, 143, 146, 157,  56, 245, 188, 182, 218,  33,  16, 255,
 	243, 210, 205,  12,  19, 236,  95, 151,  68,  23, 196, 167, 126,  61,
	100,  93,  25, 115,  96, 129,  79, 220,  34,  42, 144, 136,  70, 238,
@@ -2938,7 +2937,7 @@ static uint8_t AES_SBOX[256] = {
 	176,  84, 187,  22
 };
 
-static uint32_t AES_RCON[30] = { 
+static uint32_t AES_RCON[30] = {
 	0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8,
	0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4,
	0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91
@@ -2946,11 +2945,11 @@ static uint32_t AES_RCON[30] = { 
 
 STATIC int
 mv_aes_ksched(uint8_t k[4][MAXKC], int keyBits,
-uint8_t W[MAXROUNDS+1][4]

CVS commit: src/sys/dev/marvell

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:48:09 UTC 2022

Modified Files:
src/sys/dev/marvell: mvxpsec.c

Log Message:
mvxpsec(4): Nix trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/marvell/mvxpsec.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:47:58 UTC 2022

Modified Files:
src/common/lib/libc/arch/alpha/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/hppa/atomic: membar_ops.S
src/common/lib/libc/arch/i386/atomic: atomic.S
src/common/lib/libc/arch/ia64/atomic: atomic.S
src/common/lib/libc/arch/m68k/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_cas_68000.S atomic_dec.S atomic_inc.S
atomic_nand.S atomic_op_asm.h atomic_or.S atomic_sub.S
atomic_swap.S atomic_xor.S
src/common/lib/libc/arch/or1k/atomic: atomic_swap_32.S
src/common/lib/libc/arch/powerpc/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/riscv/atomic: membar_ops.S
src/common/lib/libc/arch/sparc/atomic: atomic_cas_up.S atomic_op_asm.h
membar_ops.S
src/common/lib/libc/arch/sparc64/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/x86_64/atomic: atomic.S
src/sys/arch/i386/i386: lock_stubs.S
src/sys/arch/ia64/include: mutex.h
src/sys/arch/m68k/m68k: lock_stubs.s
src/sys/arch/powerpc/powerpc: lock_stubs.S
src/sys/arch/sparc/sparc: lock_stubs.s
src/sys/arch/sparc64/sparc64: lock_stubs.s
src/sys/arch/vax/include: mutex.h
src/sys/arch/vax/vax: lock_stubs.S

Log Message:
Nix trailing whitespace in files of membars, atomics, and lock stubs.

Will be touching many of these files soon for functional changes.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/alpha/atomic/atomic_add.S \
src/common/lib/libc/arch/alpha/atomic/atomic_and.S \
src/common/lib/libc/arch/alpha/atomic/atomic_dec.S \
src/common/lib/libc/arch/alpha/atomic/atomic_inc.S \
src/common/lib/libc/arch/alpha/atomic/atomic_or.S \
src/common/lib/libc/arch/alpha/atomic/atomic_swap.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/alpha/atomic/atomic_cas.S
cvs rdiff -u -r1.3 -r1.4 \
src/common/lib/libc/arch/alpha/atomic/atomic_op_asm.h
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/alpha/atomic/membar_ops.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/hppa/atomic/membar_ops.S
cvs rdiff -u -r1.29 -r1.30 src/common/lib/libc/arch/i386/atomic/atomic.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/ia64/atomic/atomic.S
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/atomic_add.S
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/atomic_and.S \
src/common/lib/libc/arch/m68k/atomic/atomic_or.S
cvs rdiff -u -r1.13 -r1.14 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S \
src/common/lib/libc/arch/m68k/atomic/atomic_dec.S \
src/common/lib/libc/arch/m68k/atomic/atomic_inc.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/m68k/atomic/atomic_nand.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/atomic/atomic_sub.S \
src/common/lib/libc/arch/m68k/atomic/atomic_xor.S
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/m68k/atomic/atomic_swap.S
cvs rdiff -u -r1.1 -r1.2 \
src/common/lib/libc/arch/or1k/atomic/atomic_swap_32.S
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/powerpc/atomic/atomic_add.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/powerpc/atomic/atomic_and.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_dec.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_inc.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h \
src/common/lib/libc/arch/powerpc/atomic/atomic_or.S
cvs rdiff -u -r1.9 -r1.10 \
src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/powerpc/atomic/membar_ops.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/riscv/atomic/membar_ops.S
cvs rdiff -u -r1.2 -r1.3 \
src/common/lib/libc/arch/sparc/atomic/atomic_cas_up.S
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/sparc/atomic/membar_ops.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/sparc64/atomic/atomic_add.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_and.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_cas.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_inc.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h \
src/common/lib/

CVS commit: src

2022-04-06 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Wed Apr  6 22:47:58 UTC 2022

Modified Files:
src/common/lib/libc/arch/alpha/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/hppa/atomic: membar_ops.S
src/common/lib/libc/arch/i386/atomic: atomic.S
src/common/lib/libc/arch/ia64/atomic: atomic.S
src/common/lib/libc/arch/m68k/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_cas_68000.S atomic_dec.S atomic_inc.S
atomic_nand.S atomic_op_asm.h atomic_or.S atomic_sub.S
atomic_swap.S atomic_xor.S
src/common/lib/libc/arch/or1k/atomic: atomic_swap_32.S
src/common/lib/libc/arch/powerpc/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/riscv/atomic: membar_ops.S
src/common/lib/libc/arch/sparc/atomic: atomic_cas_up.S atomic_op_asm.h
membar_ops.S
src/common/lib/libc/arch/sparc64/atomic: atomic_add.S atomic_and.S
atomic_cas.S atomic_dec.S atomic_inc.S atomic_op_asm.h atomic_or.S
atomic_swap.S membar_ops.S
src/common/lib/libc/arch/x86_64/atomic: atomic.S
src/sys/arch/i386/i386: lock_stubs.S
src/sys/arch/ia64/include: mutex.h
src/sys/arch/m68k/m68k: lock_stubs.s
src/sys/arch/powerpc/powerpc: lock_stubs.S
src/sys/arch/sparc/sparc: lock_stubs.s
src/sys/arch/sparc64/sparc64: lock_stubs.s
src/sys/arch/vax/include: mutex.h
src/sys/arch/vax/vax: lock_stubs.S

Log Message:
Nix trailing whitespace in files of membars, atomics, and lock stubs.

Will be touching many of these files soon for functional changes.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/alpha/atomic/atomic_add.S \
src/common/lib/libc/arch/alpha/atomic/atomic_and.S \
src/common/lib/libc/arch/alpha/atomic/atomic_dec.S \
src/common/lib/libc/arch/alpha/atomic/atomic_inc.S \
src/common/lib/libc/arch/alpha/atomic/atomic_or.S \
src/common/lib/libc/arch/alpha/atomic/atomic_swap.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/alpha/atomic/atomic_cas.S
cvs rdiff -u -r1.3 -r1.4 \
src/common/lib/libc/arch/alpha/atomic/atomic_op_asm.h
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/alpha/atomic/membar_ops.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/hppa/atomic/membar_ops.S
cvs rdiff -u -r1.29 -r1.30 src/common/lib/libc/arch/i386/atomic/atomic.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/ia64/atomic/atomic.S
cvs rdiff -u -r1.10 -r1.11 src/common/lib/libc/arch/m68k/atomic/atomic_add.S
cvs rdiff -u -r1.11 -r1.12 src/common/lib/libc/arch/m68k/atomic/atomic_and.S \
src/common/lib/libc/arch/m68k/atomic/atomic_or.S
cvs rdiff -u -r1.13 -r1.14 src/common/lib/libc/arch/m68k/atomic/atomic_cas.S
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/m68k/atomic/atomic_cas_68000.S \
src/common/lib/libc/arch/m68k/atomic/atomic_dec.S \
src/common/lib/libc/arch/m68k/atomic/atomic_inc.S
cvs rdiff -u -r1.2 -r1.3 src/common/lib/libc/arch/m68k/atomic/atomic_nand.S
cvs rdiff -u -r1.5 -r1.6 src/common/lib/libc/arch/m68k/atomic/atomic_op_asm.h
cvs rdiff -u -r1.3 -r1.4 src/common/lib/libc/arch/m68k/atomic/atomic_sub.S \
src/common/lib/libc/arch/m68k/atomic/atomic_xor.S
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/arch/m68k/atomic/atomic_swap.S
cvs rdiff -u -r1.1 -r1.2 \
src/common/lib/libc/arch/or1k/atomic/atomic_swap_32.S
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/arch/powerpc/atomic/atomic_add.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_swap.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/powerpc/atomic/atomic_and.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_dec.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_inc.S \
src/common/lib/libc/arch/powerpc/atomic/atomic_op_asm.h \
src/common/lib/libc/arch/powerpc/atomic/atomic_or.S
cvs rdiff -u -r1.9 -r1.10 \
src/common/lib/libc/arch/powerpc/atomic/atomic_cas.S
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/powerpc/atomic/membar_ops.S
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/riscv/atomic/membar_ops.S
cvs rdiff -u -r1.2 -r1.3 \
src/common/lib/libc/arch/sparc/atomic/atomic_cas_up.S
cvs rdiff -u -r1.6 -r1.7 \
src/common/lib/libc/arch/sparc/atomic/atomic_op_asm.h
cvs rdiff -u -r1.4 -r1.5 src/common/lib/libc/arch/sparc/atomic/membar_ops.S
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/sparc64/atomic/atomic_add.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_and.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_cas.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_inc.S \
src/common/lib/libc/arch/sparc64/atomic/atomic_op_asm.h \
src/common/lib/

CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Wed Apr  6 22:25:00 UTC 2022

Modified Files:
src/usr.sbin/makefs: Makefile

Log Message:
udf.c uses math library functions.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/Makefile
diff -u src/usr.sbin/makefs/Makefile:1.37 src/usr.sbin/makefs/Makefile:1.38
--- src/usr.sbin/makefs/Makefile:1.37	Sun Oct 13 07:28:19 2019
+++ src/usr.sbin/makefs/Makefile	Wed Apr  6 22:25:00 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.37 2019/10/13 07:28:19 mrg Exp $
+#	$NetBSD: Makefile,v 1.38 2022/04/06 22:25:00 hauke Exp $
 #
 
 WARNS?=	5
@@ -29,8 +29,8 @@ CPPFLAGS+=	-I${.CURDIR} -I${MKNODSRC} -I
 .include "${.CURDIR}/udf/Makefile.inc"
 
 .if !defined(HOSTPROG)
-DPADD+= ${LIBUTIL}
-LDADD+= -lutil
+DPADD+= ${LIBUTIL} ${LIBM}
+LDADD+= -lutil -lm
 
 COPTS.cd9660.c+=		${GCC_NO_STRINGOP_TRUNCATION} ${GCC_NO_FORMAT_TRUNCATION}
 COPTS.cd9660_conversion.c+=	${GCC_NO_FORMAT_TRUNCATION}



CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Wed Apr  6 22:25:00 UTC 2022

Modified Files:
src/usr.sbin/makefs: Makefile

Log Message:
udf.c uses math library functions.


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/usr.sbin/makefs/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/usb

2022-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Apr  6 22:01:45 UTC 2022

Modified Files:
src/sys/dev/usb: ehci.c if_smscreg.h if_urtwn.c ubt.c uhub.c usb_subr.c
usbdi.c uvideo.c xhci.c xhcireg.h

Log Message:
revert accidental last commit (except ukbd.c)


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/if_smscreg.h
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/uhub.c
cvs rdiff -u -r1.276 -r1.277 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.163 -r1.164 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/usb/xhcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.310 src/sys/dev/usb/ehci.c:1.311
--- src/sys/dev/usb/ehci.c:1.310	Wed Apr  6 21:51:29 2022
+++ src/sys/dev/usb/ehci.c	Wed Apr  6 22:01:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $ */
+/*	$NetBSD: ehci.c,v 1.311 2022/04/06 22:01:45 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.311 2022/04/06 22:01:45 mlelstv Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -790,9 +790,6 @@ ehci_intr1(ehci_softc_t *sc)
 	if (eintrs & EHCI_STS_HSE) {
 		printf("%s: unrecoverable error, controller halted\n",
 		   device_xname(sc->sc_dev));
-#ifdef EHCI_DEBUG
-		ehci_dump();
-#endif
 		/* XXX what else */
 	}
 	if (eintrs & EHCI_STS_PCD) {
@@ -2244,7 +2241,6 @@ ehci_sync_hc(ehci_softc_t *sc)
 	unsigned starttime = getticks();
 	unsigned endtime = starttime + delta;
 	unsigned now;
-	uint32_t v;
 
 	KASSERT(mutex_owned(&sc->sc_lock));
 
@@ -2264,10 +2260,7 @@ ehci_sync_hc(ehci_softc_t *sc)
 	sc->sc_doorbelllwp = curlwp;
 
 	/* ask for doorbell */
-	v = EOREAD4(sc, EHCI_USBCMD);
-	if ((v & EHCI_CMD_IAAD) == 0)
-		EOWRITE4(sc, EHCI_USBCMD, v | EHCI_CMD_IAAD);
-
+	EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);
 	DPRINTF("cmd = 0x%08jx sts = 0x%08jx",
 	EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS), 0, 0);
 

Index: src/sys/dev/usb/if_smscreg.h
diff -u src/sys/dev/usb/if_smscreg.h:1.7 src/sys/dev/usb/if_smscreg.h:1.8
--- src/sys/dev/usb/if_smscreg.h:1.7	Wed Apr  6 21:51:29 2022
+++ src/sys/dev/usb/if_smscreg.h	Wed Apr  6 22:01:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smscreg.h,v 1.7 2022/04/06 21:51:29 mlelstv Exp $	*/
+/*	$NetBSD: if_smscreg.h,v 1.8 2022/04/06 22:01:45 mlelstv Exp $	*/
 
 /*	$OpenBSD: if_smscreg.h,v 1.2 2012/09/27 12:38:11 jsg Exp $	*/
 /*-
@@ -244,7 +244,7 @@
 #define SMSC_UR_GET_STATS	0xA2
 
 #define SMSC_RX_LIST_CNT	1
-#define SMSC_TX_LIST_CNT	2
+#define SMSC_TX_LIST_CNT	1
 
 #define	SMSC_CONFIG_INDEX	1	/* config number 1 */
 #define	SMSC_IFACE_IDX		0

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.102 src/sys/dev/usb/if_urtwn.c:1.103
--- src/sys/dev/usb/if_urtwn.c:1.102	Wed Apr  6 21:51:29 2022
+++ src/sys/dev/usb/if_urtwn.c	Wed Apr  6 22:01:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.103 2022/04/06 22:01:45 mlelstv Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.103 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2623,8 +2623,7 @@ urtwn_txeof(struct usbd_xfer *xfer, void
 struct usbd_pipe *pipe = sc->tx_pipe[pidx];
 usbd_clear_endpoint_stall_async(pipe);
 			}
-			device_printf(sc->sc_dev, "device error %s\n",
-			  usbd_errstr(status));
+			device_printf(sc->sc_dev, "device timeout\n");
 			if_statinc(ifp, if_oerrors);
 		}
 		splx(s);

Index: src/sys/dev/usb/ubt.c
diff -u src/sys/dev/usb/ubt.c:1.65 src/sys/dev/usb/ubt.c:1.66
--- src/sys/dev/usb/ubt.c:1.65	Wed Apr  6 21:51:29 2022
+++ src/sys/dev/usb/ubt.c	Wed Apr  6 22:01:45 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $	*/
+/*	$NetBSD: ubt.c,v 1.66 2022/04/06 22:01:45 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.66 2022/04/06 22:01:45 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1456,7 +1456,7 @@ ubt_xmit_sco_start1(struct ubt_softc *sc
 			 isoc,
 			 isoc->size,
 			 num

CVS commit: src/sys/dev/usb

2022-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Apr  6 22:01:45 UTC 2022

Modified Files:
src/sys/dev/usb: ehci.c if_smscreg.h if_urtwn.c ubt.c uhub.c usb_subr.c
usbdi.c uvideo.c xhci.c xhcireg.h

Log Message:
revert accidental last commit (except ukbd.c)


To generate a diff of this commit:
cvs rdiff -u -r1.310 -r1.311 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/if_smscreg.h
cvs rdiff -u -r1.102 -r1.103 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.65 -r1.66 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/uhub.c
cvs rdiff -u -r1.276 -r1.277 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.241 -r1.242 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.163 -r1.164 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.20 -r1.21 src/sys/dev/usb/xhcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/usb

2022-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Apr  6 21:51:29 UTC 2022

Modified Files:
src/sys/dev/usb: ehci.c if_smscreg.h if_urtwn.c ubt.c uhub.c ukbd.c
usb_subr.c usbdi.c uvideo.c xhci.c xhcireg.h

Log Message:
remove debug printf


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/if_smscreg.h
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/usb/uhub.c
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/ukbd.c
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.240 -r1.241 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/xhcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.309 src/sys/dev/usb/ehci.c:1.310
--- src/sys/dev/usb/ehci.c:1.309	Sun Mar 13 11:29:21 2022
+++ src/sys/dev/usb/ehci.c	Wed Apr  6 21:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.309 2022/03/13 11:29:21 riastradh Exp $ */
+/*	$NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2004-2012,2016,2020 The NetBSD Foundation, Inc.
@@ -54,7 +54,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.309 2022/03/13 11:29:21 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.310 2022/04/06 21:51:29 mlelstv Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -790,6 +790,9 @@ ehci_intr1(ehci_softc_t *sc)
 	if (eintrs & EHCI_STS_HSE) {
 		printf("%s: unrecoverable error, controller halted\n",
 		   device_xname(sc->sc_dev));
+#ifdef EHCI_DEBUG
+		ehci_dump();
+#endif
 		/* XXX what else */
 	}
 	if (eintrs & EHCI_STS_PCD) {
@@ -2241,6 +2244,7 @@ ehci_sync_hc(ehci_softc_t *sc)
 	unsigned starttime = getticks();
 	unsigned endtime = starttime + delta;
 	unsigned now;
+	uint32_t v;
 
 	KASSERT(mutex_owned(&sc->sc_lock));
 
@@ -2260,7 +2264,10 @@ ehci_sync_hc(ehci_softc_t *sc)
 	sc->sc_doorbelllwp = curlwp;
 
 	/* ask for doorbell */
-	EOWRITE4(sc, EHCI_USBCMD, EOREAD4(sc, EHCI_USBCMD) | EHCI_CMD_IAAD);
+	v = EOREAD4(sc, EHCI_USBCMD);
+	if ((v & EHCI_CMD_IAAD) == 0)
+		EOWRITE4(sc, EHCI_USBCMD, v | EHCI_CMD_IAAD);
+
 	DPRINTF("cmd = 0x%08jx sts = 0x%08jx",
 	EOREAD4(sc, EHCI_USBCMD), EOREAD4(sc, EHCI_USBSTS), 0, 0);
 

Index: src/sys/dev/usb/if_smscreg.h
diff -u src/sys/dev/usb/if_smscreg.h:1.6 src/sys/dev/usb/if_smscreg.h:1.7
--- src/sys/dev/usb/if_smscreg.h:1.6	Mon Aug 12 08:40:09 2019
+++ src/sys/dev/usb/if_smscreg.h	Wed Apr  6 21:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smscreg.h,v 1.6 2019/08/12 08:40:09 skrll Exp $	*/
+/*	$NetBSD: if_smscreg.h,v 1.7 2022/04/06 21:51:29 mlelstv Exp $	*/
 
 /*	$OpenBSD: if_smscreg.h,v 1.2 2012/09/27 12:38:11 jsg Exp $	*/
 /*-
@@ -244,7 +244,7 @@
 #define SMSC_UR_GET_STATS	0xA2
 
 #define SMSC_RX_LIST_CNT	1
-#define SMSC_TX_LIST_CNT	1
+#define SMSC_TX_LIST_CNT	2
 
 #define	SMSC_CONFIG_INDEX	1	/* config number 1 */
 #define	SMSC_IFACE_IDX		0

Index: src/sys/dev/usb/if_urtwn.c
diff -u src/sys/dev/usb/if_urtwn.c:1.101 src/sys/dev/usb/if_urtwn.c:1.102
--- src/sys/dev/usb/if_urtwn.c:1.101	Thu Oct 21 20:18:16 2021
+++ src/sys/dev/usb/if_urtwn.c	Wed Apr  6 21:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_urtwn.c,v 1.101 2021/10/21 20:18:16 jnemeth Exp $	*/
+/*	$NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $	*/
 /*	$OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $	*/
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.101 2021/10/21 20:18:16 jnemeth Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.102 2022/04/06 21:51:29 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2623,7 +2623,8 @@ urtwn_txeof(struct usbd_xfer *xfer, void
 struct usbd_pipe *pipe = sc->tx_pipe[pidx];
 usbd_clear_endpoint_stall_async(pipe);
 			}
-			device_printf(sc->sc_dev, "device timeout\n");
+			device_printf(sc->sc_dev, "device error %s\n",
+			  usbd_errstr(status));
 			if_statinc(ifp, if_oerrors);
 		}
 		splx(s);

Index: src/sys/dev/usb/ubt.c
diff -u src/sys/dev/usb/ubt.c:1.64 src/sys/dev/usb/ubt.c:1.65
--- src/sys/dev/usb/ubt.c:1.64	Sun Dec  1 08:27:54 2019
+++ src/sys/dev/usb/ubt.c	Wed Apr  6 21:51:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubt.c,v 1.64 2019/12/01 08:27:54 maxv Exp $	*/
+/*	$NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.64 2019/12/01 08:27:54 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ubt.c,v 1.65 2022/04/06 21:51:29 mlelstv Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1456,7 +1456,7 @@ ubt_xmit_sco_start1(struct ubt_softc *sc
 			 isoc,
 			

CVS commit: src/sys/dev/usb

2022-04-06 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Apr  6 21:51:29 UTC 2022

Modified Files:
src/sys/dev/usb: ehci.c if_smscreg.h if_urtwn.c ubt.c uhub.c ukbd.c
usb_subr.c usbdi.c uvideo.c xhci.c xhcireg.h

Log Message:
remove debug printf


To generate a diff of this commit:
cvs rdiff -u -r1.309 -r1.310 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.6 -r1.7 src/sys/dev/usb/if_smscreg.h
cvs rdiff -u -r1.101 -r1.102 src/sys/dev/usb/if_urtwn.c
cvs rdiff -u -r1.64 -r1.65 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.159 -r1.160 src/sys/dev/usb/uhub.c
cvs rdiff -u -r1.160 -r1.161 src/sys/dev/usb/ukbd.c
cvs rdiff -u -r1.275 -r1.276 src/sys/dev/usb/usb_subr.c
cvs rdiff -u -r1.240 -r1.241 src/sys/dev/usb/usbdi.c
cvs rdiff -u -r1.70 -r1.71 src/sys/dev/usb/uvideo.c
cvs rdiff -u -r1.162 -r1.163 src/sys/dev/usb/xhci.c
cvs rdiff -u -r1.19 -r1.20 src/sys/dev/usb/xhcireg.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/adb

2022-04-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr  6 17:37:31 UTC 2022

Modified Files:
src/sys/dev/adb: adb_ktm.c

Log Message:
KNF nits, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/adb/adb_ktm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/adb/adb_ktm.c
diff -u src/sys/dev/adb/adb_ktm.c:1.4 src/sys/dev/adb/adb_ktm.c:1.5
--- src/sys/dev/adb/adb_ktm.c:1.4	Sat Aug  7 16:19:09 2021
+++ src/sys/dev/adb/adb_ktm.c	Wed Apr  6 17:37:31 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_ktm.c,v 1.4 2021/08/07 16:19:09 thorpej Exp $	*/
+/*	$NetBSD: adb_ktm.c,v 1.5 2022/04/06 17:37:31 macallan Exp $	*/
 
 /*-
  * Copyright (c) 2019 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb_ktm.c,v 1.4 2021/08/07 16:19:09 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb_ktm.c,v 1.5 2022/04/06 17:37:31 macallan Exp $");
 
 #include 
 #include 
@@ -363,9 +363,9 @@ ktm_ioctl(void *v, u_long cmd, void *dat
 		break;
 
 	default:
-		return (EPASSTHROUGH);
+		return EPASSTHROUGH;
 	}
-	return (0);
+	return 0;
 }
 
 static void



CVS commit: src/sys/dev/adb

2022-04-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr  6 17:37:31 UTC 2022

Modified Files:
src/sys/dev/adb: adb_ktm.c

Log Message:
KNF nits, NFC


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/dev/adb/adb_ktm.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/dev/adb

2022-04-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr  6 17:14:43 UTC 2022

Modified Files:
src/sys/dev/adb: adb_keymap.h

Log Message:
we've been using the power key for its intended purpose for yesrs, which
makes breaking into DDB awkward, so let's do what everyone else does and
use Ctrl-Alt-Escape / Cmd-Escape depending on the layout variant


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/adb/adb_keymap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/adb/adb_keymap.h
diff -u src/sys/dev/adb/adb_keymap.h:1.8 src/sys/dev/adb/adb_keymap.h:1.9
--- src/sys/dev/adb/adb_keymap.h:1.8	Mon Aug 31 17:51:56 2020
+++ src/sys/dev/adb/adb_keymap.h	Wed Apr  6 17:14:42 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_keymap.h,v 1.8 2020/08/31 17:51:56 macallan Exp $	*/
+/*	$NetBSD: adb_keymap.h,v 1.9 2022/04/06 17:14:42 macallan Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@ static const keysym_t akbd_keydesc_us[] 
 KC(50),			KS_grave,	KS_asciitilde,
 KC(51),			KS_Delete,
 KC(52),			KS_KP_Enter,/* Pretend this is alt-R ? */
-KC(53),			KS_Escape,
+KC(53), KS_Cmd_Debugger,	KS_Escape,
 KC(54),  KS_Cmd1,		KS_Control_L,
 KC(55),			KS_Meta_L,	/* Command */
 KC(56),			KS_Shift_L,



CVS commit: src/sys/dev/adb

2022-04-06 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Wed Apr  6 17:14:43 UTC 2022

Modified Files:
src/sys/dev/adb: adb_keymap.h

Log Message:
we've been using the power key for its intended purpose for yesrs, which
makes breaking into DDB awkward, so let's do what everyone else does and
use Ctrl-Alt-Escape / Cmd-Escape depending on the layout variant


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/adb/adb_keymap.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  6 16:01:07 UTC 2022

Modified Files:
src/sbin/fsck_udf: main.c

Log Message:
Use PRI macros for uint64_t printf formats, %zu for size_t.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_udf/main.c
diff -u src/sbin/fsck_udf/main.c:1.2 src/sbin/fsck_udf/main.c:1.3
--- src/sbin/fsck_udf/main.c:1.2	Wed Apr  6 13:42:39 2022
+++ src/sbin/fsck_udf/main.c	Wed Apr  6 16:01:06 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.2 2022/04/06 13:42:39 wiz Exp $	*/
+/*	$NetBSD: main.c,v 1.3 2022/04/06 16:01:06 martin Exp $	*/
 
 /*
  * Copyright (c) 2022 Reinoud Zandijk
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.2 2022/04/06 13:42:39 wiz Exp $");
+__RCSID("$NetBSD: main.c,v 1.3 2022/04/06 16:01:06 martin Exp $");
 #endif /* not lint */
 
 #include 
@@ -520,7 +520,7 @@ udf_rebuild_fid_stream(struct udf_fsck_n
 	}
 
 	if (sfpos != dfpos)
-		printf("%s: could save %ld bytes in directory\n", udf_node_path(node), sfpos - dfpos);
+		printf("%s: could save %" PRIi64 " bytes in directory\n", udf_node_path(node), sfpos - dfpos);
 
 	memset(directory, 0, inf_len);
 	memcpy(directory, rebuild_dir, dfpos);
@@ -2985,7 +2985,7 @@ udf_close_volume(void)
 
 	/* check our highest unique id */
 	if (context.unique_id > udf_rw64(lvid->lvint_next_unique_id)) {
-		pwarn("Last unique id updated from %ld to %ld : FIXED\n",
+		pwarn("Last unique id updated from %" PRIi64 " to %" PRIi64 " : FIXED\n",
 udf_rw64(lvid->lvint_next_unique_id),
 context.unique_id);
 		open_integrity = 1;
@@ -3299,7 +3299,7 @@ udf_fixup_lengths_pass1(struct udf_fsck_
 	diff = node->found.inf_len - node->declared.inf_len;
 	if (diff) {
 		pwarn("%s : recorded information length incorrect: "
-			"%lu instead of declared %lu\n",
+			"%" PRIu64 " instead of declared %" PRIu64 "\n",
 			udf_node_path(node),
 			node->found.inf_len, node->declared.inf_len);
 			node->declared.inf_len = node->found.inf_len;
@@ -3311,7 +3311,7 @@ udf_fixup_lengths_pass1(struct udf_fsck_
 	diff = node->found.logblks_rec - node->declared.logblks_rec;
 	if (diff) {
 		pwarn("%s : logical blocks recorded incorrect: "
-		  "%lu instead of declared %lu, fixing\n",
+		  "%" PRIu64 " instead of declared %" PRIu64 ", fixing\n",
 			udf_node_path(node),
 			node->found.logblks_rec, node->declared.logblks_rec);
 		node->declared.logblks_rec = node->found.logblks_rec;
@@ -3332,7 +3332,7 @@ udf_fixup_lengths_pass1(struct udf_fsck_
 	if (udf_rw16(dscr->tag.desc_crc_len) !=
 			udf_tagsize(dscr, 1) - sizeof(struct desc_tag)) {
 		pwarn("%s : node file descriptor CRC length mismatch; "
-			"%d declared, %ld expected\n",
+			"%d declared, %zu\n",
 			udf_node_path(node), udf_rw16(dscr->tag.desc_crc_len),
 			udf_tagsize(dscr, 1) - sizeof(struct desc_tag));
 		udf_recursive_keep(node);
@@ -4020,7 +4020,7 @@ udf_check_directory_tree(void)
 		/* object sizes */
 		if (cur_node->declared.obj_size != cur_node->found.obj_size) {
 			pwarn("%s : recorded object size incorrect; "
-			  "%lu instead of declared %lu\n",
+			  "%" PRIu64 " instead of declared %" PRIu64 "\n",
 udf_node_path(cur_node),
 cur_node->found.obj_size, cur_node->declared.obj_size);
 			cur_node->declared.obj_size = cur_node->found.obj_size;



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Apr  6 16:01:07 UTC 2022

Modified Files:
src/sbin/fsck_udf: main.c

Log Message:
Use PRI macros for uint64_t printf formats, %zu for size_t.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/conf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:47:54 UTC 2022

Modified Files:
src/sys/conf: filesystems.config

Log Message:
Keep UDF commented out by default


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/conf/filesystems.config

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/filesystems.config
diff -u src/sys/conf/filesystems.config:1.15 src/sys/conf/filesystems.config:1.16
--- src/sys/conf/filesystems.config:1.15	Wed Apr  6 13:59:22 2022
+++ src/sys/conf/filesystems.config	Wed Apr  6 14:47:54 2022
@@ -1,4 +1,4 @@
-# $NetBSD: filesystems.config,v 1.15 2022/04/06 13:59:22 reinoud Exp $
+# $NetBSD: filesystems.config,v 1.16 2022/04/06 14:47:54 reinoud Exp $
 #file-system	ADOSFS		# AmigaDOS-compatible file system
 #options 	APPLE_UFS	# Apple UFS support in FFS
 #file-system	AUTOFS		# Automounter Filesystem
@@ -28,7 +28,7 @@ file-system	PUFFS		# Userspace file syst
 pseudo-device	putter		# for puffs and pud
 #file-system	SYSVBFS		# sysvfs
 file-system	TMPFS		# Efficient memory file-system
-file-system	UDF		# OSTA UDF CD/DVD file-system
+#file-system	UDF		# OSTA UDF CD/DVD file-system
 file-system	UMAPFS		# NULLFS + uid and gid remapping
 file-system	UNION		# union file system
 #file-system	V7FS		# 7th Edition(V7) File System



CVS commit: src/sys/conf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:47:54 UTC 2022

Modified Files:
src/sys/conf: filesystems.config

Log Message:
Keep UDF commented out by default


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/conf/filesystems.config

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/distrib/sets/lists/debug

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:28:44 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: mi

Log Message:
Add fsck_udf to the debug sets


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/distrib/sets/lists/debug/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/debug/mi
diff -u src/distrib/sets/lists/debug/mi:1.374 src/distrib/sets/lists/debug/mi:1.375
--- src/distrib/sets/lists/debug/mi:1.374	Mon Mar 28 20:52:17 2022
+++ src/distrib/sets/lists/debug/mi	Wed Apr  6 14:28:44 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.374 2022/03/28 20:52:17 christos Exp $
+# $NetBSD: mi,v 1.375 2022/04/06 14:28:44 reinoud Exp $
 ./etc/mtree/set.debug   comp-sys-root
 ./usr/lib	comp-sys-usr		compatdir
 ./usr/lib/i18n/libBIG5_g.a			comp-c-debuglib		debuglib,compatfile
@@ -360,6 +360,7 @@
 ./usr/libdata/debug/sbin/fsck_ffs.debug		comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/fsck_lfs.debug		comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/fsck_msdos.debug	comp-sysutil-debug	debug
+./usr/libdata/debug/sbin/fsck_udf.debug		comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/fsck_v7fs.debug	comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/fsdb.debug		comp-sysutil-debug	debug
 ./usr/libdata/debug/sbin/fsirand.debug		comp-sysutil-debug	debug



CVS commit: src/distrib/sets/lists/debug

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:28:44 UTC 2022

Modified Files:
src/distrib/sets/lists/debug: mi

Log Message:
Add fsck_udf to the debug sets


To generate a diff of this commit:
cvs rdiff -u -r1.374 -r1.375 src/distrib/sets/lists/debug/mi

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:20:07 UTC 2022

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/man: mi
src/sbin: Makefile

Log Message:
Add the fsck_udf(8) tool to the build and release


To generate a diff of this commit:
cvs rdiff -u -r1.1292 -r1.1293 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1737 -r1.1738 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.135 -r1.136 src/sbin/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/mi
diff -u src/distrib/sets/lists/base/mi:1.1292 src/distrib/sets/lists/base/mi:1.1293
--- src/distrib/sets/lists/base/mi:1.1292	Mon Mar  7 09:45:02 2022
+++ src/distrib/sets/lists/base/mi	Wed Apr  6 14:20:07 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1292 2022/03/07 09:45:02 mrg Exp $
+# $NetBSD: mi,v 1.1293 2022/04/06 14:20:07 reinoud Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -382,6 +382,7 @@
 ./sbin/fsck_ffs	base-sysutil-root
 ./sbin/fsck_lfs	base-sysutil-root
 ./sbin/fsck_msdosbase-sysutil-root
+./sbin/fsck_udf	base-sysutil-root
 ./sbin/fsck_v7fsbase-sysutil-root
 ./sbin/fsdb	base-sysutil-root
 ./sbin/fsirand	base-sysutil-root

Index: src/distrib/sets/lists/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1737 src/distrib/sets/lists/man/mi:1.1738
--- src/distrib/sets/lists/man/mi:1.1737	Thu Mar 24 16:33:05 2022
+++ src/distrib/sets/lists/man/mi	Wed Apr  6 14:20:07 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1737 2022/03/24 16:33:05 wiz Exp $
+# $NetBSD: mi,v 1.1738 2022/04/06 14:20:07 reinoud Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2626,6 +2626,7 @@
 ./usr/share/man/cat8/fsck_ffs.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/fsck_lfs.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/fsck_msdos.0		man-sysutil-catman	.cat
+./usr/share/man/cat8/fsck_udf.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/fsck_v7fs.0		man-sysutil-catman	.cat
 ./usr/share/man/cat8/fsdb.0			man-sysutil-catman	.cat
 ./usr/share/man/cat8/fsinfo.0			man-sysutil-catman	.cat
@@ -5722,6 +5723,7 @@
 ./usr/share/man/html8/fsck_ffs.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/fsck_lfs.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/fsck_msdos.html		man-sysutil-htmlman	html
+./usr/share/man/html8/fsck_udf.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/fsck_v7fs.html		man-sysutil-htmlman	html
 ./usr/share/man/html8/fsdb.html			man-sysutil-htmlman	html
 ./usr/share/man/html8/fsinfo.html		man-sysutil-htmlman	html
@@ -8907,6 +8909,7 @@
 ./usr/share/man/man8/fsck_ffs.8			man-sysutil-man		.man
 ./usr/share/man/man8/fsck_lfs.8			man-sysutil-man		.man
 ./usr/share/man/man8/fsck_msdos.8		man-sysutil-man		.man
+./usr/share/man/man8/fsck_udf.8			man-sysutil-man		.man
 ./usr/share/man/man8/fsck_v7fs.8		man-sysutil-man		.man
 ./usr/share/man/man8/fsdb.8			man-sysutil-man		.man
 ./usr/share/man/man8/fsinfo.8			man-sysutil-man		.man

Index: src/sbin/Makefile
diff -u src/sbin/Makefile:1.135 src/sbin/Makefile:1.136
--- src/sbin/Makefile:1.135	Thu Feb 24 03:35:32 2022
+++ src/sbin/Makefile	Wed Apr  6 14:20:07 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.135 2022/02/24 03:35:32 mrg Exp $
+#	$NetBSD: Makefile,v 1.136 2022/04/06 14:20:07 reinoud Exp $
 #	@(#)Makefile	8.5 (Berkeley) 3/31/94
 
 # Not ported: XNSrouted enpload scsiformat startslip
@@ -22,7 +22,7 @@ SUBDIR+= newfs fsck_ffs fsdb dump restor
 SUBDIR+= newfs_lfs fsck_lfs dump_lfs resize_lfs
 SUBDIR+= newfs_msdos fsck_msdos
 SUBDIR+= newfs_sysvbfs
-SUBDIR+= newfs_udf
+SUBDIR+= newfs_udf fsck_udf
 SUBDIR+= newfs_v7fs fsck_v7fs
 SUBDIR+= mount_ados
 SUBDIR+= mount_autofs



CVS commit: src

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 14:20:07 UTC 2022

Modified Files:
src/distrib/sets/lists/base: mi
src/distrib/sets/lists/man: mi
src/sbin: Makefile

Log Message:
Add the fsck_udf(8) tool to the build and release


To generate a diff of this commit:
cvs rdiff -u -r1.1292 -r1.1293 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.1737 -r1.1738 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.135 -r1.136 src/sbin/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/conf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:59:22 UTC 2022

Modified Files:
src/sys/conf: filesystems.config

Log Message:
UDF has been around for more than a decade in the kernel. Now with a
fsck_udf(8) it is not making sense to keep it calling `experimental'.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/conf/filesystems.config

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sys/conf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:59:22 UTC 2022

Modified Files:
src/sys/conf: filesystems.config

Log Message:
UDF has been around for more than a decade in the kernel. Now with a
fsck_udf(8) it is not making sense to keep it calling `experimental'.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/conf/filesystems.config

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/conf/filesystems.config
diff -u src/sys/conf/filesystems.config:1.14 src/sys/conf/filesystems.config:1.15
--- src/sys/conf/filesystems.config:1.14	Sat Apr  4 15:43:22 2020
+++ src/sys/conf/filesystems.config	Wed Apr  6 13:59:22 2022
@@ -1,4 +1,4 @@
-# $NetBSD: filesystems.config,v 1.14 2020/04/04 15:43:22 jdolecek Exp $
+# $NetBSD: filesystems.config,v 1.15 2022/04/06 13:59:22 reinoud Exp $
 #file-system	ADOSFS		# AmigaDOS-compatible file system
 #options 	APPLE_UFS	# Apple UFS support in FFS
 #file-system	AUTOFS		# Automounter Filesystem
@@ -28,7 +28,7 @@ file-system	PUFFS		# Userspace file syst
 pseudo-device	putter		# for puffs and pud
 #file-system	SYSVBFS		# sysvfs
 file-system	TMPFS		# Efficient memory file-system
-#file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
+file-system	UDF		# OSTA UDF CD/DVD file-system
 file-system	UMAPFS		# NULLFS + uid and gid remapping
 file-system	UNION		# union file system
 #file-system	V7FS		# 7th Edition(V7) File System



CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:44:25 UTC 2022

Modified Files:
src/usr.sbin/makefs: ffs.c udf.c walk.c

Log Message:
makefs: fix some typos


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/makefs/udf.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/makefs/walk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/ffs.c
diff -u src/usr.sbin/makefs/ffs.c:1.70 src/usr.sbin/makefs/ffs.c:1.71
--- src/usr.sbin/makefs/ffs.c:1.70	Sat Dec 16 23:08:40 2017
+++ src/usr.sbin/makefs/ffs.c	Wed Apr  6 13:44:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs.c,v 1.70 2017/12/16 23:08:40 christos Exp $	*/
+/*	$NetBSD: ffs.c,v 1.71 2022/04/06 13:44:25 wiz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -71,7 +71,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: ffs.c,v 1.70 2017/12/16 23:08:40 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.71 2022/04/06 13:44:25 wiz Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -149,7 +149,7 @@ static  void	*ffs_build_dinode2(struct u
 
 
 
-	/* publically visible functions */
+	/* publicly visible functions */
 void
 ffs_prep_opts(fsinfo_t *fsopts)
 {

Index: src/usr.sbin/makefs/udf.c
diff -u src/usr.sbin/makefs/udf.c:1.23 src/usr.sbin/makefs/udf.c:1.24
--- src/usr.sbin/makefs/udf.c:1.23	Wed Apr  6 13:29:15 2022
+++ src/usr.sbin/makefs/udf.c	Wed Apr  6 13:44:25 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: udf.c,v 1.23 2022/04/06 13:29:15 reinoud Exp $ */
+/* $NetBSD: udf.c,v 1.24 2022/04/06 13:44:25 wiz Exp $ */
 
 /*
  * Copyright (c) 2006, 2008, 2013, 2021, 2022 Reinoud Zandijk
@@ -30,7 +30,7 @@
 #endif
 
 #include 
-__RCSID("$NetBSD: udf.c,v 1.23 2022/04/06 13:29:15 reinoud Exp $");
+__RCSID("$NetBSD: udf.c,v 1.24 2022/04/06 13:44:25 wiz Exp $");
 
 #include 
 #include 
@@ -130,7 +130,7 @@ udf_prep_opts(fsinfo_t *fsopts)
 		OPT_BOOL('c', "checksurface", check_surface,
 			"perform crude surface check on rewritable media"),
 		OPT_BOOL('F', "forceformat", create_new_session,
-			"force file system contruction on non-empty recordable media"),
+			"force file system construction on non-empty recordable media"),
 		{ .name = NULL }
 	};
 
@@ -1235,7 +1235,7 @@ udf_makefs(const char *image, const char
 	error = udf_populate(dir, root, fsopts, &stats);
 
 	if (!error) {
-		/* update values for integrety sequence */
+		/* update values for integrity sequence */
 		context.num_files = stats.nfiles;
 		context.num_directories = stats.ndirs;
 

Index: src/usr.sbin/makefs/walk.c
diff -u src/usr.sbin/makefs/walk.c:1.30 src/usr.sbin/makefs/walk.c:1.31
--- src/usr.sbin/makefs/walk.c:1.30	Sat Apr  3 14:10:56 2021
+++ src/usr.sbin/makefs/walk.c	Wed Apr  6 13:44:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: walk.c,v 1.30 2021/04/03 14:10:56 simonb Exp $	*/
+/*	$NetBSD: walk.c,v 1.31 2022/04/06 13:44:25 wiz Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: walk.c,v 1.30 2021/04/03 14:10:56 simonb Exp $");
+__RCSID("$NetBSD: walk.c,v 1.31 2022/04/06 13:44:25 wiz Exp $");
 #endif	/* !__lint */
 
 #include 
@@ -277,7 +277,7 @@ create_fsnode(const char *root, const ch
 /*
  * free_fsnodes --
  *	Removes node from tree and frees it and all of
- *   its decendents.
+ *   its descendents.
  */
 void
 free_fsnodes(fsnode *node)



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:42:40 UTC 2022

Modified Files:
src/sbin/fsck_udf: main.c

Log Message:
fsck_udf: match usage to man page; fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_udf/main.c
diff -u src/sbin/fsck_udf/main.c:1.1 src/sbin/fsck_udf/main.c:1.2
--- src/sbin/fsck_udf/main.c:1.1	Wed Apr  6 13:35:50 2022
+++ src/sbin/fsck_udf/main.c	Wed Apr  6 13:42:39 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.1 2022/04/06 13:35:50 reinoud Exp $	*/
+/*	$NetBSD: main.c,v 1.2 2022/04/06 13:42:39 wiz Exp $	*/
 
 /*
  * Copyright (c) 2022 Reinoud Zandijk
@@ -37,7 +37,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: main.c,v 1.1 2022/04/06 13:35:50 reinoud Exp $");
+__RCSID("$NetBSD: main.c,v 1.2 2022/04/06 13:42:39 wiz Exp $");
 #endif /* not lint */
 
 #include 
@@ -1040,7 +1040,7 @@ udf_process_file(union dscrptr *dscrptr,
 		case UDF_EXT_REDIRECT  :
 			if (piece_len != context.sector_size) {
 /* should this be an error? */
-pwarn("Got extention redirect with wrong size %d\n",
+pwarn("Got extension redirect with wrong size %d\n",
 	piece_len);
 error = EINVAL;
 break;
@@ -3501,7 +3501,7 @@ udf_process_node_pass1(struct udf_fsck_n
 		node->fsck_flags |= FSCK_NODE_FLAG_PAR_NOT_FOUND;
 		rest_len = node->found.inf_len;
 
-		/* walk trough all our FIDs in the directory stream */
+		/* walk through all our FIDs in the directory stream */
 		bpos = node->directory;
 		fpos = 0;
 		while (rest_len > 0) {
@@ -4321,7 +4321,7 @@ checkfilesys(char *given_dev)
 static void
 usage(void)
 {
-	(void)fprintf(stderr, "Usage: %s [-psSynfH] filesystem ... \n",
+	(void)fprintf(stderr, "Usage: %s [-fHnpSsy] file-system ... \n",
 	getprogname());
 	exit(FSCK_EXIT_USAGE);
 }



CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:44:25 UTC 2022

Modified Files:
src/usr.sbin/makefs: ffs.c udf.c walk.c

Log Message:
makefs: fix some typos


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/makefs/ffs.c
cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/makefs/udf.c
cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/makefs/walk.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/doc

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:43:24 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF


To generate a diff of this commit:
cvs rdiff -u -r1.2868 -r1.2869 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2868 src/doc/CHANGES:1.2869
--- src/doc/CHANGES:1.2868	Sun Apr  3 01:12:47 2022
+++ src/doc/CHANGES	Wed Apr  6 13:43:24 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2868 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2869 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -486,3 +486,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		from previously merged zones) [kre 20220320] 
 	tzcode: Updated to 2022a. [christos 20220322]
 	dhcp: Import version 4.4.3. [christos 20220402]
+	udf: Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF. [reinoud 20220506]
+



CVS commit: src/doc

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:43:24 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
Added fsck_udf(8) and upgraded newfs_udf/makefs for UDF


To generate a diff of this commit:
cvs rdiff -u -r1.2868 -r1.2869 src/doc/CHANGES

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:42:40 UTC 2022

Modified Files:
src/sbin/fsck_udf: main.c

Log Message:
fsck_udf: match usage to man page; fix typos


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:41:14 UTC 2022

Modified Files:
src/sbin/fsck_udf: fsck_udf.8

Log Message:
New sentence, new line. Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_udf/fsck_udf.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_udf/fsck_udf.8
diff -u src/sbin/fsck_udf/fsck_udf.8:1.1 src/sbin/fsck_udf/fsck_udf.8:1.2
--- src/sbin/fsck_udf/fsck_udf.8:1.1	Wed Apr  6 13:35:50 2022
+++ src/sbin/fsck_udf/fsck_udf.8	Wed Apr  6 13:41:13 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fsck_udf.8,v 1.1 2022/04/06 13:35:50 reinoud Exp $
+.\"	$NetBSD: fsck_udf.8,v 1.2 2022/04/06 13:41:13 wiz Exp $
 .\"
 .\" Copyright (C) 2022 Reinoud Zandijk
 .\" Based on fsck_msdos(8) by
@@ -31,32 +31,32 @@
 .Os
 .Sh NAME
 .Nm fsck_udf
-.Nd Universal Disk Format filesystem consistency checker
+.Nd Universal Disk Format file system consistency checker
 .Sh SYNOPSIS
 .Nm
 .Fl p
 .Op Fl fH
-.Ar filesystem ...
+.Ar file system ...
 .Nm
-.Op Fl sSynfH
-.Ar filesystem ...
+.Op Fl fHnSsy
+.Ar file system ...
 .Sh DESCRIPTION
 The
 .Nm
 utility verifies and repairs
 .Tn Universal Disk Format
-filesystems (more commonly known as
+file systems (more commonly known as
 .Tn UDF
-filesystems).
+file systems).
 .Pp
 The first form of
 .Nm
-preens the specified filesystems.
+preens the specified file systems.
 It is normally started by
 .Xr fsck 8
 run from
 .Pa /etc/rc
-during automatic reboot, when an UDF filesystem is detected.
+during automatic reboot, when an UDF file system is detected.
 When preening file systems,
 .Nm
 will fix common inconsistencies non-interactively.
@@ -75,30 +75,31 @@ The options are as follows:
 .Bl -tag -width XXXoptions
 .It Fl f
 Force detailed checking even when file system is marked closed.
+.It Fl H
+Enables heuristic repair options repairing known corruptions in the wild
+caused by bugs.
 .It Fl n
 Causes
 .Nm
-to assume no as the answer to all operator
-questions.
+to assume no as the answer to all operator questions.
 .It Fl p
-Preen the specified filesystems.
-.It Fl y
+Preen the specified file systems.
+.It Fl S
 Causes
 .Nm
-to assume yes as the answer to all operator questions.
+to scan for older VAT tables on recordable media.
+This allows older snapshots of the file system on recordable media to
+be recovered.
 .It Fl s Ar session
 Select session
 .Ar session
-to be checked on recordable media. This allows older sessions
-of the file system on recordable media to be recovered.
-.It Fl S
+to be checked on recordable media.
+This allows older sessions of the file system on recordable media to
+be recovered.
+.It Fl y
 Causes
 .Nm
-to scan for older VAT tables on recordable media. This allows older snapshots
-of the file system on recordable media to be recovered.
-.It Fl H
-Enables heuristic repair options repairing known corruptions in the wild
-caused by bugs.
+to assume yes as the answer to all operator questions.
 .El
 .Sh SEE ALSO
 .Xr fsck 8 ,
@@ -111,5 +112,5 @@ utility appeared in
 .Nx 10.0 .
 .Sh BUGS
 .Nm
-is still under construction. Not all possible reparations are implemented.
-
+is still under construction.
+Not all possible reparations are implemented.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:41:14 UTC 2022

Modified Files:
src/sbin/fsck_udf: fsck_udf.8

Log Message:
New sentence, new line. Sort options.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sbin/fsck_udf/fsck_udf.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:39:06 UTC 2022

Modified Files:
src/usr.sbin/makefs: makefs.8

Log Message:
new sentence, new line


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/makefs/makefs.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/makefs.8
diff -u src/usr.sbin/makefs/makefs.8:1.69 src/usr.sbin/makefs/makefs.8:1.70
--- src/usr.sbin/makefs/makefs.8:1.69	Wed Apr  6 13:29:15 2022
+++ src/usr.sbin/makefs/makefs.8	Wed Apr  6 13:39:06 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: makefs.8,v 1.69 2022/04/06 13:29:15 reinoud Exp $
+.\"	$NetBSD: makefs.8,v 1.70 2022/04/06 13:39:06 wiz Exp $
 .\"
 .\" Copyright (c) 2001-2003 Wasabi Systems, Inc.
 .\" All rights reserved.
@@ -490,7 +490,8 @@ population.
 .Ss UDF-specific options
 .Nm
 supports besides writing to image files also direct formatting of disc
-partitions and optical media. Optical media will auto configure settings.
+partitions and optical media.
+Optical media will auto configure settings.
 The following udf-specific optional parameters may be provided.
 Each of the options consists of a keyword, an equal sign
 .Pq Ql = ,
@@ -511,8 +512,10 @@ create a rewritable fs on once recordabl
 create a rewritable fs with sparing for defective sectors
 .El
 The sectorsize is set for the selected media and the default maximum disc size
-is assumed unless overridden. For cdrom, dvdrom and bdrom images, the disc
-size is the minimum size needed. Note that the size estimator can
+is assumed unless overridden.
+For CD-ROM, DVD-ROM and BD-ROM images, the disc
+size is the minimum size needed.
+Note that the size estimator can
 under-estimate in some cases; specify extra free blocks if encountering this.
 .It Sy loglabel
 Set the logical volume label of the disc to the specified argument.
@@ -525,22 +528,22 @@ manually unless it has an unique hex num
 positions.
 .It Sy minver
 Set the minimum UDF version to be used.
-Choose UDF version numbers from 0x102, 0x150, 0x200, 0x201 and 0x250.
+Choose UDF version numbers from 0x102, 0x150, 0x200, 0x201, and 0x250.
 Version 0x260 is currently not supported
 in
 .Nm .
 .It Sy maxver
 Set the maximum UDF version to be used.
-Choose UDF version numbers from 0x102, 0x150, 0x200, 0x201 and 0x250.
+Choose UDF version numbers from 0x102, 0x150, 0x200, 0x201, and 0x250.
 Version 0x260 is currently not supported
 in
 .Nm .
 .It Sy metaperc
-Set the minimum amount of free metadata space. This is only applicable on UDF
-0x250 on rewritable media.
+Set the minimum amount of free metadata space.
+This is only applicable on UDF 0x250 on rewritable media.
 .It Sy checksurface
-Check the surface of non error-free rewritable media for remapping. Note this
-is a destructive test and can take quite a while!
+Check the surface of non error-free rewritable media for remapping.
+Note this is a destructive test and can take quite a while!
 .It Sy forceformat
 Force formatting on non-empty recordable media.
 .El



CVS commit: src/usr.sbin/makefs

2022-04-06 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Wed Apr  6 13:39:06 UTC 2022

Modified Files:
src/usr.sbin/makefs: makefs.8

Log Message:
new sentence, new line


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/usr.sbin/makefs/makefs.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:35:50 UTC 2022

Added Files:
src/sbin/fsck_udf: Makefile fsck_udf.8 main.c

Log Message:
Initial commit of the fsck_udf(8) utility that checks and repairs UDF
filesystems on optical media as well as on disc images, harddisc partitions
and wedges.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sbin/fsck_udf/Makefile \
src/sbin/fsck_udf/fsck_udf.8 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/sbin/fsck_udf

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:35:50 UTC 2022

Added Files:
src/sbin/fsck_udf: Makefile fsck_udf.8 main.c

Log Message:
Initial commit of the fsck_udf(8) utility that checks and repairs UDF
filesystems on optical media as well as on disc images, harddisc partitions
and wedges.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sbin/fsck_udf/Makefile \
src/sbin/fsck_udf/fsck_udf.8 src/sbin/fsck_udf/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: src/sbin/fsck_udf/Makefile
diff -u /dev/null src/sbin/fsck_udf/Makefile:1.1
--- /dev/null	Wed Apr  6 13:35:50 2022
+++ src/sbin/fsck_udf/Makefile	Wed Apr  6 13:35:50 2022
@@ -0,0 +1,23 @@
+#	$NetBSD: Makefile,v 1.1 2022/04/06 13:35:50 reinoud Exp $
+
+.include 
+
+PROG=	fsck_udf
+MAN=	fsck_udf.8
+SRCS=	main.c udf_core.c \
+	udf_osta.c fattr.c fsutil.c
+
+FSCK=	${NETBSDSRCDIR}/sbin/fsck
+NEWFS=	${NETBSDSRCDIR}/sbin/newfs_udf
+MOUNT=	${NETBSDSRCDIR}/sbin/mount
+KUDF=	${NETBSDSRCDIR}/sys/fs/udf
+CPPFLAGS+= -I${FSCK} -I${KUDF} -I${NEWFS} -I${NETBSDSRCDIR}/sys
+.PATH:	${FSCK} ${NEWFS} ${MOUNT} ${KUDF}
+
+DPADD+=${LIBUTIL}
+LDADD+=-lutil -lprop
+
+CWARNFLAGS.clang+=	-Wno-error=address-of-packed-member
+CWARNFLAGS.gcc+=	${GCC_NO_ADDR_OF_PACKED_MEMBER}
+
+.include 
Index: src/sbin/fsck_udf/fsck_udf.8
diff -u /dev/null src/sbin/fsck_udf/fsck_udf.8:1.1
--- /dev/null	Wed Apr  6 13:35:50 2022
+++ src/sbin/fsck_udf/fsck_udf.8	Wed Apr  6 13:35:50 2022
@@ -0,0 +1,115 @@
+.\"	$NetBSD: fsck_udf.8,v 1.1 2022/04/06 13:35:50 reinoud Exp $
+.\"
+.\" Copyright (C) 2022 Reinoud Zandijk
+.\" Based on fsck_msdos(8) by
+.\" Copyright (C) 1995 Wolfgang Solfrank
+.\" Copyright (c) 1995 Martin Husemann
+.\"
+.\" 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 AUTHORS ``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 AUTHORS 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 February 6, 2022
+.Dt FSCK_UDF 8
+.Os
+.Sh NAME
+.Nm fsck_udf
+.Nd Universal Disk Format filesystem consistency checker
+.Sh SYNOPSIS
+.Nm
+.Fl p
+.Op Fl fH
+.Ar filesystem ...
+.Nm
+.Op Fl sSynfH
+.Ar filesystem ...
+.Sh DESCRIPTION
+The
+.Nm
+utility verifies and repairs
+.Tn Universal Disk Format
+filesystems (more commonly known as
+.Tn UDF
+filesystems).
+.Pp
+The first form of
+.Nm
+preens the specified filesystems.
+It is normally started by
+.Xr fsck 8
+run from
+.Pa /etc/rc
+during automatic reboot, when an UDF filesystem is detected.
+When preening file systems,
+.Nm
+will fix common inconsistencies non-interactively.
+If more serious problems are found,
+.Nm
+does not try to fix them, indicates that it was not
+successful, and exits.
+.Pp
+The second form of
+.Nm
+checks the specified file systems and tries to repair all
+detected inconsistencies, requesting confirmation before
+making any changes.
+.Pp
+The options are as follows:
+.Bl -tag -width XXXoptions
+.It Fl f
+Force detailed checking even when file system is marked closed.
+.It Fl n
+Causes
+.Nm
+to assume no as the answer to all operator
+questions.
+.It Fl p
+Preen the specified filesystems.
+.It Fl y
+Causes
+.Nm
+to assume yes as the answer to all operator questions.
+.It Fl s Ar session
+Select session
+.Ar session
+to be checked on recordable media. This allows older sessions
+of the file system on recordable media to be recovered.
+.It Fl S
+Causes
+.Nm
+to scan for older VAT tables on recordable media. This allows older snapshots
+of the file system on recordable media to be recovered.
+.It Fl H
+Enables heuristic repair options repairing known corruptions in the wild
+caused by bugs.
+.El
+.Sh SEE ALSO
+.Xr fsck 8 ,
+.Xr fsck_ffs 8 ,
+.Xr mount_udf 8
+.Sh HISTORY
+A
+.Nm
+utility appeared in
+.Nx 10.0 .
+.Sh BUGS
+.Nm
+is still under construction. Not all possible repar

CVS commit: src

2022-04-06 Thread Reinoud Zandijk
Module Name:src
Committed By:   reinoud
Date:   Wed Apr  6 13:29:16 UTC 2022

Modified Files:
src/sbin/newfs_udf: Makefile newfs_udf.c newfs_udf.h
src/usr.sbin/makefs: makefs.8 udf.c
src/usr.sbin/makefs/udf: Makefile.inc
Added Files:
src/sbin/newfs_udf: udf_core.c udf_core.h
Removed Files:
src/sbin/newfs_udf: udf_create.c udf_create.h udf_write.c udf_write.h

Log Message:
Refactor and rewrite of newfs_udf(8) and makefs(8) (-t udf) with a shared
section for fsck_udf(8).

Newfs_udf and makefs support predefined disc image profiles, harddisc
partitions (disklabel and wedges on all generic block devices) and all optical
media types on CD/DVD/BD writers.

Newfs_udf and makefs now also support formatting of UDF 2.50 with a metadata
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sbin/newfs_udf/Makefile \
src/sbin/newfs_udf/newfs_udf.h
cvs rdiff -u -r1.22 -r1.23 src/sbin/newfs_udf/newfs_udf.c
cvs rdiff -u -r0 -r1.1 src/sbin/newfs_udf/udf_core.c \
src/sbin/newfs_udf/udf_core.h
cvs rdiff -u -r1.31 -r0 src/sbin/newfs_udf/udf_create.c
cvs rdiff -u -r1.7 -r0 src/sbin/newfs_udf/udf_create.h
cvs rdiff -u -r1.11 -r0 src/sbin/newfs_udf/udf_write.c
cvs rdiff -u -r1.4 -r0 src/sbin/newfs_udf/udf_write.h
cvs rdiff -u -r1.68 -r1.69 src/usr.sbin/makefs/makefs.8
cvs rdiff -u -r1.22 -r1.23 src/usr.sbin/makefs/udf.c
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/makefs/udf/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/tests/lib/libc/sys

2022-04-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Apr  6 10:02:55 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile t_mmap.c

Log Message:
Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_mmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/lib/libc/sys/Makefile
diff -u src/tests/lib/libc/sys/Makefile:1.70 src/tests/lib/libc/sys/Makefile:1.71
--- src/tests/lib/libc/sys/Makefile:1.70	Mon Nov  1 14:33:41 2021
+++ src/tests/lib/libc/sys/Makefile	Wed Apr  6 10:02:55 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.70 2021/11/01 14:33:41 hannken Exp $
+# $NetBSD: Makefile,v 1.71 2022/04/06 10:02:55 gson Exp $
 
 MKMAN=	no
 
@@ -97,6 +97,7 @@ SRCS.t_mprotect=	t_mprotect.c ${SRCS_EXE
 
 LDADD.t_eventfd+=	-lpthread
 LDADD.t_getpid+=	-lpthread
+LDADD.t_mmap+=		-lpthread
 LDADD.t_timerfd+=	-lpthread
 
 LDADD.t_ptrace_sigchld+=	-pthread -lm

Index: src/tests/lib/libc/sys/t_mmap.c
diff -u src/tests/lib/libc/sys/t_mmap.c:1.16 src/tests/lib/libc/sys/t_mmap.c:1.17
--- src/tests/lib/libc/sys/t_mmap.c:1.16	Tue Apr  5 15:59:22 2022
+++ src/tests/lib/libc/sys/t_mmap.c	Wed Apr  6 10:02:55 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $ */
+/* $NetBSD: t_mmap.c,v 1.17 2022/04/06 10:02:55 gson Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  * SUCH DAMAGE.
  */
 #include 
-__RCSID("$NetBSD: t_mmap.c,v 1.16 2022/04/05 15:59:22 gson Exp $");
+__RCSID("$NetBSD: t_mmap.c,v 1.17 2022/04/06 10:02:55 gson Exp $");
 
 #include 
 #include 
@@ -74,6 +74,7 @@ __RCSID("$NetBSD: t_mmap.c,v 1.16 2022/0
 #include 
 #include 
 #include 
+#include 
 
 static long	page = 0;
 static char	path[] = "mmap";
@@ -413,6 +414,65 @@ ATF_TC_CLEANUP(mmap_prot_3, tc)
 	(void)unlink(path);
 }
 
+ATF_TC(mmap_reprotect_race);
+
+ATF_TC_HEAD(mmap_reprotect_race, tc)
+{
+	atf_tc_set_md_var(tc, "descr", "Test for the race condition of PR 52239");
+}
+
+const int mmap_reprotect_race_npages = 13;
+const int mmap_reprotect_iterations = 100;
+
+static void *
+mmap_reprotect_race_thread(void *arg)
+{
+	int i, r;
+	void *p;
+
+	for (i = 0; i < mmap_reprotect_iterations; i++) {
+		/* Get some unrelated memory */
+		p = mmap(0, mmap_reprotect_race_npages * page,
+			 PROT_READ|PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0);
+		ATF_REQUIRE(p);
+		r = munmap(p, mmap_reprotect_race_npages * page);
+		ATF_REQUIRE(r == 0);
+	}
+	return 0;
+}
+
+ATF_TC_BODY(mmap_reprotect_race, tc)
+{
+	pthread_t thread;
+	void *p, *q;
+	int i, r;
+
+	r = pthread_create(&thread, 0, mmap_reprotect_race_thread, 0);
+	ATF_REQUIRE(r == 0);
+
+	for (i = 0; i < mmap_reprotect_iterations; i++) {
+		/* Get a placeholder region */
+		p = mmap(0, mmap_reprotect_race_npages * page,
+			 PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
+		if (p == MAP_FAILED)
+			atf_tc_fail("mmap: %s", strerror(errno));
+
+		/* Upgrade placeholder to read/write access */
+		q = mmap(p, mmap_reprotect_race_npages * page,
+			 PROT_READ|PROT_WRITE,
+			 MAP_ANON|MAP_PRIVATE|MAP_FIXED, -1, 0);
+		if (q == MAP_FAILED)
+			atf_tc_fail("update mmap: %s", strerror(errno));
+		ATF_REQUIRE(q == p);
+
+		/* Free it */
+		r = munmap(q, mmap_reprotect_race_npages * page);
+		if (r != 0)
+			atf_tc_fail("munmap: %s", strerror(errno));
+	}
+	pthread_join(thread, NULL);
+}
+
 ATF_TC_WITH_CLEANUP(mmap_truncate);
 ATF_TC_HEAD(mmap_truncate, tc)
 {
@@ -570,6 +630,7 @@ ATF_TP_ADD_TCS(tp)
 	ATF_TP_ADD_TC(tp, mmap_prot_1);
 	ATF_TP_ADD_TC(tp, mmap_prot_2);
 	ATF_TP_ADD_TC(tp, mmap_prot_3);
+	ATF_TP_ADD_TC(tp, mmap_reprotect_race);
 	ATF_TP_ADD_TC(tp, mmap_truncate);
 	ATF_TP_ADD_TC(tp, mmap_truncate_signal);
 	ATF_TP_ADD_TC(tp, mmap_va0);



CVS commit: src/tests/lib/libc/sys

2022-04-06 Thread Andreas Gustafsson
Module Name:src
Committed By:   gson
Date:   Wed Apr  6 10:02:55 UTC 2022

Modified Files:
src/tests/lib/libc/sys: Makefile t_mmap.c

Log Message:
Add a regression test for PR kern/52239, "Changing protections of
already mmap'ed region can fail", based on the test program in the PR.


To generate a diff of this commit:
cvs rdiff -u -r1.70 -r1.71 src/tests/lib/libc/sys/Makefile
cvs rdiff -u -r1.16 -r1.17 src/tests/lib/libc/sys/t_mmap.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.