From c137c6184862512805d366fcb6f3582b96c01a43 Mon Sep 17 00:00:00 2001 From: Greg Haerr Date: Sun, 15 Sep 2024 21:14:18 -0600 Subject: [PATCH] [kernel] Cleanup register decls in console*.c, cleanup init/main.c --- elks/arch/i86/drivers/char/console-bios.c | 14 ++++++------- .../i86/drivers/char/console-direct-pc98.c | 12 +++++------ elks/arch/i86/drivers/char/console-direct.c | 14 ++++++------- elks/arch/i86/drivers/char/console-headless.c | 6 +++--- .../i86/drivers/char/console-serial-8018x.c | 4 ++-- elks/arch/i86/drivers/char/console.c | 18 ++++++++-------- elks/init/main.c | 21 ------------------- elkscmd/test/other/test_float.c | 1 + 8 files changed, 35 insertions(+), 55 deletions(-) diff --git a/elks/arch/i86/drivers/char/console-bios.c b/elks/arch/i86/drivers/char/console-bios.c index 7509139bf..32f944d40 100644 --- a/elks/arch/i86/drivers/char/console-bios.c +++ b/elks/arch/i86/drivers/char/console-bios.c @@ -76,9 +76,9 @@ static int Current_VCminor; #define TERM_TYPE " dumb " #endif -static void std_char(register Console *, int); +static void std_char(Console *, int); -static void PositionCursor(register Console * C) +static void PositionCursor(Console * C) { int x, y, p; @@ -102,7 +102,7 @@ static void DisplayCursor(Console * C, int onoff) { } -static void VideoWrite(register Console * C, char c) +static void VideoWrite(Console * C, char c) { int a, p; @@ -111,7 +111,7 @@ static void VideoWrite(register Console * C, char c) bios_writecharattr (c, a, p); } -static void scroll(register Console * C, int n, int x, int y, int xx, int yy) +static void scroll(Console * C, int n, int x, int y, int xx, int yy) { int a; @@ -127,18 +127,18 @@ static void scroll(register Console * C, int n, int x, int y, int xx, int yy) } } -static void ClearRange(register Console * C, int x, int y, int xx, int yy) +static void ClearRange(Console * C, int x, int y, int xx, int yy) { scroll(C, 26, x, y, xx, yy); } -static void ScrollUp(register Console * C, int y) +static void ScrollUp(Console * C, int y) { scroll(C, 1, 0, y, C->Width - 1, C->Height - 1); } #ifdef CONFIG_EMUL_ANSI -static void ScrollDown(register Console * C, int y) +static void ScrollDown(Console * C, int y) { scroll(C, -1, 0, y, C->Width - 1, C->Height - 1); } diff --git a/elks/arch/i86/drivers/char/console-direct-pc98.c b/elks/arch/i86/drivers/char/console-direct-pc98.c index 2ef51c806..a6d2f7db3 100644 --- a/elks/arch/i86/drivers/char/console-direct-pc98.c +++ b/elks/arch/i86/drivers/char/console-direct-pc98.c @@ -89,11 +89,11 @@ unsigned AttributeSeg; static void std_char(Console *, int); -static void SetDisplayPage(register Console * C) +static void SetDisplayPage(Console * C) { } -static void PositionCursor(register Console * C) +static void PositionCursor(Console * C) { unsigned int Pos; @@ -130,7 +130,7 @@ static word_t conv_pcattr(word_t attr) return attr98; } -static void VideoWrite(register Console * C, int c) +static void VideoWrite(Console * C, int c) { word_t addr; word_t attr; @@ -142,7 +142,7 @@ static void VideoWrite(register Console * C, int c) pokew(addr, (seg_t) C->vseg, c & 255); } -static void ClearRange(register Console * C, int x, int y, int xx, int yy) +static void ClearRange(Console * C, int x, int y, int xx, int yy) { __u16 *vp; word_t attr; @@ -160,7 +160,7 @@ static void ClearRange(register Console * C, int x, int y, int xx, int yy) } while (++y <= yy); } -static void ScrollUp(register Console * C, int y) +static void ScrollUp(Console * C, int y) { __u16 *vp; int MaxRow = C->Height - 1; @@ -175,7 +175,7 @@ static void ScrollUp(register Console * C, int y) } #ifdef CONFIG_EMUL_ANSI -static void ScrollDown(register Console * C, int y) +static void ScrollDown(Console * C, int y) { __u16 *vp; int MaxRow = C->Height - 1; diff --git a/elks/arch/i86/drivers/char/console-direct.c b/elks/arch/i86/drivers/char/console-direct.c index 31e467634..f4902da3a 100644 --- a/elks/arch/i86/drivers/char/console-direct.c +++ b/elks/arch/i86/drivers/char/console-direct.c @@ -86,15 +86,15 @@ int kraw; #define TERM_TYPE " dumb " #endif -static void std_char(register Console *, int); +static void std_char(Console *, int); -static void SetDisplayPage(register Console * C) +static void SetDisplayPage(Console * C) { outw((C->vseg_offset & 0xff00) | 0x0c, C->crtc_base); outw((C->vseg_offset << 8) | 0x0d, C->crtc_base); } -static void PositionCursor(register Console * C) +static void PositionCursor(Console * C) { unsigned int Pos = C->cx + C->Width * C->cy + C->vseg_offset; @@ -119,13 +119,13 @@ static void DisplayCursor(Console * C, int onoff) outb(v, C->crtc_base + 1); } -static void VideoWrite(register Console * C, int c) +static void VideoWrite(Console * C, int c) { pokew((C->cx + C->cy * C->Width) << 1, (seg_t) C->vseg, (C->attr << 8) | (c & 255)); } -static void ClearRange(register Console * C, int x, int y, int x2, int y2) +static void ClearRange(Console * C, int x, int y, int x2, int y2) { int vp; @@ -140,7 +140,7 @@ static void ClearRange(register Console * C, int x, int y, int x2, int y2) } while (++y <= y2); } -static void ScrollUp(register Console * C, int y) +static void ScrollUp(Console * C, int y) { int vp; int MaxRow = C->Height - 1; @@ -154,7 +154,7 @@ static void ScrollUp(register Console * C, int y) } #ifdef CONFIG_EMUL_ANSI -static void ScrollDown(register Console * C, int y) +static void ScrollDown(Console * C, int y) { int vp; int yy = C->Height - 1; diff --git a/elks/arch/i86/drivers/char/console-headless.c b/elks/arch/i86/drivers/char/console-headless.c index 7fcd5f394..9152cc5e7 100644 --- a/elks/arch/i86/drivers/char/console-headless.c +++ b/elks/arch/i86/drivers/char/console-headless.c @@ -23,7 +23,7 @@ void INITPROC console_init(void) void Console_conin(unsigned char Key) { - register struct tty *ttyp = &ttys[0]; /* /dev/tty1*/ + struct tty *ttyp = &ttys[0]; /* /dev/tty1*/ if (!tty_intcheck(ttyp, Key)) chq_addch(&ttyp->inq, Key); @@ -55,7 +55,7 @@ static int Console_ioctl(struct tty *tty, int cmd, char *arg) return -EINVAL; } -static int Console_write(register struct tty *tty) +static int Console_write(struct tty *tty) { int cnt = 0; @@ -71,7 +71,7 @@ static void Console_release(struct tty *tty) ttystd_release(tty); } -static int Console_open(register struct tty *tty) +static int Console_open(struct tty *tty) { return ttystd_open(tty); } diff --git a/elks/arch/i86/drivers/char/console-serial-8018x.c b/elks/arch/i86/drivers/char/console-serial-8018x.c index f9b36d171..cc75c7db8 100644 --- a/elks/arch/i86/drivers/char/console-serial-8018x.c +++ b/elks/arch/i86/drivers/char/console-serial-8018x.c @@ -196,7 +196,7 @@ static int sercon_ioctl(struct tty *tty, int cmd, char *arg) return 0; } -static int sercon_write(register struct tty *tty) +static int sercon_write(struct tty *tty) { struct serial_info *port = &ports[0]; /* TODO: add support for Serial 1 */ int cnt = 0; @@ -213,7 +213,7 @@ static void sercon_release(struct tty *tty) ttystd_release(tty); } -static int sercon_open(register struct tty *tty) +static int sercon_open(struct tty *tty) { return ttystd_open(tty); } diff --git a/elks/arch/i86/drivers/char/console.c b/elks/arch/i86/drivers/char/console.c index d66649de4..fe13d6b99 100644 --- a/elks/arch/i86/drivers/char/console.c +++ b/elks/arch/i86/drivers/char/console.c @@ -1,6 +1,6 @@ /* shared console routines for Direct and BIOS consoles - #include in console drivers*/ -static void WriteChar(register Console * C, int c) +static void WriteChar(Console * C, int c) { /* check for graphics lock */ while (glock) { @@ -30,7 +30,7 @@ void Console_conin(unsigned char Key) } #ifdef CONFIG_EMUL_ANSI -static void Console_gotoxy(register Console * C, int x, int y) +static void Console_gotoxy(Console * C, int x, int y) { int xp = x; int MaxRow = C->Height - 1; @@ -42,7 +42,7 @@ static void Console_gotoxy(register Console * C, int x, int y) C->XN = 0; } -static int parm1(register unsigned char *buf) +static int parm1(unsigned char *buf) { int n; @@ -51,7 +51,7 @@ static int parm1(register unsigned char *buf) return n; } -static int parm2(register unsigned char *buf) +static int parm2(unsigned char *buf) { while (*buf != ';' && *buf) buf++; @@ -79,7 +79,7 @@ static unsigned char ega_color[16] = { 0, 4, 2, 6, 1, 5, 3, 7, 8, 12, 10, 14, 9, 13, 11, 15 }; /* ESC [ processing */ -static void AnsiCmd(register Console * C, int c) +static void AnsiCmd(Console * C, int c) { int n; int MaxRow = C->Height - 1; @@ -230,7 +230,7 @@ static void AnsiCmd(register Console * C, int c) } /* ANSI emulator - ESC seen */ -static void esc_char(register Console * C, int c) +static void esc_char(Console * C, int c) { /* Parse CSI sequence */ C->parmptr = C->params; @@ -252,7 +252,7 @@ static void esc_char(register Console * C, int c) #endif /* Normal character processing */ -static void std_char(register Console * C, int c) +static void std_char(Console * C, int c) { int MaxRow = C->Height - 1; int MaxCol = C->Width - 1; @@ -366,7 +366,7 @@ static int Console_ioctl(struct tty *tty, int cmd, char *arg) return -EINVAL; } -static int Console_write(register struct tty *tty) +static int Console_write(struct tty *tty) { Console *C = &Con[tty->minor]; int cnt = 0; @@ -385,7 +385,7 @@ static void Console_release(struct tty *tty) ttystd_release(tty); } -static int Console_open(register struct tty *tty) +static int Console_open(struct tty *tty) { if ((int)tty->minor >= NumConsoles) return -ENODEV; diff --git a/elks/init/main.c b/elks/init/main.c index 92e5cc6a9..713219d66 100644 --- a/elks/init/main.c +++ b/elks/init/main.c @@ -114,27 +114,6 @@ void start_kernel(void) kfork_proc(init_task); wake_up_process(&task[1]); -#if TIMER_TEST - /* printk rewrite debug statements */ - printk("#04X: '%#04X'\n", 0x2ab); - printk("04X: '%04X'\n", 0x2ab); - printk("04x: '%04x'\n", 0x2ab); - printk(" 4x: '%4x'\n", 0x2ab); - printk("04d: '%04d'\n", 0x200); - printk(" 4d: '%4d'\n", 0x200); - printk("05d: '%05d'\n", -20); - printk(" 5d: '%5d'\n", -20); - printk("+5d: '%5d'\n", -20); - printk("+5d: '%5d'\n", 20); - printk(",ld: '%,ld'\n", -123456789L); - printk(" lx: '%lx'\n", 0x87654321L); - printk(" lo: '%lo'\n", 0xFFFFFFFFL); - printk(" s: '%s'\n", "thisisatest"); - printk(" 6s: '%6s'\n", "thisisatest"); - printk("20s: '%20s'\n", "thisisatest"); - test_ptime_print(); -#endif - /* * We are now the idle task. We won't run unless no other process can run. * The idle task always runs with _gint_count == 1 (switched from user mode syscall) diff --git a/elkscmd/test/other/test_float.c b/elkscmd/test/other/test_float.c index 3147e94ba..cdac180e8 100755 --- a/elkscmd/test/other/test_float.c +++ b/elkscmd/test/other/test_float.c @@ -280,6 +280,7 @@ int main(int argc, char **argv) { printf("-300000 %s\n", ltostr(-300000L, 10)); printf(" p: '%p'\n", 0x18AF); printf(" lp: '%lp'\n", 0x02d018AFL); + /*printk("#04X: '%#04X'\n", 0x2ab);*/ /* kernel only */ printf("04X: '%04X'\n", 0x2ab); printf("04x: '%04x'\n", 0x2ab); printf(" 4x: '%4x'\n", 0x2ab);