start: move more discardables into _DISCARD
authorAlan Cox <alan@etchedpixels.co.uk>
Sat, 1 Nov 2014 15:34:45 +0000 (15:34 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Sat, 1 Nov 2014 15:34:45 +0000 (15:34 +0000)
Kernel/devio.c
Kernel/start.c
Kernel/tty.c

index 717e836..061640b 100644 (file)
@@ -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
index 33bde92..947be5b 100644 (file)
  *     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;
index 2d69cd8..bada714 100644 (file)
 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
  */