From 43c019d8c0b450ba36b313eafec28b079e6f0714 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 1 Nov 2014 15:34:45 +0000 Subject: [PATCH] start: move more discardables into _DISCARD --- Kernel/devio.c | 10 ---------- Kernel/start.c | 31 +++++++++++++++++++++++++++++++ Kernel/tty.c | 20 -------------------- 3 files changed, 31 insertions(+), 30 deletions(-) diff --git a/Kernel/devio.c b/Kernel/devio.c index 717e8366..061640b8 100644 --- a/Kernel/devio.c +++ b/Kernel/devio.c @@ -165,16 +165,6 @@ bufptr freebuf(void) } -void bufinit(void) -{ - bufptr bp; - - for (bp = bufpool; bp < bufpool + NBUFS; ++bp) { - bp->bf_dev = NO_DEVICE; - bp->bf_busy = false; - } -} - /* * Helper for hinting that a buffer is not likely to be re-read rapidly * Ignores the hint if the buffer is dirty, resets it if the buffer is diff --git a/Kernel/start.c b/Kernel/start.c index 33bde923..947be5bc 100644 --- a/Kernel/start.c +++ b/Kernel/start.c @@ -10,6 +10,37 @@ * make the entire of this disappear after the initial _execve */ +static struct termios ttydflt = { + BRKINT | ICRNL, + OPOST | ONLCR, + CS8 | B9600 | CREAD | HUPCL, + ISIG | ICANON | ECHO | ECHOE | ECHOK | IEXTEN, + {CTRL('D'), 0, 127, CTRL('C'), + CTRL('U'), CTRL('\\'), CTRL('Q'), CTRL('S'), + CTRL('Z'), CTRL('Y'), CTRL('V'), CTRL('O') + } +}; + +void tty_init(void) { + struct termios *t = &ttydata[1]; + int i; + for(i = 1; i <= NUM_DEV_TTY; i++) { + memcpy(t, &ttydflt, sizeof(struct termios)); + t++; + } +} + +void bufinit(void) +{ + bufptr bp; + + for (bp = bufpool; bp < bufpool + NBUFS; ++bp) { + bp->bf_dev = NO_DEVICE; + bp->bf_busy = false; + } +} + + void create_init(void) { uint8_t *j; diff --git a/Kernel/tty.c b/Kernel/tty.c index 2d69cd85..bada714d 100644 --- a/Kernel/tty.c +++ b/Kernel/tty.c @@ -26,17 +26,6 @@ struct termios ttydata[NUM_DEV_TTY + 1]; /* ttydata[0] is not used */ uint16_t tty_pgrp[NUM_DEV_TTY + 1]; -static struct termios ttydflt = { - BRKINT | ICRNL, - OPOST | ONLCR, - CS8 | B9600 | CREAD | HUPCL, - ISIG | ICANON | ECHO | ECHOE | ECHOK | IEXTEN, - {CTRL('D'), 0, 127, CTRL('C'), - CTRL('U'), CTRL('\\'), CTRL('Q'), CTRL('S'), - CTRL('Z'), CTRL('Y'), CTRL('V'), CTRL('O') - } -}; - static bool stopflag[NUM_DEV_TTY + 1]; // Flag for ^S/^Q static bool flshflag[NUM_DEV_TTY + 1]; // Flag for ^O static bool deadflag[NUM_DEV_TTY + 1]; // True if hung up @@ -415,15 +404,6 @@ void tty_carrier_raise(uint8_t minor) wakeup(&ttydata[minor].c_cflag); } -void tty_init(void) { - struct termios *t = &ttydata[1]; - int i; - for(i = 1; i <= NUM_DEV_TTY; i++) { - memcpy(t, &ttydflt, sizeof(struct termios)); - t++; - } -} - /* * PTY logic */ -- 2.34.1