diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 02:59:00 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-07-08 02:59:00 +0000 |
commit | 1fcb7623bc138d780101d7a70cfe29b11f7c67ef (patch) | |
tree | e1ec9bb6aa19db16a405fb4393e2a90c38b4c75d /arch/i386 | |
parent | 458fe58677afb17219d864e100131728038b4f1b (diff) |
Merge with Linux 2.4.0-test3-pre5. 64-bit kernel are still not
-Werror clean.
Diffstat (limited to 'arch/i386')
-rw-r--r-- | arch/i386/config.in | 8 | ||||
-rw-r--r-- | arch/i386/defconfig | 1 | ||||
-rw-r--r-- | arch/i386/kernel/microcode.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/setup.c | 3 | ||||
-rw-r--r-- | arch/i386/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/traps.c | 179 | ||||
-rw-r--r-- | arch/i386/kernel/vm86.c | 12 |
7 files changed, 90 insertions, 118 deletions
diff --git a/arch/i386/config.in b/arch/i386/config.in index 81cd0241d..7344e802c 100644 --- a/arch/i386/config.in +++ b/arch/i386/config.in @@ -21,7 +21,7 @@ choice 'Processor family' \ "386 CONFIG_M386 \ 486 CONFIG_M486 \ 586/K5/5x86/6x86/6x86MX CONFIG_M586 \ - Pentium/Pentium-MMX CONFIG_M586TSC \ + Pentium-Classic/Pentium-MMX CONFIG_M586TSC \ Pentium-Pro/Celeron/Pentium-II CONFIG_M686 \ Pentium-III CONFIG_M686FXSR \ K6/K6-II/K6-III CONFIG_MK6 \ @@ -29,7 +29,7 @@ choice 'Processor family' \ Crusoe CONFIG_MCRUSOE \ Winchip-C6 CONFIG_MWINCHIPC6 \ Winchip-2 CONFIG_MWINCHIP2 \ - Winchip-2A/3 CONFIG_MWINCHIP3D" Pentium-Pro + Winchip-2A/Winchip-3 CONFIG_MWINCHIP3D" Pentium-Pro # # Define implied options from the CPU selection here # @@ -73,8 +73,6 @@ if [ "$CONFIG_M686FXSR" = "y" ]; then define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_FXSR y define_bool CONFIG_X86_XMM y -else - define_bool CONFIG_X86_FXSR n fi if [ "$CONFIG_MK6" = "y" ]; then define_int CONFIG_X86_L1_CACHE_BYTES 32 @@ -209,7 +207,7 @@ tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC bool 'Power Management support' CONFIG_PM -bool ' ACPI support' CONFIG_ACPI $CONFIG_PM +dep_bool ' ACPI support' CONFIG_ACPI $CONFIG_PM if [ "$CONFIG_ACPI" != "n" ]; then if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then bool ' ACPI interpreter (EXPERIMENTAL)' CONFIG_ACPI_INTERPRETER diff --git a/arch/i386/defconfig b/arch/i386/defconfig index ee4f04c6a..068aceaf2 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig @@ -36,7 +36,6 @@ CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y CONFIG_X86_PGE=y CONFIG_X86_USE_PPRO_CHECKSUM=y -# CONFIG_X86_FXSR is not set # CONFIG_MICROCODE is not set # CONFIG_X86_MSR is not set # CONFIG_X86_CPUID is not set diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index 7d7a58741..c693b2dc2 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c @@ -11,6 +11,8 @@ * * http://developer.intel.com/design/pentiumii/manuals/243192.htm * + * For more information, go to http://www.urbanmyth.org/microcode + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version @@ -226,7 +228,7 @@ static void do_update_one(void *arg) } wrmsr(0x79, (unsigned int)(m->bits), 0); - __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx", "cc"); + __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); rdmsr(0x8B, val[0], val[1]); req->err = 0; diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index 771caa7e7..dc61a920b 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c @@ -1635,7 +1635,8 @@ int get_cpuinfo(char * buffer) x86_cap_flags[10] = "sep"; if (c->x86 < 6) x86_cap_flags[16] = "fcmov"; - x86_cap_flags[16] = "pat"; + else + x86_cap_flags[16] = "pat"; x86_cap_flags[22] = "mmxext"; x86_cap_flags[24] = "fxsr"; x86_cap_flags[30] = "3dnowext"; diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c index cc4843b8a..116816f1f 100644 --- a/arch/i386/kernel/signal.c +++ b/arch/i386/kernel/signal.c @@ -682,7 +682,6 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset) /* FALLTHRU */ default: - lock_kernel(); sigaddset(¤t->signal, signr); recalc_sigpending(current); current->flags |= PF_SIGNALED; diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 370c89385..a9ea15597 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c @@ -19,8 +19,6 @@ #include <linux/ptrace.h> #include <linux/timer.h> #include <linux/mm.h> -#include <linux/smp.h> -#include <linux/smp_lock.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/spinlock.h> @@ -77,68 +75,6 @@ static inline void console_verbose(void) console_loglevel = 15; } -#define DO_ERROR(trapnr, signr, str, name, tsk) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - tsk->thread.error_code = error_code; \ - tsk->thread.trap_no = trapnr; \ - die_if_no_fixup(str,regs,error_code); \ - force_sig(signr, tsk); \ -} - -#define DO_ERROR_INFO(trapnr, signr, str, name, tsk, sicode, siaddr) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - siginfo_t info; \ - tsk->thread.error_code = error_code; \ - tsk->thread.trap_no = trapnr; \ - die_if_no_fixup(str,regs,error_code); \ - info.si_signo = signr; \ - info.si_errno = 0; \ - info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ - force_sig_info(signr, &info, tsk); \ -} - -#define DO_VM86_ERROR(trapnr, signr, str, name, tsk) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - lock_kernel(); \ - if (regs->eflags & VM_MASK) { \ - if (!handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, trapnr)) \ - goto out; \ - /* else fall through */ \ - } \ - tsk->thread.error_code = error_code; \ - tsk->thread.trap_no = trapnr; \ - force_sig(signr, tsk); \ - die_if_kernel(str,regs,error_code); \ -out: \ - unlock_kernel(); \ -} - -#define DO_VM86_ERROR_INFO(trapnr, signr, str, name, tsk, sicode, siaddr) \ -asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ -{ \ - siginfo_t info; \ - lock_kernel(); \ - if (regs->eflags & VM_MASK) { \ - if (!handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, trapnr)) \ - goto out; \ - /* else fall through */ \ - } \ - tsk->thread.error_code = error_code; \ - tsk->thread.trap_no = trapnr; \ - info.si_signo = signr; \ - info.si_errno = 0; \ - info.si_code = sicode; \ - info.si_addr = (void *)siaddr; \ - force_sig_info(signr, &info, tsk); \ - die_if_kernel(str,regs,error_code); \ -out: \ - unlock_kernel(); \ -} - asmlinkage void divide_error(void); asmlinkage void debug(void); asmlinkage void nmi(void); @@ -285,20 +221,6 @@ static inline void die_if_kernel(const char * str, struct pt_regs * regs, long e die(str, regs, err); } -static void die_if_no_fixup(const char * str, struct pt_regs * regs, long err) -{ - if (!(regs->eflags & VM_MASK) && !(3 & regs->xcs)) - { - unsigned long fixup; - fixup = search_exception_table(regs->eip); - if (fixup) { - regs->eip = fixup; - return; - } - die(str, regs, err); - } -} - static inline unsigned long get_cr2(void) { unsigned long address; @@ -308,19 +230,88 @@ static inline unsigned long get_cr2(void) return address; } -DO_VM86_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, current, FPE_INTDIV, regs->eip) -DO_VM86_ERROR( 3, SIGTRAP, "int3", int3, current) -DO_VM86_ERROR( 4, SIGSEGV, "overflow", overflow, current) -DO_VM86_ERROR( 5, SIGSEGV, "bounds", bounds, current) -DO_ERROR_INFO( 6, SIGILL, "invalid operand", invalid_op, current, ILL_ILLOPN, regs->eip) -DO_VM86_ERROR( 7, SIGSEGV, "device not available", device_not_available, current) -DO_ERROR( 8, SIGSEGV, "double fault", double_fault, current) -DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun, current) -DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS, current) -DO_ERROR(11, SIGBUS, "segment not present", segment_not_present, current) -DO_ERROR(12, SIGBUS, "stack segment", stack_segment, current) -DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, current, BUS_ADRALN, get_cr2()) -DO_ERROR(18, SIGSEGV, "reserved", reserved, current) +static void inline do_trap(int trapnr, int signr, char *str, int vm86, + struct pt_regs * regs, long error_code, siginfo_t *info) +{ + if (vm86 && regs->eflags & VM_MASK) + goto vm86_trap; + if (!(regs->xcs & 3)) + goto kernel_trap; + + trap_signal: { + struct task_struct *tsk = current; + tsk->thread.error_code = error_code; + tsk->thread.trap_no = trapnr; + if (info) + force_sig_info(signr, info, tsk); + else + force_sig(signr, tsk); + return; + } + + kernel_trap: { + unsigned long fixup = search_exception_table(regs->eip); + if (fixup) + regs->eip = fixup; + else + die(str, regs, error_code); + return; + } + + vm86_trap: { + int ret = handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, trapnr); + if (ret) goto trap_signal; + return; + } +} + +#define DO_ERROR(trapnr, signr, str, name) \ +asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +{ \ + do_trap(trapnr, signr, str, 0, regs, error_code, NULL); \ +} + +#define DO_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ +asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +{ \ + siginfo_t info; \ + info.si_signo = signr; \ + info.si_errno = 0; \ + info.si_code = sicode; \ + info.si_addr = (void *)siaddr; \ + do_trap(trapnr, signr, str, 0, regs, error_code, &info); \ +} + +#define DO_VM86_ERROR(trapnr, signr, str, name) \ +asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +{ \ + do_trap(trapnr, signr, str, 1, regs, error_code, NULL); \ +} + +#define DO_VM86_ERROR_INFO(trapnr, signr, str, name, sicode, siaddr) \ +asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ +{ \ + siginfo_t info; \ + info.si_signo = signr; \ + info.si_errno = 0; \ + info.si_code = sicode; \ + info.si_addr = (void *)siaddr; \ + do_trap(trapnr, signr, str, 1, regs, error_code, &info); \ +} + +DO_VM86_ERROR_INFO( 0, SIGFPE, "divide error", divide_error, FPE_INTDIV, regs->eip) +DO_VM86_ERROR( 3, SIGTRAP, "int3", int3) +DO_VM86_ERROR( 4, SIGSEGV, "overflow", overflow) +DO_VM86_ERROR( 5, SIGSEGV, "bounds", bounds) +DO_ERROR_INFO( 6, SIGILL, "invalid operand", invalid_op, ILL_ILLOPN, regs->eip) +DO_VM86_ERROR( 7, SIGSEGV, "device not available", device_not_available) +DO_ERROR( 8, SIGSEGV, "double fault", double_fault) +DO_ERROR( 9, SIGFPE, "coprocessor segment overrun", coprocessor_segment_overrun) +DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS) +DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) +DO_ERROR(12, SIGBUS, "stack segment", stack_segment) +DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, get_cr2()) +DO_ERROR(18, SIGSEGV, "reserved", reserved) asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) { @@ -336,9 +327,7 @@ asmlinkage void do_general_protection(struct pt_regs * regs, long error_code) return; gp_in_vm86: - lock_kernel(); handle_vm86_fault((struct kernel_vm86_regs *) regs, error_code); - unlock_kernel(); return; gp_in_kernel: @@ -561,9 +550,7 @@ asmlinkage void do_debug(struct pt_regs * regs, long error_code) return; debug_vm86: - lock_kernel(); handle_vm86_trap((struct kernel_vm86_regs *) regs, error_code, 1); - unlock_kernel(); return; clear_dr7: @@ -752,12 +739,10 @@ asmlinkage void math_state_restore(struct pt_regs regs) asmlinkage void math_emulate(long arg) { - lock_kernel(); printk("math-emulation not enabled and no coprocessor found.\n"); printk("killing %s.\n",current->comm); force_sig(SIGFPE,current); schedule(); - unlock_kernel(); } #endif /* CONFIG_MATH_EMULATION */ diff --git a/arch/i386/kernel/vm86.c b/arch/i386/kernel/vm86.c index fa803c165..9875a3bdb 100644 --- a/arch/i386/kernel/vm86.c +++ b/arch/i386/kernel/vm86.c @@ -69,7 +69,6 @@ struct pt_regs * save_v86_state(struct kernel_vm86_regs * regs) struct pt_regs *ret; unsigned long tmp; - lock_kernel(); if (!current->thread.vm86_info) { printk("no vm86_info: BAD\n"); do_exit(SIGSEGV); @@ -87,7 +86,6 @@ struct pt_regs * save_v86_state(struct kernel_vm86_regs * regs) tss->esp0 = current->thread.esp0 = current->thread.saved_esp0; current->thread.saved_esp0 = 0; ret = KVM86->regs32; - unlock_kernel(); return ret; } @@ -138,7 +136,6 @@ asmlinkage int sys_vm86old(struct vm86_struct * v86) struct task_struct *tsk; int tmp, ret = -EPERM; - lock_kernel(); tsk = current; if (tsk->thread.saved_esp0) goto out; @@ -154,7 +151,6 @@ asmlinkage int sys_vm86old(struct vm86_struct * v86) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: - unlock_kernel(); return ret; } @@ -169,7 +165,6 @@ asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct * v86) struct task_struct *tsk; int tmp, ret; - lock_kernel(); tsk = current; switch (subfunction) { case VM86_REQUEST_IRQ: @@ -204,7 +199,6 @@ asmlinkage int sys_vm86(unsigned long subfunction, struct vm86plus_struct * v86) do_sys_vm86(&info, tsk); ret = 0; /* we never return here */ out: - unlock_kernel(); return ret; } @@ -258,7 +252,6 @@ static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk tsk->thread.screen_bitmap = info->screen_bitmap; if (info->flags & VM86_SCREEN_BITMAP) mark_screen_rdonly(tsk); - unlock_kernel(); __asm__ __volatile__( "xorl %%eax,%%eax; movl %%eax,%%fs; movl %%eax,%%gs\n\t" "movl %0,%%esp\n\t" @@ -274,7 +267,6 @@ static inline void return_to_32bit(struct kernel_vm86_regs * regs16, int retval) regs32 = save_v86_state(regs16); regs32->eax = retval; - unlock_kernel(); __asm__ __volatile__("movl %0,%%esp\n\t" "jmp ret_from_sys_call" : : "r" (regs32), "b" (current)); @@ -432,7 +424,6 @@ cannot_handle: return_to_32bit(regs, VM86_INTx + (i << 8)); } -/* This must be called with the kernel lock held. */ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno) { if (VMPI.is_vm86pus) { @@ -456,7 +447,6 @@ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno return 0; } -/* This must be called with the kernel lock held. */ void handle_vm86_fault(struct kernel_vm86_regs * regs, long error_code) { unsigned char *csp, *ssp; @@ -586,7 +576,6 @@ static void irq_handler(int intno, void *dev_id, struct pt_regs * regs) { int irq_bit; unsigned long flags; - lock_kernel(); save_flags(flags); cli(); irq_bit = 1 << intno; @@ -598,7 +587,6 @@ static void irq_handler(int intno, void *dev_id, struct pt_regs * regs) { /* else user will poll for IRQs */ out: restore_flags(flags); - unlock_kernel(); } static inline void free_vm86_irq(int irqnumber) |