CVS commit: src/sys/arch/ia64/include

2020-06-28 Thread Sean Cole
Module Name:src
Committed By:   scole
Date:   Mon Jun 29 01:37:27 UTC 2020

Modified Files:
src/sys/arch/ia64/include: mcontext.h setjmp.h

Log Message:
Allow kernel to compile by preventing "error: stack usage is ..."
too-large errors.  What was there previously was not correct and this
will need to be revisited for debugger to ever become functional
anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/ia64/include/mcontext.h
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/ia64/include/setjmp.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/arch/ia64/include/mcontext.h
diff -u src/sys/arch/ia64/include/mcontext.h:1.10 src/sys/arch/ia64/include/mcontext.h:1.11
--- src/sys/arch/ia64/include/mcontext.h:1.10	Fri Dec 27 00:32:17 2019
+++ src/sys/arch/ia64/include/mcontext.h	Mon Jun 29 01:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mcontext.h,v 1.10 2019/12/27 00:32:17 kamil Exp $	*/
+/*	$NetBSD: mcontext.h,v 1.11 2020/06/29 01:37:27 scole Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -39,7 +39,7 @@
 #include 
 
 /* XXX fix this, just get to compile for now */
-#define _NGREG	128 
+#define _NGREG	1
 
 #ifndef __ASSEMBLER__
 typedef unsigned long __greg_t;

Index: src/sys/arch/ia64/include/setjmp.h
diff -u src/sys/arch/ia64/include/setjmp.h:1.3 src/sys/arch/ia64/include/setjmp.h:1.4
--- src/sys/arch/ia64/include/setjmp.h:1.3	Thu May  2 16:55:51 2019
+++ src/sys/arch/ia64/include/setjmp.h	Mon Jun 29 01:37:27 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: setjmp.h,v 1.3 2019/05/02 16:55:51 scole Exp $	*/
+/*	$NetBSD: setjmp.h,v 1.4 2020/06/29 01:37:27 scole Exp $	*/
 
 /*-
  * Copyright (c) 2000
@@ -86,6 +86,7 @@
 #define	J_SIGMASK	0x1d8
 #define	J_SIGSET	0x1e0
 
-#define	_JBLEN		0x200			/* Size in long XXX: Set to sizeof(mcontext_t)/sizeof(long) */
+/* XXX use FreeBSD value for now, set to sizeof(mcontext_t)/sizeof(long) ? */
+#define	_JBLEN		0x20			/* Size in long doubles */
 
 #endif /* !_MACHINE_SETJMP_H_ */



CVS commit: src/lib/libc/posix1e

2020-06-28 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Sun Jun 28 21:37:05 UTC 2020

Modified Files:
src/lib/libc/posix1e: posix1e.3

Log Message:
Remove Xr to extattr(2) which we don't have.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/lib/libc/posix1e/posix1e.3

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

Modified files:

Index: src/lib/libc/posix1e/posix1e.3
diff -u src/lib/libc/posix1e/posix1e.3:1.3 src/lib/libc/posix1e/posix1e.3:1.4
--- src/lib/libc/posix1e/posix1e.3:1.3	Sun Jun 28 18:23:01 2020
+++ src/lib/libc/posix1e/posix1e.3	Sun Jun 28 21:37:05 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: posix1e.3,v 1.3 2020/06/28 18:23:01 christos Exp $
+.\" $NetBSD: posix1e.3,v 1.4 2020/06/28 21:37:05 wiz Exp $
 .\"-
 .\" Copyright (c) 2000, 2009 Robert N. M. Watson
 .\" All rights reserved.
@@ -51,7 +51,7 @@ implements POSIX.1e interface for access
 and supports ACLs on the
 .Xr ffs 7
 file system; ACLs must be administratively enabled using
-.Xr tunefs 8 
+.Xr tunefs 8
 or via
 .Xr mount 8
 options.
@@ -75,7 +75,6 @@ and
 .Sh SEE ALSO
 .Xr getfacl 1 ,
 .Xr setfacl 1 ,
-.Xr extattr 2 ,
 .Xr acl 3 ,
 .Xr extattr 3 ,
 .Xr ffs 7 ,



CVS commit: src/lib/libc/posix1e

2020-06-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 28 18:23:01 UTC 2020

Modified Files:
src/lib/libc/posix1e: posix1e.3

Log Message:
reality check


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/lib/libc/posix1e/posix1e.3

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

Modified files:

