Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch centralize the call unit / dialout macros



details:   https://anonhg.NetBSD.org/src/rev/af582ac83bc0
branches:  trunk
changeset: 803894:af582ac83bc0
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Nov 15 19:20:01 2014 +0000

description:
centralize the call unit / dialout macros

diffstat:

 sys/arch/arm/at91/at91dbgu.c        |  13 +++++--------
 sys/arch/arm/at91/at91usart.c       |  13 +++++--------
 sys/arch/arm/clps711x/clpscom.c     |  11 ++++-------
 sys/arch/arm/ep93xx/epcom.c         |  11 ++++-------
 sys/arch/arm/imx/imxuart.c          |  13 ++++++-------
 sys/arch/arm/ixp12x0/ixp12x0_com.c  |  11 ++++-------
 sys/arch/arm/sa11x0/sa11x0_com.c    |  11 +++++------
 sys/arch/atari/dev/ser.c            |   8 ++++----
 sys/arch/atari/dev/zsvar.h          |   8 ++++----
 sys/arch/epoc32/windermere/wmcom.c  |  11 ++++-------
 sys/arch/evbarm/dev/plcom.c         |  11 +++++------
 sys/arch/hp300/dev/dcm.c            |   8 ++++----
 sys/arch/hpcmips/tx/txcom.c         |   6 +++---
 sys/arch/mips/sibyte/dev/sbjcnvar.h |   8 ++++----
 sys/arch/mips/sibyte/dev/sbscnvar.h |   8 ++++----
 sys/arch/sh3/dev/sci.c              |  11 ++++-------
 sys/arch/sh3/dev/scif.c             |  11 ++++-------
 sys/arch/sparc64/dev/sab.c          |   8 ++++----
 18 files changed, 77 insertions(+), 104 deletions(-)

diffs (truncated from 537 to 300 lines):

diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/at91/at91dbgu.c
--- a/sys/arch/arm/at91/at91dbgu.c      Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/at91/at91dbgu.c      Sat Nov 15 19:20:01 2014 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $    */
-/*     $NetBSD: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $ */
+/*     $Id: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $       */
+/*     $NetBSD: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $ */
 
 /*
  *
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.12 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91dbgu.c,v 1.13 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -205,11 +205,8 @@
 #define DEFAULT_COMSPEED 115200
 #endif
 
-#define COMUNIT_MASK    0x7ffff
-#define COMDIALOUT_MASK 0x80000
-
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define COM_ISALIVE(sc)        ((sc)->enabled != 0 && device_is_active((sc)->sc_dev))
 
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/at91/at91usart.c
--- a/sys/arch/arm/at91/at91usart.c     Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/at91/at91usart.c     Sat Nov 15 19:20:01 2014 +0000
@@ -1,5 +1,5 @@
-/*     $Id: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $   */
-/*     $NetBSD: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $ */
+/*     $Id: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $      */
+/*     $NetBSD: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $ */
 
 /*
  * Copyright (c) 2007 Embedtronics Oy. All rights reserved.
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.11 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: at91usart.c,v 1.12 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -210,11 +210,8 @@
 #define DEFAULT_COMSPEED 115200
 #endif
 
-#define COMUNIT_MASK    0x7ffff
-#define COMDIALOUT_MASK 0x80000
-
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define COM_ISALIVE(sc)        ((sc)->enabled != 0 && device_is_active((sc)->sc_dev))
 
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/clps711x/clpscom.c
--- a/sys/arch/arm/clps711x/clpscom.c   Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/clps711x/clpscom.c   Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: clpscom.c,v 1.4 2014/08/10 16:44:33 tls Exp $      */
+/*      $NetBSD: clpscom.c,v 1.5 2014/11/15 19:20:01 christos Exp $      */
 /*
  * Copyright (c) 2013 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: clpscom.c,v 1.5 2014/11/15 19:20:01 christos Exp $");
 
 #include "rnd.h"
 
@@ -56,11 +56,8 @@
 #include "ioconf.h"
 #include "locators.h"
 
-#define COMUNIT_MASK   0x7ffff
-#define COMDIALOUT_MASK        0x80000
-
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define CLPSCOM_RING_SIZE      2048
 #define UART_FIFO_SIZE         16
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/ep93xx/epcom.c
--- a/sys/arch/arm/ep93xx/epcom.c       Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/ep93xx/epcom.c       Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: epcom.c,v 1.28 2014/08/10 16:44:33 tls Exp $ */
+/*     $NetBSD: epcom.c,v 1.29 2014/11/15 19:20:01 christos Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002, 2004 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -73,7 +73,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.28 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: epcom.c,v 1.29 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -185,11 +185,8 @@
 #define DEFAULT_COMSPEED 115200
 #endif
 
-#define COMUNIT_MASK    0x7ffff
-#define COMDIALOUT_MASK 0x80000
-
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define COM_ISALIVE(sc)        ((sc)->enabled != 0 && \
                        device_is_active((sc)->sc_dev))
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/imx/imxuart.c
--- a/sys/arch/arm/imx/imxuart.c        Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/imx/imxuart.c        Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: imxuart.c,v 1.15 2014/09/25 05:05:28 ryo Exp $ */
+/* $NetBSD: imxuart.c,v 1.16 2014/11/15 19:20:01 christos Exp $ */
 
 /*
  * Copyright (c) 2009, 2010  Genetec Corporation.  All rights reserved.
@@ -96,7 +96,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.15 2014/09/25 05:05:28 ryo Exp $");
+__KERNEL_RCSID(0, "$NetBSD: imxuart.c,v 1.16 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_imxuart.h"
 #include "opt_ddb.h"
@@ -382,11 +382,10 @@
 void   imxuart_kgdb_putc(void *, int);
 #endif /* KGDB */
 
