From ee3b242bb28a761d7211bb44dba49ced2daa4b48 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 13 Jun 1998 16:03:57 +0000 Subject: Initial incarnation of libchip compiles. --- c/src/lib/libchip/serial/Makefile.in | 10 ++--- c/src/lib/libchip/serial/ns16550.c | 3 +- c/src/lib/libchip/serial/serial.h | 78 ++++++++++++++++++++++++++++++++++++ c/src/lib/libchip/serial/z85c30.c | 2 +- c/src/libchip/serial/Makefile.in | 10 ++--- c/src/libchip/serial/ns16550.c | 3 +- c/src/libchip/serial/serial.h | 78 ++++++++++++++++++++++++++++++++++++ c/src/libchip/serial/z85c30.c | 2 +- 8 files changed, 168 insertions(+), 18 deletions(-) create mode 100644 c/src/lib/libchip/serial/serial.h create mode 100644 c/src/libchip/serial/serial.h (limited to 'c/src') diff --git a/c/src/lib/libchip/serial/Makefile.in b/c/src/lib/libchip/serial/Makefile.in index 0cc8924ea6..079da2d27b 100644 --- a/c/src/lib/libchip/serial/Makefile.in +++ b/c/src/lib/libchip/serial/Makefile.in @@ -15,12 +15,8 @@ C_PIECES=ns16550 z85c30 C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) -H_FILES=$(srcdir)/libcsupport.h -SYS_H_FILES= -RTEMS_H_FILES=$(srcdir)/libio.h -PRIVATE_H_FILES=$(srcdir)/internal.h - -INSTALLED_H_FILES=$(srcdir)/ns16550.h $(srcdir)/z8530.h +INSTALLED_H_FILES=$(srcdir)/ns16550.h $(srcdir)/z85c30.h \ + $(srcdir)/serial.h SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES) OBJS=$(C_O_FILES) @@ -54,6 +50,6 @@ $(LIB): $(SRCS) ${OBJS} # Install the library, appending _g or _p as appropriate. # for include files, just use $(INSTALL) preinstall: - $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)/libchip + $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip diff --git a/c/src/lib/libchip/serial/ns16550.c b/c/src/lib/libchip/serial/ns16550.c index dff820bb70..2edd685aaf 100644 --- a/c/src/lib/libchip/serial/ns16550.c +++ b/c/src/lib/libchip/serial/ns16550.c @@ -20,8 +20,9 @@ #include #include #include +#include -#include "console.h" +#include #include "ns16550_p.h" /* diff --git a/c/src/lib/libchip/serial/serial.h b/c/src/lib/libchip/serial/serial.h new file mode 100644 index 0000000000..b1cedae080 --- /dev/null +++ b/c/src/lib/libchip/serial/serial.h @@ -0,0 +1,78 @@ +/* + * This file contains the TTY driver table definition + * + * This driver uses the termios pseudo driver. + * + * COPYRIGHT (c) 1998 by Radstone Technology + * + * + * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK + * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. + * + * You are hereby granted permission to use, copy, modify, and distribute + * this file, provided that this notice, plus the above copyright notice + * and disclaimer, appears in all copies. Radstone Technology will provide + * no support for this code. + * + * $Id$ + */ + +#ifndef __LIBCHIP_SERIAL_h +#define __LIBCHIP_SERIAL_h + +#include + +typedef struct _console_fns { + boolean (*deviceProbe)(int minor); + int (*deviceFirstOpen)(int major, int minor, void *arg); + int (*deviceLastClose)(int major, int minor, void *arg); + int (*deviceRead)(int minor); + int (*deviceWrite)(int minor, const char *buf, int len); + void (*deviceInitialize)(int minor); + void (*deviceWritePolled)(int minor, char cChar); + int deviceOutputUsesInterrupts; +} console_fns; + +typedef struct _console_flow { + int (*deviceStopRemoteTx)(int minor); + int (*deviceStartRemoteTx)(int minor); +} console_flow; + +typedef struct _console_tbl { + char *sDeviceName; + console_fns *pDeviceFns; + boolean (*deviceProbe)(int minor); + console_flow *pDeviceFlow; + unsigned32 ulMargin; + unsigned32 ulHysteresis; + void *pDeviceParams; + unsigned32 ulCtrlPort1; + unsigned32 ulCtrlPort2; + unsigned32 ulDataPort; + unsigned8 (*getRegister)(unsigned32 port, unsigned8 register); + void (*setRegister)( + unsigned32 port, unsigned8 reg, unsigned8 value); + unsigned8 (*getData)(unsigned32 port); + void (*setData)(unsigned32 port, unsigned8 value); + unsigned32 ulClock; + unsigned int ulIntVector; +} console_tbl; + +typedef struct _console_data { + void *termios_data; + volatile boolean bActive; + volatile Ring_buffer_t TxBuffer; + /* + * This field may be used for any purpose required by the driver + */ + void *pDeviceContext; +} console_data; + +extern console_tbl Console_Port_Tbl[]; +extern console_data Console_Port_Data[]; +extern unsigned long Console_Port_Count; + +#endif +/* end of include file */ diff --git a/c/src/lib/libchip/serial/z85c30.c b/c/src/lib/libchip/serial/z85c30.c index 9fc629938a..f4bf9bc4ee 100644 --- a/c/src/lib/libchip/serial/z85c30.c +++ b/c/src/lib/libchip/serial/z85c30.c @@ -30,7 +30,7 @@ #include #include -#include "console.h" +#include #include "z85c30_p.h" /* diff --git a/c/src/libchip/serial/Makefile.in b/c/src/libchip/serial/Makefile.in index 0cc8924ea6..079da2d27b 100644 --- a/c/src/libchip/serial/Makefile.in +++ b/c/src/libchip/serial/Makefile.in @@ -15,12 +15,8 @@ C_PIECES=ns16550 z85c30 C_FILES=$(C_PIECES:%=%.c) C_O_FILES=$(C_PIECES:%=${ARCH}/%.o) -H_FILES=$(srcdir)/libcsupport.h -SYS_H_FILES= -RTEMS_H_FILES=$(srcdir)/libio.h -PRIVATE_H_FILES=$(srcdir)/internal.h - -INSTALLED_H_FILES=$(srcdir)/ns16550.h $(srcdir)/z8530.h +INSTALLED_H_FILES=$(srcdir)/ns16550.h $(srcdir)/z85c30.h \ + $(srcdir)/serial.h SRCS=$(C_FILES) $(H_FILES) $(SYS_H_FILES) $(RTEMS_H_FILES) $(PRIVATE_H_FILES) OBJS=$(C_O_FILES) @@ -54,6 +50,6 @@ $(LIB): $(SRCS) ${OBJS} # Install the library, appending _g or _p as appropriate. # for include files, just use $(INSTALL) preinstall: - $(INSTALL) -m 444 $(H_FILES) $(PROJECT_INCLUDE)/libchip + $(INSTALL) -m 444 $(INSTALLED_H_FILES) $(PROJECT_INCLUDE)/libchip diff --git a/c/src/libchip/serial/ns16550.c b/c/src/libchip/serial/ns16550.c index dff820bb70..2edd685aaf 100644 --- a/c/src/libchip/serial/ns16550.c +++ b/c/src/libchip/serial/ns16550.c @@ -20,8 +20,9 @@ #include #include #include +#include -#include "console.h" +#include #include "ns16550_p.h" /* diff --git a/c/src/libchip/serial/serial.h b/c/src/libchip/serial/serial.h new file mode 100644 index 0000000000..b1cedae080 --- /dev/null +++ b/c/src/libchip/serial/serial.h @@ -0,0 +1,78 @@ +/* + * This file contains the TTY driver table definition + * + * This driver uses the termios pseudo driver. + * + * COPYRIGHT (c) 1998 by Radstone Technology + * + * + * THIS FILE IS PROVIDED TO YOU, THE USER, "AS IS", WITHOUT WARRANTY OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK + * AS TO THE QUALITY AND PERFORMANCE OF ALL CODE IN THIS FILE IS WITH YOU. + * + * You are hereby granted permission to use, copy, modify, and distribute + * this file, provided that this notice, plus the above copyright notice + * and disclaimer, appears in all copies. Radstone Technology will provide + * no support for this code. + * + * $Id$ + */ + +#ifndef __LIBCHIP_SERIAL_h +#define __LIBCHIP_SERIAL_h + +#include + +typedef struct _console_fns { + boolean (*deviceProbe)(int minor); + int (*deviceFirstOpen)(int major, int minor, void *arg); + int (*deviceLastClose)(int major, int minor, void *arg); + int (*deviceRead)(int minor); + int (*deviceWrite)(int minor, const char *buf, int len); + void (*deviceInitialize)(int minor); + void (*deviceWritePolled)(int minor, char cChar); + int deviceOutputUsesInterrupts; +} console_fns; + +typedef struct _console_flow { + int (*deviceStopRemoteTx)(int minor); + int (*deviceStartRemoteTx)(int minor); +} console_flow; + +typedef struct _console_tbl { + char *sDeviceName; + console_fns *pDeviceFns; + boolean (*deviceProbe)(int minor); + console_flow *pDeviceFlow; + unsigned32 ulMargin; + unsigned32 ulHysteresis; + void *pDeviceParams; + unsigned32 ulCtrlPort1; + unsigned32 ulCtrlPort2; + unsigned32 ulDataPort; + unsigned8 (*getRegister)(unsigned32 port, unsigned8 register); + void (*setRegister)( + unsigned32 port, unsigned8 reg, unsigned8 value); + unsigned8 (*getData)(unsigned32 port); + void (*setData)(unsigned32 port, unsigned8 value); + unsigned32 ulClock; + unsigned int ulIntVector; +} console_tbl; + +typedef struct _console_data { + void *termios_data; + volatile boolean bActive; + volatile Ring_buffer_t TxBuffer; + /* + * This field may be used for any purpose required by the driver + */ + void *pDeviceContext; +} console_data; + +extern console_tbl Console_Port_Tbl[]; +extern console_data Console_Port_Data[]; +extern unsigned long Console_Port_Count; + +#endif +/* end of include file */ diff --git a/c/src/libchip/serial/z85c30.c b/c/src/libchip/serial/z85c30.c index 9fc629938a..f4bf9bc4ee 100644 --- a/c/src/libchip/serial/z85c30.c +++ b/c/src/libchip/serial/z85c30.c @@ -30,7 +30,7 @@ #include #include -#include "console.h" +#include #include "z85c30_p.h" /* -- cgit v1.2.3