Index: src/lib/libc/posix1e/posix1e.3
diff -u src/lib/libc/posix1e/posix1e.3:1.2 src/lib/libc/posix1e/posix1e.3:1.3
--- src/lib/libc/posix1e/posix1e.3:1.2	Thu Jun 18 15:46:59 2020
+++ src/lib/libc/posix1e/posix1e.3	Sun Jun 28 14:23:01 2020
@@ -1,4 +1,4 @@
-.\" $NetBSD: posix1e.3,v 1.2 2020/06/18 19:46:59 wiz Exp $
+.\" $NetBSD: posix1e.3,v 1.3 2020/06/28 18:23:01 christos Exp $
 .\"-
 .\" Copyright (c) 2000, 2009 Robert N. M. Watson
 .\" All rights reserved.
@@ -37,7 +37,7 @@
 .Sh SYNOPSIS
 .In sys/types.h
 .In sys/acl.h
-.In sys/mac.h
+.\" .In sys/mac.h
 .Sh DESCRIPTION
 POSIX.1e describes five security extensions to the POSIX.1 API: Access
 Control Lists (ACLs), Auditing, Capabilities, Mandatory Access Control, and
@@ -45,36 +45,25 @@ Information Flow Labels.
 While IEEE POSIX.1e D17 specification has not been standardized, several of
 its interfaces are widely used.
 .Pp
-.Fx
+.Nx
 implements POSIX.1e interface for access control lists, described in
 .Xr acl 3 ,
 and supports ACLs on the
 .Xr ffs 7
 file system; ACLs must be administratively enabled using
-.Xr tunefs 8 .
+.Xr tunefs 8 
+or via
+.Xr mount 8
+options.
 .Pp
-.Fx
-implements a POSIX.1e-like mandatory access control interface, described in
-.Xr mac 3 ,
-although with a number of extensions and important semantic differences.
-.Pp
-.Fx
-does not implement the POSIX.1e audit, privilege (capability), or information
-flow label APIs.
-However,
-.Fx
-does implement the
-.Xr libbsm 3
-audit API.
-It also provides
-.Xr capsicum 4 ,
-a lightweight OS capability and sandbox framework implementing a
-hybrid capability system model.
+.Nx
+does not implement the POSIX.1e mac, audit, privilege (capability),
+or information flow label APIs.
 .Sh ENVIRONMENT
 POSIX.1e assigns security attributes to all objects, extending the security
 functionality described in POSIX.1.
 These additional attributes store fine-grained discretionary access control
-information and mandatory access control labels; for files, they are stored
+information; for files, they are stored
 in extended attributes, described in
 .Xr extattr 3 .
 .Pp
@@ -82,36 +71,22 @@ POSIX.2c describes
 a set of userland utilities for manipulating these attributes, including
 .Xr getfacl 1
 and
-.Xr setfacl 1
-for access control lists, and
-.Xr getfmac 8
-and
-.Xr setfmac 8
-for mandatory access control labels.
+.Xr setfacl 1 .
 .Sh SEE ALSO
 .Xr getfacl 1 ,
 .Xr setfacl 1 ,
 .Xr extattr 2 ,
 .Xr acl 3 ,
 .Xr extattr 3 ,
-.Xr libbsm 3 ,
-.Xr libcasper 3 ,
-.Xr mac 3 ,
-.Xr capsicum 4 ,
 .Xr ffs 7 ,
-.Xr getfmac 8 ,
-.Xr setfmac 8 ,
 .Xr tunefs 8 ,
 .Xr acl 9 ,
-.Xr extattr 9 ,
-.Xr mac 9
+.Xr extattr 9
 .Sh STANDARDS
 POSIX.1e is described in IEEE POSIX.1e draft 17.
 .Sh HISTORY
 POSIX.1e support was introduced in
-.Fx 4.0 ;
-most features were available as of
-.Fx 5.0 .
+.Nx 10.0 .
 .Sh AUTHORS
 .An Robert N M Watson
 .An Chris D. Faulhaber



CVS commit: src/sys/compat/common

2020-06-28 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun 28 14:37:53 UTC 2020

Modified Files:
src/sys/compat/common: vfs_syscalls_20.c