-#define        IMXUART_UNIT_MASK       0x7ffff
-#define        IMXUART_DIALOUT_MASK    0x80000
-
-#define        IMXUART_UNIT(x) (minor(x) & IMXUART_UNIT_MASK)
-#define        IMXUART_DIALOUT(x)      (minor(x) & IMXUART_DIALOUT_MASK)
+#define        IMXUART_DIALOUT_MASK    TTDIALOUT_MASK
+
+#define        IMXUART_UNIT(x)         TTUNIT(x)
+#define        IMXUART_DIALOUT(x)      TTDIALOUT(x)
 
 #define        IMXUART_ISALIVE(sc)     ((sc)->enabled != 0 && \
                         device_is_active((sc)->sc_dev))
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/ixp12x0/ixp12x0_com.c
--- a/sys/arch/arm/ixp12x0/ixp12x0_com.c        Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/ixp12x0/ixp12x0_com.c        Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ixp12x0_com.c,v 1.45 2014/08/10 16:44:33 tls Exp $ */
+/*     $NetBSD: ixp12x0_com.c,v 1.46 2014/11/15 19:20:01 christos Exp $ */
 /*
  * Copyright (c) 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.45 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixp12x0_com.c,v 1.46 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -174,11 +174,8 @@
 #define DEFAULT_COMSPEED 38400
 #endif
 
-#define COMUNIT_MASK    0x7ffff
-#define COMDIALOUT_MASK 0x80000
-
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define COM_ISALIVE(sc)        ((sc)->enabled != 0 && \
                         device_is_active((sc)->sc_dev))
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/arm/sa11x0/sa11x0_com.c
--- a/sys/arch/arm/sa11x0/sa11x0_com.c  Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/arm/sa11x0/sa11x0_com.c  Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: sa11x0_com.c,v 1.53 2014/08/10 16:44:33 tls Exp $        */
+/*      $NetBSD: sa11x0_com.c,v 1.54 2014/11/15 19:20:01 christos Exp $        */
 
 /*-
  * Copyright (c) 1998, 1999, 2001 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.53 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sa11x0_com.c,v 1.54 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_com.h"
 #include "opt_ddb.h"
@@ -172,11 +172,10 @@
 static void    sacom_j720_init(device_t, device_t);
 #endif
 
-#define COMUNIT_MASK   0x7ffff
-#define COMDIALOUT_MASK        0x80000
+#define COMDIALOUT_MASK        TTDIALOUT_MASK
 
-#define COMUNIT(x)     (minor(x) & COMUNIT_MASK)
-#define COMDIALOUT(x)  (minor(x) & COMDIALOUT_MASK)
+#define COMUNIT(x)     TTUNIT(x)
+#define COMDIALOUT(x)  TTDIALOUT(x)
 
 #define COM_ISALIVE(sc)        ((sc)->enabled != 0 && \
                         device_is_active((sc)->sc_dev))
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/atari/dev/ser.c
--- a/sys/arch/atari/dev/ser.c  Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/atari/dev/ser.c  Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ser.c,v 1.55 2014/07/25 08:10:32 dholland Exp $        */
+/*     $NetBSD: ser.c,v 1.56 2014/11/15 19:20:01 christos Exp $        */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -93,7 +93,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.55 2014/07/25 08:10:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ser.c,v 1.56 2014/11/15 19:20:01 christos Exp $");
 
 #include "opt_ddb.h"
 #include "opt_mbtype.h"
