z80pack: clean up common devtty between versions
authorAlan Cox <alan@etchedpixels.co.uk>
Sun, 23 Nov 2014 13:56:52 +0000 (13:56 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sun, 23 Nov 2014 13:56:52 +0000 (13:56 +0000)
Kernel/dev/z80pack/devtty.c [moved from Kernel/platform-micropack/devtty.c with 100% similarity]
Kernel/dev/z80pack/devtty.h [moved from Kernel/platform-micropack/devtty.h with 100% similarity]
Kernel/platform-micropack/Makefile
Kernel/platform-z80pack-lite/Makefile
Kernel/platform-z80pack-lite/devtty.c [deleted file]
Kernel/platform-z80pack-lite/devtty.h [deleted file]
Kernel/platform-z80pack/Makefile
Kernel/platform-z80pack/devtty.c [deleted file]
Kernel/platform-z80pack/devtty.h [deleted file]

index 7e90a54..c574e2d 100644 (file)
@@ -1,5 +1,5 @@
 
-CSRCS = devlpr.c devtty.c ../dev/z80pack/devfd.c
+CSRCS = devlpr.c ../dev/z80pack/devtty.c ../dev/z80pack/devfd.c
 CSRCS += devices.c main.c
 
 ASRCS = crt0.s z80pack.s
index 7e90a54..c574e2d 100644 (file)
@@ -1,5 +1,5 @@
 
-CSRCS = devlpr.c devtty.c ../dev/z80pack/devfd.c
+CSRCS = devlpr.c ../dev/z80pack/devtty.c ../dev/z80pack/devfd.c
 CSRCS += devices.c main.c
 
 ASRCS = crt0.s z80pack.s
diff --git a/Kernel/platform-z80pack-lite/devtty.c b/Kernel/platform-z80pack-lite/devtty.c
deleted file mode 100644 (file)
index 71351d5..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#include <kernel.h>
-#include <kdata.h>
-#include <printf.h>
-#include <stdbool.h>
-#include <tty.h>
-#include <devtty.h>
-
-__sfr __at 0 tty1stat;
-__sfr __at 1 tty1data;
-__sfr __at 40 tty2stat;
-__sfr __at 41 tty2data;
-__sfr __at 42 tty3stat;
-__sfr __at 43 tty3data;
-
-char tbuf1[TTYSIZ];
-char tbuf2[TTYSIZ];
-char tbuf3[TTYSIZ];
-
-struct  s_queue  ttyinq[NUM_DEV_TTY+1] = {       /* ttyinq[0] is never used */
-    {   NULL,    NULL,    NULL,    0,        0,       0    },
-    {   tbuf1,   tbuf1,   tbuf1,   TTYSIZ,   0,   TTYSIZ/2 },
-    {   tbuf2,   tbuf2,   tbuf2,   TTYSIZ,   0,   TTYSIZ/2 },
-    {   tbuf3,   tbuf3,   tbuf3,   TTYSIZ,   0,   TTYSIZ/2 }
-};
-
-/* Console print */
-void kputchar(char c)
-{
-    /* handle CRLF */
-    if(c=='\n')
-        tty_putc(1, '\r');
-    tty_putc(1, c);
-}
-
-static bool tty_writeready(uint8_t minor)
-{
-    uint8_t s;
-
-    if (minor == 1)
-        return 1;
-    if (minor == 2)
-        s = tty2stat;
-    else
-        s = tty3stat;
-    return s & 2;
-}
-
-void tty_putc(uint8_t minor, unsigned char c)
-{
-    if (minor == 1)
-        tty1data = c;
-    else if (minor == 2)
-        tty2data = c;
-    else
-        tty3data = c;
-}
-
-/* Called every timer tick */
-void tty_pollirq(void)
-{
-    unsigned char c;   /* sdcc bug workaround */
-    while(tty1stat) {
-        c = tty1data;
-        tty_inproc(1, c);
-    }
-    while(tty2stat & 1) {
-        c = tty2data;
-        tty_inproc(2, c);
-    }
-    while(tty3stat & 1) {
-        c = tty3data;
-        tty_inproc(3, c);
-    }
-    if (tty2stat & 2)
-        wakeup(&ttydata[2]);
-    if (tty3stat & 2)
-        wakeup(&ttydata[3]);
-}    
-
-void tty_setup(uint8_t minor)
-{
-    minor;
-}
-
-/* For the moment */
-int tty_carrier(uint8_t minor)
-{
-    minor;
-    return 1;
-}
diff --git a/Kernel/platform-z80pack-lite/devtty.h b/Kernel/platform-z80pack-lite/devtty.h
deleted file mode 100644 (file)
index de0eaf7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef __DEVTTY_DOT_H__
-#define __DEVTTY_DOT_H__
-
-void tty_pollirq(void);
-
-#endif
index d18f536..9b86732 100644 (file)
@@ -1,5 +1,5 @@
 
-CSRCS = devlpr.c devtty.c ../dev/z80pack/devfd.c
+CSRCS = devlpr.c ../dev/z80pack/devtty.c ../dev/z80pack/devfd.c
 CSRCS += devices.c main.c
 
 ASRCS = crt0.s z80pack.s
diff --git a/Kernel/platform-z80pack/devtty.c b/Kernel/platform-z80pack/devtty.c
deleted file mode 100644 (file)
index 13a001c..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#include <kernel.h>
-#include <kdata.h>
-#include <printf.h>
-#include <stdbool.h>
-#include <tty.h>
-#include <devtty.h>
-
-__sfr __at 0 tty1stat;
-__sfr __at 1 tty1data;
-__sfr __at 40 tty2stat;
-__sfr __at 41 tty2data;
-__sfr __at 42 tty3stat;
-__sfr __at 43 tty3data;
-
-char tbuf1[TTYSIZ];
-char tbuf2[TTYSIZ];
-char tbuf3[TTYSIZ];
-
-struct  s_queue  ttyinq[NUM_DEV_TTY+1] = {       /* ttyinq[0] is never used */
-    {   NULL,    NULL,    NULL,    0,        0,       0    },
-    {   tbuf1,   tbuf1,   tbuf1,   TTYSIZ,   0,   TTYSIZ/2 },
-    {   tbuf2,   tbuf2,   tbuf2,   TTYSIZ,   0,   TTYSIZ/2 },
-    {   tbuf3,   tbuf3,   tbuf3,   TTYSIZ,   0,   TTYSIZ/2 }
-};
-
-/* Write to system console */
-void kputchar(char c)
-{
-    /* handle CRLF */
-    if(c=='\n')
-        tty_putc(1, '\r');
-    tty_putc(1, c);
-}
-
-static bool tty_writeready(uint8_t minor)
-{
-    uint8_t s;
-
-    if (minor == 1)
-        return 1;
-    if (minor == 2)
-        s = tty2stat;
-    else
-        s = tty3stat;
-    return s & 2;
-}
-
-void tty_putc(uint8_t minor, unsigned char c)
-{
-    if (minor == 1)
-        tty1data = c;
-    else if (minor == 2)
-        tty2data = c;
-    else
-        tty3data = c;
-}
-
-/* Called every timer tick */
-void tty_pollirq(void)
-{
-    unsigned char c;   /* sdcc bug workaround */
-    while(tty1stat) {
-        c = tty1data;
-        tty_inproc(1, c);
-    }
-    while(tty2stat & 1) {
-        c = tty2data;
-        tty_inproc(2, c);
-    }
-    while(tty3stat & 1) {
-        c = tty3data;
-        tty_inproc(3, c);
-    }
-    if (tty2stat & 2)
-        wakeup(&ttydata[2]);
-    if (tty3stat & 2)
-        wakeup(&ttydata[3]);
-}    
-
-void tty_setup(uint8_t minor)
-{
-    minor;
-}
-
-/* For the moment */
-int tty_carrier(uint8_t minor)
-{
-    minor;
-    return 1;
-}
diff --git a/Kernel/platform-z80pack/devtty.h b/Kernel/platform-z80pack/devtty.h
deleted file mode 100644 (file)
index 4638611..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef __DEVTTY_DOT_H__
-#define __DEVTTY_DOT_H__
-void tty_putc(uint8_t minor, unsigned char c);
-bool tty_writeready(uint8_t minor);
-void tty_pollirq(void);
-void tty_setup(uint8_t minor);
-#endif