Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mmeye Use dev/ic/com.c.



details:   https://anonhg.NetBSD.org/src/rev/1d1ad9845658
branches:  trunk
changeset: 485162:1d1ad9845658
user:      tsubai <tsubai%NetBSD.org@localhost>
date:      Fri Apr 21 07:12:53 2000 +0000

description:
Use dev/ic/com.c.

diffstat:

 sys/arch/mmeye/conf/files.shbus |    17 +-
 sys/arch/mmeye/mmeye/com.c      |  2365 ---------------------------------------
 2 files changed, 8 insertions(+), 2374 deletions(-)

diffs (truncated from 2419 to 300 lines):

diff -r 764e40934f64 -r 1d1ad9845658 sys/arch/mmeye/conf/files.shbus
--- a/sys/arch/mmeye/conf/files.shbus   Fri Apr 21 02:49:37 2000 +0000
+++ b/sys/arch/mmeye/conf/files.shbus   Fri Apr 21 07:12:53 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.shbus,v 1.4 2000/02/24 17:07:35 msaitoh Exp $
+#      $NetBSD: files.shbus,v 1.5 2000/04/21 07:12:54 tsubai Exp $
 #
 # Config file and device description for machine-independent ISA code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -13,25 +13,24 @@
             [irq = -1], [drq = -1], [drq2 = -1]}
 attach shb at mainbus
 
-file arch/mmeye/mmeye/shb.c            shb needs-flag
+file   arch/mmeye/mmeye/shb.c                  shb needs-flag
 
 # Misc devices
 
 device wdog
 attach wdog at shb
-file   arch/sh3/dev/wdog.c             wdog    needs-flag
+file   arch/sh3/dev/wdog.c                     wdog needs-flag
 
 #
-# Serial and parallel drivers
+# Serial drivers
 #
-attach com at shb with com_sh
-file arch/mmeye/mmeye/com.c            com needs-flag
-file arch/mmeye/mmeye/com_sh.c         com_sh
+attach com at shb with com_sh
+file   arch/mmeye/mmeye/com_sh.c               com_sh
 
 # never enable this entry
 #device        sci
 #attach        sci at shb
-#file  arch/sh3/dev/sci.c              sci needs-flag
+#file  arch/sh3/dev/sci.c                      sci needs-flag
 
 # XXXX pcic here because it needs to be late.  The catch: pcic needs
 # to be late, so devices which attach to it are attached late.  But it
@@ -51,7 +50,7 @@
 
 # PCIC pcmcia contoller
 attach shpcic at shb with pcic_shb
-file   arch/sh3/dev/pcic_shb.c         pcic_shb
+file   arch/sh3/dev/pcic_shb.c                 pcic_shb
 file   arch/sh3/dev/pcic_shbsubr.c             pcic_shb
 
 # this wants to be probed as late as possible.