@@ -144,8 +144,8 @@
 
 /* #define SER_DEBUG */
 
-#define        SERUNIT(x)      (minor(x) & 0x7ffff)
-#define        SERDIALOUT(x)   (minor(x) & 0x80000)
+#define        SERUNIT(x)      TTUNIT(x)
+#define        SERDIALOUT(x)   TTDIALOUT(x)
 
 /* XXX */
 #define        CONSBAUD        9600
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/atari/dev/zsvar.h
--- a/sys/arch/atari/dev/zsvar.h        Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/atari/dev/zsvar.h        Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: zsvar.h,v 1.16 2010/04/09 17:38:43 tsutsui Exp $       */
+/*     $NetBSD: zsvar.h,v 1.17 2014/11/15 19:20:01 christos Exp $      */
 
 /*
  * Copyright (c) 1992, 1993
@@ -179,6 +179,6 @@
 /*
  * Split minor into unit, dialin/dialout & flag nibble.
  */
-#define        ZS_UNIT(dev)            ((minor(dev) >> 4) & 0xf) 
-#define        ZS_FLAGS(dev)           (minor(dev) & 0xf) 
-#define        ZS_DIALOUT(dev)         (minor(dev) & 0x80000)
+#define        ZS_UNIT(dev)            (TTUNIT(dev) >> 4) 
+#define        ZS_FLAGS(dev)           (TTUNIT(dev) & 0xf) 
+#define        ZS_DIALOUT(dev)         TTDIALOUT(dev)
diff -r faddf1ee3ad0 -r af582ac83bc0 sys/arch/epoc32/windermere/wmcom.c
--- a/sys/arch/epoc32/windermere/wmcom.c        Sat Nov 15 19:18:18 2014 +0000
+++ b/sys/arch/epoc32/windermere/wmcom.c        Sat Nov 15 19:20:01 2014 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: wmcom.c,v 1.4 2014/08/10 16:44:33 tls Exp $      */
+/*      $NetBSD: wmcom.c,v 1.5 2014/11/15 19:20:01 christos Exp $      */
 /*
  * Copyright (c) 2012 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.4 2014/08/10 16:44:33 tls Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wmcom.c,v 1.5 2014/11/15 19:20:01 christos Exp $");
 
 #include "rnd.h"
 
@@ -56,11 +56,8 @@
 #include "ioconf.h"
 #include "locators.h"



Home | Main Index | Thread Index | Old Index