Log Message:
Fix struct entry size (thanks kre@)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/compat/common/vfs_syscalls_20.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/compat/common/vfs_syscalls_20.c
diff -u src/sys/compat/common/vfs_syscalls_20.c:1.45 src/sys/compat/common/vfs_syscalls_20.c:1.46
--- src/sys/compat/common/vfs_syscalls_20.c:1.45	Fri Jan 17 15:08:06 2020
+++ src/sys/compat/common/vfs_syscalls_20.c	Sun Jun 28 10:37:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_syscalls_20.c,v 1.45 2020/01/17 20:08:06 ad Exp $	*/
+/*	$NetBSD: vfs_syscalls_20.c,v 1.46 2020/06/28 14:37:53 christos Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.45 2020/01/17 20:08:06 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.46 2020/06/28 14:37:53 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -153,7 +153,7 @@ compat_20_sys_getfsstat(struct lwp *l, c
 	} */
 	return do_sys_getvfsstat(l, SCARG(uap, buf), SCARG(uap, bufsize),
 	SCARG(uap, flags), statvfs_to_statfs12_copy,
-	sizeof(struct statvfs90), retval);
+	sizeof(struct statfs12), retval);
 }
 
 int



CVS commit: src

2020-06-28 Thread Frederic Cambus
Module Name:src
Committed By:   fcambus
Date:   Sun Jun 28 14:26:19 UTC 2020

Modified Files:
src/distrib/sets/lists/base: mi
src/share/wscons/fonts: COPYRIGHT Makefile
Added Files:
src/share/wscons/fonts: spleen-12x24.fnt.uue spleen-16x32.fnt.uue
spleen-32x64.fnt.uue spleen-5x8.fnt.uue spleen-8x16.fnt.uue

Log Message:
Add font files for Spleen, which can be loaded into the wsfont pool
or a wscons display device using wsfontload(8).

For example, Spleen 16x32 can be loaded and enabled as follow:

wsfontload -N spleen-16x32 -w 16 -h 32 spleen-16x32.fnt
wsconsctl -dw font=spleen-16x32


To generate a diff of this commit:
cvs rdiff -u -r1.1252 -r1.1253 src/distrib/sets/lists/base/mi
cvs rdiff -u -r1.2 -r1.3 src/share/wscons/fonts/COPYRIGHT
cvs rdiff -u -r1.10 -r1.11 src/share/wscons/fonts/Makefile
cvs rdiff -u -r0 -r1.1 src/share/wscons/fonts/spleen-12x24.fnt.uue \
src/share/wscons/fonts/spleen-16x32.fnt.uue \
src/share/wscons/fonts/spleen-32x64.fnt.uue \
src/share/wscons/fonts/spleen-5x8.fnt.uue \
src/share/wscons/fonts/spleen-8x16.fnt.uue

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.1252 src/distrib/sets/lists/base/mi:1.1253
--- src/distrib/sets/lists/base/mi:1.1252	Sun Jun 21 17:15:51 2020
+++ src/distrib/sets/lists/base/mi	Sun Jun 28 14:26:18 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1252 2020/06/21 17:15:51 thorpej Exp $
+# $NetBSD: mi,v 1.1253 2020/06/28 14:26:18 fcambus Exp $
 #
 # Note:	Don't delete entries from here - mark them as "obsolete" instead,
 #	unless otherwise stated below.
@@ -5327,6 +5327,11 @@
 ./usr/share/wscons/fonts/latin2.814		base-util-share		share
 ./usr/share/wscons/fonts/latin2.816		base-util-share		share
 ./usr/share/wscons/fonts/orator.816		base-util-share		share
+./usr/share/wscons/fonts/spleen-12x24.fnt	base-util-share		share
+./usr/share/wscons/fonts/spleen-16x32.fnt	base-util-share		share
+./usr/share/wscons/fonts/spleen-32x64.fnt	base-util-share		share
+./usr/share/wscons/fonts/spleen-5x8.fnt		base-util-share		share
+./usr/share/wscons/fonts/spleen-8x16.fnt	base-util-share		share
 ./usr/share/wscons/fonts/vt220h.808		base-util-share		share
 ./usr/share/wscons/fonts/vt220h.810		base-util-share		share
 ./usr/share/wscons/fonts/vt220h.814		base-util-share		share

Index: src/share/wscons/fonts/COPYRIGHT
diff -u src/share/wscons/fonts/COPYRIGHT:1.2 src/share/wscons/fonts/COPYRIGHT:1.3
--- src/share/wscons/fonts/COPYRIGHT:1.2	Mon Jun 22 15:07:11 2020
+++ src/share/wscons/fonts/COPYRIGHT	Sun Jun 28 14:26:18 2020
@@ -34,4 +34,35 @@ in this directory are
   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.
- 
+
+The font files:
+
+	spleen-5x8.fnt spleen-8x16.fnt spleen-12x24.fnt spleen-16x32.fnt
+	spleen-32x64.fnt
+
+in this directory are
+
+  Copyright (c) 2018-2020, Frederic Cambus
+  All rights reserved.
+
+  Redistribution and use in source and binary forms, with or without
+  modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+* 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 COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.

