diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/.cvsignore | 3 | ||||
-rw-r--r-- | drivers/char/Makefile | 8 | ||||
-rw-r--r-- | drivers/char/console.c | 31 | ||||
-rw-r--r-- | drivers/char/ftape/.cvsignore | 1 | ||||
-rw-r--r-- | drivers/char/keyboard.c | 16 | ||||
-rw-r--r-- | drivers/char/lp.c | 58 | ||||
-rw-r--r-- | drivers/char/psaux.c | 151 | ||||
-rw-r--r-- | drivers/char/selection.h | 35 | ||||
-rw-r--r-- | drivers/char/softdog.c | 2 | ||||
-rw-r--r-- | drivers/char/vesa_blank.c | 11 | ||||
-rw-r--r-- | drivers/char/vga.c | 32 | ||||
-rw-r--r-- | drivers/char/vt.c | 5 |
12 files changed, 226 insertions, 127 deletions
diff --git a/drivers/char/.cvsignore b/drivers/char/.cvsignore new file mode 100644 index 000000000..1b9baceaa --- /dev/null +++ b/drivers/char/.cvsignore @@ -0,0 +1,3 @@ +.depend +conmakehash +uni_hash.tbl diff --git a/drivers/char/Makefile b/drivers/char/Makefile index 8bb627372..662660f10 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -26,7 +26,9 @@ L_OBJS := tty_io.o n_tty.o console.o \ ifeq ($(CONFIG_SERIAL),y) ifndef CONFIG_SUN_SERIAL - LX_OBJS += serial.o + ifndef CONFIG_SGI_SERIAL + LX_OBJS += serial.o + endif endif else ifeq ($(CONFIG_SERIAL),m) @@ -201,7 +203,9 @@ L_OBJS += tga.o else ifndef CONFIG_SUN_CONSOLE ifndef CONFIG_VIDEO_G364 - L_OBJS += vga.o vesa_blank.o + ifndef CONFIG_SGI + L_OBJS += vga.o vesa_blank.o + endif endif endif endif diff --git a/drivers/char/console.c b/drivers/char/console.c index 070dc9bf3..750fd96f7 100644 --- a/drivers/char/console.c +++ b/drivers/char/console.c @@ -105,7 +105,9 @@ #include <linux/apm_bios.h> #endif -#ifdef __mips__ +#ifdef CONFIG_SGI +#include <asm/sgialib.h> +#elif defined(CONFIG_ACER_PICA_61) #include <asm/bootinfo.h> /* * The video control ports are mapped at virtual address @@ -130,6 +132,8 @@ unsigned long video_port_base; #define MIN(a,b) ((a) < (b) ? (a) : (b)) #endif +int serial_console; + struct tty_driver console_driver; static int console_refcount; static struct tty_struct *console_table[MAX_NR_CONSOLES]; @@ -165,6 +169,9 @@ extern void set_palette(void); extern unsigned long con_type_init(unsigned long, const char **); extern int set_get_cmap(unsigned char *, int); extern int set_get_font(unsigned char *, int, int); +#ifdef CONFIG_SGI +extern void rs_cons_hook(int chip, int out, int channel); +#endif /* Description of the hardware situation */ unsigned char video_type; /* Type of display being used */ @@ -597,7 +604,7 @@ static void set_origin(int currcons) { if (video_type != VIDEO_TYPE_EGAC && video_type != VIDEO_TYPE_VGAC && video_type != VIDEO_TYPE_EGAM && video_type != VIDEO_TYPE_PICA_S3 && - video_type != VIDEO_TYPE_SNI_RM) + video_type != VIDEO_TYPE_SNI_RM && video_type != VIDEO_TYPE_SGI) return; if (currcons != fg_console || console_blanked || vcmode == KD_GRAPHICS) return; @@ -629,7 +636,7 @@ void scrup(int currcons, unsigned int t, unsigned int b) /* * Is the end of the area to scroll outside of the video RAM? * If so, just do normal softscroll. The second part of the - * expression is important for some non-Intel architectures. + * condition is important for some non-Intel architectures. */ if (scr_end > video_mem_end || scr_end < video_mem_base) { unsigned short * d = (unsigned short *) video_mem_start; @@ -898,7 +905,7 @@ static void csi_m(int currcons) toggle_meta = 0; break; case 11: /* ANSI X3.64-1979 (SCO-ish?) - * Select first alternate font, lets + * Select first alternate font, let's * chars < 32 be displayed as ROM chars. */ translate = set_translate(IBMPC_MAP); @@ -2053,6 +2060,17 @@ unsigned long con_init(unsigned long kmem_start) int orig_x = ORIG_X; int orig_y = ORIG_Y; +#ifdef CONFIG_SGI + if (serial_console) { + fg_console = 0; + + rs_cons_hook(0, 0, serial_console); + rs_cons_hook(0, 1, serial_console); + + return kmem_start; + } +#endif + memset(&console_driver, 0, sizeof(struct tty_driver)); console_driver.magic = TTY_DRIVER_MAGIC; console_driver.name = "tty"; @@ -2099,7 +2117,7 @@ unsigned long con_init(unsigned long kmem_start) || video_type == VIDEO_TYPE_VGAC || video_type == VIDEO_TYPE_EGAM || video_type == VIDEO_TYPE_PICA_S3 - || video_type == VIDEO_TYPE_SNI_RM)); + || video_type == VIDEO_TYPE_SNI_RM )); has_wrapped = 0 ; /* Due to kmalloc roundup allocating statically is more efficient - @@ -2139,7 +2157,8 @@ unsigned long con_init(unsigned long kmem_start) printable = 1; if ( video_type == VIDEO_TYPE_VGAC || video_type == VIDEO_TYPE_EGAC - || video_type == VIDEO_TYPE_EGAM || video_type == VIDEO_TYPE_TGAC ) + || video_type == VIDEO_TYPE_EGAM || video_type == VIDEO_TYPE_TGAC + || video_type == VIDEO_TYPE_SGI ) { default_font_height = video_font_height = ORIG_VIDEO_POINTS; /* This may be suboptimal but is a safe bet - go with it */ diff --git a/drivers/char/ftape/.cvsignore b/drivers/char/ftape/.cvsignore new file mode 100644 index 000000000..4671378ae --- /dev/null +++ b/drivers/char/ftape/.cvsignore @@ -0,0 +1 @@ +.depend diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index dc40910b4..36ef2bacb 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -16,10 +16,8 @@ * 11-11-96: SAK should now work in the raw mode (Martin Mares) */ -#define DISABLE_KBD_DURING_INTERRUPTS 0 - +#include <linux/config.h> #include <linux/kbdcntrlr.h> -#include <linux/delay.h> #include <linux/sched.h> #include <linux/interrupt.h> #include <linux/tty.h> @@ -47,7 +45,6 @@ static int send_data(unsigned char data); #define SIZE(x) (sizeof(x)/sizeof((x)[0])) -#define KBD_REPORT_ERR #define KBD_REPORT_UNKN /* #define KBD_IS_FOCUS_9000 */ @@ -332,6 +329,10 @@ int getkeycode(unsigned int scancode) e0_keys[scancode - 128]; } +#if defined(CONFIG_SGI) && defined(CONFIG_PSMOUSE) +extern void aux_interrupt(unsigned char status, unsigned char data); +#endif + #if DISABLE_KBD_DURING_INTERRUPTS #define disable_keyboard() do { send_cmd(0xAD); kb_wait(); } while (0) #define enable_keyboard() send_cmd(0xAE) @@ -583,8 +584,13 @@ static void keyboard_interrupt(int irq, void *dev_id, struct pt_regs *regs) unsigned char scancode; /* mouse data? */ - if (status & kbd_read_mask & 0x20) + if (status & kbd_read_mask & 0x20) { +#if defined(CONFIG_SGI) && defined(CONFIG_PSMOUSE) + scancode = kbd_inb(0x60); + aux_interrupt(status, scancode); +#endif break; + } scancode = kbd_inb(0x60); if (status & 0x01) diff --git a/drivers/char/lp.c b/drivers/char/lp.c index 40ad1712f..281226f69 100644 --- a/drivers/char/lp.c +++ b/drivers/char/lp.c @@ -6,14 +6,12 @@ * Copyright (C) 1993 by Nigel Gamble (added interrupt code) * Copyright (C) 1994 by Alan Cox (Modularised it) * LPCAREFUL, LPABORT, LPGETSTATUS added by Chris Metcalf, metcalf@lcs.mit.edu - * Mips JAZZ support by Andreas Busse, andy@waldorf-gmbh.de * Statistics and support for slow printers by Rob Janssen, rob@knoware.nl * "lp=" command line parameters added by Grant Guenther, grant@torque.net */ #include <linux/module.h> -#include <linux/config.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/major.h> @@ -27,9 +25,6 @@ #include <asm/io.h> #include <asm/uaccess.h> #include <asm/system.h> -#ifdef CONFIG_MIPS_JAZZ -# include <asm/jazz.h> -#endif /* the BIOS manuals say there can be up to 4 lpt devices * but I have not seen a board where the 4th address is listed @@ -38,13 +33,6 @@ * if you have more than 3 printers, remember to increase LP_NO */ struct lp_struct lp_table[] = { -#ifdef CONFIG_MIPS_JAZZ - { JAZZ_PARALLEL_BASE, - 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, -#else - { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, - { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, -#endif { 0x3bc, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, { 0x378, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, { 0x278, 0, 0, LP_INIT_CHAR, LP_INIT_TIME, LP_INIT_WAIT, NULL, NULL, 0, 0, 0, {0} }, @@ -68,31 +56,6 @@ struct lp_struct lp_table[] = { #undef LP_DEBUG -#ifdef CONFIG_MIPS_JAZZ -static inline unsigned int lp_in(unsigned int port) -{ -/* printk("lp_in: port>>24 = %08x, JAZZ_LOCAL_IO_SPACE >> 24 = %08x\n", - port >> 24,JAZZ_LOCAL_IO_SPACE >> 24); */ - if (port >= JAZZ_LOCAL_IO_SPACE) - return (*(volatile unsigned char *)port); - else - return inb_p(port); -} - -static inline void lp_out(unsigned char value, unsigned int port) -{ -/* printk("lp_out: port>>24 = %08x, JAZZ_LOCAL_IO_SPACE >> 24 = %08x\n", - port >> 24,JAZZ_LOCAL_IO_SPACE >> 24); */ - if (port >= JAZZ_LOCAL_IO_SPACE) - *(volatile unsigned char *)port = value; - else - outb(value, port); -} -#else -#define lp_in(port) inb_p(port) -#define lp_out(port,value) outb_p(port,value) -#endif - static int lp_reset(int minor) { outb_p(LP_PSELECP, LP_C(minor)); @@ -101,10 +64,6 @@ static int lp_reset(int minor) return LP_S(minor); } -#ifdef LP_DEBUG -static int lp_max_count = 1; -#endif - static inline int lp_char_polled(char lpchar, int minor) { int status, wait = 0; @@ -122,17 +81,17 @@ static inline int lp_char_polled(char lpchar, int minor) return 0; /* we timed out, and the character was /not/ printed */ } - lp_out(lpchar, LP_B(minor)); + outb_p(lpchar, LP_B(minor)); stats = &LP_STAT(minor); stats->chars++; /* must wait before taking strobe high, and after taking strobe low, according spec. Some printers need it, others don't. */ while(wait != LP_WAIT(minor)) wait++; /* control port takes strobe high */ - lp_out(( LP_PSELECP | LP_PINITP | LP_PSTROBE ), ( LP_C( minor ))); + outb_p(( LP_PSELECP | LP_PINITP | LP_PSTROBE ), ( LP_C( minor ))); while(wait) wait--; /* take strobe low */ - lp_out(( LP_PSELECP | LP_PINITP ), ( LP_C( minor ))); + outb_p(( LP_PSELECP | LP_PINITP ), ( LP_C( minor ))); /* update waittime statistics */ if (count > stats->maxwait) { #ifdef LP_DEBUG @@ -189,11 +148,6 @@ static inline int lp_char_interrupt(char lpchar, int minor) return 0; } -#ifdef LP_DEBUG - unsigned int lp_total_chars = 0; - unsigned int lp_last_call = 0; -#endif - static void lp_interrupt(int irq, void *dev_id, struct pt_regs *regs) { struct lp_struct *lp = &lp_table[0]; @@ -244,18 +198,18 @@ static inline int lp_write_interrupt(unsigned int minor, const char * buf, int c } LP_STAT(minor).sleeps++; cli(); - lp_out((LP_PSELECP|LP_PINITP|LP_PINTEN), (LP_C(minor))); + outb_p((LP_PSELECP|LP_PINITP|LP_PINTEN), (LP_C(minor))); status = LP_S(minor); if ((!(status & LP_PACK) || (status & LP_PBUSY)) && LP_CAREFUL_READY(minor, status)) { - lp_out((LP_PSELECP|LP_PINITP), (LP_C(minor))); + outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor))); sti(); continue; } lp_table[minor].runchars=0; current->timeout = jiffies + LP_TIMEOUT_INTERRUPT; interruptible_sleep_on(&lp->lp_wait_q); - lp_out((LP_PSELECP|LP_PINITP), (LP_C(minor))); + outb_p((LP_PSELECP|LP_PINITP), (LP_C(minor))); sti(); if (current->signal & ~current->blocked) { if (total_bytes_written + bytes_written) diff --git a/drivers/char/psaux.c b/drivers/char/psaux.c index a6ba7bdaa..e0d92057b 100644 --- a/drivers/char/psaux.c +++ b/drivers/char/psaux.c @@ -36,6 +36,7 @@ #include <linux/module.h> +#include <linux/config.h> #include <linux/sched.h> #include <linux/kernel.h> #include <linux/interrupt.h> @@ -49,6 +50,10 @@ #include <asm/io.h> #include <asm/uaccess.h> #include <asm/system.h> +#ifdef CONFIG_SGI +#include <asm/segment.h> +#include <asm/sgihpc.h> +#endif #include <linux/config.h> @@ -93,6 +98,58 @@ #endif #define AUX_BUF_SIZE 2048 +#ifdef CONFIG_SGI +extern volatile struct hpc_keyb *kh; /* see keyboard.c */ + +extern __inline__ int +ps2_inb_p(unsigned short port) +{ + int result; + + if(port == AUX_INPUT_PORT) + result = kh->data; + else if(port == AUX_STATUS) + result = kh->command; + return result; +} + +extern __inline__ int +ps2_inb(unsigned short port) +{ + int result; + + if(port == AUX_INPUT_PORT) + result = kh->data; + else if(port == AUX_STATUS) + result = kh->command; + + return result; +} + +extern __inline__ void +ps2_outb_p(unsigned char data, unsigned short port) +{ + if(port == AUX_OUTPUT_PORT) + kh->data = data; + else if(port == AUX_COMMAND) + kh->command = data; +} + +extern __inline__ void +ps2_outb(unsigned char data, unsigned short port) +{ + if(port == AUX_OUTPUT_PORT) + kh->data = data; + else if(port == AUX_COMMAND) + kh->command = data; +} +#else +#define ps2_inb_p inb_p +#define ps2_inb inb +#define ps2_outb_p outb_p +#define ps2_outb outb +#endif + /* 82C710 definitions */ #define QP_DATA 0x310 /* Data Port I/O Address */ @@ -146,9 +203,9 @@ static int probe_qp(void); static void aux_write_dev(int val) { poll_aux_status(); - outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); /* write magic cookie */ + ps2_outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); /* write magic cookie */ poll_aux_status(); - outb_p(val,AUX_OUTPUT_PORT); /* write data */ + ps2_outb_p(val,AUX_OUTPUT_PORT); /* write data */ } /* @@ -158,16 +215,16 @@ static void aux_write_dev(int val) static int aux_write_ack(int val) { int retries = 0; - + poll_aux_status_nosleep(); - outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); + ps2_outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); poll_aux_status_nosleep(); - outb_p(val,AUX_OUTPUT_PORT); + ps2_outb_p(val,AUX_OUTPUT_PORT); poll_aux_status_nosleep(); - if ((inb(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) + if ((ps2_inb(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) { - return (inb(AUX_INPUT_PORT)); + return (ps2_inb(AUX_INPUT_PORT)); } return 0; } @@ -180,12 +237,11 @@ static int aux_write_ack(int val) static void aux_write_cmd(int val) { poll_aux_status(); - outb_p(AUX_CMD_WRITE,AUX_COMMAND); + ps2_outb_p(AUX_CMD_WRITE,AUX_COMMAND); poll_aux_status(); - outb_p(val,AUX_OUTPUT_PORT); + ps2_outb_p(val,AUX_OUTPUT_PORT); } - static unsigned int get_from_queue(void) { unsigned int result; @@ -211,16 +267,42 @@ static inline int queue_empty(void) * Interrupt from the auxiliary device: a character * is waiting in the keyboard/aux controller. */ - +#ifndef CONFIG_SGI static void aux_interrupt(int cpl, void *dev_id, struct pt_regs * regs) { int head = queue->head; int maxhead = (queue->tail-1) & (AUX_BUF_SIZE-1); - if ((inb(AUX_STATUS) & AUX_OBUF_FULL) != AUX_OBUF_FULL) + if ((ps2_inb(AUX_STATUS) & AUX_OBUF_FULL) != AUX_OBUF_FULL) + return; + + add_mouse_randomness(queue->buf[head] = ps2_inb(AUX_INPUT_PORT)); + if (head != maxhead) { + head++; + head &= AUX_BUF_SIZE-1; + } + queue->head = head; + aux_ready = 1; + if (queue->fasync) + kill_fasync(queue->fasync, SIGIO); + wake_up_interruptible(&queue->proc_list); +} +#else +/* On the SGI we export this routine because the keyboard chirps at + * the same interrupt level. The status and data bytes are passed + * directly to us if the keyboard interrupt service routine detects + * that the keyboard is not the cause of the interrupt, see keyboard.c + * for details. + */ +void aux_interrupt(unsigned char status, unsigned char data) +{ + int head = queue->head; + int maxhead = (queue->tail-1) & (AUX_BUF_SIZE-1); + + if ((status & AUX_OBUF_FULL) != AUX_OBUF_FULL) return; - add_mouse_randomness(queue->buf[head] = inb(AUX_INPUT_PORT)); + add_mouse_randomness(queue->buf[head] = data); if (head != maxhead) { head++; head &= AUX_BUF_SIZE-1; @@ -231,6 +313,7 @@ static void aux_interrupt(int cpl, void *dev_id, struct pt_regs * regs) kill_fasync(queue->fasync, SIGIO); wake_up_interruptible(&queue->proc_list); } +#endif /* * Interrupt handler for the 82C710 mouse port. A character @@ -266,11 +349,13 @@ static void release_aux(struct inode * inode, struct file * file) disable_bh(KEYBOARD_BH); aux_write_cmd(AUX_INTS_OFF); /* disable controller ints */ poll_aux_status(); - outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */ - poll_aux_status(); + ps2_outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */ + poll_aux_status(); /* reenable kbd bh */ enable_bh(KEYBOARD_BH); +#ifndef CONFIG_SGI free_irq(AUX_IRQ, NULL); +#endif MOD_DEC_USE_COUNT; } @@ -319,22 +404,22 @@ static int open_aux(struct inode * inode, struct file * file) return -EBUSY; } queue->head = queue->tail = 0; /* Flush input queue */ +#ifndef CONFIG_SGI if (request_irq(AUX_IRQ, aux_interrupt, 0, "PS/2 Mouse", NULL)) { aux_count--; return -EBUSY; } +#endif MOD_INC_USE_COUNT; /* disable kbd bh to avoid mixing of cmd bytes */ disable_bh(KEYBOARD_BH); poll_aux_status(); - outb_p(AUX_ENABLE,AUX_COMMAND); /* Enable Aux */ + ps2_outb_p(AUX_ENABLE,AUX_COMMAND); /* Enable Aux */ aux_write_dev(AUX_ENABLE_DEV); /* enable aux device */ aux_write_cmd(AUX_INTS_ON); /* enable controller ints */ poll_aux_status(); - /* reenable kbd bh */ - enable_bh(KEYBOARD_BH); - aux_ready = 0; + MOD_INC_USE_COUNT; return 0; } @@ -403,7 +488,7 @@ static long write_aux(struct inode * inode, struct file * file, char c; if (!poll_aux_status()) break; - outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); + ps2_outb_p(AUX_MAGIC_WRITE,AUX_COMMAND); if (!poll_aux_status()) break; get_user(c, buffer++); @@ -534,7 +619,11 @@ int psaux_init(void) psaux_fops.release = release_qp; } else #endif +#if defined(CONFIG_SGI) && defined(CONFIG_PSMOUSE) + if(1) { +#else if (aux_device_present == 0xaa) { +#endif printk(KERN_INFO "PS/2 auxiliary pointing device detected -- driver installed.\n"); aux_present = 1; kbd_read_mask = AUX_OBUF_FULL; @@ -548,7 +637,7 @@ int psaux_init(void) queue->proc_list = NULL; if (!qp_found) { #if defined INITIALIZE_DEVICE - outb_p(AUX_ENABLE,AUX_COMMAND); /* Enable Aux */ + ps2_outb_p(AUX_ENABLE,AUX_COMMAND); /* Enable Aux */ aux_write_ack(AUX_SET_SAMPLE); aux_write_ack(100); /* 100 samples/sec */ aux_write_ack(AUX_SET_RES); @@ -556,11 +645,11 @@ int psaux_init(void) aux_write_ack(AUX_SET_SCALE21); /* 2:1 scaling */ poll_aux_status_nosleep(); #endif /* INITIALIZE_DEVICE */ - outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */ + ps2_outb_p(AUX_DISABLE,AUX_COMMAND); /* Disable Aux device */ poll_aux_status_nosleep(); - outb_p(AUX_CMD_WRITE,AUX_COMMAND); - poll_aux_status_nosleep(); /* Disable interrupts */ - outb_p(AUX_INTS_OFF, AUX_OUTPUT_PORT); /* on the controller */ + ps2_outb_p(AUX_CMD_WRITE,AUX_COMMAND); + poll_aux_status_nosleep(); /* Disable interrupts */ + ps2_outb_p(AUX_INTS_OFF, AUX_OUTPUT_PORT); /* on the controller */ } return 0; } @@ -582,9 +671,9 @@ static int poll_aux_status(void) { int retries=0; - while ((inb(AUX_STATUS)&0x03) && retries < MAX_RETRIES) { - if ((inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) - inb_p(AUX_INPUT_PORT); + while ((ps2_inb(AUX_STATUS)&0x03) && retries < MAX_RETRIES) { + if ((ps2_inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) + ps2_inb_p(AUX_INPUT_PORT); current->state = TASK_INTERRUPTIBLE; current->timeout = jiffies + (5*HZ + 99) / 100; schedule(); @@ -597,9 +686,9 @@ static int poll_aux_status_nosleep(void) { int retries = 0; - while ((inb(AUX_STATUS)&0x03) && retries < 1000000) { - if ((inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) - inb_p(AUX_INPUT_PORT); + while ((ps2_inb(AUX_STATUS)&0x03) && retries < 1000000) { + if ((ps2_inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL) + ps2_inb_p(AUX_INPUT_PORT); retries++; } return !(retries == 1000000); diff --git a/drivers/char/selection.h b/drivers/char/selection.h index 7054d63cd..4acbbb085 100644 --- a/drivers/char/selection.h +++ b/drivers/char/selection.h @@ -101,6 +101,33 @@ static inline unsigned short scr_readw(unsigned short * addr) { return *addr; } +#elif defined (CONFIG_SGI) +#include "vt_kern.h" +#include <linux/kd.h> +extern void newport_blitc(unsigned short, unsigned long); +extern void memsetw(void * s, unsigned short c, unsigned int count); +extern void memcpyw(unsigned short *to, unsigned short *from, unsigned int count); +extern unsigned long video_mem_term; + +static inline void scr_writew(unsigned short val, unsigned short * addr) +{ + /* always deposit the char/attr, then see if it was to "screen" mem. + * if so, then render the char/attr onto the real screen. + */ + if(*addr != val) { + *addr = val; + if ((unsigned long)addr < video_mem_term && + (unsigned long)addr >= video_mem_base && + vt_cons [fg_console]->vc_mode == KD_TEXT) + newport_blitc(val, (unsigned long) addr); + } +} + +static inline unsigned short scr_readw(unsigned short * addr) +{ + return *addr; +} + #elif defined (CONFIG_VIDEO_G364) /* The G364 cards: same as above. */ extern void g364_blitc(unsigned short, unsigned long); @@ -137,12 +164,12 @@ static inline void scr_writew(unsigned short val, unsigned short * addr) g364_blitc(val, (unsigned long) addr); /* B&W faster */ else g364_blitc_colour(val, (unsigned long) addr); - } + } } static inline unsigned short scr_readw(unsigned short * addr) { - return *addr; + return *addr; } #else /* CONFIG_VIDEO_G364 */ @@ -151,7 +178,7 @@ static inline unsigned short scr_readw(unsigned short * addr) * */ -#include <asm/io.h> +#include <asm/io.h> /* * NOTE: "(long) addr < 0" tests for an Alpha kernel virtual address; this @@ -190,6 +217,7 @@ static inline unsigned short scr_readw(unsigned short * addr) #endif /* CONFIG_TGA_CONSOLE */ +#ifndef CONFIG_SGI static inline void memsetw(void * s, unsigned short c, unsigned int count) { unsigned short * addr = (unsigned short *) s; @@ -210,3 +238,4 @@ static inline void memcpyw(unsigned short *to, unsigned short *from, scr_writew(scr_readw(from++), to++); } } +#endif /* CONFIG_SUN_CONSOLE */ diff --git a/drivers/char/softdog.c b/drivers/char/softdog.c index bdac54541..d168c247a 100644 --- a/drivers/char/softdog.c +++ b/drivers/char/softdog.c @@ -31,7 +31,6 @@ #include <linux/fs.h> #include <linux/mm.h> #include <linux/miscdevice.h> -#include <asm/system.h> #define WATCHDOG_MINOR 130 #define TIMER_MARGIN 60 /* (secs) Default is 1 minute */ @@ -52,6 +51,7 @@ static int timer_alive = 0; static void watchdog_fire(unsigned long data) { + extern void hard_reset_now(void); #ifdef ONLY_TESTING printk(KERN_CRIT "SOFTDOG: Would Reboot.\n"); #else diff --git a/drivers/char/vesa_blank.c b/drivers/char/vesa_blank.c index 12dd71c1a..eb957180b 100644 --- a/drivers/char/vesa_blank.c +++ b/drivers/char/vesa_blank.c @@ -41,17 +41,6 @@ ----------------------------------------------------------------------- */ -#include <linux/config.h> - -#if defined(CONFIG_ACER_PICA_61) -#include <asm/bootinfo.h> -/* - * The video control ports are mapped at virtual address - * 0xe0200000 for the onboard S3 card - */ -#define PORT_BASE video_port_base -unsigned long video_port_base; -#endif #include <asm/io.h> #include <asm/system.h> #include <asm/uaccess.h> diff --git a/drivers/char/vga.c b/drivers/char/vga.c index d0cd8dd9c..eaf3c9ac9 100644 --- a/drivers/char/vga.c +++ b/drivers/char/vga.c @@ -52,6 +52,8 @@ #ifdef __mips__ #include <asm/bootinfo.h> +#include <asm/deskstation.h> +#include <asm/sni.h> /* * The video control ports are mapped at virtual address * 0xe0200000 for the onboard S3 card @@ -61,7 +63,6 @@ unsigned long video_port_base; #endif #include <asm/io.h> -#include <asm/slots.h> #include <asm/system.h> #include <asm/uaccess.h> #include <asm/bitops.h> @@ -186,7 +187,7 @@ con_type_init(unsigned long kmem_start, const char **display_desc) && mips_machtype == MACH_SNI_RM200_PCI) { can_do_color = 1; - video_port_base = PORT_BASE_SNI; + video_port_base = SNI_PORT_BASE; video_port_reg = 0x3d4; video_port_val = 0x3d5; video_type = VIDEO_TYPE_SNI_RM; @@ -208,8 +209,9 @@ con_type_init(unsigned long kmem_start, const char **display_desc) if (mips_machgroup == MACH_GROUP_ARC && mips_machtype == MACH_DESKSTATION_RPC44) { + /* XXX */ can_do_color = 1; - video_port_base = PORT_BASE_RPC44; + video_port_base = RPC44_PORT_BASE; video_port_reg = 0x3d4; video_port_val = 0x3d5; video_type = VIDEO_TYPE_VGAC; @@ -224,26 +226,24 @@ con_type_init(unsigned long kmem_start, const char **display_desc) * the normal port address range. */ } - /* else */ /* I specifically want to use the following code... */ - -#define VGA_CAN_DO_64KB /* KLUDGE To get the address right below */ + else #endif if (ORIG_VIDEO_MODE == 7) /* Is this a monochrome display? */ { - video_mem_base = SLOTSPACE + 0xb0000; + video_mem_base = 0xb0000; video_port_reg = 0x3b4; video_port_val = 0x3b5; if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { video_type = VIDEO_TYPE_EGAM; - video_mem_term = SLOTSPACE + 0xb8000; + video_mem_term = 0xb8000; *display_desc = "EGA+"; request_region(0x3b0,16,"ega"); } else { video_type = VIDEO_TYPE_MDA; - video_mem_term = SLOTSPACE + 0xb2000; + video_mem_term = 0xb2000; *display_desc = "*MDA"; request_region(0x3b0,12,"mda"); request_region(0x3bf, 1,"mda"); @@ -252,14 +252,14 @@ con_type_init(unsigned long kmem_start, const char **display_desc) else /* If not, it is color. */ { can_do_color = 1; - video_mem_term = SLOTSPACE + 0xb8000; + video_mem_term = 0xb8000; video_port_reg = 0x3d4; video_port_val = 0x3d5; if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { int i ; - video_mem_term = SLOTSPACE + 0xc0000; + video_mem_term = 0xc0000; if (!ORIG_VIDEO_ISVGA) { video_type = VIDEO_TYPE_EGAC; @@ -277,8 +277,8 @@ con_type_init(unsigned long kmem_start, const char **display_desc) * controllers (it seems like setting MM=01 * and COE=1 isn't necessarily a good idea) */ - video_mem_base = SLOTSPACE + 0xa0000; - video_mem_term = SLOTSPACE + 0xb0000; + video_mem_base = 0xa0000; + video_mem_term = 0xb0000; outb_p (6, 0x3ce) ; outb_p (6, 0x3cf) ; #endif @@ -310,7 +310,7 @@ con_type_init(unsigned long kmem_start, const char **display_desc) else { video_type = VIDEO_TYPE_CGA; - video_mem_term = SLOTSPACE + 0xba000; + video_mem_term = 0xba000; *display_desc = "*CGA"; request_region(0x3d4,2,"cga"); } @@ -386,10 +386,10 @@ set_scrmem(int currcons, long offset) * (sizif@botik.yaroslavl.su). */ -#define colourmap ((char *)(SLOTSPACE + 0xa0000)) +#define colourmap ((char *)(0xa0000)) /* Pauline Middelink <middelin@polyware.iaf.nl> reports that we should use 0xA0000 for the bwmap as well.. */ -#define blackwmap ((char *)(SLOTSPACE + 0xa0000)) +#define blackwmap ((char *)(0xa0000)) #define cmapsz 8192 #define attrib_port (0x3c0) #define seq_port_reg (0x3c4) diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1fc0a81b3..d5cd08183 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -187,7 +187,12 @@ _kd_mksound(unsigned int hz, unsigned int ticks) return; } +#ifdef CONFIG_SGI +void _kd_nullsound(unsigned int hz, unsigned int ticks) { } +void (*kd_mksound)(unsigned int hz, unsigned int ticks) = _kd_nullsound; +#else void (*kd_mksound)(unsigned int hz, unsigned int ticks) = _kd_mksound; +#endif /* * We handle the console-specific ioctl's here. We allow the |