diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-03-09 20:33:35 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-03-09 20:33:35 +0000 |
commit | 116674acc97ba75a720329996877077d988443a2 (patch) | |
tree | 6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /arch/i386 | |
parent | 71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff) |
Merge with Linux 2.4.2.
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/boot/compressed/misc.c | 1 | ||||
-rw-r--r-- | arch/i386/defconfig | 7 | ||||
-rw-r--r-- | arch/i386/kernel/apm.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/dmi_scan.c | 50 | ||||
-rw-r--r-- | arch/i386/kernel/head.S | 2 | ||||
-rw-r--r-- | arch/i386/kernel/i386_ksyms.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/i387.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/i8259.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/io_apic.c | 11 | ||||
-rw-r--r-- | arch/i386/kernel/irq.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/microcode.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/mtrr.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/pci-irq.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/pci-pc.c | 63 | ||||
-rw-r--r-- | arch/i386/kernel/process.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 45 | ||||
-rw-r--r-- | arch/i386/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/smpboot.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/traps.c | 5 | ||||
-rw-r--r-- | arch/i386/kernel/visws_apic.c | 2 | ||||
-rw-r--r-- | arch/i386/mm/extable.c | 19 | ||||
-rw-r--r-- | arch/i386/mm/fault.c | 2 |
23 files changed, 159 insertions, 74 deletions
diff --git a/arch/i386/boot/compressed/misc.c b/arch/i386/boot/compressed/misc.c index abb382d8f..0baa87ea9 100644 --- a/arch/i386/boot/compressed/misc.c +++ b/arch/i386/boot/compressed/misc.c @@ -10,6 +10,7 @@ */ #include <linux/vmalloc.h> +#include <linux/tty.h> #include <asm/io.h> /* * gzip declarations diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 05a2e3725..875a84bf9 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -162,6 +162,11 @@ CONFIG_IP_MULTICAST=y # CONFIG_BRIDGE is not set # +# QoS and/or fair queueing +# +# CONFIG_NET_SCHED is not set + +# # Telephony Support # # CONFIG_PHONE is not set @@ -628,6 +633,8 @@ CONFIG_SOUND=y CONFIG_SOUND_ES1371=y # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set +# CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_ICH is not set # CONFIG_SOUND_SONICVIBES is not set # CONFIG_SOUND_TRIDENT is not set # CONFIG_SOUND_MSNDCLAS is not set diff --git a/arch/i386/kernel/apm.c b/arch/i386/kernel/apm.c index 9703e3304..4e1ee2f83 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/i386/kernel/apm.c @@ -176,7 +176,7 @@ #include <linux/stddef.h> #include <linux/timer.h> #include <linux/fcntl.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/stat.h> #include <linux/proc_fs.h> #include <linux/miscdevice.h> diff --git a/arch/i386/kernel/dmi_scan.c b/arch/i386/kernel/dmi_scan.c index 8d5a9efb3..4029a8d14 100644 --- a/arch/i386/kernel/dmi_scan.c +++ b/arch/i386/kernel/dmi_scan.c @@ -12,6 +12,8 @@ struct dmi_header u16 handle; }; +#define dmi_printk(x) + static char * __init dmi_string(struct dmi_header *dm, u8 s) { u8 *bp=(u8 *)dm; @@ -73,13 +75,13 @@ int __init dmi_iterate(void (*decode)(struct dmi_header *)) u16 len=buf[7]<<8|buf[6]; u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]; - printk(KERN_INFO "DMI %d.%d present.\n", - buf[14]>>4, buf[14]&0x0F); - printk(KERN_INFO "%d structures occupying %d bytes.\n", + dmi_printk((KERN_INFO "DMI %d.%d present.\n", + buf[14]>>4, buf[14]&0x0F)); + dmi_printk((KERN_INFO "%d structures occupying %d bytes.\n", buf[13]<<8|buf[12], - buf[7]<<8|buf[6]); - printk(KERN_INFO "DMI table at 0x%08X.\n", - buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]); + buf[7]<<8|buf[6])); + dmi_printk((KERN_INFO "DMI table at 0x%08X.\n", + buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8])); if(dmi_table(base,len, num, decode)==0) return 0; } @@ -106,11 +108,11 @@ static void __init dmi_decode(struct dmi_header *dm) if(*p && *p!=' ') { - printk("BIOS Vendor: %s\n", p); - printk("BIOS Version: %s\n", - dmi_string(dm, data[5])); - printk("BIOS Release: %s\n", - dmi_string(dm, data[8])); + dmi_printk(("BIOS Vendor: %s\n", p)); + dmi_printk(("BIOS Version: %s\n", + dmi_string(dm, data[5]))); + dmi_printk(("BIOS Release: %s\n", + dmi_string(dm, data[8]))); } /* @@ -144,13 +146,13 @@ static void __init dmi_decode(struct dmi_header *dm) if(*p && *p!=' ') { - printk("System Vendor: %s.\n",p); - printk("Product Name: %s.\n", - dmi_string(dm, data[5])); - printk("Version %s.\n", - dmi_string(dm, data[6])); - printk("Serial Number %s.\n", - dmi_string(dm, data[7])); + dmi_printk(("System Vendor: %s.\n",p)); + dmi_printk(("Product Name: %s.\n", + dmi_string(dm, data[5]))); + dmi_printk(("Version %s.\n", + dmi_string(dm, data[6]))); + dmi_printk(("Serial Number %s.\n", + dmi_string(dm, data[7]))); } break; case 2: @@ -158,17 +160,17 @@ static void __init dmi_decode(struct dmi_header *dm) if(*p && *p!=' ') { - printk("Board Vendor: %s.\n",p); - printk("Board Name: %s.\n", - dmi_string(dm, data[5])); - printk("Board Version: %s.\n", - dmi_string(dm, data[6])); + dmi_printk(("Board Vendor: %s.\n",p)); + dmi_printk(("Board Name: %s.\n", + dmi_string(dm, data[5]))); + dmi_printk(("Board Version: %s.\n", + dmi_string(dm, data[6]))); } break; case 3: p=dmi_string(dm,data[8]); if(*p && *p!=' ') - printk("Asset Tag: %s.\n", p); + dmi_printk(("Asset Tag: %s.\n", p)); break; } } diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S index c74b80135..400216f37 100644 --- a/arch/i386/kernel/head.S +++ b/arch/i386/kernel/head.S @@ -34,7 +34,7 @@ #define X86_HARD_MATH CPU_PARAMS+6 #define X86_CPUID CPU_PARAMS+8 #define X86_CAPABILITY CPU_PARAMS+12 -#define X86_VENDOR_ID CPU_PARAMS+16 +#define X86_VENDOR_ID CPU_PARAMS+28 /* * swapper_pg_dir is the main page directory, address 0x00101000 diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c index 071b3991a..20bc14fc6 100644 --- a/arch/i386/kernel/i386_ksyms.c +++ b/arch/i386/kernel/i386_ksyms.c @@ -13,6 +13,7 @@ #include <linux/apm_bios.h> #include <linux/kernel.h> #include <linux/string.h> +#include <linux/tty.h> #include <asm/semaphore.h> #include <asm/processor.h> diff --git a/arch/i386/kernel/i387.c b/arch/i386/kernel/i387.c index a3a526b4b..ba97ca4bc 100644 --- a/arch/i386/kernel/i387.c +++ b/arch/i386/kernel/i387.c @@ -216,7 +216,7 @@ void set_fpu_twd( struct task_struct *tsk, unsigned short twd ) void set_fpu_mxcsr( struct task_struct *tsk, unsigned short mxcsr ) { if ( cpu_has_xmm ) { - tsk->thread.i387.fxsave.mxcsr = mxcsr; + tsk->thread.i387.fxsave.mxcsr = (mxcsr & 0xffbf); } } @@ -354,6 +354,8 @@ static inline int restore_i387_fxsave( struct _fpstate *buf ) if ( __copy_from_user( &tsk->thread.i387.fxsave, &buf->_fxsr_env[0], sizeof(struct i387_fxsave_struct) ) ) return 1; + /* mxcsr bit 6 and 31-16 must be zero for security reasons */ + tsk->thread.i387.fxsave.mxcsr &= 0xffbf; return convert_fxsr_from_user( &tsk->thread.i387.fxsave, buf ); } diff --git a/arch/i386/kernel/i8259.c b/arch/i386/kernel/i8259.c index 570614282..ce8bc8737 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/i386/kernel/i8259.c @@ -6,7 +6,7 @@ #include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/timex.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/random.h> #include <linux/smp_lock.h> #include <linux/init.h> diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index b17f499b4..e7fe3957b 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c @@ -1509,15 +1509,16 @@ static inline void check_timer(void) * - IRQ2 is the cascade IRQ, and cannot be a io-apic IRQ. * Linux doesn't really care, as it's not actually used * for any interrupt handling anyway. - * - IRQ13 is the FPU error IRQ, and may be connected - * directly from the FPU to the old PIC. Linux doesn't - * really care, because Linux doesn't want to use IRQ13 - * anyway (exception 16 is the proper FPU error signal) + * - There used to be IRQ13 here as well, but all + * MPS-compliant must not use it for FPU coupling and we + * want to use exception 16 anyway. And there are + * systems who connect it to an I/O APIC for other uses. + * Thus we don't mark it special any longer. * * Additionally, something is definitely wrong with irq9 * on PIIX4 boards. */ -#define PIC_IRQS ((1<<2)|(1<<13)) +#define PIC_IRQS (1<<2) void __init setup_IO_APIC(void) { diff --git a/arch/i386/kernel/irq.c b/arch/i386/kernel/irq.c index cf6878787..2c935207a 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/i386/kernel/irq.c @@ -25,7 +25,7 @@ #include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/timex.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/random.h> #include <linux/smp_lock.h> #include <linux/init.h> @@ -312,6 +312,7 @@ static inline void get_irqlock(int cpu) /* Uhhuh.. Somebody else got it. Wait.. */ do { do { + rep_nop(); } while (test_bit(0,&global_irq_lock)); } while (test_and_set_bit(0,&global_irq_lock)); } diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index f0a88c20e..0bc04116d 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -52,7 +52,7 @@ #include <linux/init.h> #include <linux/sched.h> #include <linux/module.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/miscdevice.h> #include <linux/devfs_fs_kernel.h> diff --git a/arch/i386/kernel/mtrr.c b/arch/i386/kernel/mtrr.c index 60764e3cd..7d85ce240 100644 --- a/arch/i386/kernel/mtrr.c +++ b/arch/i386/kernel/mtrr.c @@ -241,7 +241,7 @@ #include <linux/kernel.h> #include <linux/wait.h> #include <linux/string.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/ioport.h> #include <linux/delay.h> #include <linux/fs.h> diff --git a/arch/i386/kernel/pci-irq.c b/arch/i386/kernel/pci-irq.c index 8281e3f82..bc1dd9c7e 100644 --- a/arch/i386/kernel/pci-irq.c +++ b/arch/i386/kernel/pci-irq.c @@ -9,7 +9,7 @@ #include <linux/kernel.h> #include <linux/pci.h> #include <linux/init.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/interrupt.h> #include <linux/irq.h> diff --git a/arch/i386/kernel/pci-pc.c b/arch/i386/kernel/pci-pc.c index 258e63627..d2a8afbbb 100644 --- a/arch/i386/kernel/pci-pc.c +++ b/arch/i386/kernel/pci-pc.c @@ -843,30 +843,40 @@ static void __init pci_fixup_i450gx(struct pci_dev *d) pcibios_last_bus = -1; } +/* + * ServerWorks host bridges -- Find and scan all secondary buses. + * Register 0x44 contains first, 0x45 last bus number routed there. + */ static void __init pci_fixup_serverworks(struct pci_dev *d) { - /* - * ServerWorks host bridges -- Find and scan all secondary buses. - * Register 0x44 contains first, 0x45 last bus number routed there. - */ - u8 busno; - pci_read_config_byte(d, 0x44, &busno); - printk("PCI: ServerWorks host bridge: secondary bus %02x\n", busno); - pci_scan_bus(busno, pci_root_ops, NULL); - pcibios_last_bus = -1; + u8 busno1, busno2; + + pci_read_config_byte(d, 0x44, &busno1); + pci_read_config_byte(d, 0x45, &busno2); + if (busno2 < busno1) + busno2 = busno1; + if (busno2 > pcibios_last_bus) { + pcibios_last_bus = busno2; + printk("PCI: ServerWorks host bridge: last bus %02x\n", pcibios_last_bus); + } } +/* + * Compaq host bridges -- Find and scan all secondary buses. + * This time registers 0xc8 and 0xc9. + */ static void __init pci_fixup_compaq(struct pci_dev *d) { - /* - * Compaq host bridges -- Find and scan all secondary buses. - * This time registers 0xc8 and 0xc9. - */ - u8 busno; - pci_read_config_byte(d, 0xc8, &busno); - printk("PCI: Compaq host bridge: secondary bus %02x\n", busno); - pci_scan_bus(busno, pci_root_ops, NULL); - pcibios_last_bus = -1; + u8 busno1, busno2; + + pci_read_config_byte(d, 0xc8, &busno1); + pci_read_config_byte(d, 0xc9, &busno2); + if (busno2 < busno1) + busno2 = busno1; + if (busno2 > pcibios_last_bus) { + pcibios_last_bus = busno2; + printk("PCI: Compaq host bridge: last bus %02x\n", busno2); + } } static void __init pci_fixup_umc_ide(struct pci_dev *d) @@ -924,6 +934,22 @@ static void __init pci_fixup_latency(struct pci_dev *d) pcibios_max_latency = 32; } +static void __init pci_fixup_vt8363(struct pci_dev *d) +{ + /* + * VIA VT8363 host bridge has broken feature 'PCI Master Read + * Caching'. It caches more than is good for it, sometimes + * serving the bus master with stale data. Some BIOSes enable + * it by default, so we disable it. + */ + u8 tmp; + pci_read_config_byte(d, 0x70, &tmp); + if(tmp & 4) { + printk("PCI: Bus master read caching disabled\n"); + pci_write_config_byte(d, 0x70, tmp & ~4); + } +} + struct pci_fixup pcibios_fixups[] = { { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454GX, pci_fixup_i450gx }, @@ -936,6 +962,7 @@ struct pci_fixup pcibios_fixups[] = { { PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5597, pci_fixup_latency }, { PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5598, pci_fixup_latency }, + { PCI_FIXUP_HEADER, PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8363_0, pci_fixup_vt8363 }, { 0 } }; diff --git a/arch/i386/kernel/process.c b/arch/i386/kernel/process.c index 35f11f20f..65f517966 100644 --- a/arch/i386/kernel/process.c +++ b/arch/i386/kernel/process.c @@ -23,7 +23,7 @@ #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/vmalloc.h> #include <linux/user.h> #include <linux/a.out.h> diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 2c3f61f7f..03eeabc2f 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -71,7 +71,7 @@ #include <linux/stddef.h> #include <linux/unistd.h> #include <linux/ptrace.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/user.h> #include <linux/a.out.h> #include <linux/tty.h> @@ -1104,6 +1104,9 @@ static inline void do_cyrix_devid(unsigned char *dir0, unsigned char *dir1) /* * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in * order to identify the Cyrix CPU model after we're out of setup.c + * + * Actually since bugs.h doesnt even reference this perhaps someone should + * fix the documentation ??? */ unsigned char Cx86_dir0_msb __initdata = 0; @@ -1129,6 +1132,8 @@ static char cyrix_model_mult2[] __initdata = "12233445"; * Reset the slow-loop (SLOP) bit on the 686(L) which is set by some old * BIOSes for compatability with DOS games. This makes the udelay loop * work correctly, and improves performance. + * + * FIXME: our newer udelay uses the tsc. We dont need to frob with SLOP */ extern void calibrate_delay(void) __init; @@ -1401,6 +1406,7 @@ static void __init init_centaur(struct cpuinfo_x86 *c) wrmsr (0x1107, lo, hi); set_bit(X86_FEATURE_CX8, &c->x86_capability); + set_bit(X86_FEATURE_3DNOW, &c->x86_capability); get_model_name(c); display_cacheinfo(c); @@ -1565,12 +1571,10 @@ static void __init init_intel(struct cpuinfo_x86 *c) case 4: if ( c->x86 > 6 && dl ) { /* P4 family */ - if ( dl ) { - /* L3 cache */ - cs = 128 << (dl-1); - l3 += cs; - break; - } + /* L3 cache */ + cs = 128 << (dl-1); + l3 += cs; + break; } /* else same as 8 - fall through */ case 8: @@ -1870,8 +1874,34 @@ static int __init id_and_try_enable_cpuid(struct cpuinfo_x86 *c) /* Detect Cyrix with disabled CPUID */ if ( c->x86 == 4 && test_cyrix_52div() ) { + unsigned char dir0, dir1; + strcpy(c->x86_vendor_id, "CyrixInstead"); c->x86_vendor = X86_VENDOR_CYRIX; + + /* Actually enable cpuid on the older cyrix */ + + /* Retrieve CPU revisions */ + + do_cyrix_devid(&dir0, &dir1); + + dir0>>=4; + + /* Check it is an affected model */ + + if (dir0 == 5 || dir0 == 3) + { + unsigned char ccr3, ccr4; + + printk(KERN_INFO "Enabling CPUID on Cyrix processor.\n"); + cli(); + ccr3 = getCx86(CX86_CCR3); + setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ + ccr4 = getCx86(CX86_CCR4); + setCx86(CX86_CCR4, ccr4 | 0x80); /* enable cpuid */ + setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ + sti(); + } } else /* Detect NexGen with old hypercode */ @@ -1914,7 +1944,6 @@ void __init identify_cpu(struct cpuinfo_x86 *c) (int *)&c->x86_vendor_id[4]); get_cpu_vendor(c); - /* Initialize the standard set of capabilities */ /* Note that the vendor-specific code below might override */ diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index 7df9c875c..7b096279f 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -18,6 +18,7 @@ #include <linux/ptrace.h> #include <linux/unistd.h> #include <linux/stddef.h> +#include <linux/tty.h> #include <asm/ucontext.h> #include <asm/uaccess.h> #include <asm/i387.h> diff --git a/arch/i386/kernel/smp.c b/arch/i386/kernel/smp.c index 6607edf8a..6d6463542 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/i386/kernel/smp.c @@ -4,7 +4,7 @@ * (c) 1995 Alan Cox, Building #3 <alan@redhat.com> * (c) 1998-99, 2000 Ingo Molnar <mingo@redhat.com> * - * This code is released under the GNU public license version 2 or + * This code is released under the GNU General Public License version 2 or * later. */ diff --git a/arch/i386/kernel/smpboot.c b/arch/i386/kernel/smpboot.c index aab31e839..a16965ac5 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/i386/kernel/smpboot.c @@ -11,7 +11,7 @@ * Pentium Pro and Pentium-II/Xeon MP machines. * Original development of Linux SMP code supported by Caldera. * - * This code is released under the GNU public license version 2 or + * This code is released under the GNU General Public License version 2 or * later. * * Fixes @@ -389,6 +389,7 @@ void __init smp_callin(void) */ if (test_bit(cpuid, &cpu_callout_map)) break; + rep_nop(); } if (!time_before(jiffies, timeout)) { diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 7c02813af..6fa43476a 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -127,6 +127,11 @@ void show_trace(unsigned long * stack) printk("\n"); } +void show_trace_task(struct task_struct *tsk) +{ + show_trace(&tsk->thread.esp); +} + void show_stack(unsigned long * esp) { unsigned long *stack; diff --git a/arch/i386/kernel/visws_apic.c b/arch/i386/kernel/visws_apic.c index 017b8eb58..995d0cdcd 100644 --- a/arch/i386/kernel/visws_apic.c +++ b/arch/i386/kernel/visws_apic.c @@ -20,7 +20,7 @@ #include <linux/ioport.h> #include <linux/interrupt.h> #include <linux/timex.h> -#include <linux/malloc.h> +#include <linux/slab.h> #include <linux/random.h> #include <linux/smp.h> #include <linux/smp_lock.h> diff --git a/arch/i386/mm/extable.c b/arch/i386/mm/extable.c index ba34c0395..2eb7ca6aa 100644 --- a/arch/i386/mm/extable.c +++ b/arch/i386/mm/extable.c @@ -4,6 +4,7 @@ #include <linux/config.h> #include <linux/module.h> +#include <linux/spinlock.h> #include <asm/uaccess.h> extern const struct exception_table_entry __start___ex_table[]; @@ -30,26 +31,32 @@ search_one_table(const struct exception_table_entry *first, return 0; } +extern spinlock_t modlist_lock; + unsigned long search_exception_table(unsigned long addr) { - unsigned long ret; - + unsigned long ret = 0; + unsigned long flags; + #ifndef CONFIG_MODULES /* There is only the kernel to search. */ ret = search_one_table(__start___ex_table, __stop___ex_table-1, addr); - if (ret) return ret; + return ret; #else /* The kernel is the last "module" -- no need to treat it special. */ struct module *mp; + + spin_lock_irqsave(&modlist_lock, flags); for (mp = module_list; mp != NULL; mp = mp->next) { if (mp->ex_table_start == NULL) continue; ret = search_one_table(mp->ex_table_start, mp->ex_table_end - 1, addr); - if (ret) return ret; + if (ret) + break; } + spin_unlock_irqrestore(&modlist_lock, flags); + return ret; #endif - - return 0; } diff --git a/arch/i386/mm/fault.c b/arch/i386/mm/fault.c index e2a9ee9fe..ccbc5dce1 100644 --- a/arch/i386/mm/fault.c +++ b/arch/i386/mm/fault.c @@ -81,7 +81,7 @@ extern spinlock_t console_lock, timerlist_lock; /* * Unlock any spinlocks which will prevent us from getting the - * message out (timerlist_lock is aquired through the + * message out (timerlist_lock is acquired through the * console unblank code) */ void bust_spinlocks(void) |