diff -r 764e40934f64 -r 1d1ad9845658 sys/arch/mmeye/mmeye/com.c
--- a/sys/arch/mmeye/mmeye/com.c        Fri Apr 21 02:49:37 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,2365 +0,0 @@
-/*     $NetBSD: com.c,v 1.4 2000/03/23 06:41:07 thorpej Exp $  */
-
-/*-
- * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Charles M. Hannum.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *        This product includes software developed by the NetBSD
- *        Foundation, Inc. and its contributors.
- * 4. Neither the name of The NetBSD Foundation nor the names of its
- *    contributors may be used to endorse or promote products derived
- *    from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
- */
-
-/*
- * Copyright (c) 1991 The Regents of the University of California.
- * All rights reserved.
- *
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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.
- *
- *     @(#)com.c       7.5 (Berkeley) 5/16/91
- */
-
-/*
- * COM driver, uses National Semiconductor NS16450/NS16550AF UART
- * Supports automatic hardware flow control on StarTech ST16C650A UART
- */
-
-#include "opt_ddb.h"
-#include "opt_com.h"
-
-#include "rnd.h"
-#if NRND > 0 && defined(RND_COM)
-#include <sys/rnd.h>
-#endif
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/select.h>
-#include <sys/tty.h>
-#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/conf.h>
-#include <sys/file.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/types.h>
-#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/timepps.h>
-#include <sys/vnode.h>
-
-#include <machine/intr.h>
-#include <machine/bus.h>
-
-#include <dev/ic/comreg.h>
-#include <dev/ic/comvar.h>
-#include <dev/ic/ns16550reg.h>
-#include <dev/ic/st16650reg.h>
-#ifdef COM_HAYESP
-#include <dev/ic/hayespreg.h>
-#endif
-#define        com_lcr com_cfcr
-#include <dev/cons.h>
-
-#include "com.h"
-
-#ifdef COM_HAYESP
-int comprobeHAYESP __P((bus_space_handle_t hayespioh, struct com_softc *sc));
-#endif
-
-#if defined(DDB) || defined(KGDB)
-static void com_enable_debugport __P((struct com_softc *));
-#endif
-void   com_attach_subr __P((struct com_softc *sc));
-void   com_config      __P((struct com_softc *));
-void   com_shutdown    __P((struct com_softc *));
-int    comspeed        __P((long, long));
-static u_char  cflag2lcr __P((tcflag_t));
-int    comparam        __P((struct tty *, struct termios *));
-void   comstart        __P((struct tty *));
-void   comstop         __P((struct tty *, int));
-int    comhwiflow      __P((struct tty *, int));
-
-void   com_loadchannelregs __P((struct com_softc *));
-void   com_hwiflow     __P((struct com_softc *));
-void   com_break       __P((struct com_softc *, int));
-void   com_modem       __P((struct com_softc *, int));
-void   tiocm_to_com    __P((struct com_softc *, int, int));
-int    com_to_tiocm    __P((struct com_softc *));
-void   com_iflush      __P((struct com_softc *));
-
-int    com_common_getc __P((bus_space_tag_t, bus_space_handle_t));
-void   com_common_putc __P((bus_space_tag_t, bus_space_handle_t, int));
-
-/* XXX: These belong elsewhere */
-cdev_decl(com);
-bdev_decl(com);
-
-int    comcngetc       __P((dev_t));
-void   comcnputc       __P((dev_t, int));
-void   comcnpollc      __P((dev_t, int));
-
-#define        integrate       static inline
-#ifdef __GENERIC_SOFT_INTERRUPTS
-void   comsoft         __P((void *));
-#else
-#ifndef __NO_SOFT_SERIAL_INTERRUPT
-void   comsoft         __P((void));
-#else
-void   comsoft         __P((void *));
-struct callout comsoft_callout = CALLOUT_INITIALIZER;
-#endif
-#endif
-integrate void com_rxsoft      __P((struct com_softc *, struct tty *));
-integrate void com_txsoft      __P((struct com_softc *, struct tty *));
-integrate void com_stsoft      __P((struct com_softc *, struct tty *));
-integrate void com_schedrx     __P((struct com_softc *));
-void   comdiag         __P((void *));
-
-extern struct cfdriver com_cd;
-
-/*
- * Make this an option variable one can patch.
- * But be warned:  this must be a power of 2!
- */
-u_int com_rbuf_size = COM_RING_SIZE;
-
-/* Stop input when 3/4 of the ring is full; restart when only 1/4 is full. */
-u_int com_rbuf_hiwat = (COM_RING_SIZE * 1) / 4;
-u_int com_rbuf_lowat = (COM_RING_SIZE * 3) / 4;
-
-static int     comconsaddr;
-static bus_space_tag_t comconstag;
-static bus_space_handle_t comconsioh;
-static int     comconsattached;
-static int comconsrate;
-static tcflag_t comconscflag;
-
-static int ppscap =
-       PPS_TSFMT_TSPEC |
-       PPS_CAPTUREASSERT |
-       PPS_CAPTURECLEAR |
-#ifdef  PPS_SYNC 
-       PPS_HARDPPSONASSERT | PPS_HARDPPSONCLEAR |
-#endif /* PPS_SYNC */
-       PPS_OFFSETASSERT | PPS_OFFSETCLEAR;
-
-#ifndef __GENERIC_SOFT_INTERRUPTS
-#ifdef __NO_SOFT_SERIAL_INTERRUPT
-volatile int   com_softintr_scheduled;
-#endif
-#endif
-
-#ifdef KGDB
-#include <sys/kgdb.h>
-
-static int com_kgdb_addr;
-static bus_space_tag_t com_kgdb_iot;
-static bus_space_handle_t com_kgdb_ioh;
-static int com_kgdb_attached;
-
-int    com_kgdb_getc __P((void *));
-void   com_kgdb_putc __P((void *, int));
-#endif /* KGDB */
-
-#define        COMUNIT_MASK    0x7ffff
-#define        COMDIALOUT_MASK 0x80000
-
-#define        COMUNIT(x)      (minor(x) & COMUNIT_MASK)
-#define        COMDIALOUT(x)   (minor(x) & COMDIALOUT_MASK)
-
-#define        COM_ISALIVE(sc) ((sc)->enabled != 0 && \
-                        ISSET((sc)->sc_dev.dv_flags, DVF_ACTIVE))
-
-#define        BR      BUS_SPACE_BARRIER_READ
-#define        BW      BUS_SPACE_BARRIER_WRITE
-#define COM_BARRIER(t, h, f) bus_space_barrier((t), (h), 0, COM_NPORTS, (f))
-
-int
-comspeed(speed, frequency)
-       long speed, frequency;
-{
-#define        divrnd(n, q)    (((n)*2/(q)+1)/2)       /* divide and round off */
-
-       int x, err;
-
-#if 0
-       if (speed == 0)
-               return (0);
-#endif
-       if (speed <= 0)
-               return (-1);
-       x = divrnd(frequency / 16, speed);



Home | Main Index | Thread Index | Old Index