=================================================================== RCS file: /cvs/prex-old/dev/i386/pc/console.c,v retrieving revision 1.1.1.1 retrieving revision 1.1.1.1.2.1 diff -u -r1.1.1.1 -r1.1.1.1.2.1 --- prex-old/dev/i386/pc/console.c 2008/06/03 10:38:41 1.1.1.1 +++ prex-old/dev/i386/pc/console.c 2008/08/13 17:12:23 1.1.1.1.2.1 @@ -32,7 +32,8 @@ */ #include -#include +#include +#include #include #define CRTC_INDEX 0x3d4 @@ -45,7 +46,7 @@ static int console_init(void); static int console_read(device_t, char *, size_t *, int); static int console_write(device_t, char *, size_t *, int); -static int console_ioctl(device_t, int, u_long); +static int console_ioctl(device_t, u_long, void *); /* * Driver structure @@ -56,6 +57,9 @@ /* init */ console_init, }; +/* + * Device I/O table + */ static struct devio console_io = { /* open */ NULL, /* close */ NULL, @@ -89,7 +93,7 @@ { int i; - memcpy(vram, vram + cols, cols * (rows - 1) * 2); + memcpy(vram, vram + cols, (size_t)(cols * (rows - 1) * 2)); for (i = 0; i < cols; i++) vram[cols * (rows - 1) + i] = ' ' | (attrib << 8); } @@ -101,23 +105,23 @@ irq_lock(); outb(0x0e, CRTC_INDEX); - outb((u_char)((pos >> 8) & 0xff), CRTC_DATA); + outb((pos >> 8) & 0xff, CRTC_DATA); outb(0x0f, CRTC_INDEX); - outb((u_char)(pos & 0xff), CRTC_DATA); + outb(pos & 0xff, CRTC_DATA); irq_unlock(); } static void reset_cursor(void) { - int offset; + u_int offset; irq_lock(); outb(0x0e, CRTC_INDEX); - offset = inb(CRTC_DATA); + offset = (u_int)inb(CRTC_DATA); offset <<= 8; outb(0x0f, CRTC_INDEX); - offset += inb(CRTC_DATA); + offset += (u_int)inb(CRTC_DATA); pos_x = offset % cols; pos_y = offset / cols; irq_unlock(); @@ -387,10 +391,10 @@ * I/O control */ static int -console_ioctl(device_t dev, int cmd, u_long arg) +console_ioctl(device_t dev, u_long cmd, void *arg) { - return tty_ioctl(&console_tty, cmd, (void *)arg); + return tty_ioctl(&console_tty, cmd, arg); } /* @@ -419,7 +423,6 @@ if (c == '\0') break; put_char(c); - #if defined(CONFIG_DIAG_BOCHS) if (inb(0xe9) == 0xe9) { if (c == '\n') @@ -457,7 +460,7 @@ debug_attach(diag_print); #endif tty_register(&console_io, &console_tty, console_output); - console_tty.t_winsize.ws_row = rows; - console_tty.t_winsize.ws_col = cols; + console_tty.t_winsize.ws_row = (u_short)rows; + console_tty.t_winsize.ws_col = (u_short)cols; return 0; }