From: Linus Torvalds Date: Fri, 23 Nov 2007 20:16:11 +0000 (-0500) Subject: Import 2.1.115pre1 X-Git-Tag: 2.1.115pre1 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=b5d6c0fe72cb1f7e7b0f5c4e84c5796c0dcbd54f;p=history.git Import 2.1.115pre1 --- diff --git a/Documentation/VGA-softcursor.txt b/Documentation/VGA-softcursor.txt index 5b1e12d42cdd..70acfbf399eb 100644 --- a/Documentation/VGA-softcursor.txt +++ b/Documentation/VGA-softcursor.txt @@ -3,13 +3,12 @@ Software cursor for VGA by Pavel Machek Linux now has some ability to manipulate cursor appearance. Normally, you can set the size of hardware cursor (and also work around some ugly bugs in -those miserable Trident cards--see #define TRIDENT_GLITCH in drivers/char/ -vga.c). In case you enable "Software generated cursor" in the system -configuration, you can play a few new tricks: you can make your cursor look -like a non-blinking red block, make it inverse background of the character -it's over or to highlight that character and still choose whether the -original hardware cursor should remain visible or not. There may be other -things I have never thought of. +those miserable Trident cards--see #define TRIDENT_GLITCH in drivers/video/ +vgacon.c). You can now play a few new tricks: you can make your cursor look +like a non-blinking red block, make it inverse background of the character it's +over or to highlight that character and still choose whether the original +hardware cursor should remain visible or not. There may be other things I have +never thought of. The cursor appearance is controlled by a "[?1;2;3c" escape sequence where 1, 2 and 3 are parameters described below. If you omit any of them, diff --git a/Makefile b/Makefile index b464017c9a23..079e835c915c 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ VERSION = 2 PATCHLEVEL = 1 -SUBLEVEL = 114 +SUBLEVEL = 115 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/) diff --git a/arch/alpha/kernel/setup.c b/arch/alpha/kernel/setup.c index 25f3f3435204..f0683b1c10bf 100644 --- a/arch/alpha/kernel/setup.c +++ b/arch/alpha/kernel/setup.c @@ -296,7 +296,7 @@ get_sysnames(long type, long variation, static int alcor_indices[] = {0,0,0,1,1,1,0,0,0,0,0,0,2,2,2,2,2,2}; static char * eb64p_names[] = {"EB64+", "Cabriolet", "AlphaPCI64"}; - static int eb64p_indices[] = {0,0,1.2}; + static int eb64p_indices[] = {0,0,1,2}; static char * eb66_names[] = {"EB66", "EB66+"}; static int eb66_indices[] = {0,0,1}; diff --git a/arch/i386/kernel/bios32.c b/arch/i386/kernel/bios32.c index 5e56a7300ba2..1752ff2c033a 100644 --- a/arch/i386/kernel/bios32.c +++ b/arch/i386/kernel/bios32.c @@ -1,7 +1,7 @@ /* * bios32.c - Low-Level PCI Access * - * $Id: bios32.c,v 1.43 1998/08/03 15:59:20 mj Exp $ + * $Id: bios32.c,v 1.44 1998/08/04 14:54:56 mj Exp $ * * Copyright 1993, 1994 Drew Eckhardt * Visionary Computing @@ -65,6 +65,12 @@ * * Jun 19, 1998 : Changed to use spinlocks, so that PCI configuration space * can be accessed from interrupts even on SMP systems. [mj] + * + * August 1998 : Better support for peer host bridges and more paranoid + * checks for direct hardware access. Ugh, this file starts to look as + * a large gallery of common hardware bug workarounds (watch the comments) + * -- the PCI specs themselves are sane, but most implementors should be + * hit hard with \hammer scaled \magstep5. [mj] */ #include @@ -331,6 +337,25 @@ static struct pci_access pci_direct_conf2 = { pci_conf2_write_config_dword }; +/* + * Before we decide to use direct hardware access mechanisms, we try to do some + * trivial checks to ensure it at least _seems_ to be working -- we just test + * whether bus 00 contains a host bridge (this is similar to checking + * techniques used in XFree86, but ours should be more reliable since we + * attempt to make use of direct access hints provided by the PCI BIOS). + */ +__initfunc(int pci_sanity_check(struct pci_access *a)) +{ + u16 dfn, class; + + for(dfn=0; dfn < 0x100; dfn++) + if (!a->read_config_word(0, dfn, PCI_CLASS_DEVICE, &class) && + class == PCI_CLASS_BRIDGE_HOST) + return 1; + DBG("PCI: Sanity check failed\n"); + return 0; +} + __initfunc(static struct pci_access *pci_check_direct(void)) { unsigned int tmp; @@ -345,7 +370,8 @@ __initfunc(static struct pci_access *pci_check_direct(void)) outb (0x01, 0xCFB); tmp = inl (0xCF8); outl (0x80000000, 0xCF8); - if (inl (0xCF8) == 0x80000000) { + if (inl (0xCF8) == 0x80000000 && + pci_sanity_check(&pci_direct_conf1)) { outl (tmp, 0xCF8); __restore_flags(flags); printk("PCI: Using configuration type 1\n"); @@ -361,7 +387,8 @@ __initfunc(static struct pci_access *pci_check_direct(void)) outb (0x00, 0xCFB); outb (0x00, 0xCF8); outb (0x00, 0xCFA); - if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00) { + if (inb (0xCF8) == 0x00 && inb (0xCFA) == 0x00 && + pci_sanity_check(&pci_direct_conf2)) { __restore_flags(flags); printk("PCI: Using configuration type 2\n"); return &pci_direct_conf2; @@ -920,6 +947,7 @@ __initfunc(void pcibios_fixup_peer_bridges(void)) struct pci_bus *b = &pci_root; int i; +#ifdef CONFIG_PCI_DIRECT /* * Don't search for peer host bridges if we use config type 2 * since it reads bogus values for non-existent busses and @@ -927,6 +955,7 @@ __initfunc(void pcibios_fixup_peer_bridges(void)) */ if (access_pci == &pci_direct_conf2) return; +#endif do { int n = b->subordinate+1; u16 l; diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S index 9d9b796f9576..58cc0d38b528 100644 --- a/arch/i386/kernel/entry.S +++ b/arch/i386/kernel/entry.S @@ -562,6 +562,8 @@ ENTRY(sys_call_table) .long SYMBOL_NAME(sys_capset) /* 185 */ .long SYMBOL_NAME(sys_sigaltstack) .long SYMBOL_NAME(sys_sendfile) + .long SYMBOL_NAME(sys_ni_syscall) /* streams1 */ + .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ .rept NR_syscalls-187 .long SYMBOL_NAME(sys_ni_syscall) diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index 92472655f5f9..90e1d4eb9e18 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -1108,9 +1108,8 @@ static inline void init_IO_APIC_traps(void) /* * disable it in the 8259A: */ - cached_irq_mask |= 1 << i; if (i < 16) - set_8259A_irq_mask(i); + disable_8259A_irq(i); } } } diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index 9625e5e6e5f2..ed086f5be3c9 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -48,27 +48,23 @@ atomic_t nmi_counter; /* * About the IO-APIC, the architecture is 'merged' into our * current irq architecture, seemlessly. (i hope). It is only - * visible through 8 more hardware interrupt lines, but otherwise - * drivers are unaffected. The main code is believed to be - * NR_IRQS-safe (nothing anymore thinks we have 16 + * visible through a few more more hardware interrupt lines, but + * otherwise drivers are unaffected. The main code is believed + * to be NR_IRQS-safe (nothing anymore thinks we have 16 * irq lines only), but there might be some places left ... */ /* * This contains the irq mask for both 8259A irq controllers, - * and on SMP the extended IO-APIC IRQs 16-23. The IO-APIC - * uses this mask too, in probe_irq*(). - * - * (0x0000ffff for NR_IRQS==16, 0x00ffffff for NR_IRQS=24) */ -#if NR_IRQS == 64 -unsigned long long cached_irq_mask = -1; -#else -unsigned long long cached_irq_mask = (((unsigned long long) 1)<> 8) & 0xff) +#define cached_21 (__byte(0,cached_irq_mask)) +#define cached_A1 (__byte(1,cached_irq_mask)) spinlock_t irq_controller_lock; @@ -81,18 +77,11 @@ spinlock_t irq_controller_lock; * this 'mixed mode' IRQ handling costs us one more branch in do_IRQ, * but we have _much_ higher compatibility and robustness this way. */ - -/* - * Default to all normal IRQ's _not_ using the IO APIC. - * - * To get IO-APIC interrupts we turn some of them into IO-APIC - * interrupts during boot. - */ unsigned long long io_apic_irqs = 0; static void do_8259A_IRQ (unsigned int irq, int cpu, struct pt_regs * regs); -static void enable_8259A_irq (unsigned int irq); -static void disable_8259A_irq (unsigned int irq); +static void enable_8259A_irq(unsigned int irq); +void disable_8259A_irq(unsigned int irq); /* * Dummy controller type for unused interrupts @@ -127,10 +116,10 @@ int irq_vector[NR_IRQS] = { IRQ0_TRAP_VECTOR , 0 }; * These have to be protected by the irq controller spinlock * before being called. */ - -static inline void mask_8259A(unsigned int irq) +void disable_8259A_irq(unsigned int irq) { - cached_irq_mask |= 1 << irq; + unsigned int mask = 1 << irq; + cached_irq_mask |= mask; if (irq & 8) { outb(cached_A1,0xA1); } else { @@ -138,9 +127,10 @@ static inline void mask_8259A(unsigned int irq) } } -static inline void unmask_8259A(unsigned int irq) +static void enable_8259A_irq(unsigned int irq) { - cached_irq_mask &= ~(1 << irq); + unsigned int mask = ~(1 << irq); + cached_irq_mask &= mask; if (irq & 8) { outb(cached_A1,0xA1); } else { @@ -148,21 +138,6 @@ static inline void unmask_8259A(unsigned int irq) } } -void set_8259A_irq_mask(unsigned int irq) -{ - /* - * (it might happen that we see IRQ>15 on a UP box, with SMP - * emulation) - */ - if (irq < 16) { - if (irq & 8) { - outb(cached_A1,0xA1); - } else { - outb(cached_21,0x21); - } - } -} - /* * This builds up the IRQ handler stubs using some ugly macros in irq.h * @@ -638,23 +613,7 @@ int handle_IRQ_event(unsigned int irq, struct pt_regs * regs) return status; } -/* - * disable/enable_irq() wait for all irq contexts to finish - * executing. Also it's recursive. - */ -static void disable_8259A_irq(unsigned int irq) -{ - cached_irq_mask |= 1 << irq; - set_8259A_irq_mask(irq); -} - -void enable_8259A_irq (unsigned int irq) -{ - cached_irq_mask &= ~(1 << irq); - set_8259A_irq_mask(irq); -} - -int i8259A_irq_pending (unsigned int irq) +int i8259A_irq_pending(unsigned int irq) { unsigned int mask = 1< #include #include +#include #ifdef CONFIG_APM #include #endif @@ -169,6 +170,14 @@ int kmsg_redirect = 0; */ static struct vc_data *master_display_fg = NULL; +/* + * Unfortunately, we need to delay tty echo when we're currently writing to the + * console since the code is (and always was) not re-entrant, so we insert + * all filp requests to con_task_queue instead of tq_timer and run it from + * the console_bh. + */ +DECLARE_TASK_QUEUE(con_task_queue); + /* * Low-Level Functions */ @@ -1068,7 +1077,7 @@ static void respond_string(const char * p, struct tty_struct * tty) tty_insert_flip_char(tty, *p, 0); p++; } - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void cursor_report(int currcons, struct tty_struct * tty) @@ -1735,11 +1744,6 @@ static int do_con_write(struct tty_struct * tty, int from_user, struct vt_struct *vt = (struct vt_struct *)tty->driver_data; u16 himask, charmask; -#if CONFIG_AP1000 - ap_write(1,buf,count); - return(count); -#endif - currcons = vt->vc_num; if (!vc_cons_allocated(currcons)) { /* could this happen? */ @@ -1893,6 +1897,7 @@ static int do_con_write(struct tty_struct * tty, int from_user, */ static void console_bh(void) { + run_task_queue(&con_task_queue); if (want_console >= 0) { if (want_console != fg_console && vc_cons_allocated(want_console)) { hide_cursor(fg_console); @@ -1924,10 +1929,6 @@ void vt_console_print(struct console *co, const char * b, unsigned count) ushort cnt = 0; ushort myx = x; -#if CONFIG_AP1000 - prom_printf(b); - return; -#endif if (!printable || printing) return; /* console not yet initialized */ printing = 1; @@ -1938,21 +1939,26 @@ void vt_console_print(struct console *co, const char * b, unsigned count) if (!vc_cons_allocated(currcons)) { /* impossible */ printk("vt_console_print: tty %d not allocated ??\n", currcons+1); - return; + goto quit; } /* undraw cursor first */ - hide_cursor(currcons); - + if (IS_FG) + hide_cursor(currcons); + start = (ushort *)pos; /* Contrived structure to try to emulate original need_wrap behaviour * Problems caused when we have need_wrap set on '\n' character */ + disable_bh(CONSOLE_BH); while (count--) { + enable_bh(CONSOLE_BH); c = *b++; + disable_bh(CONSOLE_BH); if (c == 10 || c == 13 || c == 8 || need_wrap) { if (cnt > 0) { - sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); + if (IS_VISIBLE) + sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); x += cnt; if (need_wrap) x--; @@ -1982,15 +1988,19 @@ void vt_console_print(struct console *co, const char * b, unsigned count) myx++; } if (cnt > 0) { - sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); + if (IS_VISIBLE) + sw->con_putcs(vc_cons[currcons].d, start, cnt, y, x); x += cnt; if (x == video_num_columns) { x--; need_wrap = 1; } } + enable_bh(CONSOLE_BH); set_cursor(currcons); poke_blanked_console(); + +quit: printing = 0; } @@ -2127,10 +2137,8 @@ static void con_stop(struct tty_struct *tty) console_num = MINOR(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; -#if !CONFIG_AP1000 set_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); -#endif } /* @@ -2144,10 +2152,8 @@ static void con_start(struct tty_struct *tty) console_num = MINOR(tty->device) - (tty->driver.minor_start); if (!vc_cons_allocated(console_num)) return; -#if !CONFIG_AP1000 clr_vc_kbd_led(kbd_table + console_num, VC_SCROLLOCK); set_leds(); -#endif } static void con_flush_chars(struct tty_struct *tty) @@ -2256,10 +2262,6 @@ __initfunc(unsigned long con_init(unsigned long kmem_start)) if (tty_register_driver(&console_driver)) panic("Couldn't register console driver\n"); -#if CONFIG_AP1000 - return kmem_start; -#endif - timer_table[BLANK_TIMER].fn = blank_screen; timer_table[BLANK_TIMER].expires = 0; if (blankinterval) { @@ -2597,7 +2599,7 @@ int con_font_op(int currcons, struct console_font_op *op) /* If from KDFONTOP ioctl, don't allow things which can be done in userland, so that we can get rid of this soon */ - if (op->flags & KD_FONT_FLAG_NEW) + if (!(op->flags & KD_FONT_FLAG_OLD)) goto quit; rc = -EFAULT; for (h = 32; h > 0; h--) @@ -2640,7 +2642,7 @@ int con_font_op(int currcons, struct console_font_op *op) if (op->data && op->charcount > old_op.charcount) rc = -ENOSPC; - if (op->flags & KD_FONT_FLAG_NEW) { + if (!(op->flags & KD_FONT_FLAG_OLD)) { if (op->width > old_op.width || op->height > old_op.height) rc = -ENOSPC; @@ -2694,7 +2696,7 @@ void putconsxy(int currcons, char *p) u16 vcs_scr_readw(int currcons, u16 *org) { - if (org == (u16 *)pos && softcursor_original != -1) + if ((unsigned long)org == pos && softcursor_original != -1) return softcursor_original; return scr_readw(org); } @@ -2702,7 +2704,7 @@ u16 vcs_scr_readw(int currcons, u16 *org) void vcs_scr_writew(int currcons, u16 val, u16 *org) { scr_writew(val, org); - if (org == (u16 *)pos) { + if ((unsigned long)org == pos) { softcursor_original = -1; add_softcursor(currcons); } diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index bbd944b05bf5..a60b2b224e84 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -19,6 +19,7 @@ * parts by Geert Uytterhoeven, May 1997 * * 27-05-97: Added support for the Magic SysRq Key (Martin Mares) + * 16-01-97: Dead-key-twice behavior now configurable (Jiri Hanika) */ #include @@ -140,7 +141,8 @@ const int max_vals[] = { const int NR_TYPES = SIZE(max_vals); -static void put_queue(int); +/* N.B. drivers/macintosh/mac_keyb.c needs to call put_queue */ +void put_queue(int); static unsigned char handle_diacr(unsigned char); /* kbd_pt_regs - set by keyboard_interrupt(), used by show_ptregs() */ @@ -310,12 +312,12 @@ void handle_scancode(unsigned char scancode) } -static void put_queue(int ch) +void put_queue(int ch) { wake_up(&keypress_wait); if (tty) { tty_insert_flip_char(tty, ch, 0); - tty_schedule_flip(tty); + con_schedule_flip(tty); } } @@ -329,7 +331,7 @@ static void puts_queue(char *cp) tty_insert_flip_char(tty, *cp, 0); cp++; } - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void applkey(int key, char mode) @@ -441,7 +443,7 @@ static void send_intr(void) if (!tty) return; tty_insert_flip_char(tty, 0, TTY_BREAK); - tty_schedule_flip(tty); + con_schedule_flip(tty); } static void scroll_forw(void) @@ -539,8 +541,8 @@ static void do_self(unsigned char value, char up_flag) static unsigned char ret_diacr[NR_DEAD] = {A_GRAVE, A_ACUTE, A_CFLEX, A_TILDE, A_DIAER, A_CEDIL }; -/* If a dead key pressed twice, output a character corresponding to it, */ -/* otherwise just remember the dead key. */ +/* If a dead key pressed twice, output a character corresponding to it, */ +/* unless overriden in accent_table; otherwise just remember the dead key. */ static void do_dead(unsigned char value, char up_flag) { @@ -549,8 +551,7 @@ static void do_dead(unsigned char value, char up_flag) value = ret_diacr[value]; if (diacr == value) { /* pressed twice */ - diacr = 0; - put_queue(value); + put_queue(handle_diacr(value)); return; } diacr = value; @@ -574,7 +575,8 @@ unsigned char handle_diacr(unsigned char ch) return accent_table[i].result; } - put_queue(d); + if (ch != d) /* dead key pressed twice, put once */ + put_queue(d); return ch; } diff --git a/drivers/char/radio-aimslab.c b/drivers/char/radio-aimslab.c index 4f1e49cec02b..ed1cced0236a 100644 --- a/drivers/char/radio-aimslab.c +++ b/drivers/char/radio-aimslab.c @@ -155,7 +155,7 @@ static int rt_setfreq(struct rt_device *dev, unsigned long freq) /* adapted from radio-aztech.c */ - freq = (freq / 16.0) * 100; /* massage the data a little */ + freq = (freq * 100) / 16; /* massage the data a little */ freq += 1070; /* IF = 10.7 MHz */ freq /= 5; /* ref = 25 kHz */ @@ -223,8 +223,8 @@ static int rt_ioctl(struct video_device *dev, unsigned int cmd, void *arg) return -EFAULT; if(v.tuner) /* Only 1 tuner */ return -EINVAL; - v.rangelow=(int)(88.0*16); - v.rangehigh=(int)(108.0*16); + v.rangelow=(88*16); + v.rangehigh=(108*16); v.flags=0; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*rt_getsigstr(rt); diff --git a/drivers/char/radio-aztech.c b/drivers/char/radio-aztech.c index d15696138ccb..e883c712a7b9 100644 --- a/drivers/char/radio-aztech.c +++ b/drivers/char/radio-aztech.c @@ -113,7 +113,7 @@ static int az_setfreq(struct az_device *dev, unsigned long frequency) { int i; - frequency = (frequency / 16.0) * 100; /* massage data a bit */ + frequency = (frequency * 100) / 16; /* massage data a bit */ frequency += 1070; /* tuning needs 24 data bits */ frequency /= 5; @@ -177,8 +177,8 @@ static int az_ioctl(struct video_device *dev, unsigned int cmd, void *arg) return -EFAULT; if(v.tuner) /* Only 1 tuner */ return -EINVAL; - v.rangelow=(int)(87.9*16); - v.rangehigh=(int)(107.8*16); + v.rangelow=(879*16)/10; + v.rangehigh=(1078*16)/10; v.flags=0; v.mode=VIDEO_MODE_AUTO; v.signal=0xFFFF*az_getsigstr(az); diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 8b8ba87ec095..5d75b9f3292b 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c @@ -393,7 +393,7 @@ do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm) if (!perm) return -EPERM; op.op = KD_FONT_OP_SET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; @@ -401,7 +401,7 @@ do_fontx_ioctl(int cmd, struct consolefontdesc *user_cfd, int perm) return con_font_op(fg_console, &op); case GIO_FONTX: { op.op = KD_FONT_OP_GET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = cfdarg.charheight; op.charcount = cfdarg.charcount; @@ -955,7 +955,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, if (!perm) return -EPERM; op.op = KD_FONT_OP_SET; - op.flags = KD_FONT_FLAG_DONT_RECALC; /* Compatibility */ + op.flags = KD_FONT_FLAG_OLD | KD_FONT_FLAG_DONT_RECALC; /* Compatibility */ op.width = 8; op.height = 0; op.charcount = 256; @@ -966,7 +966,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, case GIO_FONT: { struct console_font_op op; op.op = KD_FONT_OP_GET; - op.flags = 0; + op.flags = KD_FONT_FLAG_OLD; op.width = 8; op.height = 32; op.charcount = 256; @@ -1014,7 +1014,6 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, return -EFAULT; if (!perm && op.op != KD_FONT_OP_GET) return -EPERM; - op.flags |= KD_FONT_FLAG_NEW; i = con_font_op(console, &op); if (i) return i; if (copy_to_user((void *) arg, &op, sizeof(op))) @@ -1249,14 +1248,6 @@ void complete_change_console(unsigned int new_console) if (vt_cons[new_console]->vc_mode == KD_TEXT) set_palette() ; - /* FIXME: Do we still need this? */ -#ifdef CONFIG_SUN_CONSOLE - if (old_vc_mode != vt_cons[new_console]->vc_mode) - { - if (old_vc_mode == KD_GRAPHICS) - update_screen(new_console); - } -#endif /* * Wake anyone waiting for their VT to activate */ diff --git a/drivers/isdn/pcbit/pcbit.h b/drivers/isdn/pcbit/pcbit.h index 89a608904d7d..20051bf3ec13 100644 --- a/drivers/isdn/pcbit/pcbit.h +++ b/drivers/isdn/pcbit/pcbit.h @@ -98,7 +98,7 @@ struct pcbit_dev { }; #define STATS_TIMER (10*HZ) -#define ERRTIME (0.1*HZ) +#define ERRTIME (HZ/10) /* MRU */ #define MAXBUFSIZE 1534 diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c index 3a5aafcd4914..f116fb7bf4f4 100644 --- a/drivers/scsi/ibmmca.c +++ b/drivers/scsi/ibmmca.c @@ -2137,8 +2137,7 @@ static int ldn_access_load(struct Scsi_Host *shpnt, int ldn) { if (IBM_DS.total_accesses == 0) return (0); if (IBM_DS.ldn_access[ldn] == 0) return (0); -#error Floating point in kernel - shoot programmer - return((int)(((float)IBM_DS.ldn_access[ldn]/(float)IBM_DS.total_accesses)*(float)100.000)); + return (IBM_DS.ldn_access[ldn] * 100) / IBM_DS.total_accesses; } /* calculate total amount of r/w-accesses */ diff --git a/drivers/scsi/wd7000.c b/drivers/scsi/wd7000.c index 7b8a202c1b41..f16a44f39d2b 100644 --- a/drivers/scsi/wd7000.c +++ b/drivers/scsi/wd7000.c @@ -666,7 +666,7 @@ void wd7000_setup (char *str, int *ints) configs[wd7000_card_num].bus_on = BUS_ON; } else - configs[wd7000_card_num].bus_on = ints[4] / 125.0; + configs[wd7000_card_num].bus_on = ints[4] / 125; } else configs[wd7000_card_num].bus_on = BUS_ON; @@ -678,7 +678,7 @@ void wd7000_setup (char *str, int *ints) configs[wd7000_card_num].bus_off = BUS_OFF; } else - configs[wd7000_card_num].bus_off = ints[5] / 125.0; + configs[wd7000_card_num].bus_off = ints[5] / 125; } else configs[wd7000_card_num].bus_off = BUS_OFF; diff --git a/drivers/video/vgacon.c b/drivers/video/vgacon.c index e7a07c1c9e8b..d4fd45d4b8ba 100644 --- a/drivers/video/vgacon.c +++ b/drivers/video/vgacon.c @@ -190,6 +190,7 @@ __initfunc(static const char *vgacon_startup(void)) display_desc = "*MDA"; request_region(0x3b0,12,"mda"); request_region(0x3bf, 1,"mda"); + vga_video_font_height = 16; } } else /* If not, it is color. */ @@ -256,6 +257,7 @@ __initfunc(static const char *vgacon_startup(void)) vga_vram_end = 0xba000; display_desc = "*CGA"; request_region(0x3d4,2,"cga"); + vga_video_font_height = 8; } } vga_vram_base = VGA_MAP_MEM(vga_vram_base); @@ -284,11 +286,12 @@ __initfunc(static const char *vgacon_startup(void)) || vga_video_type == VIDEO_TYPE_EGAM) { vga_hardscroll_enabled = vga_hardscroll_user_enable; vga_default_font_height = ORIG_VIDEO_POINTS; - vga_video_font_height = video_font_height = ORIG_VIDEO_POINTS; + vga_video_font_height = ORIG_VIDEO_POINTS; /* This may be suboptimal but is a safe bet - go with it */ video_scan_lines = - video_font_height * vga_video_num_lines; + vga_video_font_height * vga_video_num_lines; } + video_font_height = vga_video_font_height; return display_desc; } @@ -356,19 +359,15 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, u8 blink, static void vgacon_invert_region(struct vc_data *c, u16 *p, int count) { - if (vga_can_do_color) { - while (count--) { - u16 a = scr_readw(p); - a = (((a) & 0x88ff) | (((a) & 0x7000) >> 4) - | (((a) & 0x0700) << 4)); - scr_writew(a, p++); - } - } else { - while (count--) { - u16 a = scr_readw(p); + int col = vga_can_do_color; + + while (count--) { + u16 a = scr_readw(p); + if (col) + a = ((a) & 0x88ff) | (((a) & 0x7000) >> 4) | (((a) & 0x0700) << 4); + else a ^= ((a & 0x0700) == 0x0100) ? 0x7000 : 0x7700; - scr_writew(a, p++); - } + scr_writew(a, p++); } } @@ -684,7 +683,7 @@ vgacon_do_font_op(char *arg, int set, int ch512) charmap = (char *)VGA_MAP_MEM(colourmap); beg = 0x0e; #ifdef VGA_CAN_DO_64KB - if (video_type == VIDEO_TYPE_VGAC) + if (vga_video_type == VIDEO_TYPE_VGAC) beg = 0x06; #endif } else { diff --git a/fs/namei.c b/fs/namei.c index f6694ab1a4ee..6d1ed898f702 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -524,13 +524,19 @@ struct dentry * open_namei(const char * pathname, int flag, int mode) if (flag & O_CREAT) { struct dentry *dir; + error = -EEXIST; + if (dentry->d_inode && (flag & O_EXCL)) + goto exit; + dir = lock_parent(dentry); error = PTR_ERR(dir); if (IS_ERR(dir)) goto exit; + /* - * The existence test must be done _after_ getting the directory - * semaphore - the dentry might otherwise change. + * Somebody might have created the file while we + * waited for the directory lock.. So we have to + * re-do the existence test. */ if (dentry->d_inode) { error = 0; diff --git a/fs/proc/proc_tty.c b/fs/proc/proc_tty.c index 86434ba453fe..5ba24561566d 100644 --- a/fs/proc/proc_tty.c +++ b/fs/proc/proc_tty.c @@ -80,7 +80,7 @@ static int tty_drivers_read_proc(char *page, char **start, off_t off, break; } len += sprintf(page+len, "%-20s /dev/%-8s %3d %7s %s\n", - p->driver_name ? p->driver_name : "", + p->driver_name ? p->driver_name : "unknown", p->name, p->major, range, type); if (len+begin > off+count) break; diff --git a/include/asm-i386/spinlock.h b/include/asm-i386/spinlock.h index 23568dd668ae..890ac50ae4c3 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-i386/spinlock.h @@ -10,8 +10,8 @@ /* * Your basic spinlocks, allowing only a single CPU anywhere */ -typedef struct { } spinlock_t; -#define SPIN_LOCK_UNLOCKED { } +typedef struct { int gcc_is_buggy; } spinlock_t; +#define SPIN_LOCK_UNLOCKED { 0 } #define spin_lock_init(lock) do { } while(0) #define spin_lock(lock) do { } while(0) diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h index a5c4659d3338..aa5aa860575c 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-i386/unistd.h @@ -193,6 +193,8 @@ #define __NR_capset 185 #define __NR_sigaltstack 186 #define __NR_sendfile 187 +#define __NR_streams1 188 /* some people actually want it */ +#define __NR_streams2 189 /* some people actually want it */ /* user-visible error numbers are in the range -1 - -122: see */ diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 64f60f425b44..dafd1c299429 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -9,12 +9,6 @@ * to achieve effects such as fast scrolling by changing the origin. */ -/* - * You can set here how should the cursor look by default. - * In case you set CONFIG_SOFTCURSOR, this might be really interesting. - */ -#define CUR_DEFAULT CUR_UNDERLINE - #define NPAR 16 struct vc_data { @@ -108,3 +102,5 @@ extern struct vc vc_cons [MAX_NR_CONSOLES]; #define CUR_BLOCK 6 #define CUR_HWMASK 0x0f #define CUR_SWMASK 0xfff0 + +#define CUR_DEFAULT CUR_UNDERLINE diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 9ce5c32c356f..f5ae9ed93523 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h @@ -151,4 +151,14 @@ int keyboard_wait_for_keypress(struct console *); extern unsigned int keymap_count; +/* console.c */ + +extern task_queue con_task_queue; + +extern inline void con_schedule_flip(struct tty_struct *t) +{ + queue_task(&t->flip.tqueue, &con_task_queue); + mark_bh(CONSOLE_BH); +} + #endif diff --git a/include/linux/kd.h b/include/linux/kd.h index ce8bc009efd0..c717c1981a35 100644 --- a/include/linux/kd.h +++ b/include/linux/kd.h @@ -168,10 +168,9 @@ struct console_font_op { #define KD_FONT_OP_SET_DEFAULT 2 /* Set font to default, data points to name / NULL */ #define KD_FONT_OP_COPY 3 /* Copy from another console */ -#define KD_FONT_FLAG_GLOBAL 1 /* Change on _all_ consoles */ -#define KD_FONT_FLAG_DONT_RECALC 2 /* Don't recalculate hw charcell size [compat] */ +#define KD_FONT_FLAG_DONT_RECALC 1 /* Don't recalculate hw charcell size [compat] */ #ifdef __KERNEL__ -#define KD_FONT_FLAG_NEW 0x80000000 /* Indicate new KDFONTOP interface, which should be more strict */ +#define KD_FONT_FLAG_OLD 0x80000000 /* Invoked via old interface [compat] */ #endif /* note: 0x4B00-0x4B4E all have had a value at some time; diff --git a/include/linux/sched.h b/include/linux/sched.h index f4ca927104f2..3c466017d407 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -322,16 +322,6 @@ struct task_struct { #define DEF_PRIORITY (20*HZ/100) /* 200 ms time slices */ -/* Note: This is very ugly I admit. But some versions of gcc will - * dump core when an empty structure constant is parsed at - * the end of a large top level structure initialization. -DaveM - */ -#ifdef __SMP__ -#define INIT_LOCKS SPIN_LOCK_UNLOCKED -#else -#define INIT_LOCKS -#endif - /* * INIT_TASK is used to set up the first task table, touch at * your own risk!. Base=0, limit=0x1fffff (=2MB) @@ -367,7 +357,7 @@ struct task_struct { /* fs */ &init_fs, \ /* files */ &init_files, \ /* mm */ &init_mm, \ -/* signals */ INIT_LOCKS, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ +/* signals */ SPIN_LOCK_UNLOCKED, &init_signals, {{0}}, {{0}}, NULL, &init_task.sigqueue, 0, 0, \ } union task_union { diff --git a/init/main.c b/init/main.c index af782a652144..aa48f852cc64 100644 --- a/init/main.c +++ b/init/main.c @@ -1123,12 +1123,13 @@ __initfunc(asmlinkage void start_kernel(void)) dquot_init_hash(); #endif printk("POSIX conformance testing by UNIFIX\n"); - check_bugs(); #ifdef __SMP__ smp_init(); #endif + check_bugs(); + #if defined(CONFIG_MTRR) /* Do this after SMP initialization */ /* * We should probably create some architecture-dependent "fixup after