Index: src/share/wscons/fonts/Makefile
diff -u src/share/wscons/fonts/Makefile:1.10 src/share/wscons/fonts/Makefile:1.11
--- src/share/wscons/fonts/Makefile:1.10	Mon Jan 18 16:55:36 2010
+++ src/share/wscons/fonts/Makefile	Sun Jun 28 14:26:18 2020
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.10 2010/01/18 16:55:36 ahoka Exp $
+# $NetBSD: Makefile,v 1.11 2020/06/28 14:26:18 fcambus Exp $
 
 FONTS=	vt220l.814 vt220h.814 vt220l.808 vt220h.808 \
 	vt220l.816 vt220h.816 vt220l.810 vt220h.810 \
 	latin2.808 latin2.814 

CVS commit: src/sys/arch/mips/mips

2020-06-28 Thread Simon Burge
Module Name:src
Committed By:   simonb
Date:   Sun Jun 28 13:33:06 UTC 2020

Modified Files:
src/sys/arch/mips/mips: mips_machdep.c

Log Message:
Fix mm_md_kernacc() for 64 bit kernels (including n32):
 - FAULT for any physical address less than start of cached XKPHY address.
 - Pass any remaining physical address less then end of RAM.
 - Pass any remaining physical address within the KEGS0 kernel address range.
Ignore all remaining addresses and fall back to uvm_kernacc() for checking
virtual address ranges.

Fixes pmap(1) (and probably other kmem grovellers).


To generate a diff of this commit:
cvs rdiff -u -r1.293 -r1.294 src/sys/arch/mips/mips/mips_machdep.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/mips/mips/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.293 src/sys/arch/mips/mips/mips_machdep.c:1.294
--- src/sys/arch/mips/mips/mips_machdep.c:1.293	Mon Jun 15 07:55:45 2020
+++ src/sys/arch/mips/mips/mips_machdep.c	Sun Jun 28 13:33:06 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: mips_machdep.c,v 1.293 2020/06/15 07:55:45 simonb Exp $	*/
+/*	$NetBSD: mips_machdep.c,v 1.294 2020/06/28 13:33:06 simonb Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -111,7 +111,7 @@
  */
 
 #include 			/* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.293 2020/06/15 07:55:45 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.294 2020/06/28 13:33:06 simonb Exp $");
 
 #define __INTR_PRIVATE
 #include "opt_cputype.h"
