Subject: Re: Changing /dev/zero minor for ARM
To: Jaromir Dolecek <jdolecek@netbsd.org>
From: Chris Gilbert <chris@dokein.co.uk>
List: port-arm
Date: 10/11/2003 20:18:05
Why?  Is there a reason for the change (yes I know it's strange, but
then so are some of the arm ports major's as well.)

Shouln't the diff also check these defines:
COMPAT_15 COMPAT_14 COMPAT_13 COMPAT_12 
bearing in mind that acorn32 is actually older than most people expect.

Also I assume you'd do the MAKEDEV changes for all the arm based archs?

Chris

On Sat, 11 Oct 2003 14:58:21 +0200 (CEST)
Jaromir Dolecek <jdolecek@netbsd.org> wrote:

> I'd like to get rid of ARM having different /dev/zero minor number
> than all other archs. Anyone sees a problem with this change?
> The MAKEDEVs for ARM ports would need to be adjusted to create
> /dev/zero with minor 12 too, of course.
> 
> Jaromir
> 
> Index: sys/conf.h
> ===================================================================
> RCS file: /cvsroot/src/sys/sys/conf.h,v
> retrieving revision 1.112
> diff -u -p -r1.112 conf.h
> --- sys/conf.h	7 Aug 2003 16:34:00 -0000	1.112
> +++ sys/conf.h	11 Oct 2003 12:54:02 -0000
> @@ -199,11 +199,8 @@ extern struct swdevt swdevt[];
>  #define	DEV_MEM		0	/* minor device 0 is physical memory */
>  #define	DEV_KMEM	1	/* minor device 1 is kernel memory */
>  #define DEV_NULL	2	/* minor device 2 is EOF/rathole */
> -#ifdef __arm__			/* XXX: FIX ME ARM! */
> -#define DEV_ZERO	3	/* minor device 3 is '\0'/rathole */
> -#else
> +#define _DEV_ZERO_oARM	3	/* reserved: old /dev/zero for __arm__ */
>  #define DEV_ZERO	12	/* minor device 12 is '\0'/rathole */
> -#endif
>  
>  #endif /* _KERNEL */
>  
> Index: arch/arm/arm32/mem.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/arm/arm32/mem.c,v
> retrieving revision 1.10
> diff -u -p -r1.10 mem.c
> --- arch/arm/arm32/mem.c	7 Aug 2003 16:26:52 -0000	1.10
> +++ arch/arm/arm32/mem.c	11 Oct 2003 12:54:02 -0000
> @@ -72,6 +72,8 @@
>   * Memory special file
>   */
>  
> +#include "opt_compat_netbsd.h"
> +
>  #include <sys/cdefs.h>
>  __KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.10 2003/08/07 16:26:52 agc Exp
>  $");
>  
> @@ -165,6 +167,9 @@ mmrw(dev, uio, flags)
>  				uio->uio_resid = 0;
>  			return (0);
>  
> +#ifdef COMPAT_16
> +		case _DEV_ZERO_oARM:
> +#endif
>  		case DEV_ZERO:
>  			if (uio->uio_rw == UIO_WRITE) {
>  				uio->uio_resid = 0;
> Index: arch/acorn26/acorn26/mem.c
> ===================================================================
> RCS file: /cvsroot/src/sys/arch/acorn26/acorn26/mem.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 mem.c
> --- arch/acorn26/acorn26/mem.c	7 Aug 2003 16:26:28 -0000	1.6
> +++ arch/acorn26/acorn26/mem.c	11 Oct 2003 12:54:02 -0000
> @@ -72,6 +72,8 @@
>   * Memory special file
>   */
>  
> +#include "opt_compat_netbsd.h"
> +
>  #include <sys/cdefs.h>
>  __KERNEL_RCSID(0, "$NetBSD: mem.c,v 1.6 2003/08/07 16:26:28 agc Exp
>  $");
>  
> @@ -161,6 +163,9 @@ mmrw(dev, uio, flags)
>  				uio->uio_resid = 0;
>  			return (0);
>  
> +#ifdef COMPAT_16
> +		case _DEV_ZERO_oARM:
> +#endif
>  		case DEV_ZERO:
>  			if (uio->uio_rw == UIO_WRITE) {
>  				uio->uio_resid = 0;
> -- 
> Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.cz/
> -=- We should be mindful of the potential goal, but as the tantric   
> -=--=- Buddhist masters say, ``You may notice during meditation that
> you -=--=- sometimes levitate or glow.   Do not let this distract
> you.''     -=-