@@ -2481,21 +2481,28 @@ mm_md_kernacc(void *ptr, vm_prot_t prot,
 	const vaddr_t v = (vaddr_t)ptr;
 
 #ifdef _LP64
-	if (v < MIPS_XKPHYS_START) {
+	extern char end[];
+
+	/* For any address < XKPHYS cached address 0, fault */
+	if (v < MIPS_PHYS_TO_XKPHYS_CACHED(0)) {
 		return EFAULT;
 	}
-	if (MIPS_XKPHYS_P(v) && v > MIPS_PHYS_TO_XKPHYS_CACHED(pmap_limits.avail_end +
+
+	/* If address < XKPHY(end of message buffer), good! */
+	if (v < MIPS_PHYS_TO_XKPHYS_CACHED(pmap_limits.avail_end +
 	mips_round_page(MSGBUFSIZE))) {
-		return EFAULT;
-	}
-	if (MIPS_KSEG0_P(v) ||
-	(MIPS_XKSEG_P(v) && v < MIPS_KSEG0_START)) {
+		/* XXX holes in RAM (eg, EdgeRouter 4) */
 		*handled = true;
 		return 0;
 	}
-	if (MIPS_KSEG1_P(v) || MIPS_KSEG2_P(v)) {
-		return EFAULT;
+
+	/* If address in KSEG0 and is before end of kernel, good! */
+	if (MIPS_KSEG0_P(v) && v < (vaddr_t)end) {
+		*handled = true;
+		return 0;
 	}
+
+	/* Otherwise, fall back to the uvm_kernacc() check. */
 #else
 	if (v < MIPS_KSEG0_START) {
 		return EFAULT;



CVS commit: src/sys

2020-06-28 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Jun 28 12:43:00 UTC 2020

Modified Files:
src/sys/arch/arm/ti: omap3_dss.c
src/sys/dev/cadence: if_cemac.c

Log Message:
Use prop_data_value (not prop_data_data_nocopy)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/ti/omap3_dss.c
cvs rdiff -u -r1.22 -r1.23 src/sys/dev/cadence/if_cemac.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/arm/ti/omap3_dss.c
diff -u src/sys/arch/arm/ti/omap3_dss.c:1.1 src/sys/arch/arm/ti/omap3_dss.c:1.2
--- src/sys/arch/arm/ti/omap3_dss.c:1.1	Thu Oct 31 17:08:54 2019
+++ src/sys/arch/arm/ti/omap3_dss.c	Sun Jun 28 12:43:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: omap3_dss.c,v 1.1 2019/10/31 17:08:54 jmcneill Exp $	*/
+/*	$NetBSD: omap3_dss.c,v 1.2 2020/06/28 12:43:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2010 Michael Lorenz
@@ -33,7 +33,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: omap3_dss.c,v 1.1 2019/10/31 17:08:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: omap3_dss.c,v 1.2 2020/06/28 12:43:00 skrll Exp $");
 
 #include 
 #include 
@@ -262,8 +262,7 @@ omapfb_attach(device_t parent, device_t 
 
 		sc->sc_edid_size = uimin(prop_data_size(edid_data), 1024);
 		memset(sc->sc_edid_data, 0, sizeof(sc->sc_edid_data));
-		memcpy(sc->sc_edid_data, prop_data_data_nocopy(edid_data),
-		sc->sc_edid_size);
+		memcpy(sc->sc_edid_data, prop_data_value(edid_data), sc->sc_edid_size);
 
 		edid_parse(sc->sc_edid_data, );
 		edid_print();

Index: src/sys/dev/cadence/if_cemac.c
diff -u src/sys/dev/cadence/if_cemac.c:1.22 src/sys/dev/cadence/if_cemac.c:1.23
--- src/sys/dev/cadence/if_cemac.c:1.22	Wed Jan 29 05:54:29 2020
+++ src/sys/dev/cadence/if_cemac.c	Sun Jun 28 12:43:00 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cemac.c,v 1.22 2020/01/29 05:54:29 thorpej Exp $	*/
+/*	$NetBSD: if_cemac.c,v 1.23 2020/06/28 12:43:00 skrll Exp $	*/
 
 /*
  * Copyright (c) 2015  Genetec Corporation.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.22 2020/01/29 05:54:29 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_cemac.c,v 1.23 2020/06/28 12:43:00 skrll Exp $");
 
 #include 
 #include 
@@ -210,7 +210,7 @@ cemac_attach_common(device_t self, bus_s
 	if (enaddr != NULL) {
 		KASSERT(prop_object_type(enaddr) == PROP_TYPE_DATA);
 		KASSERT(prop_data_size(enaddr) == ETHER_ADDR_LEN);
-		memcpy(sc->sc_enaddr, prop_data_data_nocopy(enaddr),
+		memcpy(sc->sc_enaddr, prop_data_value(enaddr),
 		   ETHER_ADDR_LEN);
 	} else {
 		static const uint8_t hardcoded[ETHER_ADDR_LEN] = {



CVS commit: src/sys/stand/efiboot

2020-06-28 Thread Jared D. McNeill
Module Name:src
Committed By:   jmcneill
Date:   Sun Jun 28 11:39:50 UTC 2020

Modified Files:
src/sys/stand/efiboot: Makefile.efiboot boot.c exec.c version
Removed Files:
src/sys/stand/efiboot: efienv.c efienv.h

Log Message:
Remove support for storing settings in EFI environment variables now that
we have boot.cfg support.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/stand/efiboot/Makefile.efiboot
cvs rdiff -u -r1.26 -r1.27 src/sys/stand/efiboot/boot.c
cvs rdiff -u -r1.6 -r0 src/sys/stand/efiboot/efienv.c
cvs rdiff -u -r1.3 -r0 src/sys/stand/efiboot/efienv.h
cvs rdiff -u -r1.17 -r1.18 src/sys/stand/efiboot/exec.c
cvs rdiff -u -r1.18 -r1.19 src/sys/stand/efiboot/version

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

Modified files:

Index: src/sys/stand/efiboot/Makefile.efiboot
diff -u src/sys/stand/efiboot/Makefile.efiboot:1.16 src/sys/stand/efiboot/Makefile.efiboot:1.17
--- src/sys/stand/efiboot/Makefile.efiboot:1.16	Fri Jun 26 03:23:04 2020
+++ src/sys/stand/efiboot/Makefile.efiboot	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.efiboot,v 1.16 2020/06/26 03:23:04 thorpej Exp $
+# $NetBSD: Makefile.efiboot,v 1.17 2020/06/28 11:39:50 jmcneill Exp $
 
 S=		${.CURDIR}/../../..
 
@@ -23,7 +23,7 @@ AFLAGS.start.S= ${${ACTIVE_CC} == "clang
 SOURCES=	crt0-efi-${GNUEFIARCH}.S reloc_${GNUEFIARCH}.c
 SOURCES+=	boot.c bootmenu.c conf.c console.c dev_net.c devopen.c exec.c \
 		module.c overlay.c panic.c prompt.c
-SOURCES+=	efiboot.c efichar.c efidev.c efienv.c efigetsecs.c efifdt.c \
+SOURCES+=	efiboot.c efichar.c efidev.c efigetsecs.c efifdt.c \
 		efifile.c efiblock.c efinet.c efipxe.c efiacpi.c efirng.c smbios.c
 
 .PATH: ${S}/external/bsd/libfdt/dist

Index: src/sys/stand/efiboot/boot.c
diff -u src/sys/stand/efiboot/boot.c:1.26 src/sys/stand/efiboot/boot.c:1.27
--- src/sys/stand/efiboot/boot.c:1.26	Sat Jun 27 18:52:24 2020
+++ src/sys/stand/efiboot/boot.c	Sun Jun 28 11:39:50 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: boot.c,v 1.26 2020/06/27 18:52:24 jmcneill Exp $	*/
+/*	$NetBSD: boot.c,v 1.27 2020/06/28 11:39:50 jmcneill Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka 
@@ -32,7 +32,6 @@
 #include "efifile.h"
 #include "efifdt.h"
 #include "efiacpi.h"
-#include "efienv.h"
 #include "efirng.h"
 #include "module.h"
 #include "overlay.h"
@@ -101,10 +100,6 @@ void	command_unload(char *);
 void	command_ls(char *);
 void	command_mem(char *);
 void	command_menu(char *);
-void	command_printenv(char *);
-void	command_setenv(char *);
-void	command_clearenv(char *);
-void	command_resetenv(char *);
 void	command_reset(char *);
 void	command_version(char *);
 void	command_quit(char *);
@@ -123,10 +118,6 @@ const struct boot_command commands[] = {
 	{ "ls",		command_ls,		"ls [hdNn:/path]" },
 	{ "mem",	command_mem,		"mem" },
 	{ "menu",	command_menu,		"menu" },
-	{ "printenv",	command_printenv,	"printenv [key]" },
-	{ "setenv",	command_setenv,		"setenv  " },
-	{ "clearenv",	command_clearenv,	"clearenv " },
-	{ "resetenv",	command_resetenv,	"resetenv" },
 	{ "reboot",	command_reset,		"reboot|reset" },
 	{ "reset",	command_reset,		NULL },
 	{ "version",	command_version,	"version" },
@@ -311,53 +302,6 @@ command_menu(char *arg)
 }
 
 void
-command_printenv(char *arg)
-{
-	char *val;
-
-	if (arg && *arg) {
-		val = efi_env_get(arg);
-		if (val) {
-			printf("\"%s\" = \"%s\"\n", arg, val);
-			FreePool(val);
-		}
-	} else {
-		efi_env_print();
-	}
-}
-
-void
-command_setenv(char *arg)
-{
-	char *spc;
-
-	spc = strchr(arg, ' ');
-	if (spc == NULL || spc[1] == '\0') {
-		command_help("");
-		return;
-	}
-
-	*spc = '\0';
-	efi_env_set(arg, spc + 1);
-}
-
-void
-command_clearenv(char *arg)
-{
-	if (*arg == '\0') {
-		command_help("");
-		return;
-	}
-	efi_env_clear(arg);
-}
-
-void
-command_resetenv(char *arg)
-{
-	efi_env_reset();
-}
-
-void
 command_version(char *arg)
 {
 	char pathbuf[80];
@@ -482,74 +426,12 @@ print_banner(void)
 	bootprog_name, bootprog_rev);
 }
 
-static void
-read_env(void)
-{
-	char *s;
-
-	s = efi_env_get("fdtfile");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting DTB path to '%s' from environment\n", s);
-#endif
-		set_dtb_path(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("initrd");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting initrd path to '%s' from environment\n", s);
-#endif
-		set_initrd_path(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("bootfile");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting bootfile path to '%s' from environment\n", s);
-#endif
-		set_bootfile(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("rootdev");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting default device to '%s' from environment\n", s);
-#endif
-		set_default_device(s);
-		FreePool(s);
-	}
-
-	s = efi_env_get("bootargs");
-	if (s) {
-#ifdef EFIBOOT_DEBUG
-		printf(">> Setting default boot args to '%s' from environment\n", s);
-#endif
-		set_bootargs(s);
-		

CVS commit: src/usr.bin/make

2020-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 28 11:06:27 UTC 2020

Modified Files:
src/usr.bin/make: cond.c
src/usr.bin/make/unit-tests: cond-short.exp cond-short.mk

Log Message:
make(1): fix evaluation of unreachable conditions

Since 2015-10-11, make had evaluated unreachable conditions even though
the manual page said it didn't.


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/usr.bin/make/cond.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/cond-short.exp \
src/usr.bin/make/unit-tests/cond-short.mk

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

Modified files:

Index: src/usr.bin/make/cond.c
diff -u src/usr.bin/make/cond.c:1.75 src/usr.bin/make/cond.c:1.76
--- src/usr.bin/make/cond.c:1.75	Sun Apr 16 20:59:04 2017
+++ src/usr.bin/make/cond.c	Sun Jun 28 11:06:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $	*/
+/*	$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $";
 #else
 #include 
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c	8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.75 2017/04/16 20:59:04 riastradh Exp $");
+__RCSID("$NetBSD: cond.c,v 1.76 2020/06/28 11:06:26 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -146,7 +146,7 @@ typedef enum {
  * last two fields are stored in condInvert and condDefProc, respectively.
  */
 static void CondPushBack(Token);
-static int CondGetArg(char **, char **, const char *);
+static int CondGetArg(Boolean, char **, char **, const char *);
 static Boolean CondDoDefined(int, const char *);
 static int CondStrMatch(const void *, const void *);
 static Boolean CondDoMake(int, const char *);
@@ -225,9 +225,6 @@ CondPushBack(Token t)
  * CondGetArg --
  *	Find the argument of a built-in function.
  *
- * Input:
- *	parens		TRUE if arg should be bounded by parens
- *
  * Results:
  *	The length of the argument and the address of the argument.
  *
@@ -238,7 +235,7 @@ CondPushBack(Token t)
  *---
  */
 static int
-CondGetArg(char **linePtr, char **argPtr, const char *func)
+CondGetArg(Boolean doEval, char **linePtr, char **argPtr, const char *func)
 {
 char	  *cp;
 int		  argLen;
@@ -290,7 +287,8 @@ CondGetArg(char **linePtr, char **argPtr
 	int		len;
 	void	*freeIt;
 
-	cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|VARF_WANTRES,
+	cp2 = Var_Parse(cp, VAR_CMD, VARF_UNDEFERR|
+			(doEval ? VARF_WANTRES : 0),
 			, );
 	Buf_AddBytes(, strlen(cp2), cp2);
 	free(freeIt);
@@ -577,7 +575,7 @@ CondGetString(Boolean doEval, Boolean *q
 	/* if we are in quotes, then an undefined variable is ok */
 	str = Var_Parse(condExpr, VAR_CMD,
 			((!qt && doEval) ? VARF_UNDEFERR : 0) |
-			VARF_WANTRES, , freeIt);
+			(doEval ? VARF_WANTRES : 0), , freeIt);
 	if (str == var_Error) {
 		if (*freeIt) {
 		free(*freeIt);
@@ -813,7 +811,7 @@ done:
 }
 
 static int
-get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
+get_mpt_arg(Boolean doEval, char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
 {
 /*
  * Use Var_Parse to parse the spec in parens and return
@@ -827,7 +825,7 @@ get_mpt_arg(char **linePtr, char **argPt
 /* We do all the work here and return the result as the length */
 *argPtr = NULL;
 
-val = Var_Parse(cp - 1, VAR_CMD, VARF_WANTRES, , );
+val = Var_Parse(cp - 1, VAR_CMD, doEval ? VARF_WANTRES : 0, , );
 /*
  * Advance *linePtr to beyond the closing ). Note that
  * we subtract one because 'length' is calculated from 'cp - 1'.
@@ -864,7 +862,7 @@ compare_function(Boolean doEval)
 static const struct fn_def {
 	const char  *fn_name;
 	int fn_name_len;
-int (*fn_getarg)(char **, char **, const char *);
+int (*fn_getarg)(Boolean, char **, char **, const char *);
 	Boolean (*fn_proc)(int, const char *);
 } fn_defs[] = {
 	{ "defined",   7, CondGetArg, CondDoDefined },
@@ -892,7 +890,7 @@ compare_function(Boolean doEval)
 	if (*cp != '(')
 	break;
 
-	arglen = fn_def->fn_getarg(, , fn_def->fn_name);
+	arglen = fn_def->fn_getarg(doEval, , , fn_def->fn_name);
 	if (arglen <= 0) {
 	condExpr = cp;
 	return arglen < 0 ? TOK_ERROR : TOK_FALSE;
@@ -917,7 +915,7 @@ compare_function(Boolean doEval)
  * would be invalid if we did "defined(a)" - so instead treat as an
  * expression.
  */
-arglen = CondGetArg(, , NULL);
+arglen = CondGetArg(doEval, , , NULL);
 for (cp1 = cp; isspace(*(unsigned 

CVS commit: src

2020-06-28 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Sun Jun 28 09:42:41 UTC 2020

Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: cond-short.exp cond-short.mk

Log Message:
make(1): demonstrate bug when evaluating conditions


To generate a diff of this commit:
cvs rdiff -u -r1.861 -r1.862 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.58 -r1.59 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/cond-short.exp \
src/usr.bin/make/unit-tests/cond-short.mk

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.861 src/distrib/sets/lists/tests/mi:1.862
--- src/distrib/sets/lists/tests/mi:1.861	Sat Jun 27 13:53:43 2020
+++ src/distrib/sets/lists/tests/mi	Sun Jun 28 09:42:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.861 2020/06/27 13:53:43 jruoho Exp $
+# $NetBSD: mi,v 1.862 2020/06/28 09:42:40 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4489,6 +4489,8 @@
 ./usr/tests/usr.bin/make/unit-tests/comment.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-late.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond-late.mk	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-short.exp	tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/cond-short.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond1.exp	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond1.mk	tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/cond2.exp	tests-usr.bin-tests	compattestfile,atf

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.58 src/usr.bin/make/unit-tests/Makefile:1.59
--- src/usr.bin/make/unit-tests/Makefile:1.58	Sun May 17 12:36:26 2020
+++ src/usr.bin/make/unit-tests/Makefile	Sun Jun 28 09:42:40 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.58 2020/05/17 12:36:26 rillig Exp $
+# $NetBSD: Makefile,v 1.59 2020/06/28 09:42:40 rillig Exp $
 #
 # Unit tests for make(1)
 # The main targets are:
@@ -23,6 +23,7 @@ UNIT_TESTS:= ${.PARSEDIR}
 TESTNAMES= \
 	comment \
 	cond-late \
+	cond-short \
 	cond1 \
 	cond2 \
 	dollar \

Added files:

Index: src/usr.bin/make/unit-tests/cond-short.exp
diff -u /dev/null src/usr.bin/make/unit-tests/cond-short.exp:1.1
--- /dev/null	Sun Jun 28 09:42:41 2020
+++ src/usr.bin/make/unit-tests/cond-short.exp	Sun Jun 28 09:42:40 2020
@@ -0,0 +1,5 @@
+unexpected and
+expected and
+unexpected or
+expected or
+exit status 0
Index: src/usr.bin/make/unit-tests/cond-short.mk
diff -u /dev/null src/usr.bin/make/unit-tests/cond-short.mk:1.1
--- /dev/null	Sun Jun 28 09:42:41 2020
+++ src/usr.bin/make/unit-tests/cond-short.mk	Sun Jun 28 09:42:40 2020
@@ -0,0 +1,41 @@
+# $NetBSD: cond-short.mk,v 1.1 2020/06/28 09:42:40 rillig Exp $
+#
+# Demonstrates that in conditions, the right-hand side of an && or ||
+# is evaluated even though it cannot influence the result.
+#
+# This is unexpected for several reasons:
+#
+# 1.  The manual page says: "bmake will only evaluate a conditional as
+# far as is necessary to determine its value."
+#
+# 2.  It differs from the way that these operators are evaluated in
+# almost all other programming languages.
+#
+# 3.  In cond.c there are lots of doEval variables.
+#
+
+.if 0 && ${echo "unexpected and" 1>&2 :L:sh}
+.endif
+
+.if 1 && ${echo "expected and" 1>&2 :L:sh}
+.endif
+
+.if 1 || ${echo "unexpected or" 1>&2 :L:sh}
+.endif
+
+.if 0 || ${echo "expected or" 1>&2 :L:sh}
+.endif
+
+# The following paragraphs demonstrate the workaround.
+
+.if 0
+.  if ${echo "unexpected nested and" 1>&2 :L:sh}
+.  endif
+.endif
+
+.if 1
+.elif ${echo "unexpected nested or" 1>&2 :L:sh}
+.endif
+
+all:
+	@:;: