diff options
-rw-r--r-- | Documentation/crypto/async-tx-api.txt | 219 | ||||
-rw-r--r-- | Documentation/devices.txt | 2 | ||||
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 8 | ||||
-rw-r--r-- | Documentation/lguest/lguest.c | 4 | ||||
-rw-r--r-- | Documentation/lockstat.txt | 120 | ||||
-rw-r--r-- | Documentation/sysrq.txt | 2 | ||||
-rw-r--r-- | Kbuild | 8 | ||||
-rw-r--r-- | Makefile | 41 | ||||
-rw-r--r-- | arch/arm/kernel/bios32.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-s3c2440/mach-osiris.c | 18 | ||||
-rw-r--r-- | arch/blackfin/kernel/bfin_gpio.c | 285 | ||||
-rw-r--r-- | arch/blackfin/mach-common/entry.S | 23 | ||||
-rw-r--r-- | arch/i386/Kconfig | 8 | ||||
-rw-r--r-- | arch/i386/Makefile | 72 | ||||
-rw-r--r-- | arch/i386/boot/Makefile | 171 | ||||
-rw-r--r-- | arch/i386/boot/compressed/Makefile | 50 | ||||
-rw-r--r-- | arch/i386/boot/memory.c | 99 | ||||
-rw-r--r-- | arch/i386/crypto/Makefile | 12 | ||||
-rw-r--r-- | arch/i386/kernel/Makefile | 88 | ||||
-rw-r--r-- | arch/i386/kernel/acpi/Makefile | 10 | ||||
-rw-r--r-- | arch/i386/kernel/asm-offsets.c | 147 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/cpufreq/longhaul.c | 970 | ||||
-rw-r--r-- | arch/i386/kernel/cpu/mtrr/state.c | 79 | ||||
-rw-r--r-- | arch/i386/kernel/early_printk.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/entry.S | 1112 | ||||
-rw-r--r-- | arch/i386/kernel/head.S | 578 | ||||
-rw-r--r-- | arch/i386/kernel/signal.c | 667 | ||||
-rw-r--r-- | arch/i386/kernel/tsc_sync.c | 1 | ||||
-rw-r--r-- | arch/i386/kernel/vsyscall-int80.S | 53 | ||||
-rw-r--r-- | arch/i386/kernel/vsyscall-note.S | 45 | ||||
-rw-r--r-- | arch/i386/kernel/vsyscall-sysenter.S | 122 | ||||
-rw-r--r-- | arch/i386/kernel/vsyscall.S | 15 | ||||
-rw-r--r-- | arch/i386/lib/Makefile | 11 | ||||
-rw-r--r-- | arch/i386/mach-generic/Makefile | 7 | ||||
-rw-r--r-- | arch/i386/mach-voyager/Makefile | 8 | ||||
-rw-r--r-- | arch/i386/mm/Makefile | 10 | ||||
-rw-r--r-- | arch/i386/pci/Makefile | 14 | ||||
-rw-r--r-- | arch/i386/xen/mmu.c | 564 | ||||
-rw-r--r-- | arch/ia64/ia32/audit.c | 2 | ||||
-rw-r--r-- | arch/mips/au1000/common/pci.c | 1 | ||||
-rw-r--r-- | arch/mips/au1000/mtx-1/board_setup.c | 4 | ||||
-rw-r--r-- | arch/mips/au1000/pb1000/board_setup.c | 6 | ||||
-rw-r--r-- | arch/mips/au1000/pb1100/board_setup.c | 4 | ||||
-rw-r--r-- | arch/mips/au1000/pb1500/board_setup.c | 6 | ||||
-rw-r--r-- | arch/mips/kernel/i8259.c | 5 | ||||
-rw-r--r-- | arch/mips/kernel/irq-msc01.c | 10 | ||||
-rw-r--r-- | arch/mips/kernel/irq.c | 10 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-o32.S | 2 | ||||
-rw-r--r-- | arch/mips/kernel/smtc.c | 5 | ||||
-rw-r--r-- | arch/mips/kernel/vmlinux.lds.S | 2 | ||||
-rw-r--r-- | arch/mips/mm/pg-r4k.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/ops-mace.c | 21 | ||||
-rw-r--r-- | arch/mips/sgi-ip32/ip32-platform.c | 4 | ||||
-rw-r--r-- | arch/powerpc/boot/dts/mpc8349emitx.dts | 1 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/83xx/usb.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 4 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/xics.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/commproc.c | 2 | ||||
-rw-r--r-- | arch/ppc/8xx_io/commproc.c | 2 | ||||
-rw-r--r-- | arch/sparc/kernel/ebus.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/binfmt_aout32.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 5 | ||||
-rw-r--r-- | arch/sparc64/kernel/pci_common.c | 4 | ||||
-rw-r--r-- | arch/sparc64/kernel/prom.c | 3 | ||||
-rw-r--r-- | arch/sparc64/kernel/smp.c | 2 | ||||
-rw-r--r-- | arch/sparc64/kernel/vio.c | 29 | ||||
-rw-r--r-- | arch/sparc64/lib/NGcopy_from_user.S | 8 | ||||
-rw-r--r-- | arch/sparc64/lib/NGcopy_to_user.S | 8 | ||||
-rw-r--r-- | arch/sparc64/lib/NGmemcpy.S | 371 | ||||
-rw-r--r-- | arch/um/sys-i386/sys_call_table.S | 2 | ||||
-rw-r--r-- | arch/um/sys-x86_64/syscall_table.c | 4 | ||||
-rw-r--r-- | arch/x86/boot/.gitignore (renamed from arch/i386/boot/.gitignore) | 0 | ||||
-rw-r--r-- | arch/x86/boot/Makefile | 171 | ||||
-rw-r--r-- | arch/x86/boot/a20.c (renamed from arch/i386/boot/a20.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/apm.c (renamed from arch/i386/boot/apm.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/bitops.h (renamed from arch/i386/boot/bitops.h) | 0 | ||||
-rw-r--r-- | arch/x86/boot/boot.h (renamed from arch/i386/boot/boot.h) | 0 | ||||
-rw-r--r-- | arch/x86/boot/cmdline.c (renamed from arch/i386/boot/cmdline.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/code16gcc.h (renamed from arch/i386/boot/code16gcc.h) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/.gitignore (renamed from arch/i386/boot/compressed/.gitignore) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile_32 | 50 | ||||
-rw-r--r-- | arch/x86/boot/compressed/Makefile_64 | 30 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_32.S (renamed from arch/i386/boot/compressed/head.S) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/head_64.S | 311 | ||||
-rw-r--r-- | arch/x86/boot/compressed/misc_32.c (renamed from arch/i386/boot/compressed/misc.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/misc_64.c (renamed from arch/x86_64/boot/compressed/misc.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/relocs.c (renamed from arch/i386/boot/compressed/relocs.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux_32.lds (renamed from arch/i386/boot/compressed/vmlinux.lds) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux_32.scr (renamed from arch/i386/boot/compressed/vmlinux.scr) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux_64.lds (renamed from arch/x86_64/boot/compressed/vmlinux.lds) | 0 | ||||
-rw-r--r-- | arch/x86/boot/compressed/vmlinux_64.scr (renamed from arch/x86_64/boot/compressed/vmlinux.scr) | 0 | ||||
-rw-r--r-- | arch/x86/boot/copy.S (renamed from arch/i386/boot/copy.S) | 0 | ||||
-rw-r--r-- | arch/x86/boot/cpu.c (renamed from arch/i386/boot/cpu.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/cpucheck.c (renamed from arch/i386/boot/cpucheck.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/edd.c (renamed from arch/i386/boot/edd.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/header.S (renamed from arch/i386/boot/header.S) | 0 | ||||
-rw-r--r-- | arch/x86/boot/install.sh (renamed from arch/i386/boot/install.sh) | 0 | ||||
-rw-r--r-- | arch/x86/boot/main.c (renamed from arch/i386/boot/main.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/mca.c (renamed from arch/i386/boot/mca.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/memory.c | 118 | ||||
-rw-r--r-- | arch/x86/boot/mtools.conf.in (renamed from arch/i386/boot/mtools.conf.in) | 0 | ||||
-rw-r--r-- | arch/x86/boot/pm.c (renamed from arch/i386/boot/pm.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/pmjump.S (renamed from arch/i386/boot/pmjump.S) | 0 | ||||
-rw-r--r-- | arch/x86/boot/printf.c (renamed from arch/i386/boot/printf.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/setup.ld (renamed from arch/i386/boot/setup.ld) | 0 | ||||
-rw-r--r-- | arch/x86/boot/string.c (renamed from arch/i386/boot/string.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/tools/.gitignore (renamed from arch/i386/boot/tools/.gitignore) | 0 | ||||
-rw-r--r-- | arch/x86/boot/tools/build.c (renamed from arch/i386/boot/tools/build.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/tty.c (renamed from arch/i386/boot/tty.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/version.c (renamed from arch/i386/boot/version.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/vesa.h (renamed from arch/i386/boot/vesa.h) | 0 | ||||
-rw-r--r-- | arch/x86/boot/video-bios.c (renamed from arch/i386/boot/video-bios.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/video-vesa.c (renamed from arch/i386/boot/video-vesa.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/video-vga.c (renamed from arch/i386/boot/video-vga.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/video.c (renamed from arch/i386/boot/video.c) | 0 | ||||
-rw-r--r-- | arch/x86/boot/video.h (renamed from arch/i386/boot/video.h) | 0 | ||||
-rw-r--r-- | arch/x86/boot/voyager.c (renamed from arch/i386/boot/voyager.c) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/crypto/Makefile_32 | 12 | ||||
-rw-r--r-- | arch/x86/crypto/Makefile_64 | 12 | ||||
-rw-r--r-- | arch/x86/crypto/aes-i586-asm_32.S (renamed from arch/i386/crypto/aes-i586-asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/aes-x86_64-asm_64.S (renamed from arch/x86_64/crypto/aes-x86_64-asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/aes_32.c (renamed from arch/i386/crypto/aes.c) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/aes_64.c (renamed from arch/x86_64/crypto/aes.c) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-i586-asm_32.S (renamed from arch/i386/crypto/twofish-i586-asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/twofish-x86_64-asm_64.S (renamed from arch/x86_64/crypto/twofish-x86_64-asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/twofish_32.c (renamed from arch/i386/crypto/twofish.c) | 0 | ||||
-rw-r--r-- | arch/x86/crypto/twofish_64.c (renamed from arch/x86_64/crypto/twofish.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/Makefile (renamed from arch/x86_64/ia32/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/audit.c | 42 | ||||
-rw-r--r-- | arch/x86/ia32/fpu32.c (renamed from arch/x86_64/ia32/fpu32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ia32_aout.c (renamed from arch/x86_64/ia32/ia32_aout.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ia32_binfmt.c (renamed from arch/x86_64/ia32/ia32_binfmt.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ia32_signal.c (renamed from arch/x86_64/ia32/ia32_signal.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ia32entry.S (renamed from arch/x86_64/ia32/ia32entry.S) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ipc32.c | 57 | ||||
-rw-r--r-- | arch/x86/ia32/mmap32.c (renamed from arch/x86_64/ia32/mmap32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/ptrace32.c (renamed from arch/x86_64/ia32/ptrace32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/sys_ia32.c (renamed from arch/x86_64/ia32/sys_ia32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/syscall32.c (renamed from arch/x86_64/ia32/syscall32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/syscall32_syscall.S | 17 | ||||
-rw-r--r-- | arch/x86/ia32/tls32.c (renamed from arch/x86_64/ia32/tls32.c) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/vsyscall-sigreturn.S | 143 | ||||
-rw-r--r-- | arch/x86/ia32/vsyscall-syscall.S (renamed from arch/x86_64/ia32/vsyscall-syscall.S) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/vsyscall-sysenter.S (renamed from arch/x86_64/ia32/vsyscall-sysenter.S) | 0 | ||||
-rw-r--r-- | arch/x86/ia32/vsyscall.lds (renamed from arch/x86_64/ia32/vsyscall.lds) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/.gitignore (renamed from arch/i386/kernel/.gitignore) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile_32 | 86 | ||||
-rw-r--r-- | arch/x86/kernel/Makefile_64 | 54 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/Makefile_32 | 10 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/Makefile_64 | 7 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c (renamed from arch/i386/kernel/acpi/boot.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/cstate.c (renamed from arch/i386/kernel/acpi/cstate.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/earlyquirk_32.c (renamed from arch/i386/kernel/acpi/earlyquirk.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/processor.c (renamed from arch/i386/kernel/acpi/processor.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/sleep_32.c (renamed from arch/i386/kernel/acpi/sleep.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/sleep_64.c (renamed from arch/x86_64/kernel/acpi/sleep.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/wakeup_32.S (renamed from arch/i386/kernel/acpi/wakeup.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/wakeup_64.S | 456 | ||||
-rw-r--r-- | arch/x86/kernel/alternative.c (renamed from arch/i386/kernel/alternative.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/aperture_64.c (renamed from arch/x86_64/kernel/aperture.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/apic_32.c (renamed from arch/i386/kernel/apic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/apic_64.c (renamed from arch/x86_64/kernel/apic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/apm_32.c (renamed from arch/i386/kernel/apm.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets.c | 5 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 147 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_64.c (renamed from arch/x86_64/kernel/asm-offsets.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/audit_64.c (renamed from arch/x86_64/kernel/audit.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/bootflag.c (renamed from arch/i386/kernel/bootflag.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/bugs_64.c (renamed from arch/x86_64/kernel/bugs.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/Makefile (renamed from arch/i386/kernel/cpu/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/addon_cpuid_features.c (renamed from arch/i386/kernel/cpu/addon_cpuid_features.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/amd.c (renamed from arch/i386/kernel/cpu/amd.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/bugs.c (renamed from arch/i386/kernel/cpu/bugs.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/centaur.c (renamed from arch/i386/kernel/cpu/centaur.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/common.c (renamed from arch/i386/kernel/cpu/common.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpu.h (renamed from arch/i386/kernel/cpu/cpu.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/Kconfig (renamed from arch/i386/kernel/cpu/cpufreq/Kconfig) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/Makefile (renamed from arch/i386/kernel/cpu/cpufreq/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c (renamed from arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c (renamed from arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/e_powersaver.c (renamed from arch/i386/kernel/cpu/cpufreq/e_powersaver.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/elanfreq.c (renamed from arch/i386/kernel/cpu/cpufreq/elanfreq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/gx-suspmod.c (renamed from arch/i386/kernel/cpu/cpufreq/gx-suspmod.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longhaul.c | 1024 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longhaul.h (renamed from arch/i386/kernel/cpu/cpufreq/longhaul.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/longrun.c (renamed from arch/i386/kernel/cpu/cpufreq/longrun.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/p4-clockmod.c (renamed from arch/i386/kernel/cpu/cpufreq/p4-clockmod.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k6.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k6.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k7.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k7.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k7.h (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k7.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.c (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/powernow-k8.h (renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/sc520_freq.c (renamed from arch/i386/kernel/cpu/cpufreq/sc520_freq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-ich.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-ich.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-lib.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-lib.h (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cpufreq/speedstep-smi.c (renamed from arch/i386/kernel/cpu/cpufreq/speedstep-smi.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/cyrix.c (renamed from arch/i386/kernel/cpu/cyrix.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel.c (renamed from arch/i386/kernel/cpu/intel.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/intel_cacheinfo.c (renamed from arch/i386/kernel/cpu/intel_cacheinfo.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/Makefile (renamed from arch/i386/kernel/cpu/mcheck/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/k7.c (renamed from arch/i386/kernel/cpu/mcheck/k7.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c (renamed from arch/i386/kernel/cpu/mcheck/mce.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.h (renamed from arch/i386/kernel/cpu/mcheck/mce.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/non-fatal.c (renamed from arch/i386/kernel/cpu/mcheck/non-fatal.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/p4.c (renamed from arch/i386/kernel/cpu/mcheck/p4.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/p5.c (renamed from arch/i386/kernel/cpu/mcheck/p5.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/p6.c (renamed from arch/i386/kernel/cpu/mcheck/p6.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/therm_throt.c (renamed from arch/i386/kernel/cpu/mcheck/therm_throt.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/winchip.c (renamed from arch/i386/kernel/cpu/mcheck/winchip.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/Makefile (renamed from arch/i386/kernel/cpu/mtrr/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/amd.c (renamed from arch/i386/kernel/cpu/mtrr/amd.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/centaur.c (renamed from arch/i386/kernel/cpu/mtrr/centaur.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/cyrix.c (renamed from arch/i386/kernel/cpu/mtrr/cyrix.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/generic.c (renamed from arch/i386/kernel/cpu/mtrr/generic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/if.c (renamed from arch/i386/kernel/cpu/mtrr/if.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/main.c (renamed from arch/i386/kernel/cpu/mtrr/main.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/mtrr.h (renamed from arch/i386/kernel/cpu/mtrr/mtrr.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/mtrr/state.c | 79 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/nexgen.c (renamed from arch/i386/kernel/cpu/nexgen.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/perfctr-watchdog.c (renamed from arch/i386/kernel/cpu/perfctr-watchdog.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/proc.c (renamed from arch/i386/kernel/cpu/proc.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/transmeta.c (renamed from arch/i386/kernel/cpu/transmeta.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpu/umc.c (renamed from arch/i386/kernel/cpu/umc.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpufreq/Kconfig (renamed from arch/x86_64/kernel/cpufreq/Kconfig) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/cpuid.c (renamed from arch/i386/kernel/cpuid.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/crash_32.c (renamed from arch/i386/kernel/crash.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/crash_64.c (renamed from arch/x86_64/kernel/crash.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/crash_dump_32.c (renamed from arch/i386/kernel/crash_dump.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/crash_dump_64.c (renamed from arch/x86_64/kernel/crash_dump.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/doublefault_32.c (renamed from arch/i386/kernel/doublefault.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/e820_32.c (renamed from arch/i386/kernel/e820.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/e820_64.c (renamed from arch/x86_64/kernel/e820.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/early-quirks_64.c (renamed from arch/x86_64/kernel/early-quirks.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/early_printk.c (renamed from arch/x86_64/kernel/early_printk.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/efi_32.c (renamed from arch/i386/kernel/efi.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/efi_stub_32.S (renamed from arch/i386/kernel/efi_stub.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/entry_32.S | 1112 | ||||
-rw-r--r-- | arch/x86/kernel/entry_64.S (renamed from arch/x86_64/kernel/entry.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/genapic_64.c (renamed from arch/x86_64/kernel/genapic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/genapic_flat_64.c (renamed from arch/x86_64/kernel/genapic_flat.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/geode_32.c (renamed from arch/i386/kernel/geode.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/head64.c (renamed from arch/x86_64/kernel/head64.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/head_32.S | 578 | ||||
-rw-r--r-- | arch/x86/kernel/head_64.S (renamed from arch/x86_64/kernel/head.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/hpet_32.c (renamed from arch/i386/kernel/hpet.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/hpet_64.c (renamed from arch/x86_64/kernel/hpet.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i386_ksyms_32.c (renamed from arch/i386/kernel/i386_ksyms.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i387_32.c (renamed from arch/i386/kernel/i387.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i387_64.c (renamed from arch/x86_64/kernel/i387.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i8237.c (renamed from arch/i386/kernel/i8237.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i8253_32.c (renamed from arch/i386/kernel/i8253.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i8259_32.c (renamed from arch/i386/kernel/i8259.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/i8259_64.c (renamed from arch/x86_64/kernel/i8259.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/init_task_32.c (renamed from arch/i386/kernel/init_task.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/init_task_64.c (renamed from arch/x86_64/kernel/init_task.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_32.c (renamed from arch/i386/kernel/io_apic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic_64.c (renamed from arch/x86_64/kernel/io_apic.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ioport_32.c (renamed from arch/i386/kernel/ioport.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ioport_64.c (renamed from arch/x86_64/kernel/ioport.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/irq_32.c (renamed from arch/i386/kernel/irq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/irq_64.c (renamed from arch/x86_64/kernel/irq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/k8.c (renamed from arch/x86_64/kernel/k8.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_32.c (renamed from arch/i386/kernel/kprobes.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/kprobes_64.c (renamed from arch/x86_64/kernel/kprobes.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ldt_32.c (renamed from arch/i386/kernel/ldt.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ldt_64.c (renamed from arch/x86_64/kernel/ldt.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_32.c (renamed from arch/i386/kernel/machine_kexec.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/machine_kexec_64.c (renamed from arch/x86_64/kernel/machine_kexec.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mca_32.c (renamed from arch/i386/kernel/mca.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mce_64.c (renamed from arch/x86_64/kernel/mce.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mce_amd_64.c (renamed from arch/x86_64/kernel/mce_amd.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mce_intel_64.c (renamed from arch/x86_64/kernel/mce_intel.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/microcode.c (renamed from arch/i386/kernel/microcode.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/module_32.c (renamed from arch/i386/kernel/module.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/module_64.c (renamed from arch/x86_64/kernel/module.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_32.c (renamed from arch/i386/kernel/mpparse.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/mpparse_64.c (renamed from arch/x86_64/kernel/mpparse.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/msr.c (renamed from arch/i386/kernel/msr.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/nmi_32.c (renamed from arch/i386/kernel/nmi.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/nmi_64.c (renamed from arch/x86_64/kernel/nmi.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/numaq_32.c (renamed from arch/i386/kernel/numaq.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/paravirt_32.c (renamed from arch/i386/kernel/paravirt.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-calgary_64.c (renamed from arch/x86_64/kernel/pci-calgary.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_32.c (renamed from arch/i386/kernel/pci-dma.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-dma_64.c (renamed from arch/x86_64/kernel/pci-dma.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-gart_64.c (renamed from arch/x86_64/kernel/pci-gart.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-nommu_64.c (renamed from arch/x86_64/kernel/pci-nommu.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pci-swiotlb_64.c (renamed from arch/x86_64/kernel/pci-swiotlb.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pcspeaker.c (renamed from arch/i386/kernel/pcspeaker.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/pmtimer_64.c (renamed from arch/x86_64/kernel/pmtimer.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/process_32.c (renamed from arch/i386/kernel/process.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/process_64.c (renamed from arch/x86_64/kernel/process.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace_32.c (renamed from arch/i386/kernel/ptrace.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/ptrace_64.c (renamed from arch/x86_64/kernel/ptrace.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/quirks.c (renamed from arch/i386/kernel/quirks.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/reboot_32.c (renamed from arch/i386/kernel/reboot.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/reboot_64.c (renamed from arch/x86_64/kernel/reboot.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/reboot_fixups_32.c (renamed from arch/i386/kernel/reboot_fixups.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/relocate_kernel_32.S (renamed from arch/i386/kernel/relocate_kernel.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/relocate_kernel_64.S (renamed from arch/x86_64/kernel/relocate_kernel.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/scx200_32.c (renamed from arch/i386/kernel/scx200.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/setup64.c (renamed from arch/x86_64/kernel/setup64.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/setup_32.c (renamed from arch/i386/kernel/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/setup_64.c (renamed from arch/x86_64/kernel/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/sigframe_32.h (renamed from arch/i386/kernel/sigframe.h) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/signal_32.c | 667 | ||||
-rw-r--r-- | arch/x86/kernel/signal_64.c (renamed from arch/x86_64/kernel/signal.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/smp_32.c (renamed from arch/i386/kernel/smp.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/smp_64.c (renamed from arch/x86_64/kernel/smp.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_32.c (renamed from arch/i386/kernel/smpboot.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot_64.c (renamed from arch/x86_64/kernel/smpboot.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/smpcommon_32.c (renamed from arch/i386/kernel/smpcommon.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/srat_32.c (renamed from arch/i386/kernel/srat.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/stacktrace.c (renamed from arch/x86_64/kernel/stacktrace.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/summit_32.c (renamed from arch/i386/kernel/summit.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/suspend_64.c (renamed from arch/x86_64/kernel/suspend.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/suspend_asm_64.S (renamed from arch/x86_64/kernel/suspend_asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/sys_i386_32.c (renamed from arch/i386/kernel/sys_i386.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/sys_x86_64.c (renamed from arch/x86_64/kernel/sys_x86_64.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_64.c | 26 | ||||
-rw-r--r-- | arch/x86/kernel/syscall_table_32.S (renamed from arch/i386/kernel/syscall_table.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/sysenter_32.c (renamed from arch/i386/kernel/sysenter.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/tce_64.c (renamed from arch/x86_64/kernel/tce.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/time_32.c (renamed from arch/i386/kernel/time.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/time_64.c (renamed from arch/x86_64/kernel/time.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/topology.c (renamed from arch/i386/kernel/topology.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/trampoline_32.S (renamed from arch/i386/kernel/trampoline.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/trampoline_64.S | 166 | ||||
-rw-r--r-- | arch/x86/kernel/traps_32.c (renamed from arch/i386/kernel/traps.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/traps_64.c (renamed from arch/x86_64/kernel/traps.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/tsc_32.c (renamed from arch/i386/kernel/tsc.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/tsc_64.c (renamed from arch/x86_64/kernel/tsc.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/tsc_sync.c (renamed from arch/x86_64/kernel/tsc_sync.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/verify_cpu_64.S (renamed from arch/x86_64/kernel/verify_cpu.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vm86_32.c (renamed from arch/i386/kernel/vm86.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vmi_32.c (renamed from arch/i386/kernel/vmi.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vmiclock_32.c (renamed from arch/i386/kernel/vmiclock.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 5 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux_32.lds.S (renamed from arch/i386/kernel/vmlinux.lds.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vmlinux_64.lds.S (renamed from arch/x86_64/kernel/vmlinux.lds.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vsmp_64.c (renamed from arch/x86_64/kernel/vsmp.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall-int80_32.S | 53 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall-note_32.S | 45 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall-sigreturn_32.S (renamed from arch/i386/kernel/vsyscall-sigreturn.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall-sysenter_32.S | 122 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall_32.S | 15 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall_32.lds.S (renamed from arch/i386/kernel/vsyscall.lds.S) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/vsyscall_64.c (renamed from arch/x86_64/kernel/vsyscall.c) | 0 | ||||
-rw-r--r-- | arch/x86/kernel/x8664_ksyms_64.c (renamed from arch/x86_64/kernel/x8664_ksyms.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/lib/Makefile_32 | 11 | ||||
-rw-r--r-- | arch/x86/lib/Makefile_64 | 13 | ||||
-rw-r--r-- | arch/x86/lib/bitops_32.c (renamed from arch/i386/lib/bitops.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/bitops_64.c (renamed from arch/x86_64/lib/bitops.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/bitstr_64.c (renamed from arch/x86_64/lib/bitstr.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/checksum_32.S (renamed from arch/i386/lib/checksum.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/clear_page_64.S (renamed from arch/x86_64/lib/clear_page.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/copy_page_64.S (renamed from arch/x86_64/lib/copy_page.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/copy_user_64.S (renamed from arch/x86_64/lib/copy_user.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/copy_user_nocache_64.S (renamed from arch/x86_64/lib/copy_user_nocache.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/csum-copy_64.S (renamed from arch/x86_64/lib/csum-copy.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/csum-partial_64.c (renamed from arch/x86_64/lib/csum-partial.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/csum-wrappers_64.c (renamed from arch/x86_64/lib/csum-wrappers.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/delay_32.c (renamed from arch/i386/lib/delay.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/delay_64.c (renamed from arch/x86_64/lib/delay.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/getuser_32.S (renamed from arch/i386/lib/getuser.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/getuser_64.S (renamed from arch/x86_64/lib/getuser.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/io_64.c (renamed from arch/x86_64/lib/io.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/iomap_copy_64.S (renamed from arch/x86_64/lib/iomap_copy.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/memcpy_32.c (renamed from arch/i386/lib/memcpy.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/memcpy_64.S (renamed from arch/x86_64/lib/memcpy.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/memmove_64.c (renamed from arch/x86_64/lib/memmove.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/memset_64.S (renamed from arch/x86_64/lib/memset.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/mmx_32.c (renamed from arch/i386/lib/mmx.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/msr-on-cpu.c (renamed from arch/i386/lib/msr-on-cpu.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/putuser_32.S (renamed from arch/i386/lib/putuser.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/putuser_64.S (renamed from arch/x86_64/lib/putuser.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/rwlock_64.S (renamed from arch/x86_64/lib/rwlock.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/semaphore_32.S (renamed from arch/i386/lib/semaphore.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/string_32.c (renamed from arch/i386/lib/string.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/strstr_32.c (renamed from arch/i386/lib/strstr.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/thunk_64.S (renamed from arch/x86_64/lib/thunk.S) | 0 | ||||
-rw-r--r-- | arch/x86/lib/usercopy_32.c (renamed from arch/i386/lib/usercopy.c) | 0 | ||||
-rw-r--r-- | arch/x86/lib/usercopy_64.c (renamed from arch/x86_64/lib/usercopy.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-default/Makefile (renamed from arch/i386/mach-default/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/mach-default/setup.c (renamed from arch/i386/mach-default/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-es7000/Makefile (renamed from arch/i386/mach-es7000/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/mach-es7000/es7000.h (renamed from arch/i386/mach-es7000/es7000.h) | 0 | ||||
-rw-r--r-- | arch/x86/mach-es7000/es7000plat.c (renamed from arch/i386/mach-es7000/es7000plat.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-generic/Makefile | 8 | ||||
-rw-r--r-- | arch/x86/mach-generic/bigsmp.c (renamed from arch/i386/mach-generic/bigsmp.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-generic/default.c (renamed from arch/i386/mach-generic/default.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-generic/es7000.c (renamed from arch/i386/mach-generic/es7000.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-generic/probe.c (renamed from arch/i386/mach-generic/probe.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-generic/summit.c (renamed from arch/i386/mach-generic/summit.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/Makefile (renamed from arch/i386/mach-visws/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/mpparse.c (renamed from arch/i386/mach-visws/mpparse.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/reboot.c (renamed from arch/i386/mach-visws/reboot.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/setup.c (renamed from arch/i386/mach-visws/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/traps.c (renamed from arch/i386/mach-visws/traps.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-visws/visws_apic.c (renamed from arch/i386/mach-visws/visws_apic.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-voyager/Makefile | 8 | ||||
-rw-r--r-- | arch/x86/mach-voyager/setup.c (renamed from arch/i386/mach-voyager/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-voyager/voyager_basic.c (renamed from arch/i386/mach-voyager/voyager_basic.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-voyager/voyager_cat.c (renamed from arch/i386/mach-voyager/voyager_cat.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-voyager/voyager_smp.c (renamed from arch/i386/mach-voyager/voyager_smp.c) | 0 | ||||
-rw-r--r-- | arch/x86/mach-voyager/voyager_thread.c (renamed from arch/i386/mach-voyager/voyager_thread.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/Makefile (renamed from arch/i386/math-emu/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/README (renamed from arch/i386/math-emu/README) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/control_w.h (renamed from arch/i386/math-emu/control_w.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/div_Xsig.S (renamed from arch/i386/math-emu/div_Xsig.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/div_small.S (renamed from arch/i386/math-emu/div_small.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/errors.c (renamed from arch/i386/math-emu/errors.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/exception.h (renamed from arch/i386/math-emu/exception.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_arith.c (renamed from arch/i386/math-emu/fpu_arith.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_asm.h (renamed from arch/i386/math-emu/fpu_asm.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_aux.c (renamed from arch/i386/math-emu/fpu_aux.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_emu.h (renamed from arch/i386/math-emu/fpu_emu.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_entry.c (renamed from arch/i386/math-emu/fpu_entry.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_etc.c (renamed from arch/i386/math-emu/fpu_etc.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_proto.h (renamed from arch/i386/math-emu/fpu_proto.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_system.h (renamed from arch/i386/math-emu/fpu_system.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_tags.c (renamed from arch/i386/math-emu/fpu_tags.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/fpu_trig.c (renamed from arch/i386/math-emu/fpu_trig.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/get_address.c (renamed from arch/i386/math-emu/get_address.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/load_store.c (renamed from arch/i386/math-emu/load_store.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/mul_Xsig.S (renamed from arch/i386/math-emu/mul_Xsig.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly.h (renamed from arch/i386/math-emu/poly.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly_2xm1.c (renamed from arch/i386/math-emu/poly_2xm1.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly_atan.c (renamed from arch/i386/math-emu/poly_atan.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly_l2.c (renamed from arch/i386/math-emu/poly_l2.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly_sin.c (renamed from arch/i386/math-emu/poly_sin.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/poly_tan.c (renamed from arch/i386/math-emu/poly_tan.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/polynom_Xsig.S (renamed from arch/i386/math-emu/polynom_Xsig.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_add_sub.c (renamed from arch/i386/math-emu/reg_add_sub.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_compare.c (renamed from arch/i386/math-emu/reg_compare.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_constant.c (renamed from arch/i386/math-emu/reg_constant.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_constant.h (renamed from arch/i386/math-emu/reg_constant.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_convert.c (renamed from arch/i386/math-emu/reg_convert.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_divide.c (renamed from arch/i386/math-emu/reg_divide.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_ld_str.c (renamed from arch/i386/math-emu/reg_ld_str.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_mul.c (renamed from arch/i386/math-emu/reg_mul.c) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_norm.S (renamed from arch/i386/math-emu/reg_norm.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_round.S (renamed from arch/i386/math-emu/reg_round.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_u_add.S (renamed from arch/i386/math-emu/reg_u_add.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_u_div.S (renamed from arch/i386/math-emu/reg_u_div.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_u_mul.S (renamed from arch/i386/math-emu/reg_u_mul.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/reg_u_sub.S (renamed from arch/i386/math-emu/reg_u_sub.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/round_Xsig.S (renamed from arch/i386/math-emu/round_Xsig.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/shr_Xsig.S (renamed from arch/i386/math-emu/shr_Xsig.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/status_w.h (renamed from arch/i386/math-emu/status_w.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/version.h (renamed from arch/i386/math-emu/version.h) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/wm_shrx.S (renamed from arch/i386/math-emu/wm_shrx.S) | 0 | ||||
-rw-r--r-- | arch/x86/math-emu/wm_sqrt.S (renamed from arch/i386/math-emu/wm_sqrt.S) | 0 | ||||
-rw-r--r-- | arch/x86/mm/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/mm/Makefile_32 | 10 | ||||
-rw-r--r-- | arch/x86/mm/Makefile_64 | 10 | ||||
-rw-r--r-- | arch/x86/mm/boot_ioremap_32.c (renamed from arch/i386/mm/boot_ioremap.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/discontig_32.c (renamed from arch/i386/mm/discontig.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/extable_32.c (renamed from arch/i386/mm/extable.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/extable_64.c (renamed from arch/x86_64/mm/extable.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/fault_32.c (renamed from arch/i386/mm/fault.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/fault_64.c (renamed from arch/x86_64/mm/fault.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/highmem_32.c (renamed from arch/i386/mm/highmem.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/hugetlbpage.c (renamed from arch/i386/mm/hugetlbpage.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/init_32.c (renamed from arch/i386/mm/init.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c (renamed from arch/x86_64/mm/init.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/ioremap_32.c (renamed from arch/i386/mm/ioremap.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/ioremap_64.c (renamed from arch/x86_64/mm/ioremap.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/k8topology_64.c (renamed from arch/x86_64/mm/k8topology.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/mmap_32.c (renamed from arch/i386/mm/mmap.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/mmap_64.c (renamed from arch/x86_64/mm/mmap.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c (renamed from arch/x86_64/mm/numa.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/pageattr_32.c (renamed from arch/i386/mm/pageattr.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/pageattr_64.c (renamed from arch/x86_64/mm/pageattr.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/pgtable_32.c (renamed from arch/i386/mm/pgtable.c) | 0 | ||||
-rw-r--r-- | arch/x86/mm/srat_64.c (renamed from arch/x86_64/mm/srat.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/Kconfig (renamed from arch/i386/oprofile/Kconfig) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/Makefile (renamed from arch/i386/oprofile/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/backtrace.c (renamed from arch/i386/oprofile/backtrace.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/init.c (renamed from arch/i386/oprofile/init.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/nmi_int.c (renamed from arch/i386/oprofile/nmi_int.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/nmi_timer_int.c (renamed from arch/i386/oprofile/nmi_timer_int.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/op_counter.h (renamed from arch/i386/oprofile/op_counter.h) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/op_model_athlon.c (renamed from arch/i386/oprofile/op_model_athlon.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/op_model_p4.c (renamed from arch/i386/oprofile/op_model_p4.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/op_model_ppro.c (renamed from arch/i386/oprofile/op_model_ppro.c) | 0 | ||||
-rw-r--r-- | arch/x86/oprofile/op_x86_model.h (renamed from arch/i386/oprofile/op_x86_model.h) | 0 | ||||
-rw-r--r-- | arch/x86/pci/Makefile | 5 | ||||
-rw-r--r-- | arch/x86/pci/Makefile_32 | 14 | ||||
-rw-r--r-- | arch/x86/pci/Makefile_64 | 17 | ||||
-rw-r--r-- | arch/x86/pci/acpi.c (renamed from arch/i386/pci/acpi.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/common.c (renamed from arch/i386/pci/common.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/direct.c (renamed from arch/i386/pci/direct.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/early.c (renamed from arch/i386/pci/early.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/fixup.c (renamed from arch/i386/pci/fixup.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/i386.c (renamed from arch/i386/pci/i386.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/init.c (renamed from arch/i386/pci/init.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/irq.c (renamed from arch/i386/pci/irq.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/k8-bus_64.c (renamed from arch/x86_64/pci/k8-bus.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/legacy.c (renamed from arch/i386/pci/legacy.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/mmconfig-shared.c (renamed from arch/i386/pci/mmconfig-shared.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/mmconfig_32.c (renamed from arch/i386/pci/mmconfig.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/mmconfig_64.c (renamed from arch/x86_64/pci/mmconfig.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/numa.c (renamed from arch/i386/pci/numa.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/pcbios.c (renamed from arch/i386/pci/pcbios.c) | 0 | ||||
-rw-r--r-- | arch/x86/pci/pci.h (renamed from arch/i386/pci/pci.h) | 0 | ||||
-rw-r--r-- | arch/x86/pci/visws.c (renamed from arch/i386/pci/visws.c) | 0 | ||||
-rw-r--r-- | arch/x86/power/Makefile (renamed from arch/i386/power/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/power/cpu.c (renamed from arch/i386/power/cpu.c) | 0 | ||||
-rw-r--r-- | arch/x86/power/suspend.c (renamed from arch/i386/power/suspend.c) | 0 | ||||
-rw-r--r-- | arch/x86/power/swsusp.S (renamed from arch/i386/power/swsusp.S) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/.gitignore (renamed from arch/x86_64/vdso/.gitignore) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/Makefile (renamed from arch/x86_64/vdso/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vclock_gettime.c (renamed from arch/x86_64/vdso/vclock_gettime.c) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vdso-note.S (renamed from arch/x86_64/vdso/vdso-note.S) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vdso-start.S (renamed from arch/x86_64/vdso/vdso-start.S) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vdso.S | 2 | ||||
-rw-r--r-- | arch/x86/vdso/vdso.lds.S (renamed from arch/x86_64/vdso/vdso.lds.S) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vextern.h (renamed from arch/x86_64/vdso/vextern.h) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vgetcpu.c (renamed from arch/x86_64/vdso/vgetcpu.c) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/vma.c (renamed from arch/x86_64/vdso/vma.c) | 0 | ||||
-rw-r--r-- | arch/x86/vdso/voffset.h | 1 | ||||
-rw-r--r-- | arch/x86/vdso/vvar.c (renamed from arch/x86_64/vdso/vvar.c) | 0 | ||||
-rw-r--r-- | arch/x86/video/Makefile (renamed from arch/i386/video/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/video/fbdev.c (renamed from arch/i386/video/fbdev.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/Kconfig (renamed from arch/i386/xen/Kconfig) | 0 | ||||
-rw-r--r-- | arch/x86/xen/Makefile (renamed from arch/i386/xen/Makefile) | 0 | ||||
-rw-r--r-- | arch/x86/xen/enlighten.c (renamed from arch/i386/xen/enlighten.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/events.c (renamed from arch/i386/xen/events.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/features.c (renamed from arch/i386/xen/features.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/manage.c (renamed from arch/i386/xen/manage.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/mmu.c | 567 | ||||
-rw-r--r-- | arch/x86/xen/mmu.h (renamed from arch/i386/xen/mmu.h) | 0 | ||||
-rw-r--r-- | arch/x86/xen/multicalls.c (renamed from arch/i386/xen/multicalls.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/multicalls.h (renamed from arch/i386/xen/multicalls.h) | 0 | ||||
-rw-r--r-- | arch/x86/xen/setup.c (renamed from arch/i386/xen/setup.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/smp.c (renamed from arch/i386/xen/smp.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/time.c (renamed from arch/i386/xen/time.c) | 0 | ||||
-rw-r--r-- | arch/x86/xen/vdso.h (renamed from arch/i386/xen/vdso.h) | 0 | ||||
-rw-r--r-- | arch/x86/xen/xen-asm.S (renamed from arch/i386/xen/xen-asm.S) | 0 | ||||
-rw-r--r-- | arch/x86/xen/xen-head.S (renamed from arch/i386/xen/xen-head.S) | 0 | ||||
-rw-r--r-- | arch/x86/xen/xen-ops.h (renamed from arch/i386/xen/xen-ops.h) | 0 | ||||
-rw-r--r-- | arch/x86_64/Kconfig | 4 | ||||
-rw-r--r-- | arch/x86_64/Makefile | 28 | ||||
-rw-r--r-- | arch/x86_64/boot/.gitignore | 5 | ||||
-rw-r--r-- | arch/x86_64/boot/Makefile | 9 | ||||
-rw-r--r-- | arch/x86_64/boot/compressed/Makefile | 30 | ||||
-rw-r--r-- | arch/x86_64/boot/compressed/head.S | 311 | ||||
-rw-r--r-- | arch/x86_64/boot/tools/.gitignore | 1 | ||||
-rw-r--r-- | arch/x86_64/crypto/Makefile | 12 | ||||
-rw-r--r-- | arch/x86_64/ia32/audit.c | 42 | ||||
-rw-r--r-- | arch/x86_64/ia32/ipc32.c | 57 | ||||
-rw-r--r-- | arch/x86_64/ia32/syscall32_syscall.S | 17 | ||||
-rw-r--r-- | arch/x86_64/ia32/vsyscall-sigreturn.S | 143 | ||||
-rw-r--r-- | arch/x86_64/kernel/Makefile | 63 | ||||
-rw-r--r-- | arch/x86_64/kernel/acpi/Makefile | 9 | ||||
-rw-r--r-- | arch/x86_64/kernel/acpi/wakeup.S | 456 | ||||
-rw-r--r-- | arch/x86_64/kernel/cpufreq/Makefile | 17 | ||||
-rw-r--r-- | arch/x86_64/kernel/syscall.c | 26 | ||||
-rw-r--r-- | arch/x86_64/kernel/trampoline.S | 166 | ||||
-rw-r--r-- | arch/x86_64/lib/Makefile | 13 | ||||
-rw-r--r-- | arch/x86_64/lib/msr-on-cpu.c | 1 | ||||
-rw-r--r-- | arch/x86_64/mm/Makefile | 11 | ||||
-rw-r--r-- | arch/x86_64/oprofile/Kconfig | 17 | ||||
-rw-r--r-- | arch/x86_64/oprofile/Makefile | 19 | ||||
-rw-r--r-- | arch/x86_64/pci/Makefile | 27 | ||||
-rw-r--r-- | arch/x86_64/vdso/vdso.S | 2 | ||||
-rw-r--r-- | arch/x86_64/vdso/voffset.h | 1 | ||||
-rw-r--r-- | crypto/async_tx/async_tx.c | 12 | ||||
-rw-r--r-- | drivers/acpi/sleep/Makefile | 2 | ||||
-rw-r--r-- | drivers/acpi/sleep/main.c | 46 | ||||
-rw-r--r-- | drivers/ata/ata_piix.c | 7 | ||||
-rw-r--r-- | drivers/ata/pata_ixp4xx_cf.c | 3 | ||||
-rw-r--r-- | drivers/ata/pata_marvell.c | 4 | ||||
-rw-r--r-- | drivers/ata/pata_sis.c | 3 | ||||
-rw-r--r-- | drivers/ata/sata_mv.c | 35 | ||||
-rw-r--r-- | drivers/ata/sata_sil24.c | 16 | ||||
-rw-r--r-- | drivers/base/core.c | 11 | ||||
-rw-r--r-- | drivers/cdrom/cdrom.c | 4 | ||||
-rw-r--r-- | drivers/char/Makefile | 2 | ||||
-rw-r--r-- | drivers/char/agp/intel-agp.c | 5 | ||||
-rw-r--r-- | drivers/char/drm/i915_drv.h | 6 | ||||
-rw-r--r-- | drivers/char/drm/i915_irq.c | 12 | ||||
-rw-r--r-- | drivers/char/hpet.c | 9 | ||||
-rw-r--r-- | drivers/char/mspec.c | 26 | ||||
-rw-r--r-- | drivers/char/random.c | 10 | ||||
-rw-r--r-- | drivers/char/vt_ioctl.c | 19 | ||||
-rw-r--r-- | drivers/firewire/Kconfig | 3 | ||||
-rw-r--r-- | drivers/ide/ppc/pmac.c | 1 | ||||
-rw-r--r-- | drivers/infiniband/hw/mlx4/qp.c | 62 | ||||
-rw-r--r-- | drivers/input/joystick/Kconfig | 2 | ||||
-rw-r--r-- | drivers/input/mouse/appletouch.c | 6 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 5 | ||||
-rw-r--r-- | drivers/lguest/lguest_asm.S | 6 | ||||
-rw-r--r-- | drivers/md/raid5.c | 17 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-fileops.c | 6 | ||||
-rw-r--r-- | drivers/media/video/usbvision/usbvision-video.c | 5 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_ethtool.c | 1 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 1 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_hw.h | 1 | ||||
-rw-r--r-- | drivers/net/e1000/e1000_main.c | 2 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.c | 5 | ||||
-rw-r--r-- | drivers/net/mv643xx_eth.h | 4 | ||||
-rw-r--r-- | drivers/net/pcmcia/3c589_cs.c | 2 | ||||
-rw-r--r-- | drivers/net/ppp_mppe.c | 14 | ||||
-rwxr-xr-x | drivers/net/qla3xxx.c | 7 | ||||
-rw-r--r-- | drivers/net/r8169.c | 30 | ||||
-rw-r--r-- | drivers/net/sky2.c | 87 | ||||
-rw-r--r-- | drivers/net/sky2.h | 2 | ||||
-rw-r--r-- | drivers/net/usb/dm9601.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/Makefile | 2 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_wx.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/cpqphp_pci.c | 2 | ||||
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 2 | ||||
-rw-r--r-- | drivers/pci/quirks.c | 7 | ||||
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 1 | ||||
-rw-r--r-- | drivers/scsi/aic94xx/aic94xx_task.c | 4 | ||||
-rw-r--r-- | drivers/scsi/esp_scsi.c | 3 | ||||
-rw-r--r-- | drivers/scsi/megaraid.c | 8 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_spi.c | 28 | ||||
-rw-r--r-- | drivers/serial/cpm_uart/cpm_uart_cpm1.h | 2 | ||||
-rw-r--r-- | drivers/serial/serial_cs.c | 1 | ||||
-rw-r--r-- | drivers/serial/sunsab.c | 2 | ||||
-rw-r--r-- | drivers/w1/w1.c | 1 | ||||
-rw-r--r-- | fs/aio.c | 2 | ||||
-rw-r--r-- | fs/binfmt_flat.c | 6 | ||||
-rw-r--r-- | fs/compat_ioctl.c | 2 | ||||
-rw-r--r-- | fs/lockd/svclock.c | 31 | ||||
-rw-r--r-- | fs/nfs/client.c | 29 | ||||
-rw-r--r-- | fs/nfs/dir.c | 2 | ||||
-rw-r--r-- | fs/nfs/getroot.c | 3 | ||||
-rw-r--r-- | fs/ocfs2/localalloc.c | 4 | ||||
-rw-r--r-- | fs/splice.c | 46 | ||||
-rw-r--r-- | fs/ufs/super.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_buf_item.h | 5 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 51 | ||||
-rw-r--r-- | fs/xfs/xfs_trans_buf.c | 1 | ||||
-rw-r--r-- | include/acpi/acpi_drivers.h | 4 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf533/bfin_serial_5xx.h | 11 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf537/bfin_serial_5xx.h | 23 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf537/portmux.h | 35 | ||||
-rw-r--r-- | include/asm-blackfin/mach-bf561/bfin_serial_5xx.h | 11 | ||||
-rw-r--r-- | include/asm-blackfin/portmux.h | 55 | ||||
-rw-r--r-- | include/asm-blackfin/unistd.h | 56 | ||||
-rw-r--r-- | include/asm-h8300/flat.h | 3 | ||||
-rw-r--r-- | include/asm-i386/Kbuild | 12 | ||||
-rw-r--r-- | include/asm-i386/k8.h | 1 | ||||
-rw-r--r-- | include/asm-i386/pci-direct.h | 1 | ||||
-rw-r--r-- | include/asm-i386/stacktrace.h | 1 | ||||
-rw-r--r-- | include/asm-i386/system.h | 318 | ||||
-rw-r--r-- | include/asm-i386/termios.h | 91 | ||||
-rw-r--r-- | include/asm-m32r/flat.h | 3 | ||||
-rw-r--r-- | include/asm-m68knommu/flat.h | 3 | ||||
-rw-r--r-- | include/asm-mips/cmpxchg.h | 107 | ||||
-rw-r--r-- | include/asm-mips/fcntl.h | 1 | ||||
-rw-r--r-- | include/asm-mips/irq.h | 32 | ||||
-rw-r--r-- | include/asm-mips/local.h | 69 | ||||
-rw-r--r-- | include/asm-mips/page.h | 2 | ||||
-rw-r--r-- | include/asm-mips/system.h | 261 | ||||
-rw-r--r-- | include/asm-sh/flat.h | 3 | ||||
-rw-r--r-- | include/asm-sh/mpc1211/mc146818rtc.h | 2 | ||||
-rw-r--r-- | include/asm-v850/flat.h | 4 | ||||
-rw-r--r-- | include/asm-x86/8253pit.h | 5 | ||||
-rw-r--r-- | include/asm-x86/8253pit_32.h (renamed from include/asm-i386/8253pit.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/8253pit_64.h (renamed from include/asm-x86_64/8253pit.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/Kbuild | 88 | ||||
-rw-r--r-- | include/asm-x86/a.out.h | 13 | ||||
-rw-r--r-- | include/asm-x86/a.out_32.h (renamed from include/asm-i386/a.out.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/a.out_64.h (renamed from include/asm-x86_64/a.out.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/acpi.h | 5 | ||||
-rw-r--r-- | include/asm-x86/acpi_32.h (renamed from include/asm-i386/acpi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/acpi_64.h (renamed from include/asm-x86_64/acpi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/agp.h | 5 | ||||
-rw-r--r-- | include/asm-x86/agp_32.h (renamed from include/asm-i386/agp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/agp_64.h (renamed from include/asm-x86_64/agp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/alternative-asm.i | 5 | ||||
-rw-r--r-- | include/asm-x86/alternative-asm_32.i (renamed from include/asm-i386/alternative-asm.i) | 0 | ||||
-rw-r--r-- | include/asm-x86/alternative-asm_64.i (renamed from include/asm-x86_64/alternative-asm.i) | 0 | ||||
-rw-r--r-- | include/asm-x86/alternative.h | 5 | ||||
-rw-r--r-- | include/asm-x86/alternative_32.h (renamed from include/asm-i386/alternative.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/alternative_64.h (renamed from include/asm-x86_64/alternative.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/apic.h | 5 | ||||
-rw-r--r-- | include/asm-x86/apic_32.h (renamed from include/asm-i386/apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/apic_64.h (renamed from include/asm-x86_64/apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/apicdef.h | 5 | ||||
-rw-r--r-- | include/asm-x86/apicdef_32.h (renamed from include/asm-i386/apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/apicdef_64.h (renamed from include/asm-x86_64/apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/arch_hooks.h (renamed from include/asm-i386/arch_hooks.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/atomic.h | 5 | ||||
-rw-r--r-- | include/asm-x86/atomic_32.h (renamed from include/asm-i386/atomic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/atomic_64.h (renamed from include/asm-x86_64/atomic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/auxvec.h | 13 | ||||
-rw-r--r-- | include/asm-x86/auxvec_32.h (renamed from include/asm-i386/auxvec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/auxvec_64.h (renamed from include/asm-x86_64/auxvec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bitops.h | 5 | ||||
-rw-r--r-- | include/asm-x86/bitops_32.h (renamed from include/asm-i386/bitops.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bitops_64.h (renamed from include/asm-x86_64/bitops.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/boot.h (renamed from include/asm-i386/boot.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bootparam.h (renamed from include/asm-i386/bootparam.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bootsetup.h (renamed from include/asm-x86_64/bootsetup.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bug.h | 5 | ||||
-rw-r--r-- | include/asm-x86/bug_32.h (renamed from include/asm-i386/bug.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bug_64.h (renamed from include/asm-x86_64/bug.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bugs.h | 5 | ||||
-rw-r--r-- | include/asm-x86/bugs_32.h (renamed from include/asm-i386/bugs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/bugs_64.h (renamed from include/asm-x86_64/bugs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/byteorder.h | 13 | ||||
-rw-r--r-- | include/asm-x86/byteorder_32.h (renamed from include/asm-i386/byteorder.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/byteorder_64.h (renamed from include/asm-x86_64/byteorder.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cache.h | 5 | ||||
-rw-r--r-- | include/asm-x86/cache_32.h (renamed from include/asm-i386/cache.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cache_64.h (renamed from include/asm-x86_64/cache.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cacheflush.h | 5 | ||||
-rw-r--r-- | include/asm-x86/cacheflush_32.h (renamed from include/asm-i386/cacheflush.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cacheflush_64.h (renamed from include/asm-x86_64/cacheflush.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/calgary.h (renamed from include/asm-x86_64/calgary.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/calling.h (renamed from include/asm-x86_64/calling.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/checksum.h | 5 | ||||
-rw-r--r-- | include/asm-x86/checksum_32.h (renamed from include/asm-i386/checksum.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/checksum_64.h (renamed from include/asm-x86_64/checksum.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cmpxchg.h | 5 | ||||
-rw-r--r-- | include/asm-x86/cmpxchg_32.h (renamed from include/asm-i386/cmpxchg.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cmpxchg_64.h (renamed from include/asm-x86_64/cmpxchg.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/compat.h (renamed from include/asm-x86_64/compat.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cpu.h (renamed from include/asm-i386/cpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cpufeature.h | 5 | ||||
-rw-r--r-- | include/asm-x86/cpufeature_32.h (renamed from include/asm-i386/cpufeature.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cpufeature_64.h | 30 | ||||
-rw-r--r-- | include/asm-x86/cputime.h | 5 | ||||
-rw-r--r-- | include/asm-x86/cputime_32.h (renamed from include/asm-i386/cputime.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/cputime_64.h (renamed from include/asm-x86_64/cputime.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/current.h | 5 | ||||
-rw-r--r-- | include/asm-x86/current_32.h (renamed from include/asm-i386/current.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/current_64.h (renamed from include/asm-x86_64/current.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/debugreg.h | 13 | ||||
-rw-r--r-- | include/asm-x86/debugreg_32.h (renamed from include/asm-i386/debugreg.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/debugreg_64.h (renamed from include/asm-x86_64/debugreg.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/delay.h | 5 | ||||
-rw-r--r-- | include/asm-x86/delay_32.h (renamed from include/asm-i386/delay.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/delay_64.h (renamed from include/asm-x86_64/delay.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/desc.h | 5 | ||||
-rw-r--r-- | include/asm-x86/desc_32.h (renamed from include/asm-i386/desc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/desc_64.h (renamed from include/asm-x86_64/desc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/desc_defs.h (renamed from include/asm-x86_64/desc_defs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/device.h | 5 | ||||
-rw-r--r-- | include/asm-x86/device_32.h (renamed from include/asm-i386/device.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/device_64.h (renamed from include/asm-x86_64/device.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/div64.h | 5 | ||||
-rw-r--r-- | include/asm-x86/div64_32.h (renamed from include/asm-i386/div64.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/div64_64.h (renamed from include/asm-x86_64/div64.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping.h | 5 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping_32.h (renamed from include/asm-i386/dma-mapping.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dma-mapping_64.h (renamed from include/asm-x86_64/dma-mapping.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dma.h | 5 | ||||
-rw-r--r-- | include/asm-x86/dma_32.h (renamed from include/asm-i386/dma.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dma_64.h (renamed from include/asm-x86_64/dma.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dmi.h | 5 | ||||
-rw-r--r-- | include/asm-x86/dmi_32.h (renamed from include/asm-i386/dmi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dmi_64.h (renamed from include/asm-x86_64/dmi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dwarf2.h | 5 | ||||
-rw-r--r-- | include/asm-x86/dwarf2_32.h (renamed from include/asm-i386/dwarf2.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/dwarf2_64.h (renamed from include/asm-x86_64/dwarf2.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/e820.h | 5 | ||||
-rw-r--r-- | include/asm-x86/e820_32.h (renamed from include/asm-i386/e820.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/e820_64.h (renamed from include/asm-x86_64/e820.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/edac.h | 5 | ||||
-rw-r--r-- | include/asm-x86/edac_32.h (renamed from include/asm-i386/edac.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/edac_64.h (renamed from include/asm-x86_64/edac.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/elf.h | 13 | ||||
-rw-r--r-- | include/asm-x86/elf_32.h (renamed from include/asm-i386/elf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/elf_64.h (renamed from include/asm-x86_64/elf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/emergency-restart.h (renamed from include/asm-i386/emergency-restart.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/errno.h | 13 | ||||
-rw-r--r-- | include/asm-x86/errno_32.h (renamed from include/asm-i386/errno.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/errno_64.h (renamed from include/asm-x86_64/errno.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fb.h | 5 | ||||
-rw-r--r-- | include/asm-x86/fb_32.h (renamed from include/asm-i386/fb.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fb_64.h (renamed from include/asm-x86_64/fb.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fcntl.h (renamed from include/asm-i386/fcntl.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fixmap.h | 5 | ||||
-rw-r--r-- | include/asm-x86/fixmap_32.h (renamed from include/asm-i386/fixmap.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fixmap_64.h (renamed from include/asm-x86_64/fixmap.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/floppy.h | 5 | ||||
-rw-r--r-- | include/asm-x86/floppy_32.h (renamed from include/asm-i386/floppy.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/floppy_64.h (renamed from include/asm-x86_64/floppy.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/fpu32.h (renamed from include/asm-x86_64/fpu32.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/frame.i (renamed from include/asm-i386/frame.i) | 0 | ||||
-rw-r--r-- | include/asm-x86/futex.h | 5 | ||||
-rw-r--r-- | include/asm-x86/futex_32.h (renamed from include/asm-i386/futex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/futex_64.h (renamed from include/asm-x86_64/futex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/genapic.h | 5 | ||||
-rw-r--r-- | include/asm-x86/genapic_32.h (renamed from include/asm-i386/genapic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/genapic_64.h (renamed from include/asm-x86_64/genapic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/geode.h (renamed from include/asm-i386/geode.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hardirq.h | 5 | ||||
-rw-r--r-- | include/asm-x86/hardirq_32.h (renamed from include/asm-i386/hardirq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hardirq_64.h (renamed from include/asm-x86_64/hardirq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/highmem.h (renamed from include/asm-i386/highmem.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hpet.h | 5 | ||||
-rw-r--r-- | include/asm-x86/hpet_32.h (renamed from include/asm-i386/hpet.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hpet_64.h | 18 | ||||
-rw-r--r-- | include/asm-x86/hw_irq.h | 5 | ||||
-rw-r--r-- | include/asm-x86/hw_irq_32.h (renamed from include/asm-i386/hw_irq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hw_irq_64.h (renamed from include/asm-x86_64/hw_irq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/hypertransport.h (renamed from include/asm-i386/hypertransport.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/i387.h | 5 | ||||
-rw-r--r-- | include/asm-x86/i387_32.h (renamed from include/asm-i386/i387.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/i387_64.h (renamed from include/asm-x86_64/i387.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/i8253.h | 5 | ||||
-rw-r--r-- | include/asm-x86/i8253_32.h (renamed from include/asm-i386/i8253.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/i8253_64.h (renamed from include/asm-x86_64/i8253.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/i8259.h (renamed from include/asm-i386/i8259.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ia32.h (renamed from include/asm-x86_64/ia32.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ia32_unistd.h (renamed from include/asm-x86_64/ia32_unistd.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ide.h (renamed from include/asm-i386/ide.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/idle.h (renamed from include/asm-x86_64/idle.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/intel_arch_perfmon.h | 5 | ||||
-rw-r--r-- | include/asm-x86/intel_arch_perfmon_32.h (renamed from include/asm-i386/intel_arch_perfmon.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/intel_arch_perfmon_64.h (renamed from include/asm-x86_64/intel_arch_perfmon.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/io.h | 5 | ||||
-rw-r--r-- | include/asm-x86/io_32.h (renamed from include/asm-i386/io.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/io_64.h (renamed from include/asm-x86_64/io.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/io_apic.h | 5 | ||||
-rw-r--r-- | include/asm-x86/io_apic_32.h (renamed from include/asm-i386/io_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/io_apic_64.h (renamed from include/asm-x86_64/io_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ioctl.h (renamed from include/asm-i386/ioctl.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ioctls.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ioctls_32.h (renamed from include/asm-i386/ioctls.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ioctls_64.h (renamed from include/asm-x86_64/ioctls.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/iommu.h (renamed from include/asm-x86_64/iommu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ipc.h (renamed from include/asm-i386/ipc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ipcbuf.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ipcbuf_32.h (renamed from include/asm-i386/ipcbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ipcbuf_64.h (renamed from include/asm-x86_64/ipcbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ipi.h (renamed from include/asm-x86_64/ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irq.h | 5 | ||||
-rw-r--r-- | include/asm-x86/irq_32.h (renamed from include/asm-i386/irq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irq_64.h (renamed from include/asm-x86_64/irq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irq_regs.h | 5 | ||||
-rw-r--r-- | include/asm-x86/irq_regs_32.h (renamed from include/asm-i386/irq_regs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irq_regs_64.h (renamed from include/asm-x86_64/irq_regs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irqflags.h | 5 | ||||
-rw-r--r-- | include/asm-x86/irqflags_32.h (renamed from include/asm-i386/irqflags.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/irqflags_64.h (renamed from include/asm-x86_64/irqflags.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ist.h (renamed from include/asm-i386/ist.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/k8.h (renamed from include/asm-x86_64/k8.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kdebug.h | 5 | ||||
-rw-r--r-- | include/asm-x86/kdebug_32.h (renamed from include/asm-i386/kdebug.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kdebug_64.h (renamed from include/asm-x86_64/kdebug.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kexec.h | 5 | ||||
-rw-r--r-- | include/asm-x86/kexec_32.h (renamed from include/asm-i386/kexec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kexec_64.h (renamed from include/asm-x86_64/kexec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kmap_types.h | 5 | ||||
-rw-r--r-- | include/asm-x86/kmap_types_32.h (renamed from include/asm-i386/kmap_types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kmap_types_64.h (renamed from include/asm-x86_64/kmap_types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kprobes.h | 5 | ||||
-rw-r--r-- | include/asm-x86/kprobes_32.h (renamed from include/asm-i386/kprobes.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/kprobes_64.h (renamed from include/asm-x86_64/kprobes.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ldt.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ldt_32.h (renamed from include/asm-i386/ldt.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ldt_64.h (renamed from include/asm-x86_64/ldt.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/linkage.h | 5 | ||||
-rw-r--r-- | include/asm-x86/linkage_32.h (renamed from include/asm-i386/linkage.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/linkage_64.h (renamed from include/asm-x86_64/linkage.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/local.h | 5 | ||||
-rw-r--r-- | include/asm-x86/local_32.h (renamed from include/asm-i386/local.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/local_64.h (renamed from include/asm-x86_64/local.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-bigsmp/mach_apic.h (renamed from include/asm-i386/mach-bigsmp/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-bigsmp/mach_apicdef.h (renamed from include/asm-i386/mach-bigsmp/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-bigsmp/mach_ipi.h (renamed from include/asm-i386/mach-bigsmp/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-bigsmp/mach_mpspec.h (renamed from include/asm-i386/mach-bigsmp/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/apm.h (renamed from include/asm-i386/mach-default/apm.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/bios_ebda.h (renamed from include/asm-i386/mach-default/bios_ebda.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/do_timer.h (renamed from include/asm-i386/mach-default/do_timer.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/entry_arch.h (renamed from include/asm-i386/mach-default/entry_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/io_ports.h (renamed from include/asm-i386/mach-default/io_ports.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/irq_vectors.h (renamed from include/asm-i386/mach-default/irq_vectors.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/irq_vectors_limits.h (renamed from include/asm-i386/mach-default/irq_vectors_limits.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_apic.h (renamed from include/asm-i386/mach-default/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_apicdef.h (renamed from include/asm-i386/mach-default/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_ipi.h (renamed from include/asm-i386/mach-default/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_mpparse.h (renamed from include/asm-i386/mach-default/mach_mpparse.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_mpspec.h (renamed from include/asm-i386/mach-default/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_reboot.h (renamed from include/asm-i386/mach-default/mach_reboot.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_time.h (renamed from include/asm-i386/mach-default/mach_time.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_timer.h (renamed from include/asm-i386/mach-default/mach_timer.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_traps.h (renamed from include/asm-i386/mach-default/mach_traps.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/mach_wakecpu.h (renamed from include/asm-i386/mach-default/mach_wakecpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/pci-functions.h (renamed from include/asm-i386/mach-default/pci-functions.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/setup_arch.h (renamed from include/asm-i386/mach-default/setup_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-default/smpboot_hooks.h (renamed from include/asm-i386/mach-default/smpboot_hooks.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_apic.h (renamed from include/asm-i386/mach-es7000/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_apicdef.h (renamed from include/asm-i386/mach-es7000/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_ipi.h (renamed from include/asm-i386/mach-es7000/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_mpparse.h (renamed from include/asm-i386/mach-es7000/mach_mpparse.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_mpspec.h (renamed from include/asm-i386/mach-es7000/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-es7000/mach_wakecpu.h (renamed from include/asm-i386/mach-es7000/mach_wakecpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/irq_vectors_limits.h (renamed from include/asm-i386/mach-generic/irq_vectors_limits.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/mach_apic.h (renamed from include/asm-i386/mach-generic/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/mach_apicdef.h (renamed from include/asm-i386/mach-generic/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/mach_ipi.h (renamed from include/asm-i386/mach-generic/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/mach_mpparse.h (renamed from include/asm-i386/mach-generic/mach_mpparse.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-generic/mach_mpspec.h (renamed from include/asm-i386/mach-generic/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_apic.h (renamed from include/asm-i386/mach-numaq/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_apicdef.h (renamed from include/asm-i386/mach-numaq/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_ipi.h (renamed from include/asm-i386/mach-numaq/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_mpparse.h (renamed from include/asm-i386/mach-numaq/mach_mpparse.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_mpspec.h (renamed from include/asm-i386/mach-numaq/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-numaq/mach_wakecpu.h (renamed from include/asm-i386/mach-numaq/mach_wakecpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/irq_vectors_limits.h (renamed from include/asm-i386/mach-summit/irq_vectors_limits.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_apic.h (renamed from include/asm-i386/mach-summit/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_apicdef.h (renamed from include/asm-i386/mach-summit/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_ipi.h (renamed from include/asm-i386/mach-summit/mach_ipi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_mpparse.h (renamed from include/asm-i386/mach-summit/mach_mpparse.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-summit/mach_mpspec.h (renamed from include/asm-i386/mach-summit/mach_mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/cobalt.h (renamed from include/asm-i386/mach-visws/cobalt.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/entry_arch.h (renamed from include/asm-i386/mach-visws/entry_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/irq_vectors.h (renamed from include/asm-i386/mach-visws/irq_vectors.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/lithium.h (renamed from include/asm-i386/mach-visws/lithium.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/mach_apic.h (renamed from include/asm-i386/mach-visws/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/mach_apicdef.h (renamed from include/asm-i386/mach-visws/mach_apicdef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/piix4.h (renamed from include/asm-i386/mach-visws/piix4.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/setup_arch.h (renamed from include/asm-i386/mach-visws/setup_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-visws/smpboot_hooks.h (renamed from include/asm-i386/mach-visws/smpboot_hooks.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/do_timer.h (renamed from include/asm-i386/mach-voyager/do_timer.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/entry_arch.h (renamed from include/asm-i386/mach-voyager/entry_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/irq_vectors.h (renamed from include/asm-i386/mach-voyager/irq_vectors.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach-voyager/setup_arch.h (renamed from include/asm-i386/mach-voyager/setup_arch.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mach_apic.h (renamed from include/asm-x86_64/mach_apic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/math_emu.h (renamed from include/asm-i386/math_emu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mc146818rtc.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mc146818rtc_32.h (renamed from include/asm-i386/mc146818rtc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mc146818rtc_64.h (renamed from include/asm-x86_64/mc146818rtc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mca.h (renamed from include/asm-i386/mca.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mca_dma.h (renamed from include/asm-i386/mca_dma.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mce.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mce_32.h (renamed from include/asm-i386/mce.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mce_64.h (renamed from include/asm-x86_64/mce.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mman.h | 13 | ||||
-rw-r--r-- | include/asm-x86/mman_32.h (renamed from include/asm-i386/mman.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mman_64.h (renamed from include/asm-x86_64/mman.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmsegment.h (renamed from include/asm-x86_64/mmsegment.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmu.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mmu_32.h (renamed from include/asm-i386/mmu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmu_64.h (renamed from include/asm-x86_64/mmu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmu_context.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mmu_context_32.h (renamed from include/asm-i386/mmu_context.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmu_context_64.h (renamed from include/asm-x86_64/mmu_context.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmx.h (renamed from include/asm-i386/mmx.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmzone.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mmzone_32.h (renamed from include/asm-i386/mmzone.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mmzone_64.h (renamed from include/asm-x86_64/mmzone.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/module.h | 5 | ||||
-rw-r--r-- | include/asm-x86/module_32.h (renamed from include/asm-i386/module.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/module_64.h (renamed from include/asm-x86_64/module.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mpspec.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mpspec_32.h (renamed from include/asm-i386/mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mpspec_64.h (renamed from include/asm-x86_64/mpspec.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mpspec_def.h (renamed from include/asm-i386/mpspec_def.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msgbuf.h | 13 | ||||
-rw-r--r-- | include/asm-x86/msgbuf_32.h (renamed from include/asm-i386/msgbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msgbuf_64.h (renamed from include/asm-x86_64/msgbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msidef.h (renamed from include/asm-i386/msidef.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msr-index.h (renamed from include/asm-i386/msr-index.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msr.h | 13 | ||||
-rw-r--r-- | include/asm-x86/msr_32.h (renamed from include/asm-i386/msr.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/msr_64.h (renamed from include/asm-x86_64/msr.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mtrr.h | 13 | ||||
-rw-r--r-- | include/asm-x86/mtrr_32.h (renamed from include/asm-i386/mtrr.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mtrr_64.h (renamed from include/asm-x86_64/mtrr.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mutex.h | 5 | ||||
-rw-r--r-- | include/asm-x86/mutex_32.h (renamed from include/asm-i386/mutex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/mutex_64.h (renamed from include/asm-x86_64/mutex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/namei.h | 5 | ||||
-rw-r--r-- | include/asm-x86/namei_32.h (renamed from include/asm-i386/namei.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/namei_64.h (renamed from include/asm-x86_64/namei.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/nmi.h | 5 | ||||
-rw-r--r-- | include/asm-x86/nmi_32.h (renamed from include/asm-i386/nmi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/nmi_64.h (renamed from include/asm-x86_64/nmi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/numa.h | 5 | ||||
-rw-r--r-- | include/asm-x86/numa_32.h (renamed from include/asm-i386/numa.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/numa_64.h (renamed from include/asm-x86_64/numa.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/numaq.h (renamed from include/asm-i386/numaq.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/page.h | 13 | ||||
-rw-r--r-- | include/asm-x86/page_32.h (renamed from include/asm-i386/page.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/page_64.h (renamed from include/asm-x86_64/page.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/param.h | 13 | ||||
-rw-r--r-- | include/asm-x86/param_32.h (renamed from include/asm-i386/param.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/param_64.h (renamed from include/asm-x86_64/param.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/paravirt.h (renamed from include/asm-i386/paravirt.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/parport.h | 5 | ||||
-rw-r--r-- | include/asm-x86/parport_32.h (renamed from include/asm-i386/parport.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/parport_64.h (renamed from include/asm-x86_64/parport.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pci-direct.h (renamed from include/asm-x86_64/pci-direct.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pci.h | 5 | ||||
-rw-r--r-- | include/asm-x86/pci_32.h (renamed from include/asm-i386/pci.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pci_64.h (renamed from include/asm-x86_64/pci.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pda.h (renamed from include/asm-x86_64/pda.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/percpu.h | 5 | ||||
-rw-r--r-- | include/asm-x86/percpu_32.h (renamed from include/asm-i386/percpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/percpu_64.h (renamed from include/asm-x86_64/percpu.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgalloc.h | 5 | ||||
-rw-r--r-- | include/asm-x86/pgalloc_32.h (renamed from include/asm-i386/pgalloc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgalloc_64.h (renamed from include/asm-x86_64/pgalloc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable-2level-defs.h (renamed from include/asm-i386/pgtable-2level-defs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable-2level.h (renamed from include/asm-i386/pgtable-2level.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable-3level-defs.h (renamed from include/asm-i386/pgtable-3level-defs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable-3level.h (renamed from include/asm-i386/pgtable-3level.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable.h | 5 | ||||
-rw-r--r-- | include/asm-x86/pgtable_32.h (renamed from include/asm-i386/pgtable.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/pgtable_64.h (renamed from include/asm-x86_64/pgtable.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/poll.h (renamed from include/asm-i386/poll.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/posix_types.h | 13 | ||||
-rw-r--r-- | include/asm-x86/posix_types_32.h (renamed from include/asm-i386/posix_types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/posix_types_64.h (renamed from include/asm-x86_64/posix_types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/prctl.h (renamed from include/asm-x86_64/prctl.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/processor-cyrix.h (renamed from include/asm-i386/processor-cyrix.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/processor-flags.h (renamed from include/asm-i386/processor-flags.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/processor.h | 5 | ||||
-rw-r--r-- | include/asm-x86/processor_32.h (renamed from include/asm-i386/processor.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/processor_64.h | 439 | ||||
-rw-r--r-- | include/asm-x86/proto.h (renamed from include/asm-x86_64/proto.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ptrace-abi.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ptrace-abi_32.h (renamed from include/asm-i386/ptrace-abi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ptrace-abi_64.h (renamed from include/asm-x86_64/ptrace-abi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ptrace.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ptrace_32.h (renamed from include/asm-i386/ptrace.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ptrace_64.h (renamed from include/asm-x86_64/ptrace.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/reboot.h (renamed from include/asm-i386/reboot.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/reboot_fixups.h (renamed from include/asm-i386/reboot_fixups.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/required-features.h | 5 | ||||
-rw-r--r-- | include/asm-x86/required-features_32.h (renamed from include/asm-i386/required-features.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/required-features_64.h (renamed from include/asm-x86_64/required-features.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/resource.h | 13 | ||||
-rw-r--r-- | include/asm-x86/resource_32.h (renamed from include/asm-i386/resource.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/resource_64.h (renamed from include/asm-x86_64/resource.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/resume-trace.h | 5 | ||||
-rw-r--r-- | include/asm-x86/resume-trace_32.h (renamed from include/asm-i386/resume-trace.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/resume-trace_64.h (renamed from include/asm-x86_64/resume-trace.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rio.h (renamed from include/asm-x86_64/rio.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rtc.h | 5 | ||||
-rw-r--r-- | include/asm-x86/rtc_32.h (renamed from include/asm-i386/rtc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rtc_64.h (renamed from include/asm-x86_64/rtc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rwlock.h | 5 | ||||
-rw-r--r-- | include/asm-x86/rwlock_32.h (renamed from include/asm-i386/rwlock.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rwlock_64.h (renamed from include/asm-x86_64/rwlock.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/rwsem.h (renamed from include/asm-i386/rwsem.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/scatterlist.h | 5 | ||||
-rw-r--r-- | include/asm-x86/scatterlist_32.h (renamed from include/asm-i386/scatterlist.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/scatterlist_64.h (renamed from include/asm-x86_64/scatterlist.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/seccomp.h | 5 | ||||
-rw-r--r-- | include/asm-x86/seccomp_32.h (renamed from include/asm-i386/seccomp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/seccomp_64.h (renamed from include/asm-x86_64/seccomp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sections.h | 5 | ||||
-rw-r--r-- | include/asm-x86/sections_32.h (renamed from include/asm-i386/sections.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sections_64.h (renamed from include/asm-x86_64/sections.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/segment.h | 5 | ||||
-rw-r--r-- | include/asm-x86/segment_32.h (renamed from include/asm-i386/segment.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/segment_64.h (renamed from include/asm-x86_64/segment.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/semaphore.h | 5 | ||||
-rw-r--r-- | include/asm-x86/semaphore_32.h (renamed from include/asm-i386/semaphore.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/semaphore_64.h (renamed from include/asm-x86_64/semaphore.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sembuf.h | 13 | ||||
-rw-r--r-- | include/asm-x86/sembuf_32.h (renamed from include/asm-i386/sembuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sembuf_64.h (renamed from include/asm-x86_64/sembuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/serial.h | 5 | ||||
-rw-r--r-- | include/asm-x86/serial_32.h (renamed from include/asm-i386/serial.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/serial_64.h (renamed from include/asm-x86_64/serial.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/setup.h | 13 | ||||
-rw-r--r-- | include/asm-x86/setup_32.h (renamed from include/asm-i386/setup.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/setup_64.h (renamed from include/asm-x86_64/setup.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/shmbuf.h | 13 | ||||
-rw-r--r-- | include/asm-x86/shmbuf_32.h (renamed from include/asm-i386/shmbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/shmbuf_64.h (renamed from include/asm-x86_64/shmbuf.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/shmparam.h | 13 | ||||
-rw-r--r-- | include/asm-x86/shmparam_32.h (renamed from include/asm-i386/shmparam.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/shmparam_64.h (renamed from include/asm-x86_64/shmparam.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sigcontext.h | 13 | ||||
-rw-r--r-- | include/asm-x86/sigcontext32.h (renamed from include/asm-x86_64/sigcontext32.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sigcontext_32.h (renamed from include/asm-i386/sigcontext.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sigcontext_64.h (renamed from include/asm-x86_64/sigcontext.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/siginfo.h | 13 | ||||
-rw-r--r-- | include/asm-x86/siginfo_32.h (renamed from include/asm-i386/siginfo.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/siginfo_64.h (renamed from include/asm-x86_64/siginfo.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/signal.h | 13 | ||||
-rw-r--r-- | include/asm-x86/signal_32.h (renamed from include/asm-i386/signal.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/signal_64.h (renamed from include/asm-x86_64/signal.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/smp.h | 5 | ||||
-rw-r--r-- | include/asm-x86/smp_32.h (renamed from include/asm-i386/smp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/smp_64.h (renamed from include/asm-x86_64/smp.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/socket.h (renamed from include/asm-i386/socket.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sockios.h | 13 | ||||
-rw-r--r-- | include/asm-x86/sockios_32.h (renamed from include/asm-i386/sockios.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sockios_64.h (renamed from include/asm-x86_64/sockios.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sparsemem.h | 5 | ||||
-rw-r--r-- | include/asm-x86/sparsemem_32.h (renamed from include/asm-i386/sparsemem.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sparsemem_64.h (renamed from include/asm-x86_64/sparsemem.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/spinlock.h | 5 | ||||
-rw-r--r-- | include/asm-x86/spinlock_32.h (renamed from include/asm-i386/spinlock.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/spinlock_64.h (renamed from include/asm-x86_64/spinlock.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/spinlock_types.h (renamed from include/asm-i386/spinlock_types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/srat.h (renamed from include/asm-i386/srat.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/stacktrace.h (renamed from include/asm-x86_64/stacktrace.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/stat.h | 13 | ||||
-rw-r--r-- | include/asm-x86/stat_32.h (renamed from include/asm-i386/stat.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/stat_64.h (renamed from include/asm-x86_64/stat.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/statfs.h | 13 | ||||
-rw-r--r-- | include/asm-x86/statfs_32.h (renamed from include/asm-i386/statfs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/statfs_64.h (renamed from include/asm-x86_64/statfs.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/string.h | 5 | ||||
-rw-r--r-- | include/asm-x86/string_32.h (renamed from include/asm-i386/string.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/string_64.h (renamed from include/asm-x86_64/string.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/suspend.h | 5 | ||||
-rw-r--r-- | include/asm-x86/suspend_32.h (renamed from include/asm-i386/suspend.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/suspend_64.h (renamed from include/asm-x86_64/suspend.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/swiotlb.h (renamed from include/asm-x86_64/swiotlb.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/sync_bitops.h (renamed from include/asm-i386/sync_bitops.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/system.h | 5 | ||||
-rw-r--r-- | include/asm-x86/system_32.h | 313 | ||||
-rw-r--r-- | include/asm-x86/system_64.h (renamed from include/asm-x86_64/system.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tce.h (renamed from include/asm-x86_64/tce.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/termbits.h | 13 | ||||
-rw-r--r-- | include/asm-x86/termbits_32.h (renamed from include/asm-i386/termbits.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/termbits_64.h (renamed from include/asm-x86_64/termbits.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/termios.h | 13 | ||||
-rw-r--r-- | include/asm-x86/termios_32.h | 90 | ||||
-rw-r--r-- | include/asm-x86/termios_64.h (renamed from include/asm-x86_64/termios.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/therm_throt.h (renamed from include/asm-i386/therm_throt.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/thread_info.h | 5 | ||||
-rw-r--r-- | include/asm-x86/thread_info_32.h (renamed from include/asm-i386/thread_info.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/thread_info_64.h (renamed from include/asm-x86_64/thread_info.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/time.h (renamed from include/asm-i386/time.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/timer.h (renamed from include/asm-i386/timer.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/timex.h | 5 | ||||
-rw-r--r-- | include/asm-x86/timex_32.h (renamed from include/asm-i386/timex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/timex_64.h (renamed from include/asm-x86_64/timex.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tlb.h | 5 | ||||
-rw-r--r-- | include/asm-x86/tlb_32.h (renamed from include/asm-i386/tlb.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tlb_64.h (renamed from include/asm-x86_64/tlb.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tlbflush.h | 5 | ||||
-rw-r--r-- | include/asm-x86/tlbflush_32.h (renamed from include/asm-i386/tlbflush.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tlbflush_64.h (renamed from include/asm-x86_64/tlbflush.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/topology.h | 5 | ||||
-rw-r--r-- | include/asm-x86/topology_32.h (renamed from include/asm-i386/topology.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/topology_64.h (renamed from include/asm-x86_64/topology.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/tsc.h (renamed from include/asm-i386/tsc.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/types.h | 13 | ||||
-rw-r--r-- | include/asm-x86/types_32.h (renamed from include/asm-i386/types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/types_64.h (renamed from include/asm-x86_64/types.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/uaccess.h | 5 | ||||
-rw-r--r-- | include/asm-x86/uaccess_32.h (renamed from include/asm-i386/uaccess.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/uaccess_64.h (renamed from include/asm-x86_64/uaccess.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ucontext.h | 13 | ||||
-rw-r--r-- | include/asm-x86/ucontext_32.h (renamed from include/asm-i386/ucontext.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/ucontext_64.h (renamed from include/asm-x86_64/ucontext.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unaligned.h | 5 | ||||
-rw-r--r-- | include/asm-x86/unaligned_32.h (renamed from include/asm-i386/unaligned.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unaligned_64.h (renamed from include/asm-x86_64/unaligned.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unistd.h | 13 | ||||
-rw-r--r-- | include/asm-x86/unistd_32.h (renamed from include/asm-i386/unistd.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unistd_64.h (renamed from include/asm-x86_64/unistd.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unwind.h | 5 | ||||
-rw-r--r-- | include/asm-x86/unwind_32.h (renamed from include/asm-i386/unwind.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/unwind_64.h (renamed from include/asm-x86_64/unwind.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/user.h | 13 | ||||
-rw-r--r-- | include/asm-x86/user32.h (renamed from include/asm-x86_64/user32.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/user_32.h (renamed from include/asm-i386/user.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/user_64.h (renamed from include/asm-x86_64/user.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vga.h (renamed from include/asm-i386/vga.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vgtod.h (renamed from include/asm-x86_64/vgtod.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vic.h (renamed from include/asm-i386/vic.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vm86.h (renamed from include/asm-i386/vm86.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vmi.h (renamed from include/asm-i386/vmi.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vmi_time.h (renamed from include/asm-i386/vmi_time.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/voyager.h (renamed from include/asm-i386/voyager.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vsyscall.h (renamed from include/asm-x86_64/vsyscall.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/vsyscall32.h (renamed from include/asm-x86_64/vsyscall32.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/xen/hypercall.h (renamed from include/asm-i386/xen/hypercall.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/xen/hypervisor.h (renamed from include/asm-i386/xen/hypervisor.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/xen/interface.h (renamed from include/asm-i386/xen/interface.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/xor.h | 5 | ||||
-rw-r--r-- | include/asm-x86/xor_32.h (renamed from include/asm-i386/xor.h) | 0 | ||||
-rw-r--r-- | include/asm-x86/xor_64.h (renamed from include/asm-x86_64/xor.h) | 0 | ||||
-rw-r--r-- | include/asm-x86_64/Kbuild | 21 | ||||
-rw-r--r-- | include/asm-x86_64/boot.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/bootparam.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/cpu.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/cpufeature.h | 30 | ||||
-rw-r--r-- | include/asm-x86_64/emergency-restart.h | 6 | ||||
-rw-r--r-- | include/asm-x86_64/fcntl.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/hpet.h | 18 | ||||
-rw-r--r-- | include/asm-x86_64/hypertransport.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/ide.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/ioctl.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/ist.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/msidef.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/msr-index.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/node.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/poll.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/processor-flags.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/processor.h | 439 | ||||
-rw-r--r-- | include/asm-x86_64/socket.h | 55 | ||||
-rw-r--r-- | include/asm-x86_64/spinlock_types.h | 20 | ||||
-rw-r--r-- | include/asm-x86_64/therm_throt.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/tsc.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/vga.h | 20 | ||||
-rw-r--r-- | include/linux/cpufreq.h | 19 | ||||
-rw-r--r-- | include/linux/sched.h | 2 | ||||
-rw-r--r-- | include/linux/writeback.h | 2 | ||||
-rw-r--r-- | include/net/rose.h | 2 | ||||
-rw-r--r-- | include/net/sctp/sm.h | 4 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 3 | ||||
-rw-r--r-- | include/net/tcp.h | 6 | ||||
-rw-r--r-- | kernel/futex.c | 26 | ||||
-rw-r--r-- | kernel/futex_compat.c | 28 | ||||
-rw-r--r-- | kernel/power/Kconfig | 2 | ||||
-rw-r--r-- | kernel/sched_fair.c | 10 | ||||
-rw-r--r-- | kernel/signal.c | 22 | ||||
-rw-r--r-- | kernel/sys.c | 2 | ||||
-rw-r--r-- | kernel/time/timer_stats.c | 5 | ||||
-rw-r--r-- | lib/Kconfig.debug | 4 | ||||
-rw-r--r-- | lib/Makefile | 4 | ||||
-rw-r--r-- | mm/Kconfig | 1 | ||||
-rw-r--r-- | mm/filemap.c | 1 | ||||
-rw-r--r-- | mm/fremap.c | 2 | ||||
-rw-r--r-- | mm/hugetlb.c | 2 | ||||
-rw-r--r-- | mm/memory.c | 23 | ||||
-rw-r--r-- | mm/page-writeback.c | 4 | ||||
-rw-r--r-- | net/ieee80211/ieee80211_rx.c | 6 | ||||
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_assoc.c | 2 | ||||
-rw-r--r-- | net/ieee80211/softmac/ieee80211softmac_wx.c | 56 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 19 | ||||
-rw-r--r-- | net/ipv6/ndisc.c | 9 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 18 | ||||
-rw-r--r-- | net/mac80211/ieee80211.c | 2 | ||||
-rw-r--r-- | net/mac80211/rc80211_simple.c | 2 | ||||
-rw-r--r-- | net/mac80211/wme.c | 2 | ||||
-rw-r--r-- | net/rose/rose_loopback.c | 4 | ||||
-rw-r--r-- | net/rose/rose_route.c | 15 | ||||
-rw-r--r-- | net/sched/cls_u32.c | 2 | ||||
-rw-r--r-- | net/sched/sch_sfq.c | 47 | ||||
-rw-r--r-- | net/sctp/bind_addr.c | 2 | ||||
-rw-r--r-- | net/sctp/input.c | 8 | ||||
-rw-r--r-- | net/sctp/inqueue.c | 8 | ||||
-rw-r--r-- | net/sctp/sm_make_chunk.c | 46 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 243 | ||||
-rw-r--r-- | net/sctp/sm_statetable.c | 16 | ||||
-rw-r--r-- | net/socket.c | 3 | ||||
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/sysfs.c | 2 | ||||
-rwxr-xr-x | scripts/checksyscalls.sh | 2 | ||||
-rwxr-xr-x | scripts/namespace.pl | 8 | ||||
-rw-r--r-- | sound/core/memalloc.c | 68 |
1263 files changed, 10570 insertions, 8581 deletions
diff --git a/Documentation/crypto/async-tx-api.txt b/Documentation/crypto/async-tx-api.txt new file mode 100644 index 00000000000..c1e9545c59b --- /dev/null +++ b/Documentation/crypto/async-tx-api.txt @@ -0,0 +1,219 @@ + Asynchronous Transfers/Transforms API + +1 INTRODUCTION + +2 GENEALOGY + +3 USAGE +3.1 General format of the API +3.2 Supported operations +3.3 Descriptor management +3.4 When does the operation execute? +3.5 When does the operation complete? +3.6 Constraints +3.7 Example + +4 DRIVER DEVELOPER NOTES +4.1 Conformance points +4.2 "My application needs finer control of hardware channels" + +5 SOURCE + +--- + +1 INTRODUCTION + +The async_tx API provides methods for describing a chain of asynchronous +bulk memory transfers/transforms with support for inter-transactional +dependencies. It is implemented as a dmaengine client that smooths over +the details of different hardware offload engine implementations. Code +that is written to the API can optimize for asynchronous operation and +the API will fit the chain of operations to the available offload +resources. + +2 GENEALOGY + +The API was initially designed to offload the memory copy and +xor-parity-calculations of the md-raid5 driver using the offload engines +present in the Intel(R) Xscale series of I/O processors. It also built +on the 'dmaengine' layer developed for offloading memory copies in the +network stack using Intel(R) I/OAT engines. The following design +features surfaced as a result: +1/ implicit synchronous path: users of the API do not need to know if + the platform they are running on has offload capabilities. The + operation will be offloaded when an engine is available and carried out + in software otherwise. +2/ cross channel dependency chains: the API allows a chain of dependent + operations to be submitted, like xor->copy->xor in the raid5 case. The + API automatically handles cases where the transition from one operation + to another implies a hardware channel switch. +3/ dmaengine extensions to support multiple clients and operation types + beyond 'memcpy' + +3 USAGE + +3.1 General format of the API: +struct dma_async_tx_descriptor * +async_<operation>(<op specific parameters>, + enum async_tx_flags flags, + struct dma_async_tx_descriptor *dependency, + dma_async_tx_callback callback_routine, + void *callback_parameter); + +3.2 Supported operations: +memcpy - memory copy between a source and a destination buffer +memset - fill a destination buffer with a byte value +xor - xor a series of source buffers and write the result to a + destination buffer +xor_zero_sum - xor a series of source buffers and set a flag if the + result is zero. The implementation attempts to prevent + writes to memory + +3.3 Descriptor management: +The return value is non-NULL and points to a 'descriptor' when the operation +has been queued to execute asynchronously. Descriptors are recycled +resources, under control of the offload engine driver, to be reused as +operations complete. When an application needs to submit a chain of +operations it must guarantee that the descriptor is not automatically recycled +before the dependency is submitted. This requires that all descriptors be +acknowledged by the application before the offload engine driver is allowed to +recycle (or free) the descriptor. A descriptor can be acked by one of the +following methods: +1/ setting the ASYNC_TX_ACK flag if no child operations are to be submitted +2/ setting the ASYNC_TX_DEP_ACK flag to acknowledge the parent + descriptor of a new operation. +3/ calling async_tx_ack() on the descriptor. + +3.4 When does the operation execute? +Operations do not immediately issue after return from the +async_<operation> call. Offload engine drivers batch operations to +improve performance by reducing the number of mmio cycles needed to +manage the channel. Once a driver-specific threshold is met the driver +automatically issues pending operations. An application can force this +event by calling async_tx_issue_pending_all(). This operates on all +channels since the application has no knowledge of channel to operation +mapping. + +3.5 When does the operation complete? +There are two methods for an application to learn about the completion +of an operation. +1/ Call dma_wait_for_async_tx(). This call causes the CPU to spin while + it polls for the completion of the operation. It handles dependency + chains and issuing pending operations. +2/ Specify a completion callback. The callback routine runs in tasklet + context if the offload engine driver supports interrupts, or it is + called in application context if the operation is carried out + synchronously in software. The callback can be set in the call to + async_<operation>, or when the application needs to submit a chain of + unknown length it can use the async_trigger_callback() routine to set a + completion interrupt/callback at the end of the chain. + +3.6 Constraints: +1/ Calls to async_<operation> are not permitted in IRQ context. Other + contexts are permitted provided constraint #2 is not violated. +2/ Completion callback routines cannot submit new operations. This + results in recursion in the synchronous case and spin_locks being + acquired twice in the asynchronous case. + +3.7 Example: +Perform a xor->copy->xor operation where each operation depends on the +result from the previous operation: + +void complete_xor_copy_xor(void *param) +{ + printk("complete\n"); +} + +int run_xor_copy_xor(struct page **xor_srcs, + int xor_src_cnt, + struct page *xor_dest, + size_t xor_len, + struct page *copy_src, + struct page *copy_dest, + size_t copy_len) +{ + struct dma_async_tx_descriptor *tx; + + tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, + ASYNC_TX_XOR_DROP_DST, NULL, NULL, NULL); + tx = async_memcpy(copy_dest, copy_src, 0, 0, copy_len, + ASYNC_TX_DEP_ACK, tx, NULL, NULL); + tx = async_xor(xor_dest, xor_srcs, 0, xor_src_cnt, xor_len, + ASYNC_TX_XOR_DROP_DST | ASYNC_TX_DEP_ACK | ASYNC_TX_ACK, + tx, complete_xor_copy_xor, NULL); + + async_tx_issue_pending_all(); +} + +See include/linux/async_tx.h for more information on the flags. See the +ops_run_* and ops_complete_* routines in drivers/md/raid5.c for more +implementation examples. + +4 DRIVER DEVELOPMENT NOTES +4.1 Conformance points: +There are a few conformance points required in dmaengine drivers to +accommodate assumptions made by applications using the async_tx API: +1/ Completion callbacks are expected to happen in tasklet context +2/ dma_async_tx_descriptor fields are never manipulated in IRQ context +3/ Use async_tx_run_dependencies() in the descriptor clean up path to + handle submission of dependent operations + +4.2 "My application needs finer control of hardware channels" +This requirement seems to arise from cases where a DMA engine driver is +trying to support device-to-memory DMA. The dmaengine and async_tx +implementations were designed for offloading memory-to-memory +operations; however, there are some capabilities of the dmaengine layer +that can be used for platform-specific channel management. +Platform-specific constraints can be handled by registering the +application as a 'dma_client' and implementing a 'dma_event_callback' to +apply a filter to the available channels in the system. Before showing +how to implement a custom dma_event callback some background of +dmaengine's client support is required. + +The following routines in dmaengine support multiple clients requesting +use of a channel: +- dma_async_client_register(struct dma_client *client) +- dma_async_client_chan_request(struct dma_client *client) + +dma_async_client_register takes a pointer to an initialized dma_client +structure. It expects that the 'event_callback' and 'cap_mask' fields +are already initialized. + +dma_async_client_chan_request triggers dmaengine to notify the client of +all channels that satisfy the capability mask. It is up to the client's +event_callback routine to track how many channels the client needs and +how many it is currently using. The dma_event_callback routine returns a +dma_state_client code to let dmaengine know the status of the +allocation. + +Below is the example of how to extend this functionality for +platform-specific filtering of the available channels beyond the +standard capability mask: + +static enum dma_state_client +my_dma_client_callback(struct dma_client *client, + struct dma_chan *chan, enum dma_state state) +{ + struct dma_device *dma_dev; + struct my_platform_specific_dma *plat_dma_dev; + + dma_dev = chan->device; + plat_dma_dev = container_of(dma_dev, + struct my_platform_specific_dma, + dma_dev); + + if (!plat_dma_dev->platform_specific_capability) + return DMA_DUP; + + . . . +} + +5 SOURCE +include/linux/dmaengine.h: core header file for DMA drivers and clients +drivers/dma/dmaengine.c: offload engine channel management routines +drivers/dma/: location for offload engine drivers +include/linux/async_tx.h: core header file for the async_tx api +crypto/async_tx/async_tx.c: async_tx interface to dmaengine and common code +crypto/async_tx/async_memcpy.c: copy offload +crypto/async_tx/async_memset.c: memory fill offload +crypto/async_tx/async_xor.c: xor and xor zero sum offload diff --git a/Documentation/devices.txt b/Documentation/devices.txt index 8de132a02ba..6c46730c631 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt @@ -94,6 +94,8 @@ Your cooperation is appreciated. 9 = /dev/urandom Faster, less secure random number gen. 10 = /dev/aio Asynchronous I/O notification interface 11 = /dev/kmsg Writes to this come out as printk's + 12 = /dev/oldmem Used by crashdump kernels to access + the memory of the kernel that crashed. 1 block RAM disk 0 = /dev/ram0 First RAM disk diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 00928d2ecfb..675f75601ae 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt @@ -306,3 +306,11 @@ Why: In kernel tree version of driver is unmaintained. Sk98lin driver Who: Stephen Hemminger <shemminger@linux-foundation.org> --------------------------- + +What: i386/x86_64 bzImage symlinks +When: April 2008 + +Why: The i386/x86_64 merge provides a symlink to the old bzImage + location so not yet updated user space tools, e.g. package + scripts, do not break. +Who: Thomas Gleixner <tglx@linutronix.de> diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index f7918401a00..103e346c8b6 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -46,7 +46,7 @@ typedef uint32_t u32; typedef uint16_t u16; typedef uint8_t u8; #include "../../include/linux/lguest_launcher.h" -#include "../../include/asm-i386/e820.h" +#include "../../include/asm-x86/e820_32.h" /*:*/ #define PAGE_PRESENT 0x7 /* Present, RW, Execute */ @@ -882,7 +882,7 @@ static u32 handle_block_output(int fd, const struct iovec *iov, * of the block file (possibly extending it). */ if (off + len > device_len) { /* Trim it back to the correct length */ - ftruncate(dev->fd, device_len); + ftruncate64(dev->fd, device_len); /* Die, bad Guest, die. */ errx(1, "Write past end %llu+%u", off, len); } diff --git a/Documentation/lockstat.txt b/Documentation/lockstat.txt new file mode 100644 index 00000000000..4ba4664ce5c --- /dev/null +++ b/Documentation/lockstat.txt @@ -0,0 +1,120 @@ + +LOCK STATISTICS + +- WHAT + +As the name suggests, it provides statistics on locks. + +- WHY + +Because things like lock contention can severely impact performance. + +- HOW + +Lockdep already has hooks in the lock functions and maps lock instances to +lock classes. We build on that. The graph below shows the relation between +the lock functions and the various hooks therein. + + __acquire + | + lock _____ + | \ + | __contended + | | + | <wait> + | _______/ + |/ + | + __acquired + | + . + <hold> + . + | + __release + | + unlock + +lock, unlock - the regular lock functions +__* - the hooks +<> - states + +With these hooks we provide the following statistics: + + con-bounces - number of lock contention that involved x-cpu data + contentions - number of lock acquisitions that had to wait + wait time min - shortest (non-0) time we ever had to wait for a lock + max - longest time we ever had to wait for a lock + total - total time we spend waiting on this lock + acq-bounces - number of lock acquisitions that involved x-cpu data + acquisitions - number of times we took the lock + hold time min - shortest (non-0) time we ever held the lock + max - longest time we ever held the lock + total - total time this lock was held + +From these number various other statistics can be derived, such as: + + hold time average = hold time total / acquisitions + +These numbers are gathered per lock class, per read/write state (when +applicable). + +It also tracks 4 contention points per class. A contention point is a call site +that had to wait on lock acquisition. + + - USAGE + +Look at the current lock statistics: + +( line numbers not part of actual output, done for clarity in the explanation + below ) + +# less /proc/lock_stat + +01 lock_stat version 0.2 +02 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +03 class name con-bounces contentions waittime-min waittime-max waittime-total acq-bounces acquisitions holdtime-min holdtime-max holdtime-total +04 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +05 +06 &inode->i_data.tree_lock-W: 15 21657 0.18 1093295.30 11547131054.85 58 10415 0.16 87.51 6387.60 +07 &inode->i_data.tree_lock-R: 0 0 0.00 0.00 0.00 23302 231198 0.25 8.45 98023.38 +08 -------------------------- +09 &inode->i_data.tree_lock 0 [<ffffffff8027c08f>] add_to_page_cache+0x5f/0x190 +10 +11 ............................................................................................................................................................................................... +12 +13 dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24 +14 ----------- +15 dcache_lock 180 [<ffffffff802c0d7e>] sys_getcwd+0x11e/0x230 +16 dcache_lock 165 [<ffffffff802c002a>] d_alloc+0x15a/0x210 +17 dcache_lock 33 [<ffffffff8035818d>] _atomic_dec_and_lock+0x4d/0x70 +18 dcache_lock 1 [<ffffffff802beef8>] shrink_dcache_parent+0x18/0x130 + +This excerpt shows the first two lock class statistics. Line 01 shows the +output version - each time the format changes this will be updated. Line 02-04 +show the header with column descriptions. Lines 05-10 and 13-18 show the actual +statistics. These statistics come in two parts; the actual stats separated by a +short separator (line 08, 14) from the contention points. + +The first lock (05-10) is a read/write lock, and shows two lines above the +short separator. The contention points don't match the column descriptors, +they have two: contentions and [<IP>] symbol. + + +View the top contending locks: + +# grep : /proc/lock_stat | head + &inode->i_data.tree_lock-W: 15 21657 0.18 1093295.30 11547131054.85 58 10415 0.16 87.51 6387.60 + &inode->i_data.tree_lock-R: 0 0 0.00 0.00 0.00 23302 231198 0.25 8.45 98023.38 + dcache_lock: 1037 1161 0.38 45.32 774.51 6611 243371 0.15 306.48 77387.24 + &inode->i_mutex: 161 286 18446744073709 62882.54 1244614.55 3653 20598 18446744073709 62318.60 1693822.74 + &zone->lru_lock: 94 94 0.53 7.33 92.10 4366 32690 0.29 59.81 16350.06 + &inode->i_data.i_mmap_lock: 79 79 0.40 3.77 53.03 11779 87755 0.28 116.93 29898.44 + &q->__queue_lock: 48 50 0.52 31.62 86.31 774 13131 0.17 113.08 12277.52 + &rq->rq_lock_key: 43 47 0.74 68.50 170.63 3706 33929 0.22 107.99 17460.62 + &rq->rq_lock_key#2: 39 46 0.75 6.68 49.03 2979 32292 0.17 125.17 17137.63 + tasklist_lock-W: 15 15 1.45 10.87 32.70 1201 7390 0.58 62.55 13648.47 + +Clear the statistics: + +# echo 0 > /proc/lock_stat diff --git a/Documentation/sysrq.txt b/Documentation/sysrq.txt index ef19142896c..10c8f6922ef 100644 --- a/Documentation/sysrq.txt +++ b/Documentation/sysrq.txt @@ -43,7 +43,7 @@ On x86 - You press the key combo 'ALT-SysRq-<command key>'. Note - Some keyboards may not have a key labeled 'SysRq'. The 'SysRq' key is also known as the 'Print Screen' key. Also some keyboards cannot handle so many keys being pressed at the same time, so you might - have better luck with "press Alt", "press SysRq", "release Alt", + have better luck with "press Alt", "press SysRq", "release SysRq", "press <command key>", release everything. On SPARC - You press 'ALT-STOP-<command key>', I believe. @@ -8,11 +8,11 @@ # 1) Generate asm-offsets.h # -offsets-file := include/asm-$(ARCH)/asm-offsets.h +offsets-file := include/asm-$(SRCARCH)/asm-offsets.h always := $(offsets-file) targets := $(offsets-file) -targets += arch/$(ARCH)/kernel/asm-offsets.s +targets += arch/$(SRCARCH)/kernel/asm-offsets.s clean-files := $(addprefix $(objtree)/,$(targets)) # Default sed regexp - multiline due to syntax constraints @@ -40,11 +40,11 @@ define cmd_offsets endef # We use internal kbuild rules to avoid the "is up to date" message from make -arch/$(ARCH)/kernel/asm-offsets.s: arch/$(ARCH)/kernel/asm-offsets.c FORCE +arch/$(SRCARCH)/kernel/asm-offsets.s: arch/$(SRCARCH)/kernel/asm-offsets.c FORCE $(Q)mkdir -p $(dir $@) $(call if_changed_dep,cc_s_c) -$(obj)/$(offsets-file): arch/$(ARCH)/kernel/asm-offsets.s Kbuild +$(obj)/$(offsets-file): arch/$(SRCARCH)/kernel/asm-offsets.s Kbuild $(Q)mkdir -p $(dir $@) $(call cmd,offsets) @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 23 -EXTRAVERSION =-rc7 +EXTRAVERSION = NAME = Arr Matey! A Hairy Bilge Rat! # *DOCUMENTATION* @@ -186,7 +186,8 @@ ARCH ?= $(SUBARCH) CROSS_COMPILE ?= # Architecture as present in compile.h -UTS_MACHINE := $(ARCH) +UTS_MACHINE := $(ARCH) +SRCARCH := $(ARCH) KCONFIG_CONFIG ?= .config @@ -322,7 +323,7 @@ KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELVERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) export VERSION PATCHLEVEL SUBLEVEL KERNELRELEASE KERNELVERSION -export ARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC +export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC export CPP AR NM STRIP OBJCOPY OBJDUMP MAKE AWK GENKSYMS PERL UTS_MACHINE export HOSTCXX HOSTCXXFLAGS LDFLAGS_MODULE CHECK CHECKFLAGS @@ -609,7 +610,7 @@ libs-y := $(libs-y1) $(libs-y2) vmlinux-init := $(head-y) $(init-y) vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y) vmlinux-all := $(vmlinux-init) $(vmlinux-main) -vmlinux-lds := arch/$(ARCH)/kernel/vmlinux.lds +vmlinux-lds := arch/$(SRCARCH)/kernel/vmlinux.lds export KBUILD_VMLINUX_OBJS := $(vmlinux-all) # Rule to link vmlinux - also used during CONFIG_KALLSYMS @@ -862,7 +863,7 @@ ifneq ($(KBUILD_SRC),) /bin/false; \ fi; $(Q)if [ ! -d include2 ]; then mkdir -p include2; fi; - $(Q)ln -fsn $(srctree)/include/asm-$(ARCH) include2/asm + $(Q)ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm endif # prepare2 creates a makefile if using a separate output directory @@ -894,9 +895,9 @@ export CPPFLAGS_vmlinux.lds += -P -C -U$(ARCH) # before switching between archs anyway. include/asm: - @echo ' SYMLINK $@ -> include/asm-$(ARCH)' + @echo ' SYMLINK $@ -> include/asm-$(SRCARCH)' $(Q)if [ ! -d include ]; then mkdir -p include; fi; - @ln -fsn asm-$(ARCH) $@ + @ln -fsn asm-$(SRCARCH) $@ # Generate some files # --------------------------------------------------------------------------- @@ -936,7 +937,8 @@ depend dep: INSTALL_HDR_PATH=$(objtree)/usr export INSTALL_HDR_PATH -HDRARCHES=$(filter-out generic,$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) +HDRFILTER=generic i386 x86_64 +HDRARCHES=$(filter-out $(HDRFILTER),$(patsubst $(srctree)/include/asm-%/Kbuild,%,$(wildcard $(srctree)/include/asm-*/Kbuild))) PHONY += headers_install_all headers_install_all: include/linux/version.h scripts_basic FORCE @@ -947,11 +949,11 @@ headers_install_all: include/linux/version.h scripts_basic FORCE PHONY += headers_install headers_install: include/linux/version.h scripts_basic FORCE - @if [ ! -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ - echo '*** Error: Headers not exportable for this architecture ($(ARCH))'; \ + @if [ ! -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ + echo '*** Error: Headers not exportable for this architecture ($(SRCARCH))'; \ exit 1 ; fi $(Q)$(MAKE) $(build)=scripts scripts/unifdef - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst obj=include + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include PHONY += headers_check_all headers_check_all: headers_install_all @@ -961,7 +963,7 @@ headers_check_all: headers_install_all PHONY += headers_check headers_check: headers_install - $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst obj=include HDRCHECK=1 + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.headersinst ARCH=$(SRCARCH) obj=include HDRCHECK=1 # --------------------------------------------------------------------------- # Modules @@ -1139,7 +1141,7 @@ help: @echo ' cscope - Generate cscope index' @echo ' kernelrelease - Output the release version string' @echo ' kernelversion - Output the version stored in Makefile' - @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ + @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ echo ' headers_install - Install sanitised kernel headers to INSTALL_HDR_PATH'; \ echo ' (default: $(INSTALL_HDR_PATH))'; \ fi @@ -1147,7 +1149,7 @@ help: @echo 'Static analysers' @echo ' checkstack - Generate a list of stack hogs' @echo ' namespacecheck - Name space analysis on compiled kernel' - @if [ -r $(srctree)/include/asm-$(ARCH)/Kbuild ]; then \ + @if [ -r $(srctree)/include/asm-$(SRCARCH)/Kbuild ]; then \ echo ' headers_check - Sanity check on exported headers'; \ fi @echo '' @@ -1292,18 +1294,23 @@ ifeq ($(ALLSOURCE_ARCHS),) ifeq ($(ARCH),um) ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH) else -ALLINCLUDE_ARCHS := $(ARCH) +ALLINCLUDE_ARCHS := $(SRCARCH) endif else #Allow user to specify only ALLSOURCE_PATHS on the command line, keeping existing behavour. ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS) endif +# Take care of arch/x86 +ifeq ($(ARCH), $(SRCARCH)) ALLSOURCE_ARCHS := $(ARCH) +else +ALLSOURCE_ARCHS := $(ARCH) $(SRCARCH) +endif define find-sources ( for ARCH in $(ALLSOURCE_ARCHS) ; do \ - find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \ + find $(__srctree)arch/$${SRCARCH} $(RCS_FIND_IGNORE) \ -name $1 -print; \ done ; \ find $(__srctree)security/selinux/include $(RCS_FIND_IGNORE) \ @@ -1312,7 +1319,7 @@ define find-sources \( -name config -o -name 'asm-*' \) -prune \ -o -name $1 -print; \ for ARCH in $(ALLINCLUDE_ARCHS) ; do \ - find $(__srctree)include/asm-$${ARCH} $(RCS_FIND_IGNORE) \ + find $(__srctree)include/asm-$${SRCARCH} $(RCS_FIND_IGNORE) \ -name $1 -print; \ done ; \ find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \ diff --git a/arch/arm/kernel/bios32.c b/arch/arm/kernel/bios32.c index 240c448ec31..a2dd930d11e 100644 --- a/arch/arm/kernel/bios32.c +++ b/arch/arm/kernel/bios32.c @@ -338,7 +338,7 @@ pbus_assign_bus_resources(struct pci_bus *bus, struct pci_sys_data *root) * pcibios_fixup_bus - Called after each bus is probed, * but before its children are examined. */ -void __devinit pcibios_fixup_bus(struct pci_bus *bus) +void pcibios_fixup_bus(struct pci_bus *bus) { struct pci_sys_data *root = bus->sysdata; struct pci_dev *dev; @@ -419,7 +419,7 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus) /* * Convert from Linux-centric to bus-centric addresses for bridge devices. */ -void __devinit +void pcibios_resource_to_bus(struct pci_dev *dev, struct pci_bus_region *region, struct resource *res) { diff --git a/arch/arm/mach-s3c2440/mach-osiris.c b/arch/arm/mach-s3c2440/mach-osiris.c index 0ba7e9060c7..c326983f4a8 100644 --- a/arch/arm/mach-s3c2440/mach-osiris.c +++ b/arch/arm/mach-s3c2440/mach-osiris.c @@ -276,7 +276,21 @@ static unsigned char pm_osiris_ctrl0; static int osiris_pm_suspend(struct sys_device *sd, pm_message_t state) { + unsigned int tmp; + pm_osiris_ctrl0 = __raw_readb(OSIRIS_VA_CTRL0); + tmp = pm_osiris_ctrl0 & ~OSIRIS_CTRL0_NANDSEL; + + /* ensure correct NAND slot is selected on resume */ + if ((pm_osiris_ctrl0 & OSIRIS_CTRL0_BOOT_INT) == 0) + tmp |= 2; + + __raw_writeb(tmp, OSIRIS_VA_CTRL0); + + /* ensure that an nRESET is not generated on resume. */ + s3c2410_gpio_setpin(S3C2410_GPA21, 1); + s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_OUT); + return 0; } @@ -285,6 +299,10 @@ static int osiris_pm_resume(struct sys_device *sd) if (pm_osiris_ctrl0 & OSIRIS_CTRL0_FIX8) __raw_writeb(OSIRIS_CTRL1_FIX8, OSIRIS_VA_CTRL1); + __raw_writeb(pm_osiris_ctrl0, OSIRIS_VA_CTRL0); + + s3c2410_gpio_cfgpin(S3C2410_GPA21, S3C2410_GPA21_nRSTOUT); + return 0; } diff --git a/arch/blackfin/kernel/bfin_gpio.c b/arch/blackfin/kernel/bfin_gpio.c index bafcfa52142..5d488ef965c 100644 --- a/arch/blackfin/kernel/bfin_gpio.c +++ b/arch/blackfin/kernel/bfin_gpio.c @@ -84,6 +84,7 @@ #include <linux/err.h> #include <asm/blackfin.h> #include <asm/gpio.h> +#include <asm/portmux.h> #include <linux/irq.h> #ifdef BF533_FAMILY @@ -115,7 +116,11 @@ static struct gpio_port_t *gpio_bankb[gpio_bank(MAX_BLACKFIN_GPIOS)] = { }; #endif -static unsigned short reserved_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; +static unsigned short reserved_gpio_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; +static unsigned short reserved_peri_map[gpio_bank(MAX_BLACKFIN_GPIOS + 16)]; +char *str_ident = NULL; + +#define RESOURCE_LABEL_SIZE 16 #ifdef CONFIG_PM static unsigned short wakeup_map[gpio_bank(MAX_BLACKFIN_GPIOS)]; @@ -143,22 +148,100 @@ inline int check_gpio(unsigned short gpio) return 0; } +static void set_label(unsigned short ident, const char *label) +{ + + if (label && str_ident) { + strncpy(str_ident + ident * RESOURCE_LABEL_SIZE, label, + RESOURCE_LABEL_SIZE); + str_ident[ident * RESOURCE_LABEL_SIZE + + RESOURCE_LABEL_SIZE - 1] = 0; + } +} + +static char *get_label(unsigned short ident) +{ + if (!str_ident) + return "UNKNOWN"; + + return (str_ident[ident * RESOURCE_LABEL_SIZE] ? + (str_ident + ident * RESOURCE_LABEL_SIZE) : "UNKNOWN"); +} + +static int cmp_label(unsigned short ident, const char *label) +{ + if (label && str_ident) + return strncmp(str_ident + ident * RESOURCE_LABEL_SIZE, + label, strlen(label)); + else + return -EINVAL; +} + #ifdef BF537_FAMILY static void port_setup(unsigned short gpio, unsigned short usage) { - if (usage == GPIO_USAGE) { - if (*port_fer[gpio_bank(gpio)] & gpio_bit(gpio)) - printk(KERN_WARNING "bfin-gpio: Possible Conflict with Peripheral " - "usage and GPIO %d detected!\n", gpio); - *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); - } else - *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); - SSYNC(); + if (!check_gpio(gpio)) { + if (usage == GPIO_USAGE) { + *port_fer[gpio_bank(gpio)] &= ~gpio_bit(gpio); + } else + *port_fer[gpio_bank(gpio)] |= gpio_bit(gpio); + SSYNC(); + } } #else # define port_setup(...) do { } while (0) #endif +#ifdef BF537_FAMILY + +#define PMUX_LUT_RES 0 +#define PMUX_LUT_OFFSET 1 +#define PMUX_LUT_ENTRIES 41 +#define PMUX_LUT_SIZE 2 + +static unsigned short port_mux_lut[PMUX_LUT_ENTRIES][PMUX_LUT_SIZE] = { + {P_PPI0_D13, 11}, {P_PPI0_D14, 11}, {P_PPI0_D15, 11}, + {P_SPORT1_TFS, 11}, {P_SPORT1_TSCLK, 11}, {P_SPORT1_DTPRI, 11}, + {P_PPI0_D10, 10}, {P_PPI0_D11, 10}, {P_PPI0_D12, 10}, + {P_SPORT1_RSCLK, 10}, {P_SPORT1_RFS, 10}, {P_SPORT1_DRPRI, 10}, + {P_PPI0_D8, 9}, {P_PPI0_D9, 9}, {P_SPORT1_DRSEC, 9}, + {P_SPORT1_DTSEC, 9}, {P_TMR2, 8}, {P_PPI0_FS3, 8}, {P_TMR3, 7}, + {P_SPI0_SSEL4, 7}, {P_TMR4, 6}, {P_SPI0_SSEL5, 6}, {P_TMR5, 5}, + {P_SPI0_SSEL6, 5}, {P_UART1_RX, 4}, {P_UART1_TX, 4}, {P_TMR6, 4}, + {P_TMR7, 4}, {P_UART0_RX, 3}, {P_UART0_TX, 3}, {P_DMAR0, 3}, + {P_DMAR1, 3}, {P_SPORT0_DTSEC, 1}, {P_SPORT0_DRSEC, 1}, + {P_CAN0_RX, 1}, {P_CAN0_TX, 1}, {P_SPI0_SSEL7, 1}, + {P_SPORT0_TFS, 0}, {P_SPORT0_DTPRI, 0}, {P_SPI0_SSEL2, 0}, + {P_SPI0_SSEL3, 0} +}; + +static void portmux_setup(unsigned short per, unsigned short function) +{ + u16 y, muxreg, offset; + + for (y = 0; y < PMUX_LUT_ENTRIES; y++) { + if (port_mux_lut[y][PMUX_LUT_RES] == per) { + + /* SET PORTMUX REG */ + + offset = port_mux_lut[y][PMUX_LUT_OFFSET]; + muxreg = bfin_read_PORT_MUX(); + + if (offset != 1) { + muxreg &= ~(1 << offset); + } else { + muxreg &= ~(3 << 1); + } + + muxreg |= (function << offset); + bfin_write_PORT_MUX(muxreg); + } + } +} + +#else +# define portmux_setup(...) do { } while (0) +#endif static void default_gpio(unsigned short gpio) { @@ -179,22 +262,15 @@ static void default_gpio(unsigned short gpio) static int __init bfin_gpio_init(void) { - int i; - - printk(KERN_INFO "Blackfin GPIO Controller\n"); - for (i = 0; i < MAX_BLACKFIN_GPIOS; i += GPIO_BANKSIZE) - reserved_map[gpio_bank(i)] = 0; + str_ident = kzalloc(RESOURCE_LABEL_SIZE * 256, GFP_KERNEL); + if (!str_ident) + return -ENOMEM; -#if defined(BF537_FAMILY) && (defined(CONFIG_BFIN_MAC) || defined(CONFIG_BFIN_MAC_MODULE)) -# if defined(CONFIG_BFIN_MAC_RMII) - reserved_map[gpio_bank(PORT_H)] = 0xC373; -# else - reserved_map[gpio_bank(PORT_H)] = 0xFFFF; -# endif -#endif + printk(KERN_INFO "Blackfin GPIO Controller\n"); return 0; + } arch_initcall(bfin_gpio_init); @@ -223,7 +299,7 @@ arch_initcall(bfin_gpio_init); void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ { \ unsigned long flags; \ - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ local_irq_save(flags); \ if (arg) \ gpio_bankb[gpio_bank(gpio)]->name |= gpio_bit(gpio); \ @@ -243,7 +319,7 @@ SET_GPIO(both) #define SET_GPIO_SC(name) \ void set_gpio_ ## name(unsigned short gpio, unsigned short arg) \ { \ - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); \ if (arg) \ gpio_bankb[gpio_bank(gpio)]->name ## _set = gpio_bit(gpio); \ else \ @@ -258,7 +334,7 @@ SET_GPIO_SC(maskb) void set_gpio_data(unsigned short gpio, unsigned short arg) { unsigned long flags; - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); local_irq_save(flags); if (arg) gpio_bankb[gpio_bank(gpio)]->data_set = gpio_bit(gpio); @@ -277,7 +353,7 @@ SET_GPIO_SC(data) void set_gpio_toggle(unsigned short gpio) { unsigned long flags; - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); local_irq_save(flags); gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); bfin_read_CHIPID(); @@ -286,7 +362,7 @@ void set_gpio_toggle(unsigned short gpio) #else void set_gpio_toggle(unsigned short gpio) { - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); gpio_bankb[gpio_bank(gpio)]->toggle = gpio_bit(gpio); } #endif @@ -350,7 +426,7 @@ unsigned short get_gpio_data(unsigned short gpio) { unsigned long flags; unsigned short ret; - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); local_irq_save(flags); ret = 0x01 & (gpio_bankb[gpio_bank(gpio)]->data >> gpio_sub_n(gpio)); bfin_read_CHIPID(); @@ -494,13 +570,14 @@ u32 gpio_pm_setup(void) gpio_bank_saved[bank].dir = gpio_bankb[bank]->dir; gpio_bank_saved[bank].edge = gpio_bankb[bank]->edge; gpio_bank_saved[bank].both = gpio_bankb[bank]->both; - gpio_bank_saved[bank].reserved = reserved_map[bank]; + gpio_bank_saved[bank].reserved = + reserved_gpio_map[bank]; gpio = i; while (mask) { if (mask & 1) { - reserved_map[gpio_bank(gpio)] |= + reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); bfin_gpio_wakeup_type(gpio, wakeup_flags_map[gpio]); @@ -540,7 +617,8 @@ void gpio_pm_restore(void) gpio_bankb[bank]->edge = gpio_bank_saved[bank].edge; gpio_bankb[bank]->both = gpio_bank_saved[bank].both; - reserved_map[bank] = gpio_bank_saved[bank].reserved; + reserved_gpio_map[bank] = + gpio_bank_saved[bank].reserved; } @@ -550,6 +628,141 @@ void gpio_pm_restore(void) #endif + + + +int peripheral_request(unsigned short per, const char *label) +{ + unsigned long flags; + unsigned short ident = P_IDENT(per); + + /* + * Don't cares are pins with only one dedicated function + */ + + if (per & P_DONTCARE) + return 0; + + if (!(per & P_DEFINED)) + return -ENODEV; + + local_irq_save(flags); + + if (!check_gpio(ident)) { + + if (unlikely(reserved_gpio_map[gpio_bank(ident)] & gpio_bit(ident))) { + printk(KERN_ERR + "%s: Peripheral %d is already reserved as GPIO by %s !\n", + __FUNCTION__, ident, get_label(ident)); + dump_stack(); + local_irq_restore(flags); + return -EBUSY; + } + + } + + if (unlikely(reserved_peri_map[gpio_bank(ident)] & gpio_bit(ident))) { + + /* + * Pin functions like AMC address strobes my + * be requested and used by several drivers + */ + + if (!(per & P_MAYSHARE)) { + + /* + * Allow that the identical pin function can + * be requested from the same driver twice + */ + + if (cmp_label(ident, label) == 0) + goto anyway; + + printk(KERN_ERR + "%s: Peripheral %d function %d is already" + "reserved by %s !\n", + __FUNCTION__, ident, P_FUNCT2MUX(per), + get_label(ident)); + dump_stack(); + local_irq_restore(flags); + return -EBUSY; + } + + } + +anyway: + + + portmux_setup(per, P_FUNCT2MUX(per)); + + port_setup(ident, PERIPHERAL_USAGE); + + reserved_peri_map[gpio_bank(ident)] |= gpio_bit(ident); + local_irq_restore(flags); + set_label(ident, label); + + return 0; +} +EXPORT_SYMBOL(peripheral_request); + +int peripheral_request_list(unsigned short per[], const char *label) +{ + u16 cnt; + int ret; + + for (cnt = 0; per[cnt] != 0; cnt++) { + ret = peripheral_request(per[cnt], label); + if (ret < 0) + return ret; + } + + return 0; +} +EXPORT_SYMBOL(peripheral_request_list); + +void peripheral_free(unsigned short per) +{ + unsigned long flags; + unsigned short ident = P_IDENT(per); + + if (per & P_DONTCARE) + return; + + if (!(per & P_DEFINED)) + return; + + if (check_gpio(ident) < 0) + return; + + local_irq_save(flags); + + if (unlikely(!(reserved_peri_map[gpio_bank(ident)] + & gpio_bit(ident)))) { + local_irq_restore(flags); + return; + } + + if (!(per & P_MAYSHARE)) { + port_setup(ident, GPIO_USAGE); + } + + reserved_peri_map[gpio_bank(ident)] &= ~gpio_bit(ident); + + local_irq_restore(flags); +} +EXPORT_SYMBOL(peripheral_free); + +void peripheral_free_list(unsigned short per[]) +{ + u16 cnt; + + for (cnt = 0; per[cnt] != 0; cnt++) { + peripheral_free(per[cnt]); + } + +} +EXPORT_SYMBOL(peripheral_free_list); + /*********************************************************** * * FUNCTIONS: Blackfin GPIO Driver @@ -574,13 +787,13 @@ int gpio_request(unsigned short gpio, const char *label) local_irq_save(flags); - if (unlikely(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))) { + if (unlikely(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))) { printk(KERN_ERR "bfin-gpio: GPIO %d is already reserved!\n", gpio); dump_stack(); local_irq_restore(flags); return -EBUSY; } - reserved_map[gpio_bank(gpio)] |= gpio_bit(gpio); + reserved_gpio_map[gpio_bank(gpio)] |= gpio_bit(gpio); local_irq_restore(flags); @@ -599,7 +812,7 @@ void gpio_free(unsigned short gpio) local_irq_save(flags); - if (unlikely(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { + if (unlikely(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio)))) { printk(KERN_ERR "bfin-gpio: GPIO %d wasn't reserved!\n", gpio); dump_stack(); local_irq_restore(flags); @@ -608,7 +821,7 @@ void gpio_free(unsigned short gpio) default_gpio(gpio); - reserved_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); + reserved_gpio_map[gpio_bank(gpio)] &= ~gpio_bit(gpio); local_irq_restore(flags); } @@ -618,7 +831,7 @@ void gpio_direction_input(unsigned short gpio) { unsigned long flags; - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); local_irq_save(flags); gpio_bankb[gpio_bank(gpio)]->dir &= ~gpio_bit(gpio); @@ -631,7 +844,7 @@ void gpio_direction_output(unsigned short gpio) { unsigned long flags; - BUG_ON(!(reserved_map[gpio_bank(gpio)] & gpio_bit(gpio))); + BUG_ON(!(reserved_gpio_map[gpio_bank(gpio)] & gpio_bit(gpio))); local_irq_save(flags); gpio_bankb[gpio_bank(gpio)]->inen &= ~gpio_bit(gpio); diff --git a/arch/blackfin/mach-common/entry.S b/arch/blackfin/mach-common/entry.S index d61bba98fb5..96045880834 100644 --- a/arch/blackfin/mach-common/entry.S +++ b/arch/blackfin/mach-common/entry.S @@ -815,7 +815,7 @@ _extable: ALIGN ENTRY(_sys_call_table) - .long _sys_ni_syscall /* 0 - old "setup()" system call*/ + .long _sys_restart_syscall /* 0 */ .long _sys_exit .long _sys_fork .long _sys_read @@ -978,13 +978,13 @@ ENTRY(_sys_call_table) .long _sys_sched_get_priority_min /* 160 */ .long _sys_sched_rr_get_interval .long _sys_nanosleep - .long _sys_ni_syscall /* sys_mremap */ + .long _sys_mremap .long _sys_setresuid /* setresuid16 */ .long _sys_getresuid /* getresuid16 */ /* 165 */ .long _sys_ni_syscall /* for vm86 */ .long _sys_ni_syscall /* old "query_module" */ .long _sys_ni_syscall /* sys_poll */ - .long _sys_ni_syscall /* sys_nfsservctl */ + .long _sys_nfsservctl .long _sys_setresgid /* setresgid16 */ /* 170 */ .long _sys_getresgid /* getresgid16 */ .long _sys_prctl @@ -1040,7 +1040,7 @@ ENTRY(_sys_call_table) .long _sys_ni_syscall /* reserved for TUX */ .long _sys_ni_syscall .long _sys_gettid - .long _sys_ni_syscall /* 225 */ /* sys_readahead */ + .long _sys_readahead /* 225 */ .long _sys_setxattr .long _sys_lsetxattr .long _sys_fsetxattr @@ -1157,6 +1157,21 @@ ENTRY(_sys_call_table) .long _sys_shmctl .long _sys_shmdt /* 340 */ .long _sys_shmget + .long _sys_splice + .long _sys_sync_file_range + .long _sys_tee + .long _sys_vmsplice /* 345 */ + .long _sys_epoll_pwait + .long _sys_utimensat + .long _sys_signalfd + .long _sys_timerfd + .long _sys_eventfd /* 350 */ + .long _sys_pread64 + .long _sys_pwrite64 + .long _sys_fadvise64 + .long _sys_set_robust_list + .long _sys_get_robust_list /* 355 */ + .long _sys_fallocate .rept NR_syscalls-(.-_sys_call_table)/4 .long _sys_ni_syscall .endr diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 97b64d7d6bf..2d85e4b8730 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -226,7 +226,7 @@ config PARAVIRT However, when run without a hypervisor the kernel is theoretically slower. If in doubt, say N. -source "arch/i386/xen/Kconfig" +source "arch/x86/xen/Kconfig" config VMI bool "VMI Paravirt-ops support" @@ -707,7 +707,7 @@ config MATH_EMULATION intend to use this kernel on different machines. More information about the internals of the Linux math coprocessor - emulation can be found in <file:arch/i386/math-emu/README>. + emulation can be found in <file:arch/x86/math-emu/README>. If you are not sure, say Y; apart from resulting in a 66 KB bigger kernel, it won't hurt. @@ -1067,7 +1067,7 @@ config APM_REAL_MODE_POWER_OFF endif # APM -source "arch/i386/kernel/cpu/cpufreq/Kconfig" +source "arch/x86/kernel/cpu/cpufreq/Kconfig" endmenu @@ -1240,7 +1240,7 @@ menuconfig INSTRUMENTATION if INSTRUMENTATION -source "arch/i386/oprofile/Kconfig" +source "arch/x86/oprofile/Kconfig" config KPROBES bool "Kprobes" diff --git a/arch/i386/Makefile b/arch/i386/Makefile index 52b932478c6..5e50dbf00f3 100644 --- a/arch/i386/Makefile +++ b/arch/i386/Makefile @@ -17,6 +17,9 @@ # 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net> # Added support for GEODE CPU +# Fill in SRCARCH +SRCARCH := x86 + HAS_BIARCH := $(call cc-option-yn, -m32) ifeq ($(HAS_BIARCH),y) AS := $(AS) --32 @@ -61,62 +64,62 @@ AFLAGS += $(call as-instr,.cfi_startproc\n.cfi_signal_frame\n.cfi_endproc,-DCONF CFLAGS += $(cflags-y) # Default subarch .c files -mcore-y := mach-default +mcore-y := arch/x86/mach-default # Voyager subarch support -mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager -mcore-$(CONFIG_X86_VOYAGER) := mach-voyager +mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-x86/mach-voyager +mcore-$(CONFIG_X86_VOYAGER) := arch/x86/mach-voyager # VISWS subarch support -mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws -mcore-$(CONFIG_X86_VISWS) := mach-visws +mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-x86/mach-visws +mcore-$(CONFIG_X86_VISWS) := arch/x86/mach-visws # NUMAQ subarch support -mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq -mcore-$(CONFIG_X86_NUMAQ) := mach-default +mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-x86/mach-numaq +mcore-$(CONFIG_X86_NUMAQ) := arch/x86/mach-default # BIGSMP subarch support -mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp -mcore-$(CONFIG_X86_BIGSMP) := mach-default +mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-x86/mach-bigsmp +mcore-$(CONFIG_X86_BIGSMP) := arch/x86/mach-default #Summit subarch support -mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit -mcore-$(CONFIG_X86_SUMMIT) := mach-default +mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-x86/mach-summit +mcore-$(CONFIG_X86_SUMMIT) := arch/x86/mach-default # generic subarchitecture -mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic -mcore-$(CONFIG_X86_GENERICARCH) := mach-default -core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/ +mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-x86/mach-generic +mcore-$(CONFIG_X86_GENERICARCH) := arch/x86/mach-default +core-$(CONFIG_X86_GENERICARCH) += arch/x86/mach-generic/ # ES7000 subarch support -mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000 -mcore-$(CONFIG_X86_ES7000) := mach-default -core-$(CONFIG_X86_ES7000) := arch/i386/mach-es7000/ +mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-x86/mach-es7000 +mcore-$(CONFIG_X86_ES7000) := arch/x86/mach-default +core-$(CONFIG_X86_ES7000) := arch/x86/mach-es7000/ # Xen paravirtualization support -core-$(CONFIG_XEN) += arch/i386/xen/ +core-$(CONFIG_XEN) += arch/x86/xen/ # default subarch .h files -mflags-y += -Iinclude/asm-i386/mach-default +mflags-y += -Iinclude/asm-x86/mach-default -head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o +head-y := arch/x86/kernel/head_32.o arch/x86/kernel/init_task_32.o -libs-y += arch/i386/lib/ -core-y += arch/i386/kernel/ \ - arch/i386/mm/ \ - arch/i386/$(mcore-y)/ \ - arch/i386/crypto/ -drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/ -drivers-$(CONFIG_PCI) += arch/i386/pci/ +libs-y += arch/x86/lib/ +core-y += arch/x86/kernel/ \ + arch/x86/mm/ \ + $(mcore-y)/ \ + arch/x86/crypto/ +drivers-$(CONFIG_MATH_EMULATION) += arch/x86/math-emu/ +drivers-$(CONFIG_PCI) += arch/x86/pci/ # must be linked after kernel/ -drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/ -drivers-$(CONFIG_PM) += arch/i386/power/ -drivers-$(CONFIG_FB) += arch/i386/video/ +drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/ +drivers-$(CONFIG_PM) += arch/x86/power/ +drivers-$(CONFIG_FB) += arch/x86/video/ CFLAGS += $(mflags-y) AFLAGS += $(mflags-y) -boot := arch/i386/boot +boot := arch/x86/boot PHONY += zImage bzImage compressed zlilo bzlilo \ zdisk bzdisk fdimage fdimage144 fdimage288 isoimage install @@ -125,9 +128,11 @@ all: bzImage # KBUILD_IMAGE specify target image being built KBUILD_IMAGE := $(boot)/bzImage -zImage zlilo zdisk: KBUILD_IMAGE := arch/i386/boot/zImage +zImage zlilo zdisk: KBUILD_IMAGE := arch/x86/boot/zImage zImage bzImage: vmlinux + $(Q)mkdir -p $(objtree)/arch/i386/boot + $(Q)ln -fsn $(objtree)/arch/x86/boot/bzImage $(objtree)/arch/i386/boot/bzImage $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE) compressed: zImage @@ -145,7 +150,8 @@ install: $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install archclean: - $(Q)$(MAKE) $(clean)=arch/i386/boot + $(Q)rm -rf $(objtree)/arch/i386/boot + $(Q)$(MAKE) $(clean)=arch/x86/boot define archhelp echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)' diff --git a/arch/i386/boot/Makefile b/arch/i386/boot/Makefile deleted file mode 100644 index 93386a4e40b..00000000000 --- a/arch/i386/boot/Makefile +++ /dev/null @@ -1,171 +0,0 @@ -# -# arch/i386/boot/Makefile -# -# This file is subject to the terms and conditions of the GNU General Public -# License. See the file "COPYING" in the main directory of this archive -# for more details. -# -# Copyright (C) 1994 by Linus Torvalds -# - -# ROOT_DEV specifies the default root-device when making the image. -# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case -# the default of FLOPPY is used by 'build'. - -ROOT_DEV := CURRENT - -# If you want to preset the SVGA mode, uncomment the next line and -# set SVGA_MODE to whatever number you want. -# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. -# The number is the same as you would ordinarily press at bootup. - -SVGA_MODE := -DSVGA_MODE=NORMAL_VGA - -# If you want the RAM disk device, define this to be the size in blocks. - -#RAMDISK := -DRAMDISK=512 - -targets := vmlinux.bin setup.bin setup.elf zImage bzImage -subdir- := compressed - -setup-y += a20.o apm.o cmdline.o copy.o cpu.o cpucheck.o edd.o -setup-y += header.o main.o mca.o memory.o pm.o pmjump.o -setup-y += printf.o string.o tty.o video.o version.o voyager.o - -# The link order of the video-*.o modules can matter. In particular, -# video-vga.o *must* be listed first, followed by video-vesa.o. -# Hardware-specific drivers should follow in the order they should be -# probed, and video-bios.o should typically be last. -setup-y += video-vga.o -setup-y += video-vesa.o -setup-y += video-bios.o -targets += $(setup-y) -hostprogs-y := tools/build - -HOSTCFLAGS_build.o := $(LINUXINCLUDE) - -# --------------------------------------------------------------------------- - -# How to compile the 16-bit code. Note we always compile for -march=i386, -# that way we can complain to the user if the CPU is insufficient. -cflags-i386 := -cflags-x86_64 := -m32 -CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ - $(cflags-$(ARCH)) \ - -Wall -Wstrict-prototypes \ - -march=i386 -mregparm=3 \ - -include $(srctree)/$(src)/code16gcc.h \ - -fno-strict-aliasing -fomit-frame-pointer \ - $(call cc-option, -ffreestanding) \ - $(call cc-option, -fno-toplevel-reorder,\ - $(call cc-option, -fno-unit-at-a-time)) \ - $(call cc-option, -fno-stack-protector) \ - $(call cc-option, -mpreferred-stack-boundary=2) -AFLAGS := $(CFLAGS) -D__ASSEMBLY__ - -$(obj)/zImage: IMAGE_OFFSET := 0x1000 -$(obj)/zImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) -$(obj)/bzImage: IMAGE_OFFSET := 0x100000 -$(obj)/bzImage: EXTRA_CFLAGS := -D__BIG_KERNEL__ -$(obj)/bzImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ -$(obj)/bzImage: BUILDFLAGS := -b - -quiet_cmd_image = BUILD $@ -cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ - $(obj)/vmlinux.bin $(ROOT_DEV) > $@ - -$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ - $(obj)/vmlinux.bin $(obj)/tools/build FORCE - $(call if_changed,image) - @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' - -$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE - $(call if_changed,objcopy) - -SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) - -LDFLAGS_setup.elf := -T -$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE - $(call if_changed,ld) - -OBJCOPYFLAGS_setup.bin := -O binary - -$(obj)/setup.bin: $(obj)/setup.elf FORCE - $(call if_changed,objcopy) - -$(obj)/compressed/vmlinux: FORCE - $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ - -# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel -FDARGS = -# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel -FDINITRD = - -image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) - -$(obj)/mtools.conf: $(src)/mtools.conf.in - sed -e 's|@OBJ@|$(obj)|g' < $< > $@ - -# This requires write access to /dev/fd0 -zdisk: $(BOOTIMAGE) $(obj)/mtools.conf - MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync - syslinux /dev/fd0 ; sync - echo '$(image_cmdline)' | \ - MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg - if [ -f '$(FDINITRD)' ] ; then \ - MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ - fi - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync - -# These require being root or having syslinux 2.02 or higher installed -fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf - dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 - MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync - syslinux $(obj)/fdimage ; sync - echo '$(image_cmdline)' | \ - MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg - if [ -f '$(FDINITRD)' ] ; then \ - MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ - fi - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync - -fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf - dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 - MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync - syslinux $(obj)/fdimage ; sync - echo '$(image_cmdline)' | \ - MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg - if [ -f '$(FDINITRD)' ] ; then \ - MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ - fi - MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync - -isoimage: $(BOOTIMAGE) - -rm -rf $(obj)/isoimage - mkdir $(obj)/isoimage - for i in lib lib64 share end ; do \ - if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \ - cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \ - break ; \ - fi ; \ - if [ $$i = end ] ; then exit 1 ; fi ; \ - done - cp $(BOOTIMAGE) $(obj)/isoimage/linux - echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg - if [ -f '$(FDINITRD)' ] ; then \ - cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ - fi - mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \ - -no-emul-boot -boot-load-size 4 -boot-info-table \ - $(obj)/isoimage - rm -rf $(obj)/isoimage - -zlilo: $(BOOTIMAGE) - if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi - if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi - cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz - cp System.map $(INSTALL_PATH)/ - if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi - -install: - sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" diff --git a/arch/i386/boot/compressed/Makefile b/arch/i386/boot/compressed/Makefile deleted file mode 100644 index 189fa1dbefc..00000000000 --- a/arch/i386/boot/compressed/Makefile +++ /dev/null @@ -1,50 +0,0 @@ -# -# linux/arch/i386/boot/compressed/Makefile -# -# create a compressed vmlinux image from the original vmlinux -# - -targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o \ - vmlinux.bin.all vmlinux.relocs -EXTRA_AFLAGS := -traditional - -LDFLAGS_vmlinux := -T -hostprogs-y := relocs - -CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \ - -fno-strict-aliasing -fPIC \ - $(call cc-option,-ffreestanding) \ - $(call cc-option,-fno-stack-protector) -LDFLAGS := -m elf_i386 - -$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE - $(call if_changed,ld) - @: - -$(obj)/vmlinux.bin: vmlinux FORCE - $(call if_changed,objcopy) - -quiet_cmd_relocs = RELOCS $@ - cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $< -$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE - $(call if_changed,relocs) - -vmlinux.bin.all-y := $(obj)/vmlinux.bin -vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs -quiet_cmd_relocbin = BUILD $@ - cmd_relocbin = cat $(filter-out FORCE,$^) > $@ -$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE - $(call if_changed,relocbin) - -ifdef CONFIG_RELOCATABLE -$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE - $(call if_changed,gzip) -else -$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE - $(call if_changed,gzip) -endif - -LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T - -$(obj)/piggy.o: $(src)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE - $(call if_changed,ld) diff --git a/arch/i386/boot/memory.c b/arch/i386/boot/memory.c deleted file mode 100644 index 1a2e62db8be..00000000000 --- a/arch/i386/boot/memory.c +++ /dev/null @@ -1,99 +0,0 @@ -/* -*- linux-c -*- ------------------------------------------------------- * - * - * Copyright (C) 1991, 1992 Linus Torvalds - * Copyright 2007 rPath, Inc. - All Rights Reserved - * - * This file is part of the Linux kernel, and is made available under - * the terms of the GNU General Public License version 2. - * - * ----------------------------------------------------------------------- */ - -/* - * arch/i386/boot/memory.c - * - * Memory detection code - */ - -#include "boot.h" - -#define SMAP 0x534d4150 /* ASCII "SMAP" */ - -static int detect_memory_e820(void) -{ - u32 next = 0; - u32 size, id; - u8 err; - struct e820entry *desc = boot_params.e820_map; - - do { - size = sizeof(struct e820entry); - id = SMAP; - asm("int $0x15; setc %0" - : "=am" (err), "+b" (next), "+d" (id), "+c" (size), - "=m" (*desc) - : "D" (desc), "a" (0xe820)); - - if (err || id != SMAP) - break; - - boot_params.e820_entries++; - desc++; - } while (next && boot_params.e820_entries < E820MAX); - - return boot_params.e820_entries; -} - -static int detect_memory_e801(void) -{ - u16 ax, bx, cx, dx; - u8 err; - - bx = cx = dx = 0; - ax = 0xe801; - asm("stc; int $0x15; setc %0" - : "=m" (err), "+a" (ax), "+b" (bx), "+c" (cx), "+d" (dx)); - - if (err) - return -1; - - /* Do we really need to do this? */ - if (cx || dx) { - ax = cx; - bx = dx; - } - - if (ax > 15*1024) - return -1; /* Bogus! */ - - /* This ignores memory above 16MB if we have a memory hole - there. If someone actually finds a machine with a memory - hole at 16MB and no support for 0E820h they should probably - generate a fake e820 map. */ - boot_params.alt_mem_k = (ax == 15*1024) ? (dx << 6)+ax : ax; - - return 0; -} - -static int detect_memory_88(void) -{ - u16 ax; - u8 err; - - ax = 0x8800; - asm("stc; int $0x15; setc %0" : "=bcdm" (err), "+a" (ax)); - - boot_params.screen_info.ext_mem_k = ax; - - return -err; -} - -int detect_memory(void) -{ - if (detect_memory_e820() > 0) - return 0; - - if (!detect_memory_e801()) - return 0; - - return detect_memory_88(); -} diff --git a/arch/i386/crypto/Makefile b/arch/i386/crypto/Makefile deleted file mode 100644 index 3fd19af18e3..00000000000 --- a/arch/i386/crypto/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# -# i386/crypto/Makefile -# -# Arch-specific CryptoAPI modules. -# - -obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o -obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o - -aes-i586-y := aes-i586-asm.o aes.o -twofish-i586-y := twofish-i586-asm.o twofish.o - diff --git a/arch/i386/kernel/Makefile b/arch/i386/kernel/Makefile deleted file mode 100644 index 9d33b00de65..00000000000 --- a/arch/i386/kernel/Makefile +++ /dev/null @@ -1,88 +0,0 @@ -# -# Makefile for the linux kernel. -# - -extra-y := head.o init_task.o vmlinux.lds - -obj-y := process.o signal.o entry.o traps.o irq.o \ - ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ - pci-dma.o i386_ksyms.o i387.o bootflag.o e820.o\ - quirks.o i8237.o topology.o alternative.o i8253.o tsc.o - -obj-$(CONFIG_STACKTRACE) += stacktrace.o -obj-y += cpu/ -obj-y += acpi/ -obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o -obj-$(CONFIG_MCA) += mca.o -obj-$(CONFIG_X86_MSR) += msr.o -obj-$(CONFIG_X86_CPUID) += cpuid.o -obj-$(CONFIG_MICROCODE) += microcode.o -obj-$(CONFIG_APM) += apm.o -obj-$(CONFIG_X86_SMP) += smp.o smpboot.o tsc_sync.o -obj-$(CONFIG_SMP) += smpcommon.o -obj-$(CONFIG_X86_TRAMPOLINE) += trampoline.o -obj-$(CONFIG_X86_MPPARSE) += mpparse.o -obj-$(CONFIG_X86_LOCAL_APIC) += apic.o nmi.o -obj-$(CONFIG_X86_IO_APIC) += io_apic.o -obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups.o -obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o -obj-$(CONFIG_CRASH_DUMP) += crash_dump.o -obj-$(CONFIG_X86_NUMAQ) += numaq.o -obj-$(CONFIG_X86_SUMMIT_NUMA) += summit.o -obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CONFIG_MODULES) += module.o -obj-y += sysenter.o vsyscall.o -obj-$(CONFIG_ACPI_SRAT) += srat.o -obj-$(CONFIG_EFI) += efi.o efi_stub.o -obj-$(CONFIG_DOUBLEFAULT) += doublefault.o -obj-$(CONFIG_VM86) += vm86.o -obj-$(CONFIG_EARLY_PRINTK) += early_printk.o -obj-$(CONFIG_HPET_TIMER) += hpet.o -obj-$(CONFIG_K8_NB) += k8.o -obj-$(CONFIG_MGEODE_LX) += geode.o - -obj-$(CONFIG_VMI) += vmi.o vmiclock.o -obj-$(CONFIG_PARAVIRT) += paravirt.o -obj-y += pcspeaker.o - -obj-$(CONFIG_SCx200) += scx200.o - -# vsyscall.o contains the vsyscall DSO images as __initdata. -# We must build both images before we can assemble it. -# Note: kbuild does not track this dependency due to usage of .incbin -$(obj)/vsyscall.o: $(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so -targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) -targets += vsyscall-note.o vsyscall.lds - -# The DSO images are built using a special linker script. -quiet_cmd_syscall = SYSCALL $@ - cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ - -Wl,-T,$(filter-out FORCE,$^) -o $@ - -export CPPFLAGS_vsyscall.lds += -P -C -U$(ARCH) - -vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ - $(call ld-option, -Wl$(comma)--hash-style=sysv) -SYSCFLAGS_vsyscall-sysenter.so = $(vsyscall-flags) -SYSCFLAGS_vsyscall-int80.so = $(vsyscall-flags) - -$(obj)/vsyscall-int80.so $(obj)/vsyscall-sysenter.so: \ -$(obj)/vsyscall-%.so: $(src)/vsyscall.lds \ - $(obj)/vsyscall-%.o $(obj)/vsyscall-note.o FORCE - $(call if_changed,syscall) - -# We also create a special relocatable object that should mirror the symbol -# table and layout of the linked DSO. With ld -R we can then refer to -# these symbols in the kernel code rather than hand-coded addresses. -extra-y += vsyscall-syms.o -$(obj)/built-in.o: $(obj)/vsyscall-syms.o -$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o - -SYSCFLAGS_vsyscall-syms.o = -r -$(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \ - $(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE - $(call if_changed,syscall) - -k8-y += ../../x86_64/kernel/k8.o -stacktrace-y += ../../x86_64/kernel/stacktrace.o - diff --git a/arch/i386/kernel/acpi/Makefile b/arch/i386/kernel/acpi/Makefile deleted file mode 100644 index 7f7be01f44e..00000000000 --- a/arch/i386/kernel/acpi/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -obj-$(CONFIG_ACPI) += boot.o -ifneq ($(CONFIG_PCI),) -obj-$(CONFIG_X86_IO_APIC) += earlyquirk.o -endif -obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o - -ifneq ($(CONFIG_ACPI_PROCESSOR),) -obj-y += cstate.o processor.o -endif - diff --git a/arch/i386/kernel/asm-offsets.c b/arch/i386/kernel/asm-offsets.c deleted file mode 100644 index 7288ac88d74..00000000000 --- a/arch/i386/kernel/asm-offsets.c +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Generate definitions needed by assembly language modules. - * This code generates raw asm output which is post-processed - * to extract and format the required data. - */ - -#include <linux/crypto.h> -#include <linux/sched.h> -#include <linux/signal.h> -#include <linux/personality.h> -#include <linux/suspend.h> -#include <asm/ucontext.h> -#include "sigframe.h" -#include <asm/pgtable.h> -#include <asm/fixmap.h> -#include <asm/processor.h> -#include <asm/thread_info.h> -#include <asm/elf.h> - -#include <xen/interface/xen.h> - -#ifdef CONFIG_LGUEST_GUEST -#include <linux/lguest.h> -#include "../../../drivers/lguest/lg.h" -#endif - -#define DEFINE(sym, val) \ - asm volatile("\n->" #sym " %0 " #val : : "i" (val)) - -#define BLANK() asm volatile("\n->" : : ) - -#define OFFSET(sym, str, mem) \ - DEFINE(sym, offsetof(struct str, mem)); - -/* workaround for a warning with -Wmissing-prototypes */ -void foo(void); - -void foo(void) -{ - OFFSET(SIGCONTEXT_eax, sigcontext, eax); - OFFSET(SIGCONTEXT_ebx, sigcontext, ebx); - OFFSET(SIGCONTEXT_ecx, sigcontext, ecx); - OFFSET(SIGCONTEXT_edx, sigcontext, edx); - OFFSET(SIGCONTEXT_esi, sigcontext, esi); - OFFSET(SIGCONTEXT_edi, sigcontext, edi); - OFFSET(SIGCONTEXT_ebp, sigcontext, ebp); - OFFSET(SIGCONTEXT_esp, sigcontext, esp); - OFFSET(SIGCONTEXT_eip, sigcontext, eip); - BLANK(); - - OFFSET(CPUINFO_x86, cpuinfo_x86, x86); - OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); - OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); - OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); - OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math); - OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); - OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); - OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); - BLANK(); - - OFFSET(TI_task, thread_info, task); - OFFSET(TI_exec_domain, thread_info, exec_domain); - OFFSET(TI_flags, thread_info, flags); - OFFSET(TI_status, thread_info, status); - OFFSET(TI_preempt_count, thread_info, preempt_count); - OFFSET(TI_addr_limit, thread_info, addr_limit); - OFFSET(TI_restart_block, thread_info, restart_block); - OFFSET(TI_sysenter_return, thread_info, sysenter_return); - OFFSET(TI_cpu, thread_info, cpu); - BLANK(); - - OFFSET(GDS_size, Xgt_desc_struct, size); - OFFSET(GDS_address, Xgt_desc_struct, address); - OFFSET(GDS_pad, Xgt_desc_struct, pad); - BLANK(); - - OFFSET(PT_EBX, pt_regs, ebx); - OFFSET(PT_ECX, pt_regs, ecx); - OFFSET(PT_EDX, pt_regs, edx); - OFFSET(PT_ESI, pt_regs, esi); - OFFSET(PT_EDI, pt_regs, edi); - OFFSET(PT_EBP, pt_regs, ebp); - OFFSET(PT_EAX, pt_regs, eax); - OFFSET(PT_DS, pt_regs, xds); - OFFSET(PT_ES, pt_regs, xes); - OFFSET(PT_FS, pt_regs, xfs); - OFFSET(PT_ORIG_EAX, pt_regs, orig_eax); - OFFSET(PT_EIP, pt_regs, eip); - OFFSET(PT_CS, pt_regs, xcs); - OFFSET(PT_EFLAGS, pt_regs, eflags); - OFFSET(PT_OLDESP, pt_regs, esp); - OFFSET(PT_OLDSS, pt_regs, xss); - BLANK(); - - OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); - OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); - BLANK(); - - OFFSET(pbe_address, pbe, address); - OFFSET(pbe_orig_address, pbe, orig_address); - OFFSET(pbe_next, pbe, next); - - /* Offset from the sysenter stack to tss.esp0 */ - DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - - sizeof(struct tss_struct)); - - DEFINE(PAGE_SIZE_asm, PAGE_SIZE); - DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT); - DEFINE(PTRS_PER_PTE, PTRS_PER_PTE); - DEFINE(PTRS_PER_PMD, PTRS_PER_PMD); - DEFINE(PTRS_PER_PGD, PTRS_PER_PGD); - - DEFINE(VDSO_PRELINK_asm, VDSO_PRELINK); - - OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); - -#ifdef CONFIG_PARAVIRT - BLANK(); - OFFSET(PARAVIRT_enabled, paravirt_ops, paravirt_enabled); - OFFSET(PARAVIRT_irq_disable, paravirt_ops, irq_disable); - OFFSET(PARAVIRT_irq_enable, paravirt_ops, irq_enable); - OFFSET(PARAVIRT_irq_enable_sysexit, paravirt_ops, irq_enable_sysexit); - OFFSET(PARAVIRT_iret, paravirt_ops, iret); - OFFSET(PARAVIRT_read_cr0, paravirt_ops, read_cr0); -#endif - -#ifdef CONFIG_XEN - BLANK(); - OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); - OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); -#endif - -#ifdef CONFIG_LGUEST_GUEST - BLANK(); - OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); - OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc); - OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc); - OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3); - OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp); - OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc); - OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc); - OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt); - OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum); - OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); - OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); -#endif -} diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.c b/arch/i386/kernel/cpu/cpufreq/longhaul.c deleted file mode 100644 index ef8f0bc3fc7..00000000000 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.c +++ /dev/null @@ -1,970 +0,0 @@ -/* - * (C) 2001-2004 Dave Jones. <davej@codemonkey.org.uk> - * (C) 2002 Padraig Brady. <padraig@antefacto.com> - * - * Licensed under the terms of the GNU GPL License version 2. - * Based upon datasheets & sample CPUs kindly provided by VIA. - * - * VIA have currently 3 different versions of Longhaul. - * Version 1 (Longhaul) uses the BCR2 MSR at 0x1147. - * It is present only in Samuel 1 (C5A), Samuel 2 (C5B) stepping 0. - * Version 2 of longhaul is backward compatible with v1, but adds - * LONGHAUL MSR for purpose of both frequency and voltage scaling. - * Present in Samuel 2 (steppings 1-7 only) (C5B), and Ezra (C5C). - * Version 3 of longhaul got renamed to Powersaver and redesigned - * to use only the POWERSAVER MSR at 0x110a. - * It is present in Ezra-T (C5M), Nehemiah (C5X) and above. - * It's pretty much the same feature wise to longhaul v2, though - * there is provision for scaling FSB too, but this doesn't work - * too well in practice so we don't even try to use this. - * - * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* - */ - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/moduleparam.h> -#include <linux/init.h> -#include <linux/cpufreq.h> -#include <linux/pci.h> -#include <linux/slab.h> -#include <linux/string.h> -#include <linux/delay.h> - -#include <asm/msr.h> -#include <asm/timex.h> -#include <asm/io.h> -#include <asm/acpi.h> -#include <linux/acpi.h> -#include <acpi/processor.h> - -#include "longhaul.h" - -#define PFX "longhaul: " - -#define TYPE_LONGHAUL_V1 1 -#define TYPE_LONGHAUL_V2 2 -#define TYPE_POWERSAVER 3 - -#define CPU_SAMUEL 1 -#define CPU_SAMUEL2 2 -#define CPU_EZRA 3 -#define CPU_EZRA_T 4 -#define CPU_NEHEMIAH 5 -#define CPU_NEHEMIAH_C 6 - -/* Flags */ -#define USE_ACPI_C3 (1 << 1) -#define USE_NORTHBRIDGE (1 << 2) - -static int cpu_model; -static unsigned int numscales=16; -static unsigned int fsb; - -static const struct mV_pos *vrm_mV_table; -static const unsigned char *mV_vrm_table; - -static unsigned int highest_speed, lowest_speed; /* kHz */ -static unsigned int minmult, maxmult; -static int can_scale_voltage; -static struct acpi_processor *pr = NULL; -static struct acpi_processor_cx *cx = NULL; -static u32 acpi_regs_addr; -static u8 longhaul_flags; -static unsigned int longhaul_index; - -/* Module parameters */ -static int scale_voltage; -static int disable_acpi_c3; - -#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) - - -/* Clock ratios multiplied by 10 */ -static int clock_ratio[32]; -static int eblcr_table[32]; -static int longhaul_version; -static struct cpufreq_frequency_table *longhaul_table; - -#ifdef CONFIG_CPU_FREQ_DEBUG -static char speedbuffer[8]; - -static char *print_speed(int speed) -{ - if (speed < 1000) { - snprintf(speedbuffer, sizeof(speedbuffer),"%dMHz", speed); - return speedbuffer; - } - - if (speed%1000 == 0) - snprintf(speedbuffer, sizeof(speedbuffer), - "%dGHz", speed/1000); - else - snprintf(speedbuffer, sizeof(speedbuffer), - "%d.%dGHz", speed/1000, (speed%1000)/100); - - return speedbuffer; -} -#endif - - -static unsigned int calc_speed(int mult) -{ - int khz; - khz = (mult/10)*fsb; - if (mult%10) - khz += fsb/2; - khz *= 1000; - return khz; -} - - -static int longhaul_get_cpu_mult(void) -{ - unsigned long invalue=0,lo, hi; - - rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); - invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22; - if (longhaul_version==TYPE_LONGHAUL_V2 || longhaul_version==TYPE_POWERSAVER) { - if (lo & (1<<27)) - invalue+=16; - } - return eblcr_table[invalue]; -} - -/* For processor with BCR2 MSR */ - -static void do_longhaul1(unsigned int clock_ratio_index) -{ - union msr_bcr2 bcr2; - - rdmsrl(MSR_VIA_BCR2, bcr2.val); - /* Enable software clock multiplier */ - bcr2.bits.ESOFTBF = 1; - bcr2.bits.CLOCKMUL = clock_ratio_index & 0xff; - - /* Sync to timer tick */ - safe_halt(); - /* Change frequency on next halt or sleep */ - wrmsrl(MSR_VIA_BCR2, bcr2.val); - /* Invoke transition */ - ACPI_FLUSH_CPU_CACHE(); - halt(); - - /* Disable software clock multiplier */ - local_irq_disable(); - rdmsrl(MSR_VIA_BCR2, bcr2.val); - bcr2.bits.ESOFTBF = 0; - wrmsrl(MSR_VIA_BCR2, bcr2.val); -} - -/* For processor with Longhaul MSR */ - -static void do_powersaver(int cx_address, unsigned int clock_ratio_index, - unsigned int dir) -{ - union msr_longhaul longhaul; - u32 t; - - rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); - /* Setup new frequency */ - longhaul.bits.RevisionKey = longhaul.bits.RevisionID; - longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; - longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; - /* Setup new voltage */ - if (can_scale_voltage) - longhaul.bits.SoftVID = (clock_ratio_index >> 8) & 0x1f; - /* Sync to timer tick */ - safe_halt(); - /* Raise voltage if necessary */ - if (can_scale_voltage && dir) { - longhaul.bits.EnableSoftVID = 1; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - /* Change voltage */ - if (!cx_address) { - ACPI_FLUSH_CPU_CACHE(); - halt(); - } else { - ACPI_FLUSH_CPU_CACHE(); - /* Invoke C3 */ - inb(cx_address); - /* Dummy op - must do something useless after P_LVL3 - * read */ - t = inl(acpi_gbl_FADT.xpm_timer_block.address); - } - longhaul.bits.EnableSoftVID = 0; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - } - - /* Change frequency on next halt or sleep */ - longhaul.bits.EnableSoftBusRatio = 1; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - if (!cx_address) { - ACPI_FLUSH_CPU_CACHE(); - halt(); - } else { - ACPI_FLUSH_CPU_CACHE(); - /* Invoke C3 */ - inb(cx_address); - /* Dummy op - must do something useless after P_LVL3 read */ - t = inl(acpi_gbl_FADT.xpm_timer_block.address); - } - /* Disable bus ratio bit */ - longhaul.bits.EnableSoftBusRatio = 0; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - - /* Reduce voltage if necessary */ - if (can_scale_voltage && !dir) { - longhaul.bits.EnableSoftVID = 1; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - /* Change voltage */ - if (!cx_address) { - ACPI_FLUSH_CPU_CACHE(); - halt(); - } else { - ACPI_FLUSH_CPU_CACHE(); - /* Invoke C3 */ - inb(cx_address); - /* Dummy op - must do something useless after P_LVL3 - * read */ - t = inl(acpi_gbl_FADT.xpm_timer_block.address); - } - longhaul.bits.EnableSoftVID = 0; - wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); - } -} - -/** - * longhaul_set_cpu_frequency() - * @clock_ratio_index : bitpattern of the new multiplier. - * - * Sets a new clock ratio. - */ - -static void longhaul_setstate(unsigned int table_index) -{ - unsigned int clock_ratio_index; - int speed, mult; - struct cpufreq_freqs freqs; - unsigned long flags; - unsigned int pic1_mask, pic2_mask; - u16 bm_status = 0; - u32 bm_timeout = 1000; - unsigned int dir = 0; - - clock_ratio_index = longhaul_table[table_index].index; - /* Safety precautions */ - mult = clock_ratio[clock_ratio_index & 0x1f]; - if (mult == -1) - return; - speed = calc_speed(mult); - if ((speed > highest_speed) || (speed < lowest_speed)) - return; - /* Voltage transition before frequency transition? */ - if (can_scale_voltage && longhaul_index < table_index) - dir = 1; - - freqs.old = calc_speed(longhaul_get_cpu_mult()); - freqs.new = speed; - freqs.cpu = 0; /* longhaul.c is UP only driver */ - - cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); - - dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", - fsb, mult/10, mult%10, print_speed(speed/1000)); - - preempt_disable(); - local_irq_save(flags); - - pic2_mask = inb(0xA1); - pic1_mask = inb(0x21); /* works on C3. save mask. */ - outb(0xFF,0xA1); /* Overkill */ - outb(0xFE,0x21); /* TMR0 only */ - - /* Wait while PCI bus is busy. */ - if (acpi_regs_addr && (longhaul_flags & USE_NORTHBRIDGE - || ((pr != NULL) && pr->flags.bm_control))) { - bm_status = inw(acpi_regs_addr); - bm_status &= 1 << 4; - while (bm_status && bm_timeout) { - outw(1 << 4, acpi_regs_addr); - bm_timeout--; - bm_status = inw(acpi_regs_addr); - bm_status &= 1 << 4; - } - } - - if (longhaul_flags & USE_NORTHBRIDGE) { - /* Disable AGP and PCI arbiters */ - outb(3, 0x22); - } else if ((pr != NULL) && pr->flags.bm_control) { - /* Disable bus master arbitration */ - acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1); - } - switch (longhaul_version) { - - /* - * Longhaul v1. (Samuel[C5A] and Samuel2 stepping 0[C5B]) - * Software controlled multipliers only. - */ - case TYPE_LONGHAUL_V1: - do_longhaul1(clock_ratio_index); - break; - - /* - * Longhaul v2 appears in Samuel2 Steppings 1->7 [C5B] and Ezra [C5C] - * - * Longhaul v3 (aka Powersaver). (Ezra-T [C5M] & Nehemiah [C5N]) - * Nehemiah can do FSB scaling too, but this has never been proven - * to work in practice. - */ - case TYPE_LONGHAUL_V2: - case TYPE_POWERSAVER: - if (longhaul_flags & USE_ACPI_C3) { - /* Don't allow wakeup */ - acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0); - do_powersaver(cx->address, clock_ratio_index, dir); - } else { - do_powersaver(0, clock_ratio_index, dir); - } - break; - } - - if (longhaul_flags & USE_NORTHBRIDGE) { - /* Enable arbiters */ - outb(0, 0x22); - } else if ((pr != NULL) && pr->flags.bm_control) { - /* Enable bus master arbitration */ - acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); - } - outb(pic2_mask,0xA1); /* restore mask */ - outb(pic1_mask,0x21); - - local_irq_restore(flags); - preempt_enable(); - - freqs.new = calc_speed(longhaul_get_cpu_mult()); - cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); - - if (!bm_timeout) - printk(KERN_INFO PFX "Warning: Timeout while waiting for idle PCI bus.\n"); -} - -/* - * Centaur decided to make life a little more tricky. - * Only longhaul v1 is allowed to read EBLCR BSEL[0:1]. - * Samuel2 and above have to try and guess what the FSB is. - * We do this by assuming we booted at maximum multiplier, and interpolate - * between that value multiplied by possible FSBs and cpu_mhz which - * was calculated at boot time. Really ugly, but no other way to do this. - */ - -#define ROUNDING 0xf - -static int guess_fsb(int mult) -{ - int speed = cpu_khz / 1000; - int i; - int speeds[] = { 666, 1000, 1333, 2000 }; - int f_max, f_min; - - for (i = 0; i < 4; i++) { - f_max = ((speeds[i] * mult) + 50) / 100; - f_max += (ROUNDING / 2); - f_min = f_max - ROUNDING; - if ((speed <= f_max) && (speed >= f_min)) - return speeds[i] / 10; - } - return 0; -} - - -static int __init longhaul_get_ranges(void) -{ - unsigned int i, j, k = 0; - unsigned int ratio; - int mult; - - /* Get current frequency */ - mult = longhaul_get_cpu_mult(); - if (mult == -1) { - printk(KERN_INFO PFX "Invalid (reserved) multiplier!\n"); - return -EINVAL; - } - fsb = guess_fsb(mult); - if (fsb == 0) { - printk(KERN_INFO PFX "Invalid (reserved) FSB!\n"); - return -EINVAL; - } - /* Get max multiplier - as we always did. - * Longhaul MSR is usefull only when voltage scaling is enabled. - * C3 is booting at max anyway. */ - maxmult = mult; - /* Get min multiplier */ - switch (cpu_model) { - case CPU_NEHEMIAH: - minmult = 50; - break; - case CPU_NEHEMIAH_C: - minmult = 40; - break; - default: - minmult = 30; - break; - } - - dprintk ("MinMult:%d.%dx MaxMult:%d.%dx\n", - minmult/10, minmult%10, maxmult/10, maxmult%10); - - highest_speed = calc_speed(maxmult); - lowest_speed = calc_speed(minmult); - dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, - print_speed(lowest_speed/1000), - print_speed(highest_speed/1000)); - - if (lowest_speed == highest_speed) { - printk (KERN_INFO PFX "highestspeed == lowest, aborting.\n"); - return -EINVAL; - } - if (lowest_speed > highest_speed) { - printk (KERN_INFO PFX "nonsense! lowest (%d > %d) !\n", - lowest_speed, highest_speed); - return -EINVAL; - } - - longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); - if(!longhaul_table) - return -ENOMEM; - - for (j = 0; j < numscales; j++) { - ratio = clock_ratio[j]; - if (ratio == -1) - continue; - if (ratio > maxmult || ratio < minmult) - continue; - longhaul_table[k].frequency = calc_speed(ratio); - longhaul_table[k].index = j; - k++; - } - if (k <= 1) { - kfree(longhaul_table); - return -ENODEV; - } - /* Sort */ - for (j = 0; j < k - 1; j++) { - unsigned int min_f, min_i; - min_f = longhaul_table[j].frequency; - min_i = j; - for (i = j + 1; i < k; i++) { - if (longhaul_table[i].frequency < min_f) { - min_f = longhaul_table[i].frequency; - min_i = i; - } - } - if (min_i != j) { - unsigned int temp; - temp = longhaul_table[j].frequency; - longhaul_table[j].frequency = longhaul_table[min_i].frequency; - longhaul_table[min_i].frequency = temp; - temp = longhaul_table[j].index; - longhaul_table[j].index = longhaul_table[min_i].index; - longhaul_table[min_i].index = temp; - } - } - - longhaul_table[k].frequency = CPUFREQ_TABLE_END; - - /* Find index we are running on */ - for (j = 0; j < k; j++) { - if (clock_ratio[longhaul_table[j].index & 0x1f] == mult) { - longhaul_index = j; - break; - } - } - return 0; -} - - -static void __init longhaul_setup_voltagescaling(void) -{ - union msr_longhaul longhaul; - struct mV_pos minvid, maxvid, vid; - unsigned int j, speed, pos, kHz_step, numvscales; - int min_vid_speed; - - rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); - if (!(longhaul.bits.RevisionID & 1)) { - printk(KERN_INFO PFX "Voltage scaling not supported by CPU.\n"); - return; - } - - if (!longhaul.bits.VRMRev) { - printk(KERN_INFO PFX "VRM 8.5\n"); - vrm_mV_table = &vrm85_mV[0]; - mV_vrm_table = &mV_vrm85[0]; - } else { - printk(KERN_INFO PFX "Mobile VRM\n"); - if (cpu_model < CPU_NEHEMIAH) - return; - vrm_mV_table = &mobilevrm_mV[0]; - mV_vrm_table = &mV_mobilevrm[0]; - } - - minvid = vrm_mV_table[longhaul.bits.MinimumVID]; - maxvid = vrm_mV_table[longhaul.bits.MaximumVID]; - - if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) { - printk (KERN_INFO PFX "Bogus values Min:%d.%03d Max:%d.%03d. " - "Voltage scaling disabled.\n", - minvid.mV/1000, minvid.mV%1000, maxvid.mV/1000, maxvid.mV%1000); - return; - } - - if (minvid.mV == maxvid.mV) { - printk (KERN_INFO PFX "Claims to support voltage scaling but min & max are " - "both %d.%03d. Voltage scaling disabled\n", - maxvid.mV/1000, maxvid.mV%1000); - return; - } - - /* How many voltage steps */ - numvscales = maxvid.pos - minvid.pos + 1; - printk(KERN_INFO PFX - "Max VID=%d.%03d " - "Min VID=%d.%03d, " - "%d possible voltage scales\n", - maxvid.mV/1000, maxvid.mV%1000, - minvid.mV/1000, minvid.mV%1000, - numvscales); - - /* Calculate max frequency at min voltage */ - j = longhaul.bits.MinMHzBR; - if (longhaul.bits.MinMHzBR4) - j += 16; - min_vid_speed = eblcr_table[j]; - if (min_vid_speed == -1) - return; - switch (longhaul.bits.MinMHzFSB) { - case 0: - min_vid_speed *= 13333; - break; - case 1: - min_vid_speed *= 10000; - break; - case 3: - min_vid_speed *= 6666; - break; - default: - return; - break; - } - if (min_vid_speed >= highest_speed) - return; - /* Calculate kHz for one voltage step */ - kHz_step = (highest_speed - min_vid_speed) / numvscales; - - j = 0; - while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) { - speed = longhaul_table[j].frequency; - if (speed > min_vid_speed) - pos = (speed - min_vid_speed) / kHz_step + minvid.pos; - else - pos = minvid.pos; - longhaul_table[j].index |= mV_vrm_table[pos] << 8; - vid = vrm_mV_table[mV_vrm_table[pos]]; - printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n", speed, j, vid.mV); - j++; - } - - can_scale_voltage = 1; - printk(KERN_INFO PFX "Voltage scaling enabled.\n"); -} - - -static int longhaul_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, longhaul_table); -} - - -static int longhaul_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) -{ - unsigned int table_index = 0; - unsigned int i; - unsigned int dir = 0; - u8 vid, current_vid; - - if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, relation, &table_index)) - return -EINVAL; - - /* Don't set same frequency again */ - if (longhaul_index == table_index) - return 0; - - if (!can_scale_voltage) - longhaul_setstate(table_index); - else { - /* On test system voltage transitions exceeding single - * step up or down were turning motherboard off. Both - * "ondemand" and "userspace" are unsafe. C7 is doing - * this in hardware, C3 is old and we need to do this - * in software. */ - i = longhaul_index; - current_vid = (longhaul_table[longhaul_index].index >> 8) & 0x1f; - if (table_index > longhaul_index) - dir = 1; - while (i != table_index) { - vid = (longhaul_table[i].index >> 8) & 0x1f; - if (vid != current_vid) { - longhaul_setstate(i); - current_vid = vid; - msleep(200); - } - if (dir) - i++; - else - i--; - } - longhaul_setstate(table_index); - } - longhaul_index = table_index; - return 0; -} - - -static unsigned int longhaul_get(unsigned int cpu) -{ - if (cpu) - return 0; - return calc_speed(longhaul_get_cpu_mult()); -} - -static acpi_status longhaul_walk_callback(acpi_handle obj_handle, - u32 nesting_level, - void *context, void **return_value) -{ - struct acpi_device *d; - - if ( acpi_bus_get_device(obj_handle, &d) ) { - return 0; - } - *return_value = (void *)acpi_driver_data(d); - return 1; -} - -/* VIA don't support PM2 reg, but have something similar */ -static int enable_arbiter_disable(void) -{ - struct pci_dev *dev; - int status = 1; - int reg; - u8 pci_cmd; - - /* Find PLE133 host bridge */ - reg = 0x78; - dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, - NULL); - /* Find CLE266 host bridge */ - if (dev == NULL) { - reg = 0x76; - dev = pci_get_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_862X_0, NULL); - /* Find CN400 V-Link host bridge */ - if (dev == NULL) - dev = pci_get_device(PCI_VENDOR_ID_VIA, 0x7259, NULL); - } - if (dev != NULL) { - /* Enable access to port 0x22 */ - pci_read_config_byte(dev, reg, &pci_cmd); - if (!(pci_cmd & 1<<7)) { - pci_cmd |= 1<<7; - pci_write_config_byte(dev, reg, pci_cmd); - pci_read_config_byte(dev, reg, &pci_cmd); - if (!(pci_cmd & 1<<7)) { - printk(KERN_ERR PFX - "Can't enable access to port 0x22.\n"); - status = 0; - } - } - pci_dev_put(dev); - return status; - } - return 0; -} - -static int longhaul_setup_southbridge(void) -{ - struct pci_dev *dev; - u8 pci_cmd; - - /* Find VT8235 southbridge */ - dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL); - if (dev == NULL) - /* Find VT8237 southbridge */ - dev = pci_get_device(PCI_VENDOR_ID_VIA, - PCI_DEVICE_ID_VIA_8237, NULL); - if (dev != NULL) { - /* Set transition time to max */ - pci_read_config_byte(dev, 0xec, &pci_cmd); - pci_cmd &= ~(1 << 2); - pci_write_config_byte(dev, 0xec, pci_cmd); - pci_read_config_byte(dev, 0xe4, &pci_cmd); - pci_cmd &= ~(1 << 7); - pci_write_config_byte(dev, 0xe4, pci_cmd); - pci_read_config_byte(dev, 0xe5, &pci_cmd); - pci_cmd |= 1 << 7; - pci_write_config_byte(dev, 0xe5, pci_cmd); - /* Get address of ACPI registers block*/ - pci_read_config_byte(dev, 0x81, &pci_cmd); - if (pci_cmd & 1 << 7) { - pci_read_config_dword(dev, 0x88, &acpi_regs_addr); - acpi_regs_addr &= 0xff00; - printk(KERN_INFO PFX "ACPI I/O at 0x%x\n", acpi_regs_addr); - } - - pci_dev_put(dev); - return 1; - } - return 0; -} - -static int __init longhaul_cpu_init(struct cpufreq_policy *policy) -{ - struct cpuinfo_x86 *c = cpu_data; - char *cpuname=NULL; - int ret; - u32 lo, hi; - - /* Check what we have on this motherboard */ - switch (c->x86_model) { - case 6: - cpu_model = CPU_SAMUEL; - cpuname = "C3 'Samuel' [C5A]"; - longhaul_version = TYPE_LONGHAUL_V1; - memcpy (clock_ratio, samuel1_clock_ratio, sizeof(samuel1_clock_ratio)); - memcpy (eblcr_table, samuel1_eblcr, sizeof(samuel1_eblcr)); - break; - - case 7: - switch (c->x86_mask) { - case 0: - longhaul_version = TYPE_LONGHAUL_V1; - cpu_model = CPU_SAMUEL2; - cpuname = "C3 'Samuel 2' [C5B]"; - /* Note, this is not a typo, early Samuel2's had - * Samuel1 ratios. */ - memcpy(clock_ratio, samuel1_clock_ratio, - sizeof(samuel1_clock_ratio)); - memcpy(eblcr_table, samuel2_eblcr, - sizeof(samuel2_eblcr)); - break; - case 1 ... 15: - longhaul_version = TYPE_LONGHAUL_V1; - if (c->x86_mask < 8) { - cpu_model = CPU_SAMUEL2; - cpuname = "C3 'Samuel 2' [C5B]"; - } else { - cpu_model = CPU_EZRA; - cpuname = "C3 'Ezra' [C5C]"; - } - memcpy(clock_ratio, ezra_clock_ratio, - sizeof(ezra_clock_ratio)); - memcpy(eblcr_table, ezra_eblcr, - sizeof(ezra_eblcr)); - break; - } - break; - - case 8: - cpu_model = CPU_EZRA_T; - cpuname = "C3 'Ezra-T' [C5M]"; - longhaul_version = TYPE_POWERSAVER; - numscales=32; - memcpy (clock_ratio, ezrat_clock_ratio, sizeof(ezrat_clock_ratio)); - memcpy (eblcr_table, ezrat_eblcr, sizeof(ezrat_eblcr)); - break; - - case 9: - longhaul_version = TYPE_POWERSAVER; - numscales = 32; - memcpy(clock_ratio, - nehemiah_clock_ratio, - sizeof(nehemiah_clock_ratio)); - memcpy(eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr)); - switch (c->x86_mask) { - case 0 ... 1: - cpu_model = CPU_NEHEMIAH; - cpuname = "C3 'Nehemiah A' [C5XLOE]"; - break; - case 2 ... 4: - cpu_model = CPU_NEHEMIAH; - cpuname = "C3 'Nehemiah B' [C5XLOH]"; - break; - case 5 ... 15: - cpu_model = CPU_NEHEMIAH_C; - cpuname = "C3 'Nehemiah C' [C5P]"; - break; - } - break; - - default: - cpuname = "Unknown"; - break; - } - /* Check Longhaul ver. 2 */ - if (longhaul_version == TYPE_LONGHAUL_V2) { - rdmsr(MSR_VIA_LONGHAUL, lo, hi); - if (lo == 0 && hi == 0) - /* Looks like MSR isn't present */ - longhaul_version = TYPE_LONGHAUL_V1; - } - - printk (KERN_INFO PFX "VIA %s CPU detected. ", cpuname); - switch (longhaul_version) { - case TYPE_LONGHAUL_V1: - case TYPE_LONGHAUL_V2: - printk ("Longhaul v%d supported.\n", longhaul_version); - break; - case TYPE_POWERSAVER: - printk ("Powersaver supported.\n"); - break; - }; - - /* Doesn't hurt */ - longhaul_setup_southbridge(); - - /* Find ACPI data for processor */ - acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, - ACPI_UINT32_MAX, &longhaul_walk_callback, - NULL, (void *)&pr); - - /* Check ACPI support for C3 state */ - if (pr != NULL && longhaul_version == TYPE_POWERSAVER) { - cx = &pr->power.states[ACPI_STATE_C3]; - if (cx->address > 0 && cx->latency <= 1000) - longhaul_flags |= USE_ACPI_C3; - } - /* Disable if it isn't working */ - if (disable_acpi_c3) - longhaul_flags &= ~USE_ACPI_C3; - /* Check if northbridge is friendly */ - if (enable_arbiter_disable()) - longhaul_flags |= USE_NORTHBRIDGE; - - /* Check ACPI support for bus master arbiter disable */ - if (!(longhaul_flags & USE_ACPI_C3 - || longhaul_flags & USE_NORTHBRIDGE) - && ((pr == NULL) || !(pr->flags.bm_control))) { - printk(KERN_ERR PFX - "No ACPI support. Unsupported northbridge.\n"); - return -ENODEV; - } - - if (longhaul_flags & USE_NORTHBRIDGE) - printk(KERN_INFO PFX "Using northbridge support.\n"); - if (longhaul_flags & USE_ACPI_C3) - printk(KERN_INFO PFX "Using ACPI support.\n"); - - ret = longhaul_get_ranges(); - if (ret != 0) - return ret; - - if ((longhaul_version != TYPE_LONGHAUL_V1) && (scale_voltage != 0)) - longhaul_setup_voltagescaling(); - - policy->governor = CPUFREQ_DEFAULT_GOVERNOR; - policy->cpuinfo.transition_latency = 200000; /* nsec */ - policy->cur = calc_speed(longhaul_get_cpu_mult()); - - ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table); - if (ret) - return ret; - - cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu); - - return 0; -} - -static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr* longhaul_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - -static struct cpufreq_driver longhaul_driver = { - .verify = longhaul_verify, - .target = longhaul_target, - .get = longhaul_get, - .init = longhaul_cpu_init, - .exit = __devexit_p(longhaul_cpu_exit), - .name = "longhaul", - .owner = THIS_MODULE, - .attr = longhaul_attr, -}; - - -static int __init longhaul_init(void) -{ - struct cpuinfo_x86 *c = cpu_data; - - if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6) - return -ENODEV; - -#ifdef CONFIG_SMP - if (num_online_cpus() > 1) { - printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n"); - return -ENODEV; - } -#endif -#ifdef CONFIG_X86_IO_APIC - if (cpu_has_apic) { - printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n"); - return -ENODEV; - } -#endif - switch (c->x86_model) { - case 6 ... 9: - return cpufreq_register_driver(&longhaul_driver); - case 10: - printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n"); - default: - ;; - } - - return -ENODEV; -} - - -static void __exit longhaul_exit(void) -{ - int i; - - for (i=0; i < numscales; i++) { - if (clock_ratio[i] == maxmult) { - longhaul_setstate(i); - break; - } - } - - cpufreq_unregister_driver(&longhaul_driver); - kfree(longhaul_table); -} - -module_param (disable_acpi_c3, int, 0644); -MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); - -module_param (scale_voltage, int, 0644); -MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); - -MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>"); -MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); -MODULE_LICENSE ("GPL"); - -late_initcall(longhaul_init); -module_exit(longhaul_exit); diff --git a/arch/i386/kernel/cpu/mtrr/state.c b/arch/i386/kernel/cpu/mtrr/state.c deleted file mode 100644 index c9014ca4a57..00000000000 --- a/arch/i386/kernel/cpu/mtrr/state.c +++ /dev/null @@ -1,79 +0,0 @@ -#include <linux/mm.h> -#include <linux/init.h> -#include <asm/io.h> -#include <asm/mtrr.h> -#include <asm/msr.h> -#include <asm-i386/processor-cyrix.h> -#include "mtrr.h" - - -/* Put the processor into a state where MTRRs can be safely set */ -void set_mtrr_prepare_save(struct set_mtrr_context *ctxt) -{ - unsigned int cr0; - - /* Disable interrupts locally */ - local_irq_save(ctxt->flags); - - if (use_intel() || is_cpu(CYRIX)) { - - /* Save value of CR4 and clear Page Global Enable (bit 7) */ - if ( cpu_has_pge ) { - ctxt->cr4val = read_cr4(); - write_cr4(ctxt->cr4val & ~X86_CR4_PGE); - } - - /* Disable and flush caches. Note that wbinvd flushes the TLBs as - a side-effect */ - cr0 = read_cr0() | 0x40000000; - wbinvd(); - write_cr0(cr0); - wbinvd(); - - if (use_intel()) - /* Save MTRR state */ - rdmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); - else - /* Cyrix ARRs - everything else were excluded at the top */ - ctxt->ccr3 = getCx86(CX86_CCR3); - } -} - -void set_mtrr_cache_disable(struct set_mtrr_context *ctxt) -{ - if (use_intel()) - /* Disable MTRRs, and set the default type to uncached */ - mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL, - ctxt->deftype_hi); - else if (is_cpu(CYRIX)) - /* Cyrix ARRs - everything else were excluded at the top */ - setCx86(CX86_CCR3, (ctxt->ccr3 & 0x0f) | 0x10); -} - -/* Restore the processor after a set_mtrr_prepare */ -void set_mtrr_done(struct set_mtrr_context *ctxt) -{ - if (use_intel() || is_cpu(CYRIX)) { - - /* Flush caches and TLBs */ - wbinvd(); - - /* Restore MTRRdefType */ - if (use_intel()) - /* Intel (P6) standard MTRRs */ - mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); - else - /* Cyrix ARRs - everything else was excluded at the top */ - setCx86(CX86_CCR3, ctxt->ccr3); - - /* Enable caches */ - write_cr0(read_cr0() & 0xbfffffff); - - /* Restore value of CR4 */ - if ( cpu_has_pge ) - write_cr4(ctxt->cr4val); - } - /* Re-enable interrupts locally (if enabled previously) */ - local_irq_restore(ctxt->flags); -} - diff --git a/arch/i386/kernel/early_printk.c b/arch/i386/kernel/early_printk.c deleted file mode 100644 index 92f812ba275..00000000000 --- a/arch/i386/kernel/early_printk.c +++ /dev/null @@ -1,2 +0,0 @@ - -#include "../../x86_64/kernel/early_printk.c" diff --git a/arch/i386/kernel/entry.S b/arch/i386/kernel/entry.S deleted file mode 100644 index a714d6b4350..00000000000 --- a/arch/i386/kernel/entry.S +++ /dev/null @@ -1,1112 +0,0 @@ -/* - * linux/arch/i386/entry.S - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * entry.S contains the system-call and fault low-level handling routines. - * This also contains the timer-interrupt handler, as well as all interrupts - * and faults that can result in a task-switch. - * - * NOTE: This code handles signal-recognition, which happens every time - * after a timer-interrupt and after each system call. - * - * I changed all the .align's to 4 (16 byte alignment), as that's faster - * on a 486. - * - * Stack layout in 'syscall_exit': - * ptrace needs to have all regs on the stack. - * if the order here is changed, it needs to be - * updated in fork.c:copy_process, signal.c:do_signal, - * ptrace.c and ptrace.h - * - * 0(%esp) - %ebx - * 4(%esp) - %ecx - * 8(%esp) - %edx - * C(%esp) - %esi - * 10(%esp) - %edi - * 14(%esp) - %ebp - * 18(%esp) - %eax - * 1C(%esp) - %ds - * 20(%esp) - %es - * 24(%esp) - %fs - * 28(%esp) - orig_eax - * 2C(%esp) - %eip - * 30(%esp) - %cs - * 34(%esp) - %eflags - * 38(%esp) - %oldesp - * 3C(%esp) - %oldss - * - * "current" is in register %ebx during any slow entries. - */ - -#include <linux/linkage.h> -#include <asm/thread_info.h> -#include <asm/irqflags.h> -#include <asm/errno.h> -#include <asm/segment.h> -#include <asm/smp.h> -#include <asm/page.h> -#include <asm/desc.h> -#include <asm/percpu.h> -#include <asm/dwarf2.h> -#include "irq_vectors.h" - -/* - * We use macros for low-level operations which need to be overridden - * for paravirtualization. The following will never clobber any registers: - * INTERRUPT_RETURN (aka. "iret") - * GET_CR0_INTO_EAX (aka. "movl %cr0, %eax") - * ENABLE_INTERRUPTS_SYSEXIT (aka "sti; sysexit"). - * - * For DISABLE_INTERRUPTS/ENABLE_INTERRUPTS (aka "cli"/"sti"), you must - * specify what registers can be overwritten (CLBR_NONE, CLBR_EAX/EDX/ECX/ANY). - * Allowing a register to be clobbered can shrink the paravirt replacement - * enough to patch inline, increasing performance. - */ - -#define nr_syscalls ((syscall_table_size)/4) - -CF_MASK = 0x00000001 -TF_MASK = 0x00000100 -IF_MASK = 0x00000200 -DF_MASK = 0x00000400 -NT_MASK = 0x00004000 -VM_MASK = 0x00020000 - -#ifdef CONFIG_PREEMPT -#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF -#else -#define preempt_stop(clobbers) -#define resume_kernel restore_nocheck -#endif - -.macro TRACE_IRQS_IRET -#ifdef CONFIG_TRACE_IRQFLAGS - testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off? - jz 1f - TRACE_IRQS_ON -1: -#endif -.endm - -#ifdef CONFIG_VM86 -#define resume_userspace_sig check_userspace -#else -#define resume_userspace_sig resume_userspace -#endif - -#define SAVE_ALL \ - cld; \ - pushl %fs; \ - CFI_ADJUST_CFA_OFFSET 4;\ - /*CFI_REL_OFFSET fs, 0;*/\ - pushl %es; \ - CFI_ADJUST_CFA_OFFSET 4;\ - /*CFI_REL_OFFSET es, 0;*/\ - pushl %ds; \ - CFI_ADJUST_CFA_OFFSET 4;\ - /*CFI_REL_OFFSET ds, 0;*/\ - pushl %eax; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET eax, 0;\ - pushl %ebp; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET ebp, 0;\ - pushl %edi; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET edi, 0;\ - pushl %esi; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET esi, 0;\ - pushl %edx; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET edx, 0;\ - pushl %ecx; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET ecx, 0;\ - pushl %ebx; \ - CFI_ADJUST_CFA_OFFSET 4;\ - CFI_REL_OFFSET ebx, 0;\ - movl $(__USER_DS), %edx; \ - movl %edx, %ds; \ - movl %edx, %es; \ - movl $(__KERNEL_PERCPU), %edx; \ - movl %edx, %fs - -#define RESTORE_INT_REGS \ - popl %ebx; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE ebx;\ - popl %ecx; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE ecx;\ - popl %edx; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE edx;\ - popl %esi; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE esi;\ - popl %edi; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE edi;\ - popl %ebp; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE ebp;\ - popl %eax; \ - CFI_ADJUST_CFA_OFFSET -4;\ - CFI_RESTORE eax - -#define RESTORE_REGS \ - RESTORE_INT_REGS; \ -1: popl %ds; \ - CFI_ADJUST_CFA_OFFSET -4;\ - /*CFI_RESTORE ds;*/\ -2: popl %es; \ - CFI_ADJUST_CFA_OFFSET -4;\ - /*CFI_RESTORE es;*/\ -3: popl %fs; \ - CFI_ADJUST_CFA_OFFSET -4;\ - /*CFI_RESTORE fs;*/\ -.pushsection .fixup,"ax"; \ -4: movl $0,(%esp); \ - jmp 1b; \ -5: movl $0,(%esp); \ - jmp 2b; \ -6: movl $0,(%esp); \ - jmp 3b; \ -.section __ex_table,"a";\ - .align 4; \ - .long 1b,4b; \ - .long 2b,5b; \ - .long 3b,6b; \ -.popsection - -#define RING0_INT_FRAME \ - CFI_STARTPROC simple;\ - CFI_SIGNAL_FRAME;\ - CFI_DEF_CFA esp, 3*4;\ - /*CFI_OFFSET cs, -2*4;*/\ - CFI_OFFSET eip, -3*4 - -#define RING0_EC_FRAME \ - CFI_STARTPROC simple;\ - CFI_SIGNAL_FRAME;\ - CFI_DEF_CFA esp, 4*4;\ - /*CFI_OFFSET cs, -2*4;*/\ - CFI_OFFSET eip, -3*4 - -#define RING0_PTREGS_FRAME \ - CFI_STARTPROC simple;\ - CFI_SIGNAL_FRAME;\ - CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\ - /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\ - CFI_OFFSET eip, PT_EIP-PT_OLDESP;\ - /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\ - /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\ - CFI_OFFSET eax, PT_EAX-PT_OLDESP;\ - CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\ - CFI_OFFSET edi, PT_EDI-PT_OLDESP;\ - CFI_OFFSET esi, PT_ESI-PT_OLDESP;\ - CFI_OFFSET edx, PT_EDX-PT_OLDESP;\ - CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\ - CFI_OFFSET ebx, PT_EBX-PT_OLDESP - -ENTRY(ret_from_fork) - CFI_STARTPROC - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - call schedule_tail - GET_THREAD_INFO(%ebp) - popl %eax - CFI_ADJUST_CFA_OFFSET -4 - pushl $0x0202 # Reset kernel eflags - CFI_ADJUST_CFA_OFFSET 4 - popfl - CFI_ADJUST_CFA_OFFSET -4 - jmp syscall_exit - CFI_ENDPROC -END(ret_from_fork) - -/* - * Return to user mode is not as complex as all this looks, - * but we want the default path for a system call return to - * go as quickly as possible which is why some of this is - * less clear than it otherwise should be. - */ - - # userspace resumption stub bypassing syscall exit tracing - ALIGN - RING0_PTREGS_FRAME -ret_from_exception: - preempt_stop(CLBR_ANY) -ret_from_intr: - GET_THREAD_INFO(%ebp) -check_userspace: - movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS - movb PT_CS(%esp), %al - andl $(VM_MASK | SEGMENT_RPL_MASK), %eax - cmpl $USER_RPL, %eax - jb resume_kernel # not returning to v8086 or userspace - -ENTRY(resume_userspace) - DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt - # setting need_resched or sigpending - # between sampling and the iret - movl TI_flags(%ebp), %ecx - andl $_TIF_WORK_MASK, %ecx # is there any work to be done on - # int/exception return? - jne work_pending - jmp restore_all -END(ret_from_exception) - -#ifdef CONFIG_PREEMPT -ENTRY(resume_kernel) - DISABLE_INTERRUPTS(CLBR_ANY) - cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? - jnz restore_nocheck -need_resched: - movl TI_flags(%ebp), %ecx # need_resched set ? - testb $_TIF_NEED_RESCHED, %cl - jz restore_all - testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ? - jz restore_all - call preempt_schedule_irq - jmp need_resched -END(resume_kernel) -#endif - CFI_ENDPROC - -/* SYSENTER_RETURN points to after the "sysenter" instruction in - the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ - - # sysenter call handler stub -ENTRY(sysenter_entry) - CFI_STARTPROC simple - CFI_SIGNAL_FRAME - CFI_DEF_CFA esp, 0 - CFI_REGISTER esp, ebp - movl TSS_sysenter_esp0(%esp),%esp -sysenter_past_esp: - /* - * No need to follow this irqs on/off section: the syscall - * disabled irqs and here we enable it straight after entry: - */ - ENABLE_INTERRUPTS(CLBR_NONE) - pushl $(__USER_DS) - CFI_ADJUST_CFA_OFFSET 4 - /*CFI_REL_OFFSET ss, 0*/ - pushl %ebp - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET esp, 0 - pushfl - CFI_ADJUST_CFA_OFFSET 4 - pushl $(__USER_CS) - CFI_ADJUST_CFA_OFFSET 4 - /*CFI_REL_OFFSET cs, 0*/ - /* - * Push current_thread_info()->sysenter_return to the stack. - * A tiny bit of offset fixup is necessary - 4*4 means the 4 words - * pushed above; +8 corresponds to copy_thread's esp0 setting. - */ - pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET eip, 0 - -/* - * Load the potential sixth argument from user stack. - * Careful about security. - */ - cmpl $__PAGE_OFFSET-3,%ebp - jae syscall_fault -1: movl (%ebp),%ebp -.section __ex_table,"a" - .align 4 - .long 1b,syscall_fault -.previous - - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - GET_THREAD_INFO(%ebp) - - /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ - testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) - jnz syscall_trace_entry - cmpl $(nr_syscalls), %eax - jae syscall_badsys - call *sys_call_table(,%eax,4) - movl %eax,PT_EAX(%esp) - DISABLE_INTERRUPTS(CLBR_ANY) - TRACE_IRQS_OFF - movl TI_flags(%ebp), %ecx - testw $_TIF_ALLWORK_MASK, %cx - jne syscall_exit_work -/* if something modifies registers it must also disable sysexit */ - movl PT_EIP(%esp), %edx - movl PT_OLDESP(%esp), %ecx - xorl %ebp,%ebp - TRACE_IRQS_ON -1: mov PT_FS(%esp), %fs - ENABLE_INTERRUPTS_SYSEXIT - CFI_ENDPROC -.pushsection .fixup,"ax" -2: movl $0,PT_FS(%esp) - jmp 1b -.section __ex_table,"a" - .align 4 - .long 1b,2b -.popsection -ENDPROC(sysenter_entry) - - # system call handler stub -ENTRY(system_call) - RING0_INT_FRAME # can't unwind into user space anyway - pushl %eax # save orig_eax - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - GET_THREAD_INFO(%ebp) - # system call tracing in operation / emulation - /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ - testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) - jnz syscall_trace_entry - cmpl $(nr_syscalls), %eax - jae syscall_badsys -syscall_call: - call *sys_call_table(,%eax,4) - movl %eax,PT_EAX(%esp) # store the return value -syscall_exit: - DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt - # setting need_resched or sigpending - # between sampling and the iret - TRACE_IRQS_OFF - testl $TF_MASK,PT_EFLAGS(%esp) # If tracing set singlestep flag on exit - jz no_singlestep - orl $_TIF_SINGLESTEP,TI_flags(%ebp) -no_singlestep: - movl TI_flags(%ebp), %ecx - testw $_TIF_ALLWORK_MASK, %cx # current->work - jne syscall_exit_work - -restore_all: - movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS - # Warning: PT_OLDSS(%esp) contains the wrong/random values if we - # are returning to the kernel. - # See comments in process.c:copy_thread() for details. - movb PT_OLDSS(%esp), %ah - movb PT_CS(%esp), %al - andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax - cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax - CFI_REMEMBER_STATE - je ldt_ss # returning to user-space with LDT SS -restore_nocheck: - TRACE_IRQS_IRET -restore_nocheck_notrace: - RESTORE_REGS - addl $4, %esp # skip orig_eax/error_code - CFI_ADJUST_CFA_OFFSET -4 -1: INTERRUPT_RETURN -.section .fixup,"ax" -iret_exc: - pushl $0 # no error code - pushl $do_iret_error - jmp error_code -.previous -.section __ex_table,"a" - .align 4 - .long 1b,iret_exc -.previous - - CFI_RESTORE_STATE -ldt_ss: - larl PT_OLDSS(%esp), %eax - jnz restore_nocheck - testl $0x00400000, %eax # returning to 32bit stack? - jnz restore_nocheck # allright, normal return - -#ifdef CONFIG_PARAVIRT - /* - * The kernel can't run on a non-flat stack if paravirt mode - * is active. Rather than try to fixup the high bits of - * ESP, bypass this code entirely. This may break DOSemu - * and/or Wine support in a paravirt VM, although the option - * is still available to implement the setting of the high - * 16-bits in the INTERRUPT_RETURN paravirt-op. - */ - cmpl $0, paravirt_ops+PARAVIRT_enabled - jne restore_nocheck -#endif - - /* If returning to userspace with 16bit stack, - * try to fix the higher word of ESP, as the CPU - * won't restore it. - * This is an "official" bug of all the x86-compatible - * CPUs, which we can try to work around to make - * dosemu and wine happy. */ - movl PT_OLDESP(%esp), %eax - movl %esp, %edx - call patch_espfix_desc - pushl $__ESPFIX_SS - CFI_ADJUST_CFA_OFFSET 4 - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - DISABLE_INTERRUPTS(CLBR_EAX) - TRACE_IRQS_OFF - lss (%esp), %esp - CFI_ADJUST_CFA_OFFSET -8 - jmp restore_nocheck - CFI_ENDPROC -ENDPROC(system_call) - - # perform work that needs to be done immediately before resumption - ALIGN - RING0_PTREGS_FRAME # can't unwind into user space anyway -work_pending: - testb $_TIF_NEED_RESCHED, %cl - jz work_notifysig -work_resched: - call schedule - DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt - # setting need_resched or sigpending - # between sampling and the iret - TRACE_IRQS_OFF - movl TI_flags(%ebp), %ecx - andl $_TIF_WORK_MASK, %ecx # is there any work to be done other - # than syscall tracing? - jz restore_all - testb $_TIF_NEED_RESCHED, %cl - jnz work_resched - -work_notifysig: # deal with pending signals and - # notify-resume requests -#ifdef CONFIG_VM86 - testl $VM_MASK, PT_EFLAGS(%esp) - movl %esp, %eax - jne work_notifysig_v86 # returning to kernel-space or - # vm86-space - xorl %edx, %edx - call do_notify_resume - jmp resume_userspace_sig - - ALIGN -work_notifysig_v86: - pushl %ecx # save ti_flags for do_notify_resume - CFI_ADJUST_CFA_OFFSET 4 - call save_v86_state # %eax contains pt_regs pointer - popl %ecx - CFI_ADJUST_CFA_OFFSET -4 - movl %eax, %esp -#else - movl %esp, %eax -#endif - xorl %edx, %edx - call do_notify_resume - jmp resume_userspace_sig -END(work_pending) - - # perform syscall exit tracing - ALIGN -syscall_trace_entry: - movl $-ENOSYS,PT_EAX(%esp) - movl %esp, %eax - xorl %edx,%edx - call do_syscall_trace - cmpl $0, %eax - jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU, - # so must skip actual syscall - movl PT_ORIG_EAX(%esp), %eax - cmpl $(nr_syscalls), %eax - jnae syscall_call - jmp syscall_exit -END(syscall_trace_entry) - - # perform syscall exit tracing - ALIGN -syscall_exit_work: - testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl - jz work_pending - TRACE_IRQS_ON - ENABLE_INTERRUPTS(CLBR_ANY) # could let do_syscall_trace() call - # schedule() instead - movl %esp, %eax - movl $1, %edx - call do_syscall_trace - jmp resume_userspace -END(syscall_exit_work) - CFI_ENDPROC - - RING0_INT_FRAME # can't unwind into user space anyway -syscall_fault: - pushl %eax # save orig_eax - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - GET_THREAD_INFO(%ebp) - movl $-EFAULT,PT_EAX(%esp) - jmp resume_userspace -END(syscall_fault) - -syscall_badsys: - movl $-ENOSYS,PT_EAX(%esp) - jmp resume_userspace -END(syscall_badsys) - CFI_ENDPROC - -#define FIXUP_ESPFIX_STACK \ - /* since we are on a wrong stack, we cant make it a C code :( */ \ - PER_CPU(gdt_page, %ebx); \ - GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ - addl %esp, %eax; \ - pushl $__KERNEL_DS; \ - CFI_ADJUST_CFA_OFFSET 4; \ - pushl %eax; \ - CFI_ADJUST_CFA_OFFSET 4; \ - lss (%esp), %esp; \ - CFI_ADJUST_CFA_OFFSET -8; -#define UNWIND_ESPFIX_STACK \ - movl %ss, %eax; \ - /* see if on espfix stack */ \ - cmpw $__ESPFIX_SS, %ax; \ - jne 27f; \ - movl $__KERNEL_DS, %eax; \ - movl %eax, %ds; \ - movl %eax, %es; \ - /* switch to normal stack */ \ - FIXUP_ESPFIX_STACK; \ -27:; - -/* - * Build the entry stubs and pointer table with - * some assembler magic. - */ -.data -ENTRY(interrupt) -.text - -ENTRY(irq_entries_start) - RING0_INT_FRAME -vector=0 -.rept NR_IRQS - ALIGN - .if vector - CFI_ADJUST_CFA_OFFSET -4 - .endif -1: pushl $~(vector) - CFI_ADJUST_CFA_OFFSET 4 - jmp common_interrupt - .previous - .long 1b - .text -vector=vector+1 -.endr -END(irq_entries_start) - -.previous -END(interrupt) -.previous - -/* - * the CPU automatically disables interrupts when executing an IRQ vector, - * so IRQ-flags tracing has to follow that: - */ - ALIGN -common_interrupt: - SAVE_ALL - TRACE_IRQS_OFF - movl %esp,%eax - call do_IRQ - jmp ret_from_intr -ENDPROC(common_interrupt) - CFI_ENDPROC - -#define BUILD_INTERRUPT(name, nr) \ -ENTRY(name) \ - RING0_INT_FRAME; \ - pushl $~(nr); \ - CFI_ADJUST_CFA_OFFSET 4; \ - SAVE_ALL; \ - TRACE_IRQS_OFF \ - movl %esp,%eax; \ - call smp_##name; \ - jmp ret_from_intr; \ - CFI_ENDPROC; \ -ENDPROC(name) - -/* The include is where all of the SMP etc. interrupts come from */ -#include "entry_arch.h" - -KPROBE_ENTRY(page_fault) - RING0_EC_FRAME - pushl $do_page_fault - CFI_ADJUST_CFA_OFFSET 4 - ALIGN -error_code: - /* the function address is in %fs's slot on the stack */ - pushl %es - CFI_ADJUST_CFA_OFFSET 4 - /*CFI_REL_OFFSET es, 0*/ - pushl %ds - CFI_ADJUST_CFA_OFFSET 4 - /*CFI_REL_OFFSET ds, 0*/ - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET eax, 0 - pushl %ebp - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET ebp, 0 - pushl %edi - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET edi, 0 - pushl %esi - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET esi, 0 - pushl %edx - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET edx, 0 - pushl %ecx - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET ecx, 0 - pushl %ebx - CFI_ADJUST_CFA_OFFSET 4 - CFI_REL_OFFSET ebx, 0 - cld - pushl %fs - CFI_ADJUST_CFA_OFFSET 4 - /*CFI_REL_OFFSET fs, 0*/ - movl $(__KERNEL_PERCPU), %ecx - movl %ecx, %fs - UNWIND_ESPFIX_STACK - popl %ecx - CFI_ADJUST_CFA_OFFSET -4 - /*CFI_REGISTER es, ecx*/ - movl PT_FS(%esp), %edi # get the function address - movl PT_ORIG_EAX(%esp), %edx # get the error code - movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart - mov %ecx, PT_FS(%esp) - /*CFI_REL_OFFSET fs, ES*/ - movl $(__USER_DS), %ecx - movl %ecx, %ds - movl %ecx, %es - movl %esp,%eax # pt_regs pointer - call *%edi - jmp ret_from_exception - CFI_ENDPROC -KPROBE_END(page_fault) - -ENTRY(coprocessor_error) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_coprocessor_error - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(coprocessor_error) - -ENTRY(simd_coprocessor_error) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_simd_coprocessor_error - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(simd_coprocessor_error) - -ENTRY(device_not_available) - RING0_INT_FRAME - pushl $-1 # mark this as an int - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - GET_CR0_INTO_EAX - testl $0x4, %eax # EM (math emulation bit) - jne device_not_available_emulate - preempt_stop(CLBR_ANY) - call math_state_restore - jmp ret_from_exception -device_not_available_emulate: - pushl $0 # temporary storage for ORIG_EIP - CFI_ADJUST_CFA_OFFSET 4 - call math_emulate - addl $4, %esp - CFI_ADJUST_CFA_OFFSET -4 - jmp ret_from_exception - CFI_ENDPROC -END(device_not_available) - -/* - * Debug traps and NMI can happen at the one SYSENTER instruction - * that sets up the real kernel stack. Check here, since we can't - * allow the wrong stack to be used. - * - * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have - * already pushed 3 words if it hits on the sysenter instruction: - * eflags, cs and eip. - * - * We just load the right stack, and push the three (known) values - * by hand onto the new stack - while updating the return eip past - * the instruction that would have done it for sysenter. - */ -#define FIX_STACK(offset, ok, label) \ - cmpw $__KERNEL_CS,4(%esp); \ - jne ok; \ -label: \ - movl TSS_sysenter_esp0+offset(%esp),%esp; \ - CFI_DEF_CFA esp, 0; \ - CFI_UNDEFINED eip; \ - pushfl; \ - CFI_ADJUST_CFA_OFFSET 4; \ - pushl $__KERNEL_CS; \ - CFI_ADJUST_CFA_OFFSET 4; \ - pushl $sysenter_past_esp; \ - CFI_ADJUST_CFA_OFFSET 4; \ - CFI_REL_OFFSET eip, 0 - -KPROBE_ENTRY(debug) - RING0_INT_FRAME - cmpl $sysenter_entry,(%esp) - jne debug_stack_correct - FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) -debug_stack_correct: - pushl $-1 # mark this as an int - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - xorl %edx,%edx # error code 0 - movl %esp,%eax # pt_regs pointer - call do_debug - jmp ret_from_exception - CFI_ENDPROC -KPROBE_END(debug) - -/* - * NMI is doubly nasty. It can happen _while_ we're handling - * a debug fault, and the debug fault hasn't yet been able to - * clear up the stack. So we first check whether we got an - * NMI on the sysenter entry path, but after that we need to - * check whether we got an NMI on the debug path where the debug - * fault happened on the sysenter path. - */ -KPROBE_ENTRY(nmi) - RING0_INT_FRAME - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - movl %ss, %eax - cmpw $__ESPFIX_SS, %ax - popl %eax - CFI_ADJUST_CFA_OFFSET -4 - je nmi_espfix_stack - cmpl $sysenter_entry,(%esp) - je nmi_stack_fixup - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - movl %esp,%eax - /* Do not access memory above the end of our stack page, - * it might not exist. - */ - andl $(THREAD_SIZE-1),%eax - cmpl $(THREAD_SIZE-20),%eax - popl %eax - CFI_ADJUST_CFA_OFFSET -4 - jae nmi_stack_correct - cmpl $sysenter_entry,12(%esp) - je nmi_debug_stack_check -nmi_stack_correct: - /* We have a RING0_INT_FRAME here */ - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - xorl %edx,%edx # zero error code - movl %esp,%eax # pt_regs pointer - call do_nmi - jmp restore_nocheck_notrace - CFI_ENDPROC - -nmi_stack_fixup: - RING0_INT_FRAME - FIX_STACK(12,nmi_stack_correct, 1) - jmp nmi_stack_correct - -nmi_debug_stack_check: - /* We have a RING0_INT_FRAME here */ - cmpw $__KERNEL_CS,16(%esp) - jne nmi_stack_correct - cmpl $debug,(%esp) - jb nmi_stack_correct - cmpl $debug_esp_fix_insn,(%esp) - ja nmi_stack_correct - FIX_STACK(24,nmi_stack_correct, 1) - jmp nmi_stack_correct - -nmi_espfix_stack: - /* We have a RING0_INT_FRAME here. - * - * create the pointer to lss back - */ - pushl %ss - CFI_ADJUST_CFA_OFFSET 4 - pushl %esp - CFI_ADJUST_CFA_OFFSET 4 - addw $4, (%esp) - /* copy the iret frame of 12 bytes */ - .rept 3 - pushl 16(%esp) - CFI_ADJUST_CFA_OFFSET 4 - .endr - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - FIXUP_ESPFIX_STACK # %eax == %esp - xorl %edx,%edx # zero error code - call do_nmi - RESTORE_REGS - lss 12+4(%esp), %esp # back to espfix stack - CFI_ADJUST_CFA_OFFSET -24 -1: INTERRUPT_RETURN - CFI_ENDPROC -.section __ex_table,"a" - .align 4 - .long 1b,iret_exc -.previous -KPROBE_END(nmi) - -#ifdef CONFIG_PARAVIRT -ENTRY(native_iret) -1: iret -.section __ex_table,"a" - .align 4 - .long 1b,iret_exc -.previous -END(native_iret) - -ENTRY(native_irq_enable_sysexit) - sti - sysexit -END(native_irq_enable_sysexit) -#endif - -KPROBE_ENTRY(int3) - RING0_INT_FRAME - pushl $-1 # mark this as an int - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - xorl %edx,%edx # zero error code - movl %esp,%eax # pt_regs pointer - call do_int3 - jmp ret_from_exception - CFI_ENDPROC -KPROBE_END(int3) - -ENTRY(overflow) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_overflow - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(overflow) - -ENTRY(bounds) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_bounds - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(bounds) - -ENTRY(invalid_op) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_invalid_op - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(invalid_op) - -ENTRY(coprocessor_segment_overrun) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_coprocessor_segment_overrun - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(coprocessor_segment_overrun) - -ENTRY(invalid_TSS) - RING0_EC_FRAME - pushl $do_invalid_TSS - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(invalid_TSS) - -ENTRY(segment_not_present) - RING0_EC_FRAME - pushl $do_segment_not_present - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(segment_not_present) - -ENTRY(stack_segment) - RING0_EC_FRAME - pushl $do_stack_segment - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(stack_segment) - -KPROBE_ENTRY(general_protection) - RING0_EC_FRAME - pushl $do_general_protection - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -KPROBE_END(general_protection) - -ENTRY(alignment_check) - RING0_EC_FRAME - pushl $do_alignment_check - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(alignment_check) - -ENTRY(divide_error) - RING0_INT_FRAME - pushl $0 # no error code - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_divide_error - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(divide_error) - -#ifdef CONFIG_X86_MCE -ENTRY(machine_check) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl machine_check_vector - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(machine_check) -#endif - -ENTRY(spurious_interrupt_bug) - RING0_INT_FRAME - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - pushl $do_spurious_interrupt_bug - CFI_ADJUST_CFA_OFFSET 4 - jmp error_code - CFI_ENDPROC -END(spurious_interrupt_bug) - -ENTRY(kernel_thread_helper) - pushl $0 # fake return address for unwinder - CFI_STARTPROC - movl %edx,%eax - push %edx - CFI_ADJUST_CFA_OFFSET 4 - call *%ebx - push %eax - CFI_ADJUST_CFA_OFFSET 4 - call do_exit - CFI_ENDPROC -ENDPROC(kernel_thread_helper) - -#ifdef CONFIG_XEN -ENTRY(xen_hypervisor_callback) - CFI_STARTPROC - pushl $0 - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - TRACE_IRQS_OFF - - /* Check to see if we got the event in the critical - region in xen_iret_direct, after we've reenabled - events and checked for pending events. This simulates - iret instruction's behaviour where it delivers a - pending interrupt when enabling interrupts. */ - movl PT_EIP(%esp),%eax - cmpl $xen_iret_start_crit,%eax - jb 1f - cmpl $xen_iret_end_crit,%eax - jae 1f - - call xen_iret_crit_fixup - -1: mov %esp, %eax - call xen_evtchn_do_upcall - jmp ret_from_intr - CFI_ENDPROC -ENDPROC(xen_hypervisor_callback) - -# Hypervisor uses this for application faults while it executes. -# We get here for two reasons: -# 1. Fault while reloading DS, ES, FS or GS -# 2. Fault while executing IRET -# Category 1 we fix up by reattempting the load, and zeroing the segment -# register if the load fails. -# Category 2 we fix up by jumping to do_iret_error. We cannot use the -# normal Linux return path in this case because if we use the IRET hypercall -# to pop the stack frame we end up in an infinite loop of failsafe callbacks. -# We distinguish between categories by maintaining a status value in EAX. -ENTRY(xen_failsafe_callback) - CFI_STARTPROC - pushl %eax - CFI_ADJUST_CFA_OFFSET 4 - movl $1,%eax -1: mov 4(%esp),%ds -2: mov 8(%esp),%es -3: mov 12(%esp),%fs -4: mov 16(%esp),%gs - testl %eax,%eax - popl %eax - CFI_ADJUST_CFA_OFFSET -4 - lea 16(%esp),%esp - CFI_ADJUST_CFA_OFFSET -16 - jz 5f - addl $16,%esp - jmp iret_exc # EAX != 0 => Category 2 (Bad IRET) -5: pushl $0 # EAX == 0 => Category 1 (Bad segment) - CFI_ADJUST_CFA_OFFSET 4 - SAVE_ALL - jmp ret_from_exception - CFI_ENDPROC - -.section .fixup,"ax" -6: xorl %eax,%eax - movl %eax,4(%esp) - jmp 1b -7: xorl %eax,%eax - movl %eax,8(%esp) - jmp 2b -8: xorl %eax,%eax - movl %eax,12(%esp) - jmp 3b -9: xorl %eax,%eax - movl %eax,16(%esp) - jmp 4b -.previous -.section __ex_table,"a" - .align 4 - .long 1b,6b - .long 2b,7b - .long 3b,8b - .long 4b,9b -.previous -ENDPROC(xen_failsafe_callback) - -#endif /* CONFIG_XEN */ - -.section .rodata,"a" -#include "syscall_table.S" - -syscall_table_size=(.-sys_call_table) diff --git a/arch/i386/kernel/head.S b/arch/i386/kernel/head.S deleted file mode 100644 index 8f0382161c9..00000000000 --- a/arch/i386/kernel/head.S +++ /dev/null @@ -1,578 +0,0 @@ -/* - * linux/arch/i386/kernel/head.S -- the 32-bit startup code. - * - * Copyright (C) 1991, 1992 Linus Torvalds - * - * Enhanced CPU detection and feature setting code by Mike Jagdis - * and Martin Mares, November 1997. - */ - -.text -#include <linux/threads.h> -#include <linux/linkage.h> -#include <asm/segment.h> -#include <asm/page.h> -#include <asm/pgtable.h> -#include <asm/desc.h> -#include <asm/cache.h> -#include <asm/thread_info.h> -#include <asm/asm-offsets.h> -#include <asm/setup.h> - -/* - * References to members of the new_cpu_data structure. - */ - -#define X86 new_cpu_data+CPUINFO_x86 -#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor -#define X86_MODEL new_cpu_data+CPUINFO_x86_model -#define X86_MASK new_cpu_data+CPUINFO_x86_mask -#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math -#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level -#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability -#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id - -/* - * This is how much memory *in addition to the memory covered up to - * and including _end* we need mapped initially. - * We need: - * - one bit for each possible page, but only in low memory, which means - * 2^32/4096/8 = 128K worst case (4G/4G split.) - * - enough space to map all low memory, which means - * (2^32/4096) / 1024 pages (worst case, non PAE) - * (2^32/4096) / 512 + 4 pages (worst case for PAE) - * - a few pages for allocator use before the kernel pagetable has - * been set up - * - * Modulo rounding, each megabyte assigned here requires a kilobyte of - * memory, which is currently unreclaimed. - * - * This should be a multiple of a page. - */ -LOW_PAGES = 1<<(32-PAGE_SHIFT_asm) - -#if PTRS_PER_PMD > 1 -PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD -#else -PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PGD) -#endif -BOOTBITMAP_SIZE = LOW_PAGES / 8 -ALLOCATOR_SLOP = 4 - -INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_SIZE_asm - -/* - * 32-bit kernel entrypoint; only used by the boot CPU. On entry, - * %esi points to the real-mode code as a 32-bit pointer. - * CS and DS must be 4 GB flat segments, but we don't depend on - * any particular GDT layout, because we load our own as soon as we - * can. - */ -.section .text.head,"ax",@progbits -ENTRY(startup_32) - -/* - * Set segments to known values. - */ - cld - lgdt boot_gdt_descr - __PAGE_OFFSET - movl $(__BOOT_DS),%eax - movl %eax,%ds - movl %eax,%es - movl %eax,%fs - movl %eax,%gs - -/* - * Clear BSS first so that there are no surprises... - * No need to cld as DF is already clear from cld above... - */ - xorl %eax,%eax - movl $__bss_start - __PAGE_OFFSET,%edi - movl $__bss_stop - __PAGE_OFFSET,%ecx - subl %edi,%ecx - shrl $2,%ecx - rep ; stosl -/* - * Copy bootup parameters out of the way. - * Note: %esi still has the pointer to the real-mode data. - * With the kexec as boot loader, parameter segment might be loaded beyond - * kernel image and might not even be addressable by early boot page tables. - * (kexec on panic case). Hence copy out the parameters before initializing - * page tables. - */ - movl $(boot_params - __PAGE_OFFSET),%edi - movl $(PARAM_SIZE/4),%ecx - cld - rep - movsl - movl boot_params - __PAGE_OFFSET + NEW_CL_POINTER,%esi - andl %esi,%esi - jnz 2f # New command line protocol - cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR - jne 1f - movzwl OLD_CL_OFFSET,%esi - addl $(OLD_CL_BASE_ADDR),%esi -2: - movl $(boot_command_line - __PAGE_OFFSET),%edi - movl $(COMMAND_LINE_SIZE/4),%ecx - rep - movsl -1: - -/* - * Initialize page tables. This creates a PDE and a set of page - * tables, which are located immediately beyond _end. The variable - * init_pg_tables_end is set up to point to the first "safe" location. - * Mappings are created both at virtual address 0 (identity mapping) - * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END. - * - * Warning: don't use %esi or the stack in this code. However, %esp - * can be used as a GPR if you really need it... - */ -page_pde_offset = (__PAGE_OFFSET >> 20); - - movl $(pg0 - __PAGE_OFFSET), %edi - movl $(swapper_pg_dir - __PAGE_OFFSET), %edx - movl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ -10: - leal 0x007(%edi),%ecx /* Create PDE entry */ - movl %ecx,(%edx) /* Store identity PDE entry */ - movl %ecx,page_pde_offset(%edx) /* Store kernel PDE entry */ - addl $4,%edx - movl $1024, %ecx -11: - stosl - addl $0x1000,%eax - loop 11b - /* End condition: we must map up to and including INIT_MAP_BEYOND_END */ - /* bytes beyond the end of our own page tables; the +0x007 is the attribute bits */ - leal (INIT_MAP_BEYOND_END+0x007)(%edi),%ebp - cmpl %ebp,%eax - jb 10b - movl %edi,(init_pg_tables_end - __PAGE_OFFSET) - - xorl %ebx,%ebx /* This is the boot CPU (BSP) */ - jmp 3f -/* - * Non-boot CPU entry point; entered from trampoline.S - * We can't lgdt here, because lgdt itself uses a data segment, but - * we know the trampoline has already loaded the boot_gdt for us. - * - * If cpu hotplug is not supported then this code can go in init section - * which will be freed later - */ - -#ifndef CONFIG_HOTPLUG_CPU -.section .init.text,"ax",@progbits -#endif - - /* Do an early initialization of the fixmap area */ - movl $(swapper_pg_dir - __PAGE_OFFSET), %edx - movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax - addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ - movl %eax, 4092(%edx) - -#ifdef CONFIG_SMP -ENTRY(startup_32_smp) - cld - movl $(__BOOT_DS),%eax - movl %eax,%ds - movl %eax,%es - movl %eax,%fs - movl %eax,%gs - -/* - * New page tables may be in 4Mbyte page mode and may - * be using the global pages. - * - * NOTE! If we are on a 486 we may have no cr4 at all! - * So we do not try to touch it unless we really have - * some bits in it to set. This won't work if the BSP - * implements cr4 but this AP does not -- very unlikely - * but be warned! The same applies to the pse feature - * if not equally supported. --macro - * - * NOTE! We have to correct for the fact that we're - * not yet offset PAGE_OFFSET.. - */ -#define cr4_bits mmu_cr4_features-__PAGE_OFFSET - movl cr4_bits,%edx - andl %edx,%edx - jz 6f - movl %cr4,%eax # Turn on paging options (PSE,PAE,..) - orl %edx,%eax - movl %eax,%cr4 - - btl $5, %eax # check if PAE is enabled - jnc 6f - - /* Check if extended functions are implemented */ - movl $0x80000000, %eax - cpuid - cmpl $0x80000000, %eax - jbe 6f - mov $0x80000001, %eax - cpuid - /* Execute Disable bit supported? */ - btl $20, %edx - jnc 6f - - /* Setup EFER (Extended Feature Enable Register) */ - movl $0xc0000080, %ecx - rdmsr - - btsl $11, %eax - /* Make changes effective */ - wrmsr - -6: - /* This is a secondary processor (AP) */ - xorl %ebx,%ebx - incl %ebx - -#endif /* CONFIG_SMP */ -3: - -/* - * Enable paging - */ - movl $swapper_pg_dir-__PAGE_OFFSET,%eax - movl %eax,%cr3 /* set the page table pointer.. */ - movl %cr0,%eax - orl $0x80000000,%eax - movl %eax,%cr0 /* ..and set paging (PG) bit */ - ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ -1: - /* Set up the stack pointer */ - lss stack_start,%esp - -/* - * Initialize eflags. Some BIOS's leave bits like NT set. This would - * confuse the debugger if this code is traced. - * XXX - best to initialize before switching to protected mode. - */ - pushl $0 - popfl - -#ifdef CONFIG_SMP - andl %ebx,%ebx - jz 1f /* Initial CPU cleans BSS */ - jmp checkCPUtype -1: -#endif /* CONFIG_SMP */ - -/* - * start system 32-bit setup. We need to re-do some of the things done - * in 16-bit mode for the "real" operations. - */ - call setup_idt - -checkCPUtype: - - movl $-1,X86_CPUID # -1 for no CPUID initially - -/* check if it is 486 or 386. */ -/* - * XXX - this does a lot of unnecessary setup. Alignment checks don't - * apply at our cpl of 0 and the stack ought to be aligned already, and - * we don't need to preserve eflags. - */ - - movb $3,X86 # at least 386 - pushfl # push EFLAGS - popl %eax # get EFLAGS - movl %eax,%ecx # save original EFLAGS - xorl $0x240000,%eax # flip AC and ID bits in EFLAGS - pushl %eax # copy to EFLAGS - popfl # set EFLAGS - pushfl # get new EFLAGS - popl %eax # put it in eax - xorl %ecx,%eax # change in flags - pushl %ecx # restore original EFLAGS - popfl - testl $0x40000,%eax # check if AC bit changed - je is386 - - movb $4,X86 # at least 486 - testl $0x200000,%eax # check if ID bit changed - je is486 - - /* get vendor info */ - xorl %eax,%eax # call CPUID with 0 -> return vendor ID - cpuid - movl %eax,X86_CPUID # save CPUID level - movl %ebx,X86_VENDOR_ID # lo 4 chars - movl %edx,X86_VENDOR_ID+4 # next 4 chars - movl %ecx,X86_VENDOR_ID+8 # last 4 chars - - orl %eax,%eax # do we have processor info as well? - je is486 - - movl $1,%eax # Use the CPUID instruction to get CPU type - cpuid - movb %al,%cl # save reg for future use - andb $0x0f,%ah # mask processor family - movb %ah,X86 - andb $0xf0,%al # mask model - shrb $4,%al - movb %al,X86_MODEL - andb $0x0f,%cl # mask mask revision - movb %cl,X86_MASK - movl %edx,X86_CAPABILITY - -is486: movl $0x50022,%ecx # set AM, WP, NE and MP - jmp 2f - -is386: movl $2,%ecx # set MP -2: movl %cr0,%eax - andl $0x80000011,%eax # Save PG,PE,ET - orl %ecx,%eax - movl %eax,%cr0 - - call check_x87 - lgdt early_gdt_descr - lidt idt_descr - ljmp $(__KERNEL_CS),$1f -1: movl $(__KERNEL_DS),%eax # reload all the segment registers - movl %eax,%ss # after changing gdt. - movl %eax,%fs # gets reset once there's real percpu - - movl $(__USER_DS),%eax # DS/ES contains default USER segment - movl %eax,%ds - movl %eax,%es - - xorl %eax,%eax # Clear GS and LDT - movl %eax,%gs - lldt %ax - - cld # gcc2 wants the direction flag cleared at all times - pushl $0 # fake return address for unwinder -#ifdef CONFIG_SMP - movb ready, %cl - movb $1, ready - cmpb $0,%cl # the first CPU calls start_kernel - je 1f - movl $(__KERNEL_PERCPU), %eax - movl %eax,%fs # set this cpu's percpu - jmp initialize_secondary # all other CPUs call initialize_secondary -1: -#endif /* CONFIG_SMP */ - jmp start_kernel - -/* - * We depend on ET to be correct. This checks for 287/387. - */ -check_x87: - movb $0,X86_HARD_MATH - clts - fninit - fstsw %ax - cmpb $0,%al - je 1f - movl %cr0,%eax /* no coprocessor: have to set bits */ - xorl $4,%eax /* set EM */ - movl %eax,%cr0 - ret - ALIGN -1: movb $1,X86_HARD_MATH - .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ - ret - -/* - * setup_idt - * - * sets up a idt with 256 entries pointing to - * ignore_int, interrupt gates. It doesn't actually load - * idt - that can be done only after paging has been enabled - * and the kernel moved to PAGE_OFFSET. Interrupts - * are enabled elsewhere, when we can be relatively - * sure everything is ok. - * - * Warning: %esi is live across this function. - */ -setup_idt: - lea ignore_int,%edx - movl $(__KERNEL_CS << 16),%eax - movw %dx,%ax /* selector = 0x0010 = cs */ - movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ - - lea idt_table,%edi - mov $256,%ecx -rp_sidt: - movl %eax,(%edi) - movl %edx,4(%edi) - addl $8,%edi - dec %ecx - jne rp_sidt - -.macro set_early_handler handler,trapno - lea \handler,%edx - movl $(__KERNEL_CS << 16),%eax - movw %dx,%ax - movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ - lea idt_table,%edi - movl %eax,8*\trapno(%edi) - movl %edx,8*\trapno+4(%edi) -.endm - - set_early_handler handler=early_divide_err,trapno=0 - set_early_handler handler=early_illegal_opcode,trapno=6 - set_early_handler handler=early_protection_fault,trapno=13 - set_early_handler handler=early_page_fault,trapno=14 - - ret - -early_divide_err: - xor %edx,%edx - pushl $0 /* fake errcode */ - jmp early_fault - -early_illegal_opcode: - movl $6,%edx - pushl $0 /* fake errcode */ - jmp early_fault - -early_protection_fault: - movl $13,%edx - jmp early_fault - -early_page_fault: - movl $14,%edx - jmp early_fault - -early_fault: - cld -#ifdef CONFIG_PRINTK - movl $(__KERNEL_DS),%eax - movl %eax,%ds - movl %eax,%es - cmpl $2,early_recursion_flag - je hlt_loop - incl early_recursion_flag - movl %cr2,%eax - pushl %eax - pushl %edx /* trapno */ - pushl $fault_msg -#ifdef CONFIG_EARLY_PRINTK - call early_printk -#else - call printk -#endif -#endif -hlt_loop: - hlt - jmp hlt_loop - -/* This is the default interrupt "handler" :-) */ - ALIGN -ignore_int: - cld -#ifdef CONFIG_PRINTK - pushl %eax - pushl %ecx - pushl %edx - pushl %es - pushl %ds - movl $(__KERNEL_DS),%eax - movl %eax,%ds - movl %eax,%es - cmpl $2,early_recursion_flag - je hlt_loop - incl early_recursion_flag - pushl 16(%esp) - pushl 24(%esp) - pushl 32(%esp) - pushl 40(%esp) - pushl $int_msg -#ifdef CONFIG_EARLY_PRINTK - call early_printk -#else - call printk -#endif - addl $(5*4),%esp - popl %ds - popl %es - popl %edx - popl %ecx - popl %eax -#endif - iret - -.section .text -/* - * Real beginning of normal "text" segment - */ -ENTRY(stext) -ENTRY(_stext) - -/* - * BSS section - */ -.section ".bss.page_aligned","wa" - .align PAGE_SIZE_asm -ENTRY(swapper_pg_dir) - .fill 1024,4,0 -ENTRY(swapper_pg_pmd) - .fill 1024,4,0 -ENTRY(empty_zero_page) - .fill 4096,1,0 - -/* - * This starts the data section. - */ -.data -ENTRY(stack_start) - .long init_thread_union+THREAD_SIZE - .long __BOOT_DS - -ready: .byte 0 - -early_recursion_flag: - .long 0 - -int_msg: - .asciz "Unknown interrupt or fault at EIP %p %p %p\n" - -fault_msg: - .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n" - .asciz "Stack: %p %p %p %p %p %p %p %p\n" - -#include "../xen/xen-head.S" - -/* - * The IDT and GDT 'descriptors' are a strange 48-bit object - * only used by the lidt and lgdt instructions. They are not - * like usual segment descriptors - they consist of a 16-bit - * segment size, and 32-bit linear address value: - */ - -.globl boot_gdt_descr -.globl idt_descr - - ALIGN -# early boot GDT descriptor (must use 1:1 address mapping) - .word 0 # 32 bit align gdt_desc.address -boot_gdt_descr: - .word __BOOT_DS+7 - .long boot_gdt - __PAGE_OFFSET - - .word 0 # 32-bit align idt_desc.address -idt_descr: - .word IDT_ENTRIES*8-1 # idt contains 256 entries - .long idt_table - -# boot GDT descriptor (later on used by CPU#0): - .word 0 # 32 bit align gdt_desc.address -ENTRY(early_gdt_descr) - .word GDT_ENTRIES*8-1 - .long per_cpu__gdt_page /* Overwritten for secondary CPUs */ - -/* - * The boot_gdt must mirror the equivalent in setup.S and is - * used only for booting. - */ - .align L1_CACHE_BYTES -ENTRY(boot_gdt) - .fill GDT_ENTRY_BOOT_CS,8,0 - .quad 0x00cf9a000000ffff /* kernel 4GB code at 0x00000000 */ - .quad 0x00cf92000000ffff /* kernel 4GB data at 0x00000000 */ diff --git a/arch/i386/kernel/signal.c b/arch/i386/kernel/signal.c deleted file mode 100644 index f5dd85656c1..00000000000 --- a/arch/i386/kernel/signal.c +++ /dev/null @@ -1,667 +0,0 @@ -/* - * linux/arch/i386/kernel/signal.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - * - * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson - * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes - */ - -#include <linux/sched.h> -#include <linux/mm.h> -#include <linux/smp.h> -#include <linux/kernel.h> -#include <linux/signal.h> -#include <linux/errno.h> -#include <linux/wait.h> -#include <linux/unistd.h> -#include <linux/stddef.h> -#include <linux/personality.h> -#include <linux/suspend.h> -#include <linux/ptrace.h> -#include <linux/elf.h> -#include <linux/binfmts.h> -#include <asm/processor.h> -#include <asm/ucontext.h> -#include <asm/uaccess.h> -#include <asm/i387.h> -#include "sigframe.h" - -#define DEBUG_SIG 0 - -#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) - -/* - * Atomically swap in the new signal mask, and wait for a signal. - */ -asmlinkage int -sys_sigsuspend(int history0, int history1, old_sigset_t mask) -{ - mask &= _BLOCKABLE; - spin_lock_irq(¤t->sighand->siglock); - current->saved_sigmask = current->blocked; - siginitset(¤t->blocked, mask); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - current->state = TASK_INTERRUPTIBLE; - schedule(); - set_thread_flag(TIF_RESTORE_SIGMASK); - return -ERESTARTNOHAND; -} - -asmlinkage int -sys_sigaction(int sig, const struct old_sigaction __user *act, - struct old_sigaction __user *oact) -{ - struct k_sigaction new_ka, old_ka; - int ret; - - if (act) { - old_sigset_t mask; - if (!access_ok(VERIFY_READ, act, sizeof(*act)) || - __get_user(new_ka.sa.sa_handler, &act->sa_handler) || - __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) - return -EFAULT; - __get_user(new_ka.sa.sa_flags, &act->sa_flags); - __get_user(mask, &act->sa_mask); - siginitset(&new_ka.sa.sa_mask, mask); - } - - ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); - - if (!ret && oact) { - if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || - __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || - __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) - return -EFAULT; - __put_user(old_ka.sa.sa_flags, &oact->sa_flags); - __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); - } - - return ret; -} - -asmlinkage int -sys_sigaltstack(unsigned long ebx) -{ - /* This is needed to make gcc realize it doesn't own the "struct pt_regs" */ - struct pt_regs *regs = (struct pt_regs *)&ebx; - const stack_t __user *uss = (const stack_t __user *)ebx; - stack_t __user *uoss = (stack_t __user *)regs->ecx; - - return do_sigaltstack(uss, uoss, regs->esp); -} - - -/* - * Do a signal return; undo the signal stack. - */ - -static int -restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax) -{ - unsigned int err = 0; - - /* Always make any pending restarted system calls return -EINTR */ - current_thread_info()->restart_block.fn = do_no_restart_syscall; - -#define COPY(x) err |= __get_user(regs->x, &sc->x) - -#define COPY_SEG(seg) \ - { unsigned short tmp; \ - err |= __get_user(tmp, &sc->seg); \ - regs->x##seg = tmp; } - -#define COPY_SEG_STRICT(seg) \ - { unsigned short tmp; \ - err |= __get_user(tmp, &sc->seg); \ - regs->x##seg = tmp|3; } - -#define GET_SEG(seg) \ - { unsigned short tmp; \ - err |= __get_user(tmp, &sc->seg); \ - loadsegment(seg,tmp); } - -#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_RF | \ - X86_EFLAGS_OF | X86_EFLAGS_DF | \ - X86_EFLAGS_TF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \ - X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF) - - GET_SEG(gs); - COPY_SEG(fs); - COPY_SEG(es); - COPY_SEG(ds); - COPY(edi); - COPY(esi); - COPY(ebp); - COPY(esp); - COPY(ebx); - COPY(edx); - COPY(ecx); - COPY(eip); - COPY_SEG_STRICT(cs); - COPY_SEG_STRICT(ss); - - { - unsigned int tmpflags; - err |= __get_user(tmpflags, &sc->eflags); - regs->eflags = (regs->eflags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); - regs->orig_eax = -1; /* disable syscall checks */ - } - - { - struct _fpstate __user * buf; - err |= __get_user(buf, &sc->fpstate); - if (buf) { - if (!access_ok(VERIFY_READ, buf, sizeof(*buf))) - goto badframe; - err |= restore_i387(buf); - } else { - struct task_struct *me = current; - if (used_math()) { - clear_fpu(me); - clear_used_math(); - } - } - } - - err |= __get_user(*peax, &sc->eax); - return err; - -badframe: - return 1; -} - -asmlinkage int sys_sigreturn(unsigned long __unused) -{ - struct pt_regs *regs = (struct pt_regs *) &__unused; - struct sigframe __user *frame = (struct sigframe __user *)(regs->esp - 8); - sigset_t set; - int eax; - - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__get_user(set.sig[0], &frame->sc.oldmask) - || (_NSIG_WORDS > 1 - && __copy_from_user(&set.sig[1], &frame->extramask, - sizeof(frame->extramask)))) - goto badframe; - - sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sighand->siglock); - current->blocked = set; - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - if (restore_sigcontext(regs, &frame->sc, &eax)) - goto badframe; - return eax; - -badframe: - if (show_unhandled_signals && printk_ratelimit()) - printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" - " esp:%lx oeax:%lx\n", - current->pid > 1 ? KERN_INFO : KERN_EMERG, - current->comm, current->pid, frame, regs->eip, - regs->esp, regs->orig_eax); - - force_sig(SIGSEGV, current); - return 0; -} - -asmlinkage int sys_rt_sigreturn(unsigned long __unused) -{ - struct pt_regs *regs = (struct pt_regs *) &__unused; - struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs->esp - 4); - sigset_t set; - int eax; - - if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) - goto badframe; - if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) - goto badframe; - - sigdelsetmask(&set, ~_BLOCKABLE); - spin_lock_irq(¤t->sighand->siglock); - current->blocked = set; - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - - if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) - goto badframe; - - if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->esp) == -EFAULT) - goto badframe; - - return eax; - -badframe: - force_sig(SIGSEGV, current); - return 0; -} - -/* - * Set up a signal frame. - */ - -static int -setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, - struct pt_regs *regs, unsigned long mask) -{ - int tmp, err = 0; - - err |= __put_user(regs->xfs, (unsigned int __user *)&sc->fs); - savesegment(gs, tmp); - err |= __put_user(tmp, (unsigned int __user *)&sc->gs); - - err |= __put_user(regs->xes, (unsigned int __user *)&sc->es); - err |= __put_user(regs->xds, (unsigned int __user *)&sc->ds); - err |= __put_user(regs->edi, &sc->edi); - err |= __put_user(regs->esi, &sc->esi); - err |= __put_user(regs->ebp, &sc->ebp); - err |= __put_user(regs->esp, &sc->esp); - err |= __put_user(regs->ebx, &sc->ebx); - err |= __put_user(regs->edx, &sc->edx); - err |= __put_user(regs->ecx, &sc->ecx); - err |= __put_user(regs->eax, &sc->eax); - err |= __put_user(current->thread.trap_no, &sc->trapno); - err |= __put_user(current->thread.error_code, &sc->err); - err |= __put_user(regs->eip, &sc->eip); - err |= __put_user(regs->xcs, (unsigned int __user *)&sc->cs); - err |= __put_user(regs->eflags, &sc->eflags); - err |= __put_user(regs->esp, &sc->esp_at_signal); - err |= __put_user(regs->xss, (unsigned int __user *)&sc->ss); - - tmp = save_i387(fpstate); - if (tmp < 0) - err = 1; - else - err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate); - - /* non-iBCS2 extensions.. */ - err |= __put_user(mask, &sc->oldmask); - err |= __put_user(current->thread.cr2, &sc->cr2); - - return err; -} - -/* - * Determine which stack to use.. - */ -static inline void __user * -get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) -{ - unsigned long esp; - - /* Default to using normal stack */ - esp = regs->esp; - - /* This is the X/Open sanctioned signal stack switching. */ - if (ka->sa.sa_flags & SA_ONSTACK) { - if (sas_ss_flags(esp) == 0) - esp = current->sas_ss_sp + current->sas_ss_size; - } - - /* This is the legacy signal stack switching. */ - else if ((regs->xss & 0xffff) != __USER_DS && - !(ka->sa.sa_flags & SA_RESTORER) && - ka->sa.sa_restorer) { - esp = (unsigned long) ka->sa.sa_restorer; - } - - esp -= frame_size; - /* Align the stack pointer according to the i386 ABI, - * i.e. so that on function entry ((sp + 4) & 15) == 0. */ - esp = ((esp + 4) & -16ul) - 4; - return (void __user *) esp; -} - -/* These symbols are defined with the addresses in the vsyscall page. - See vsyscall-sigreturn.S. */ -extern void __user __kernel_sigreturn; -extern void __user __kernel_rt_sigreturn; - -static int setup_frame(int sig, struct k_sigaction *ka, - sigset_t *set, struct pt_regs * regs) -{ - void __user *restorer; - struct sigframe __user *frame; - int err = 0; - int usig; - - frame = get_sigframe(ka, regs, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - goto give_sigsegv; - - usig = current_thread_info()->exec_domain - && current_thread_info()->exec_domain->signal_invmap - && sig < 32 - ? current_thread_info()->exec_domain->signal_invmap[sig] - : sig; - - err = __put_user(usig, &frame->sig); - if (err) - goto give_sigsegv; - - err = setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]); - if (err) - goto give_sigsegv; - - if (_NSIG_WORDS > 1) { - err = __copy_to_user(&frame->extramask, &set->sig[1], - sizeof(frame->extramask)); - if (err) - goto give_sigsegv; - } - - if (current->binfmt->hasvdso) - restorer = (void *)VDSO_SYM(&__kernel_sigreturn); - else - restorer = (void *)&frame->retcode; - if (ka->sa.sa_flags & SA_RESTORER) - restorer = ka->sa.sa_restorer; - - /* Set up to return from userspace. */ - err |= __put_user(restorer, &frame->pretcode); - - /* - * This is popl %eax ; movl $,%eax ; int $0x80 - * - * WE DO NOT USE IT ANY MORE! It's only left here for historical - * reasons and because gdb uses it as a signature to notice - * signal handler stack frames. - */ - err |= __put_user(0xb858, (short __user *)(frame->retcode+0)); - err |= __put_user(__NR_sigreturn, (int __user *)(frame->retcode+2)); - err |= __put_user(0x80cd, (short __user *)(frame->retcode+6)); - - if (err) - goto give_sigsegv; - - /* Set up registers for signal handler */ - regs->esp = (unsigned long) frame; - regs->eip = (unsigned long) ka->sa.sa_handler; - regs->eax = (unsigned long) sig; - regs->edx = (unsigned long) 0; - regs->ecx = (unsigned long) 0; - - set_fs(USER_DS); - regs->xds = __USER_DS; - regs->xes = __USER_DS; - regs->xss = __USER_DS; - regs->xcs = __USER_CS; - - /* - * Clear TF when entering the signal handler, but - * notify any tracer that was single-stepping it. - * The tracer may want to single-step inside the - * handler too. - */ - regs->eflags &= ~TF_MASK; - if (test_thread_flag(TIF_SINGLESTEP)) - ptrace_notify(SIGTRAP); - -#if DEBUG_SIG - printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", - current->comm, current->pid, frame, regs->eip, frame->pretcode); -#endif - - return 0; - -give_sigsegv: - force_sigsegv(sig, current); - return -EFAULT; -} - -static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, - sigset_t *set, struct pt_regs * regs) -{ - void __user *restorer; - struct rt_sigframe __user *frame; - int err = 0; - int usig; - - frame = get_sigframe(ka, regs, sizeof(*frame)); - - if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) - goto give_sigsegv; - - usig = current_thread_info()->exec_domain - && current_thread_info()->exec_domain->signal_invmap - && sig < 32 - ? current_thread_info()->exec_domain->signal_invmap[sig] - : sig; - - err |= __put_user(usig, &frame->sig); - err |= __put_user(&frame->info, &frame->pinfo); - err |= __put_user(&frame->uc, &frame->puc); - err |= copy_siginfo_to_user(&frame->info, info); - if (err) - goto give_sigsegv; - - /* Create the ucontext. */ - err |= __put_user(0, &frame->uc.uc_flags); - err |= __put_user(0, &frame->uc.uc_link); - err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); - err |= __put_user(sas_ss_flags(regs->esp), - &frame->uc.uc_stack.ss_flags); - err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); - err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, - regs, set->sig[0]); - err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); - if (err) - goto give_sigsegv; - - /* Set up to return from userspace. */ - restorer = (void *)VDSO_SYM(&__kernel_rt_sigreturn); - if (ka->sa.sa_flags & SA_RESTORER) - restorer = ka->sa.sa_restorer; - err |= __put_user(restorer, &frame->pretcode); - - /* - * This is movl $,%eax ; int $0x80 - * - * WE DO NOT USE IT ANY MORE! It's only left here for historical - * reasons and because gdb uses it as a signature to notice - * signal handler stack frames. - */ - err |= __put_user(0xb8, (char __user *)(frame->retcode+0)); - err |= __put_user(__NR_rt_sigreturn, (int __user *)(frame->retcode+1)); - err |= __put_user(0x80cd, (short __user *)(frame->retcode+5)); - - if (err) - goto give_sigsegv; - - /* Set up registers for signal handler */ - regs->esp = (unsigned long) frame; - regs->eip = (unsigned long) ka->sa.sa_handler; - regs->eax = (unsigned long) usig; - regs->edx = (unsigned long) &frame->info; - regs->ecx = (unsigned long) &frame->uc; - - set_fs(USER_DS); - regs->xds = __USER_DS; - regs->xes = __USER_DS; - regs->xss = __USER_DS; - regs->xcs = __USER_CS; - - /* - * Clear TF when entering the signal handler, but - * notify any tracer that was single-stepping it. - * The tracer may want to single-step inside the - * handler too. - */ - regs->eflags &= ~TF_MASK; - if (test_thread_flag(TIF_SINGLESTEP)) - ptrace_notify(SIGTRAP); - -#if DEBUG_SIG - printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", - current->comm, current->pid, frame, regs->eip, frame->pretcode); -#endif - - return 0; - -give_sigsegv: - force_sigsegv(sig, current); - return -EFAULT; -} - -/* - * OK, we're invoking a handler - */ - -static int -handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, - sigset_t *oldset, struct pt_regs * regs) -{ - int ret; - - /* Are we from a system call? */ - if (regs->orig_eax >= 0) { - /* If so, check system call restarting.. */ - switch (regs->eax) { - case -ERESTART_RESTARTBLOCK: - case -ERESTARTNOHAND: - regs->eax = -EINTR; - break; - - case -ERESTARTSYS: - if (!(ka->sa.sa_flags & SA_RESTART)) { - regs->eax = -EINTR; - break; - } - /* fallthrough */ - case -ERESTARTNOINTR: - regs->eax = regs->orig_eax; - regs->eip -= 2; - } - } - - /* - * If TF is set due to a debugger (PT_DTRACE), clear the TF flag so - * that register information in the sigcontext is correct. - */ - if (unlikely(regs->eflags & TF_MASK) - && likely(current->ptrace & PT_DTRACE)) { - current->ptrace &= ~PT_DTRACE; - regs->eflags &= ~TF_MASK; - } - - /* Set up the stack frame */ - if (ka->sa.sa_flags & SA_SIGINFO) - ret = setup_rt_frame(sig, ka, info, oldset, regs); - else - ret = setup_frame(sig, ka, oldset, regs); - - if (ret == 0) { - spin_lock_irq(¤t->sighand->siglock); - sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); - if (!(ka->sa.sa_flags & SA_NODEFER)) - sigaddset(¤t->blocked,sig); - recalc_sigpending(); - spin_unlock_irq(¤t->sighand->siglock); - } - - return ret; -} - -/* - * Note that 'init' is a special process: it doesn't get signals it doesn't - * want to handle. Thus you cannot kill init even with a SIGKILL even by - * mistake. - */ -static void fastcall do_signal(struct pt_regs *regs) -{ - siginfo_t info; - int signr; - struct k_sigaction ka; - sigset_t *oldset; - - /* - * We want the common case to go fast, which - * is why we may in certain cases get here from - * kernel mode. Just return without doing anything - * if so. vm86 regs switched out by assembly code - * before reaching here, so testing against kernel - * CS suffices. - */ - if (!user_mode(regs)) - return; - - if (test_thread_flag(TIF_RESTORE_SIGMASK)) - oldset = ¤t->saved_sigmask; - else - oldset = ¤t->blocked; - - signr = get_signal_to_deliver(&info, &ka, regs, NULL); - if (signr > 0) { - /* Reenable any watchpoints before delivering the - * signal to user space. The processor register will - * have been cleared if the watchpoint triggered - * inside the kernel. - */ - if (unlikely(current->thread.debugreg[7])) - set_debugreg(current->thread.debugreg[7], 7); - - /* Whee! Actually deliver the signal. */ - if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { - /* a signal was successfully delivered; the saved - * sigmask will have been stored in the signal frame, - * and will be restored by sigreturn, so we can simply - * clear the TIF_RESTORE_SIGMASK flag */ - if (test_thread_flag(TIF_RESTORE_SIGMASK)) - clear_thread_flag(TIF_RESTORE_SIGMASK); - } - - return; - } - - /* Did we come from a system call? */ - if (regs->orig_eax >= 0) { - /* Restart the system call - no handlers present */ - switch (regs->eax) { - case -ERESTARTNOHAND: - case -ERESTARTSYS: - case -ERESTARTNOINTR: - regs->eax = regs->orig_eax; - regs->eip -= 2; - break; - - case -ERESTART_RESTARTBLOCK: - regs->eax = __NR_restart_syscall; - regs->eip -= 2; - break; - } - } - - /* if there's no signal to deliver, we just put the saved sigmask - * back */ - if (test_thread_flag(TIF_RESTORE_SIGMASK)) { - clear_thread_flag(TIF_RESTORE_SIGMASK); - sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); - } -} - -/* - * notification of userspace execution resumption - * - triggered by the TIF_WORK_MASK flags - */ -__attribute__((regparm(3))) -void do_notify_resume(struct pt_regs *regs, void *_unused, - __u32 thread_info_flags) -{ - /* Pending single-step? */ - if (thread_info_flags & _TIF_SINGLESTEP) { - regs->eflags |= TF_MASK; - clear_thread_flag(TIF_SINGLESTEP); - } - - /* deal with pending signal delivery */ - if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) - do_signal(regs); - - clear_thread_flag(TIF_IRET); -} diff --git a/arch/i386/kernel/tsc_sync.c b/arch/i386/kernel/tsc_sync.c deleted file mode 100644 index 12424629af8..00000000000 --- a/arch/i386/kernel/tsc_sync.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../x86_64/kernel/tsc_sync.c" diff --git a/arch/i386/kernel/vsyscall-int80.S b/arch/i386/kernel/vsyscall-int80.S deleted file mode 100644 index 530d0525e5e..00000000000 --- a/arch/i386/kernel/vsyscall-int80.S +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code for the vsyscall page. This version uses the old int $0x80 method. - * - * NOTE: - * 1) __kernel_vsyscall _must_ be first in this page. - * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S - * for details. - */ - - .text - .globl __kernel_vsyscall - .type __kernel_vsyscall,@function -__kernel_vsyscall: -.LSTART_vsyscall: - int $0x80 - ret -.LEND_vsyscall: - .size __kernel_vsyscall,.-.LSTART_vsyscall - .previous - - .section .eh_frame,"a",@progbits -.LSTARTFRAMEDLSI: - .long .LENDCIEDLSI-.LSTARTCIEDLSI -.LSTARTCIEDLSI: - .long 0 /* CIE ID */ - .byte 1 /* Version number */ - .string "zR" /* NUL-terminated augmentation string */ - .uleb128 1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 8 /* Return address register column */ - .uleb128 1 /* Augmentation value length */ - .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ - .byte 0x0c /* DW_CFA_def_cfa */ - .uleb128 4 - .uleb128 4 - .byte 0x88 /* DW_CFA_offset, column 0x8 */ - .uleb128 1 - .align 4 -.LENDCIEDLSI: - .long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */ -.LSTARTFDEDLSI: - .long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */ - .long .LSTART_vsyscall-. /* PC-relative start address */ - .long .LEND_vsyscall-.LSTART_vsyscall - .uleb128 0 - .align 4 -.LENDFDEDLSI: - .previous - -/* - * Get the common code for the sigreturn entry points. - */ -#include "vsyscall-sigreturn.S" diff --git a/arch/i386/kernel/vsyscall-note.S b/arch/i386/kernel/vsyscall-note.S deleted file mode 100644 index 07c0daf7823..00000000000 --- a/arch/i386/kernel/vsyscall-note.S +++ /dev/null @@ -1,45 +0,0 @@ -/* - * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. - * Here we can supply some information useful to userland. - */ - -#include <linux/version.h> -#include <linux/elfnote.h> - -/* Ideally this would use UTS_NAME, but using a quoted string here - doesn't work. Remember to change this when changing the - kernel's name. */ -ELFNOTE_START(Linux, 0, "a") - .long LINUX_VERSION_CODE -ELFNOTE_END - -#ifdef CONFIG_XEN -/* - * Add a special note telling glibc's dynamic linker a fake hardware - * flavor that it will use to choose the search path for libraries in the - * same way it uses real hardware capabilities like "mmx". - * We supply "nosegneg" as the fake capability, to indicate that we - * do not like negative offsets in instructions using segment overrides, - * since we implement those inefficiently. This makes it possible to - * install libraries optimized to avoid those access patterns in someplace - * like /lib/i686/tls/nosegneg. Note that an /etc/ld.so.conf.d/file - * corresponding to the bits here is needed to make ldconfig work right. - * It should contain: - * hwcap 1 nosegneg - * to match the mapping of bit to name that we give here. - * - * At runtime, the fake hardware feature will be considered to be present - * if its bit is set in the mask word. So, we start with the mask 0, and - * at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen. - */ - -#include "../xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */ - - .globl VDSO_NOTE_MASK -ELFNOTE_START(GNU, 2, "a") - .long 1 /* ncaps */ -VDSO_NOTE_MASK: - .long 0 /* mask */ - .byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */ -ELFNOTE_END -#endif diff --git a/arch/i386/kernel/vsyscall-sysenter.S b/arch/i386/kernel/vsyscall-sysenter.S deleted file mode 100644 index 1a36d26e15e..00000000000 --- a/arch/i386/kernel/vsyscall-sysenter.S +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Code for the vsyscall page. This version uses the sysenter instruction. - * - * NOTE: - * 1) __kernel_vsyscall _must_ be first in this page. - * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S - * for details. - */ - -/* - * The caller puts arg2 in %ecx, which gets pushed. The kernel will use - * %ecx itself for arg2. The pushing is because the sysexit instruction - * (found in entry.S) requires that we clobber %ecx with the desired %esp. - * User code might expect that %ecx is unclobbered though, as it would be - * for returning via the iret instruction, so we must push and pop. - * - * The caller puts arg3 in %edx, which the sysexit instruction requires - * for %eip. Thus, exactly as for arg2, we must push and pop. - * - * Arg6 is different. The caller puts arg6 in %ebp. Since the sysenter - * instruction clobbers %esp, the user's %esp won't even survive entry - * into the kernel. We store %esp in %ebp. Code in entry.S must fetch - * arg6 from the stack. - * - * You can not use this vsyscall for the clone() syscall because the - * three dwords on the parent stack do not get copied to the child. - */ - .text - .globl __kernel_vsyscall - .type __kernel_vsyscall,@function -__kernel_vsyscall: -.LSTART_vsyscall: - push %ecx -.Lpush_ecx: - push %edx -.Lpush_edx: - push %ebp -.Lenter_kernel: - movl %esp,%ebp - sysenter - - /* 7: align return point with nop's to make disassembly easier */ - .space 7,0x90 - - /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ - jmp .Lenter_kernel - /* 16: System call normal return point is here! */ - .globl SYSENTER_RETURN /* Symbol used by sysenter.c */ -SYSENTER_RETURN: - pop %ebp -.Lpop_ebp: - pop %edx -.Lpop_edx: - pop %ecx -.Lpop_ecx: - ret -.LEND_vsyscall: - .size __kernel_vsyscall,.-.LSTART_vsyscall - .previous - - .section .eh_frame,"a",@progbits -.LSTARTFRAMEDLSI: - .long .LENDCIEDLSI-.LSTARTCIEDLSI -.LSTARTCIEDLSI: - .long 0 /* CIE ID */ - .byte 1 /* Version number */ - .string "zR" /* NUL-terminated augmentation string */ - .uleb128 1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 8 /* Return address register column */ - .uleb128 1 /* Augmentation value length */ - .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ - .byte 0x0c /* DW_CFA_def_cfa */ - .uleb128 4 - .uleb128 4 - .byte 0x88 /* DW_CFA_offset, column 0x8 */ - .uleb128 1 - .align 4 -.LENDCIEDLSI: - .long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */ -.LSTARTFDEDLSI: - .long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */ - .long .LSTART_vsyscall-. /* PC-relative start address */ - .long .LEND_vsyscall-.LSTART_vsyscall - .uleb128 0 - /* What follows are the instructions for the table generation. - We have to record all changes of the stack pointer. */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lpush_ecx-.LSTART_vsyscall - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x08 /* RA at offset 8 now */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lpush_edx-.Lpush_ecx - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x0c /* RA at offset 12 now */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lenter_kernel-.Lpush_edx - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x10 /* RA at offset 16 now */ - .byte 0x85, 0x04 /* DW_CFA_offset %ebp -16 */ - /* Finally the epilogue. */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lpop_ebp-.Lenter_kernel - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x0c /* RA at offset 12 now */ - .byte 0xc5 /* DW_CFA_restore %ebp */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lpop_edx-.Lpop_ebp - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x08 /* RA at offset 8 now */ - .byte 0x04 /* DW_CFA_advance_loc4 */ - .long .Lpop_ecx-.Lpop_edx - .byte 0x0e /* DW_CFA_def_cfa_offset */ - .byte 0x04 /* RA at offset 4 now */ - .align 4 -.LENDFDEDLSI: - .previous - -/* - * Get the common code for the sigreturn entry points. - */ -#include "vsyscall-sigreturn.S" diff --git a/arch/i386/kernel/vsyscall.S b/arch/i386/kernel/vsyscall.S deleted file mode 100644 index b403890fe39..00000000000 --- a/arch/i386/kernel/vsyscall.S +++ /dev/null @@ -1,15 +0,0 @@ -#include <linux/init.h> - -__INITDATA - - .globl vsyscall_int80_start, vsyscall_int80_end -vsyscall_int80_start: - .incbin "arch/i386/kernel/vsyscall-int80.so" -vsyscall_int80_end: - - .globl vsyscall_sysenter_start, vsyscall_sysenter_end -vsyscall_sysenter_start: - .incbin "arch/i386/kernel/vsyscall-sysenter.so" -vsyscall_sysenter_end: - -__FINIT diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile deleted file mode 100644 index 4d105fdfe81..00000000000 --- a/arch/i386/lib/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Makefile for i386-specific library files.. -# - - -lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ - bitops.o semaphore.o string.o - -lib-$(CONFIG_X86_USE_3DNOW) += mmx.o - -obj-$(CONFIG_SMP) += msr-on-cpu.o diff --git a/arch/i386/mach-generic/Makefile b/arch/i386/mach-generic/Makefile deleted file mode 100644 index 6914485c0d8..00000000000 --- a/arch/i386/mach-generic/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -# -# Makefile for the generic architecture -# - -EXTRA_CFLAGS := -Iarch/i386/kernel - -obj-y := probe.o summit.o bigsmp.o es7000.o default.o ../mach-es7000/ diff --git a/arch/i386/mach-voyager/Makefile b/arch/i386/mach-voyager/Makefile deleted file mode 100644 index 33b74cf0dd2..00000000000 --- a/arch/i386/mach-voyager/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# -# Makefile for the linux kernel. -# - -EXTRA_CFLAGS := -Iarch/i386/kernel -obj-y := setup.o voyager_basic.o voyager_thread.o - -obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o diff --git a/arch/i386/mm/Makefile b/arch/i386/mm/Makefile deleted file mode 100644 index 80908b5aa60..00000000000 --- a/arch/i386/mm/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# -# Makefile for the linux i386-specific parts of the memory manager. -# - -obj-y := init.o pgtable.o fault.o ioremap.o extable.o pageattr.o mmap.o - -obj-$(CONFIG_NUMA) += discontig.o -obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_HIGHMEM) += highmem.o -obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap.o diff --git a/arch/i386/pci/Makefile b/arch/i386/pci/Makefile deleted file mode 100644 index 44650e03308..00000000000 --- a/arch/i386/pci/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -obj-y := i386.o init.o - -obj-$(CONFIG_PCI_BIOS) += pcbios.o -obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o -obj-$(CONFIG_PCI_DIRECT) += direct.o - -pci-y := fixup.o -pci-$(CONFIG_ACPI) += acpi.o -pci-y += legacy.o irq.o - -pci-$(CONFIG_X86_VISWS) := visws.o fixup.o -pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o - -obj-y += $(pci-y) common.o early.o diff --git a/arch/i386/xen/mmu.c b/arch/i386/xen/mmu.c deleted file mode 100644 index 4ae038aa6c2..00000000000 --- a/arch/i386/xen/mmu.c +++ /dev/null @@ -1,564 +0,0 @@ -/* - * Xen mmu operations - * - * This file contains the various mmu fetch and update operations. - * The most important job they must perform is the mapping between the - * domain's pfn and the overall machine mfns. - * - * Xen allows guests to directly update the pagetable, in a controlled - * fashion. In other words, the guest modifies the same pagetable - * that the CPU actually uses, which eliminates the overhead of having - * a separate shadow pagetable. - * - * In order to allow this, it falls on the guest domain to map its - * notion of a "physical" pfn - which is just a domain-local linear - * address - into a real "machine address" which the CPU's MMU can - * use. - * - * A pgd_t/pmd_t/pte_t will typically contain an mfn, and so can be - * inserted directly into the pagetable. When creating a new - * pte/pmd/pgd, it converts the passed pfn into an mfn. Conversely, - * when reading the content back with __(pgd|pmd|pte)_val, it converts - * the mfn back into a pfn. - * - * The other constraint is that all pages which make up a pagetable - * must be mapped read-only in the guest. This prevents uncontrolled - * guest updates to the pagetable. Xen strictly enforces this, and - * will disallow any pagetable update which will end up mapping a - * pagetable page RW, and will disallow using any writable page as a - * pagetable. - * - * Naively, when loading %cr3 with the base of a new pagetable, Xen - * would need to validate the whole pagetable before going on. - * Naturally, this is quite slow. The solution is to "pin" a - * pagetable, which enforces all the constraints on the pagetable even - * when it is not actively in use. This menas that Xen can be assured - * that it is still valid when you do load it into %cr3, and doesn't - * need to revalidate it. - * - * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007 - */ -#include <linux/sched.h> -#include <linux/highmem.h> -#include <linux/bug.h> -#include <linux/sched.h> - -#include <asm/pgtable.h> -#include <asm/tlbflush.h> -#include <asm/mmu_context.h> -#include <asm/paravirt.h> - -#include <asm/xen/hypercall.h> -#include <asm/xen/hypervisor.h> - -#include <xen/page.h> -#include <xen/interface/xen.h> - -#include "multicalls.h" -#include "mmu.h" - -xmaddr_t arbitrary_virt_to_machine(unsigned long address) -{ - pte_t *pte = lookup_address(address); - unsigned offset = address & PAGE_MASK; - - BUG_ON(pte == NULL); - - return XMADDR((pte_mfn(*pte) << PAGE_SHIFT) + offset); -} - -void make_lowmem_page_readonly(void *vaddr) -{ - pte_t *pte, ptev; - unsigned long address = (unsigned long)vaddr; - - pte = lookup_address(address); - BUG_ON(pte == NULL); - - ptev = pte_wrprotect(*pte); - - if (HYPERVISOR_update_va_mapping(address, ptev, 0)) - BUG(); -} - -void make_lowmem_page_readwrite(void *vaddr) -{ - pte_t *pte, ptev; - unsigned long address = (unsigned long)vaddr; - - pte = lookup_address(address); - BUG_ON(pte == NULL); - - ptev = pte_mkwrite(*pte); - - if (HYPERVISOR_update_va_mapping(address, ptev, 0)) - BUG(); -} - - -void xen_set_pmd(pmd_t *ptr, pmd_t val) -{ - struct multicall_space mcs; - struct mmu_update *u; - - preempt_disable(); - - mcs = xen_mc_entry(sizeof(*u)); - u = mcs.args; - u->ptr = virt_to_machine(ptr).maddr; - u->val = pmd_val_ma(val); - MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF); - - xen_mc_issue(PARAVIRT_LAZY_MMU); - - preempt_enable(); -} - -/* - * Associate a virtual page frame with a given physical page frame - * and protection flags for that frame. - */ -void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) -{ - pgd_t *pgd; - pud_t *pud; - pmd_t *pmd; - pte_t *pte; - - pgd = swapper_pg_dir + pgd_index(vaddr); - if (pgd_none(*pgd)) { - BUG(); - return; - } - pud = pud_offset(pgd, vaddr); - if (pud_none(*pud)) { - BUG(); - return; - } - pmd = pmd_offset(pud, vaddr); - if (pmd_none(*pmd)) { - BUG(); - return; - } - pte = pte_offset_kernel(pmd, vaddr); - /* <mfn,flags> stored as-is, to permit clearing entries */ - xen_set_pte(pte, mfn_pte(mfn, flags)); - - /* - * It's enough to flush this one mapping. - * (PGE mappings get flushed as well) - */ - __flush_tlb_one(vaddr); -} - -void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, - pte_t *ptep, pte_t pteval) -{ - if (mm == current->mm || mm == &init_mm) { - if (xen_get_lazy_mode() == PARAVIRT_LAZY_MMU) { - struct multicall_space mcs; - mcs = xen_mc_entry(0); - - MULTI_update_va_mapping(mcs.mc, addr, pteval, 0); - xen_mc_issue(PARAVIRT_LAZY_MMU); - return; - } else - if (HYPERVISOR_update_va_mapping(addr, pteval, 0) == 0) - return; - } - xen_set_pte(ptep, pteval); -} - -#ifdef CONFIG_X86_PAE -void xen_set_pud(pud_t *ptr, pud_t val) -{ - struct multicall_space mcs; - struct mmu_update *u; - - preempt_disable(); - - mcs = xen_mc_entry(sizeof(*u)); - u = mcs.args; - u->ptr = virt_to_machine(ptr).maddr; - u->val = pud_val_ma(val); - MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF); - - xen_mc_issue(PARAVIRT_LAZY_MMU); - - preempt_enable(); -} - -void xen_set_pte(pte_t *ptep, pte_t pte) -{ - ptep->pte_high = pte.pte_high; - smp_wmb(); - ptep->pte_low = pte.pte_low; -} - -void xen_set_pte_atomic(pte_t *ptep, pte_t pte) -{ - set_64bit((u64 *)ptep, pte_val_ma(pte)); -} - -void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) -{ - ptep->pte_low = 0; - smp_wmb(); /* make sure low gets written first */ - ptep->pte_high = 0; -} - -void xen_pmd_clear(pmd_t *pmdp) -{ - xen_set_pmd(pmdp, __pmd(0)); -} - -unsigned long long xen_pte_val(pte_t pte) -{ - unsigned long long ret = 0; - - if (pte.pte_low) { - ret = ((unsigned long long)pte.pte_high << 32) | pte.pte_low; - ret = machine_to_phys(XMADDR(ret)).paddr | 1; - } - - return ret; -} - -unsigned long long xen_pmd_val(pmd_t pmd) -{ - unsigned long long ret = pmd.pmd; - if (ret) - ret = machine_to_phys(XMADDR(ret)).paddr | 1; - return ret; -} - -unsigned long long xen_pgd_val(pgd_t pgd) -{ - unsigned long long ret = pgd.pgd; - if (ret) - ret = machine_to_phys(XMADDR(ret)).paddr | 1; - return ret; -} - -pte_t xen_make_pte(unsigned long long pte) -{ - if (pte & 1) - pte = phys_to_machine(XPADDR(pte)).maddr; - - return (pte_t){ pte, pte >> 32 }; -} - -pmd_t xen_make_pmd(unsigned long long pmd) -{ - if (pmd & 1) - pmd = phys_to_machine(XPADDR(pmd)).maddr; - - return (pmd_t){ pmd }; -} - -pgd_t xen_make_pgd(unsigned long long pgd) -{ - if (pgd & _PAGE_PRESENT) - pgd = phys_to_machine(XPADDR(pgd)).maddr; - - return (pgd_t){ pgd }; -} -#else /* !PAE */ -void xen_set_pte(pte_t *ptep, pte_t pte) -{ - *ptep = pte; -} - -unsigned long xen_pte_val(pte_t pte) -{ - unsigned long ret = pte.pte_low; - - if (ret & _PAGE_PRESENT) - ret = machine_to_phys(XMADDR(ret)).paddr; - - return ret; -} - -unsigned long xen_pgd_val(pgd_t pgd) -{ - unsigned long ret = pgd.pgd; - if (ret) - ret = machine_to_phys(XMADDR(ret)).paddr | 1; - return ret; -} - -pte_t xen_make_pte(unsigned long pte) -{ - if (pte & _PAGE_PRESENT) - pte = phys_to_machine(XPADDR(pte)).maddr; - - return (pte_t){ pte }; -} - -pgd_t xen_make_pgd(unsigned long pgd) -{ - if (pgd & _PAGE_PRESENT) - pgd = phys_to_machine(XPADDR(pgd)).maddr; - - return (pgd_t){ pgd }; -} -#endif /* CONFIG_X86_PAE */ - - - -/* - (Yet another) pagetable walker. This one is intended for pinning a - pagetable. This means that it walks a pagetable and calls the - callback function on each page it finds making up the page table, - at every level. It walks the entire pagetable, but it only bothers - pinning pte pages which are below pte_limit. In the normal case - this will be TASK_SIZE, but at boot we need to pin up to - FIXADDR_TOP. But the important bit is that we don't pin beyond - there, because then we start getting into Xen's ptes. -*/ -static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, unsigned), - unsigned long limit) -{ - pgd_t *pgd = pgd_base; - int flush = 0; - unsigned long addr = 0; - unsigned long pgd_next; - - BUG_ON(limit > FIXADDR_TOP); - - if (xen_feature(XENFEAT_auto_translated_physmap)) - return 0; - - for (; addr != FIXADDR_TOP; pgd++, addr = pgd_next) { - pud_t *pud; - unsigned long pud_limit, pud_next; - - pgd_next = pud_limit = pgd_addr_end(addr, FIXADDR_TOP); - - if (!pgd_val(*pgd)) - continue; - - pud = pud_offset(pgd, 0); - - if (PTRS_PER_PUD > 1) /* not folded */ - flush |= (*func)(virt_to_page(pud), 0); - - for (; addr != pud_limit; pud++, addr = pud_next) { - pmd_t *pmd; - unsigned long pmd_limit; - - pud_next = pud_addr_end(addr, pud_limit); - - if (pud_next < limit) - pmd_limit = pud_next; - else - pmd_limit = limit; - - if (pud_none(*pud)) - continue; - - pmd = pmd_offset(pud, 0); - - if (PTRS_PER_PMD > 1) /* not folded */ - flush |= (*func)(virt_to_page(pmd), 0); - - for (; addr != pmd_limit; pmd++) { - addr += (PAGE_SIZE * PTRS_PER_PTE); - if ((pmd_limit-1) < (addr-1)) { - addr = pmd_limit; - break; - } - - if (pmd_none(*pmd)) - continue; - - flush |= (*func)(pmd_page(*pmd), 0); - } - } - } - - flush |= (*func)(virt_to_page(pgd_base), UVMF_TLB_FLUSH); - - return flush; -} - -static int pin_page(struct page *page, unsigned flags) -{ - unsigned pgfl = test_and_set_bit(PG_pinned, &page->flags); - int flush; - - if (pgfl) - flush = 0; /* already pinned */ - else if (PageHighMem(page)) - /* kmaps need flushing if we found an unpinned - highpage */ - flush = 1; - else { - void *pt = lowmem_page_address(page); - unsigned long pfn = page_to_pfn(page); - struct multicall_space mcs = __xen_mc_entry(0); - - flush = 0; - - MULTI_update_va_mapping(mcs.mc, (unsigned long)pt, - pfn_pte(pfn, PAGE_KERNEL_RO), - flags); - } - - return flush; -} - -/* This is called just after a mm has been created, but it has not - been used yet. We need to make sure that its pagetable is all - read-only, and can be pinned. */ -void xen_pgd_pin(pgd_t *pgd) -{ - struct multicall_space mcs; - struct mmuext_op *op; - - xen_mc_batch(); - - if (pgd_walk(pgd, pin_page, TASK_SIZE)) { - /* re-enable interrupts for kmap_flush_unused */ - xen_mc_issue(0); - kmap_flush_unused(); - xen_mc_batch(); - } - - mcs = __xen_mc_entry(sizeof(*op)); - op = mcs.args; - -#ifdef CONFIG_X86_PAE - op->cmd = MMUEXT_PIN_L3_TABLE; -#else - op->cmd = MMUEXT_PIN_L2_TABLE; -#endif - op->arg1.mfn = pfn_to_mfn(PFN_DOWN(__pa(pgd))); - MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); - - xen_mc_issue(0); -} - -/* The init_mm pagetable is really pinned as soon as its created, but - that's before we have page structures to store the bits. So do all - the book-keeping now. */ -static __init int mark_pinned(struct page *page, unsigned flags) -{ - SetPagePinned(page); - return 0; -} - -void __init xen_mark_init_mm_pinned(void) -{ - pgd_walk(init_mm.pgd, mark_pinned, FIXADDR_TOP); -} - -static int unpin_page(struct page *page, unsigned flags) -{ - unsigned pgfl = test_and_clear_bit(PG_pinned, &page->flags); - - if (pgfl && !PageHighMem(page)) { - void *pt = lowmem_page_address(page); - unsigned long pfn = page_to_pfn(page); - struct multicall_space mcs = __xen_mc_entry(0); - - MULTI_update_va_mapping(mcs.mc, (unsigned long)pt, - pfn_pte(pfn, PAGE_KERNEL), - flags); - } - - return 0; /* never need to flush on unpin */ -} - -/* Release a pagetables pages back as normal RW */ -static void xen_pgd_unpin(pgd_t *pgd) -{ - struct mmuext_op *op; - struct multicall_space mcs; - - xen_mc_batch(); - - mcs = __xen_mc_entry(sizeof(*op)); - - op = mcs.args; - op->cmd = MMUEXT_UNPIN_TABLE; - op->arg1.mfn = pfn_to_mfn(PFN_DOWN(__pa(pgd))); - - MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); - - pgd_walk(pgd, unpin_page, TASK_SIZE); - - xen_mc_issue(0); -} - -void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next) -{ - spin_lock(&next->page_table_lock); - xen_pgd_pin(next->pgd); - spin_unlock(&next->page_table_lock); -} - -void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) -{ - spin_lock(&mm->page_table_lock); - xen_pgd_pin(mm->pgd); - spin_unlock(&mm->page_table_lock); -} - - -#ifdef CONFIG_SMP -/* Another cpu may still have their %cr3 pointing at the pagetable, so - we need to repoint it somewhere else before we can unpin it. */ -static void drop_other_mm_ref(void *info) -{ - struct mm_struct *mm = info; - - if (__get_cpu_var(cpu_tlbstate).active_mm == mm) - leave_mm(smp_processor_id()); -} - -static void drop_mm_ref(struct mm_struct *mm) -{ - if (current->active_mm == mm) { - if (current->mm == mm) - load_cr3(swapper_pg_dir); - else - leave_mm(smp_processor_id()); - } - - if (!cpus_empty(mm->cpu_vm_mask)) - xen_smp_call_function_mask(mm->cpu_vm_mask, drop_other_mm_ref, - mm, 1); -} -#else -static void drop_mm_ref(struct mm_struct *mm) -{ - if (current->active_mm == mm) - load_cr3(swapper_pg_dir); -} -#endif - -/* - * While a process runs, Xen pins its pagetables, which means that the - * hypervisor forces it to be read-only, and it controls all updates - * to it. This means that all pagetable updates have to go via the - * hypervisor, which is moderately expensive. - * - * Since we're pulling the pagetable down, we switch to use init_mm, - * unpin old process pagetable and mark it all read-write, which - * allows further operations on it to be simple memory accesses. - * - * The only subtle point is that another CPU may be still using the - * pagetable because of lazy tlb flushing. This means we need need to - * switch all CPUs off this pagetable before we can unpin it. - */ -void xen_exit_mmap(struct mm_struct *mm) -{ - get_cpu(); /* make sure we don't move around */ - drop_mm_ref(mm); - put_cpu(); - - spin_lock(&mm->page_table_lock); - xen_pgd_unpin(mm->pgd); - spin_unlock(&mm->page_table_lock); -} diff --git a/arch/ia64/ia32/audit.c b/arch/ia64/ia32/audit.c index 8850fe40ea3..5e901c75df1 100644 --- a/arch/ia64/ia32/audit.c +++ b/arch/ia64/ia32/audit.c @@ -1,4 +1,4 @@ -#include <asm-i386/unistd.h> +#include <asm-x86/unistd_32.h> unsigned ia32_dir_class[] = { #include <asm-generic/audit_dir_write.h> diff --git a/arch/mips/au1000/common/pci.c b/arch/mips/au1000/common/pci.c index 6c25e6c09f7..9be99a68932 100644 --- a/arch/mips/au1000/common/pci.c +++ b/arch/mips/au1000/common/pci.c @@ -74,6 +74,7 @@ static int __init au1x_pci_setup(void) printk(KERN_ERR "Unable to ioremap pci space\n"); return 1; } + au1x_controller.io_map_base = virt_io_addr; #ifdef CONFIG_DMA_NONCOHERENT { diff --git a/arch/mips/au1000/mtx-1/board_setup.c b/arch/mips/au1000/mtx-1/board_setup.c index 7bc5af8917d..2c460c11657 100644 --- a/arch/mips/au1000/mtx-1/board_setup.c +++ b/arch/mips/au1000/mtx-1/board_setup.c @@ -54,11 +54,11 @@ void board_reset (void) void __init board_setup(void) { -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) // enable USB power switch au_writel( au_readl(GPIO2_DIR) | 0x10, GPIO2_DIR ); au_writel( 0x100000, GPIO2_OUTPUT ); -#endif // defined (CONFIG_USB_OHCI) +#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ #ifdef CONFIG_PCI #if defined(__MIPSEB__) diff --git a/arch/mips/au1000/pb1000/board_setup.c b/arch/mips/au1000/pb1000/board_setup.c index 824cfafaff9..0aed89114bf 100644 --- a/arch/mips/au1000/pb1000/board_setup.c +++ b/arch/mips/au1000/pb1000/board_setup.c @@ -54,7 +54,7 @@ void __init board_setup(void) au_writel(0, SYS_PINSTATERD); udelay(100); -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) /* zero and disable FREQ2 */ sys_freqctrl = au_readl(SYS_FREQCTRL0); sys_freqctrl &= ~0xFFF00000; @@ -102,7 +102,7 @@ void __init board_setup(void) /* * Route 48MHz FREQ2 into USB Host and/or Device */ -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); #endif au_writel(sys_clksrc, SYS_CLKSRC); @@ -116,7 +116,7 @@ void __init board_setup(void) au_writel(pin_func, SYS_PINFUNC); au_writel(0x2800, SYS_TRIOUTCLR); au_writel(0x0030, SYS_OUTPUTCLR); -#endif // defined (CONFIG_USB_OHCI) +#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ // make gpio 15 an input (for interrupt line) pin_func = au_readl(SYS_PINFUNC) & (u32)(~0x100); diff --git a/arch/mips/au1000/pb1100/board_setup.c b/arch/mips/au1000/pb1100/board_setup.c index 6bc1f8e1b60..259ca05860c 100644 --- a/arch/mips/au1000/pb1100/board_setup.c +++ b/arch/mips/au1000/pb1100/board_setup.c @@ -54,7 +54,7 @@ void __init board_setup(void) au_writel(0, SYS_PININPUTEN); udelay(100); -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) { u32 pin_func, sys_freqctrl, sys_clksrc; @@ -98,7 +98,7 @@ void __init board_setup(void) pin_func |= 0x8000; au_writel(pin_func, SYS_PINFUNC); } -#endif // defined (CONFIG_USB_OHCI) +#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ /* Enable sys bus clock divider when IDLE state or no bus activity. */ au_writel(au_readl(SYS_POWERCTRL) | (0x3 << 5), SYS_POWERCTRL); diff --git a/arch/mips/au1000/pb1500/board_setup.c b/arch/mips/au1000/pb1500/board_setup.c index c9b655616fb..a2d850db890 100644 --- a/arch/mips/au1000/pb1500/board_setup.c +++ b/arch/mips/au1000/pb1500/board_setup.c @@ -56,7 +56,7 @@ void __init board_setup(void) au_writel(0, SYS_PINSTATERD); udelay(100); -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) /* GPIO201 is input for PCMCIA card detect */ /* GPIO203 is input for PCMCIA interrupt request */ @@ -85,7 +85,7 @@ void __init board_setup(void) /* * Route 48MHz FREQ2 into USB Host and/or Device */ -#ifdef CONFIG_USB_OHCI +#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) sys_clksrc |= ((4<<12) | (0<<11) | (0<<10)); #endif au_writel(sys_clksrc, SYS_CLKSRC); @@ -95,7 +95,7 @@ void __init board_setup(void) // 2nd USB port is USB host pin_func |= 0x8000; au_writel(pin_func, SYS_PINFUNC); -#endif // defined (CONFIG_USB_OHCI) +#endif /* defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) */ diff --git a/arch/mips/kernel/i8259.c b/arch/mips/kernel/i8259.c index b6c30800c66..3a2d255361b 100644 --- a/arch/mips/kernel/i8259.c +++ b/arch/mips/kernel/i8259.c @@ -177,10 +177,7 @@ handle_real_irq: outb(cached_master_mask, PIC_MASTER_IMR); outb(0x60+irq,PIC_MASTER_CMD); /* 'Specific EOI to master */ } -#ifdef CONFIG_MIPS_MT_SMTC - if (irq_hwmask[irq] & ST0_IM) - set_c0_status(irq_hwmask[irq] & ST0_IM); -#endif /* CONFIG_MIPS_MT_SMTC */ + smtc_im_ack_irq(irq); spin_unlock_irqrestore(&i8259A_lock, flags); return; diff --git a/arch/mips/kernel/irq-msc01.c b/arch/mips/kernel/irq-msc01.c index 410868b5ea5..1ecdd50bfc6 100644 --- a/arch/mips/kernel/irq-msc01.c +++ b/arch/mips/kernel/irq-msc01.c @@ -52,11 +52,8 @@ static void level_mask_and_ack_msc_irq(unsigned int irq) mask_msc_irq(irq); if (!cpu_has_veic) MSCIC_WRITE(MSC01_IC_EOI, 0); -#ifdef CONFIG_MIPS_MT_SMTC /* This actually needs to be a call into platform code */ - if (irq_hwmask[irq] & ST0_IM) - set_c0_status(irq_hwmask[irq] & ST0_IM); -#endif /* CONFIG_MIPS_MT_SMTC */ + smtc_im_ack_irq(irq); } /* @@ -73,10 +70,7 @@ static void edge_mask_and_ack_msc_irq(unsigned int irq) MSCIC_WRITE(MSC01_IC_SUP+irq*8, r | ~MSC01_IC_SUP_EDGE_BIT); MSCIC_WRITE(MSC01_IC_SUP+irq*8, r); } -#ifdef CONFIG_MIPS_MT_SMTC - if (irq_hwmask[irq] & ST0_IM) - set_c0_status(irq_hwmask[irq] & ST0_IM); -#endif /* CONFIG_MIPS_MT_SMTC */ + smtc_im_ack_irq(irq); } /* diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index aeded6c17de..a990aad2f04 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c @@ -74,20 +74,12 @@ EXPORT_SYMBOL_GPL(free_irqno); */ void ack_bad_irq(unsigned int irq) { + smtc_im_ack_irq(irq); printk("unexpected IRQ # %d\n", irq); } atomic_t irq_err_count; -#ifdef CONFIG_MIPS_MT_SMTC -/* - * SMTC Kernel needs to manipulate low-level CPU interrupt mask - * in do_IRQ. These are passed in setup_irq_smtc() and stored - * in this table. - */ -unsigned long irq_hwmask[NR_IRQS]; -#endif /* CONFIG_MIPS_MT_SMTC */ - /* * Generic, controller-independent functions: */ diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index b3ed731a24c..dd68afce7da 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S @@ -525,5 +525,5 @@ sys_call_table: PTR compat_sys_signalfd PTR compat_sys_timerfd PTR sys_eventfd - PTR sys_fallocate /* 4320 */ + PTR sys32_fallocate /* 4320 */ .size sys_call_table,.-sys_call_table diff --git a/arch/mips/kernel/smtc.c b/arch/mips/kernel/smtc.c index 43826c16101..f09404377ef 100644 --- a/arch/mips/kernel/smtc.c +++ b/arch/mips/kernel/smtc.c @@ -25,8 +25,11 @@ #include <asm/smtc_proc.h> /* - * This file should be built into the kernel only if CONFIG_MIPS_MT_SMTC is set. + * SMTC Kernel needs to manipulate low-level CPU interrupt mask + * in do_IRQ. These are passed in setup_irq_smtc() and stored + * in this table. */ +unsigned long irq_hwmask[NR_IRQS]; #define LOCK_MT_PRA() \ local_irq_save(flags); \ diff --git a/arch/mips/kernel/vmlinux.lds.S b/arch/mips/kernel/vmlinux.lds.S index 60bbaecde18..087ab997487 100644 --- a/arch/mips/kernel/vmlinux.lds.S +++ b/arch/mips/kernel/vmlinux.lds.S @@ -45,6 +45,8 @@ SECTIONS __dbe_table : { *(__dbe_table) } __stop___dbe_table = .; + NOTES + RODATA /* writeable */ diff --git a/arch/mips/mm/pg-r4k.c b/arch/mips/mm/pg-r4k.c index dc795be6280..e47e9e9486b 100644 --- a/arch/mips/mm/pg-r4k.c +++ b/arch/mips/mm/pg-r4k.c @@ -209,7 +209,7 @@ static inline void build_cdex_p(void) } if (R4600_V2_HIT_CACHEOP_WAR && cpu_is_r4600_v2_x()) - build_insn_word(0x3c01a000); /* lui $at, 0xa000 */ + build_insn_word(0x8c200000); /* lw $zero, ($at) */ mi.c_format.opcode = cache_op; mi.c_format.rs = 4; /* $a0 */ diff --git a/arch/mips/pci/ops-mace.c b/arch/mips/pci/ops-mace.c index 8008e31c5e8..fe545144930 100644 --- a/arch/mips/pci/ops-mace.c +++ b/arch/mips/pci/ops-mace.c @@ -29,22 +29,20 @@ * 4 N/C */ -#define chkslot(_bus,_devfn) \ -do { \ - if ((_bus)->number > 0 || PCI_SLOT (_devfn) < 1 \ - || PCI_SLOT (_devfn) > 3) \ - return PCIBIOS_DEVICE_NOT_FOUND; \ -} while (0) +static inline int mkaddr(struct pci_bus *bus, unsigned int devfn, + unsigned int reg) +{ + return ((bus->number & 0xff) << 16) | + ((devfn & 0xff) << 8) | + (reg & 0xfc); +} -#define mkaddr(_devfn, _reg) \ -((((_devfn) & 0xffUL) << 8) | ((_reg) & 0xfcUL)) static int mace_pci_read_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 *val) { - chkslot(bus, devfn); - mace->pci.config_addr = mkaddr(devfn, reg); + mace->pci.config_addr = mkaddr(bus, devfn, reg); switch (size) { case 1: *val = mace->pci.config_data.b[(reg & 3) ^ 3]; @@ -66,8 +64,7 @@ static int mace_pci_write_config(struct pci_bus *bus, unsigned int devfn, int reg, int size, u32 val) { - chkslot(bus, devfn); - mace->pci.config_addr = mkaddr(devfn, reg); + mace->pci.config_addr = mkaddr(bus, devfn, reg); switch (size) { case 1: mace->pci.config_data.b[(reg & 3) ^ 3] = val; diff --git a/arch/mips/sgi-ip32/ip32-platform.c b/arch/mips/sgi-ip32/ip32-platform.c index ba3697ee7ff..7309e48d163 100644 --- a/arch/mips/sgi-ip32/ip32-platform.c +++ b/arch/mips/sgi-ip32/ip32-platform.c @@ -41,8 +41,8 @@ static struct platform_device uart8250_device = { static int __init uart8250_init(void) { - uart8250_data[0].iobase = (unsigned long) &mace->isa.serial1; - uart8250_data[1].iobase = (unsigned long) &mace->isa.serial1; + uart8250_data[0].membase = (void __iomem *) &mace->isa.serial1; + uart8250_data[1].membase = (void __iomem *) &mace->isa.serial1; return platform_device_register(&uart8250_device); } diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts b/arch/powerpc/boot/dts/mpc8349emitx.dts index 502f47c0179..44c065a6b5e 100644 --- a/arch/powerpc/boot/dts/mpc8349emitx.dts +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts @@ -99,6 +99,7 @@ #size-cells = <0>; interrupt-parent = < &ipic >; interrupts = <26 8>; + dr_mode = "peripheral"; phy_type = "ulpi"; }; diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index e477c9d0498..8a1b001d0b1 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -605,6 +605,13 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp) regs->ccr = 0; regs->gpr[1] = sp; + /* + * We have just cleared all the nonvolatile GPRs, so make + * FULL_REGS(regs) return true. This is necessary to allow + * ptrace to examine the thread immediately after exec. + */ + regs->trap &= ~1UL; + #ifdef CONFIG_PPC32 regs->mq = 0; regs->nip = start; diff --git a/arch/powerpc/platforms/83xx/usb.c b/arch/powerpc/platforms/83xx/usb.c index e7fdf013cd3..eafe7605cda 100644 --- a/arch/powerpc/platforms/83xx/usb.c +++ b/arch/powerpc/platforms/83xx/usb.c @@ -76,14 +76,14 @@ int mpc834x_usb_cfg(void) if (port0_is_dr) printk(KERN_WARNING "834x USB port0 can't be used by both DR and MPH!\n"); - sicrl |= MPC834X_SICRL_USB0; + sicrl &= ~MPC834X_SICRL_USB0; } prop = of_get_property(np, "port1", NULL); if (prop) { if (port1_is_dr) printk(KERN_WARNING "834x USB port1 can't be used by both DR and MPH!\n"); - sicrl |= MPC834X_SICRL_USB1; + sicrl &= ~MPC834X_SICRL_USB1; } of_node_put(np); } diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 4100ddc52f0..7de4e919687 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -2177,8 +2177,8 @@ struct tree_descr spufs_dir_contents[] = { { "mbox_stat", &spufs_mbox_stat_fops, 0444, }, { "ibox_stat", &spufs_ibox_stat_fops, 0444, }, { "wbox_stat", &spufs_wbox_stat_fops, 0444, }, - { "signal1", &spufs_signal1_nosched_fops, 0222, }, - { "signal2", &spufs_signal2_nosched_fops, 0222, }, + { "signal1", &spufs_signal1_fops, 0666, }, + { "signal2", &spufs_signal2_fops, 0666, }, { "signal1_type", &spufs_signal1_type, 0666, }, { "signal2_type", &spufs_signal2_type, 0666, }, { "cntl", &spufs_cntl_fops, 0666, }, diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c index 5bd90a7eb76..f0b5ff17d86 100644 --- a/arch/powerpc/platforms/pseries/xics.c +++ b/arch/powerpc/platforms/pseries/xics.c @@ -419,7 +419,7 @@ static void xics_set_affinity(unsigned int virq, cpumask_t cpumask) * For the moment only implement delivery to all cpus or one cpu. * Get current irq_server for the given irq */ - irq_server = get_irq_server(irq, 1); + irq_server = get_irq_server(virq, 1); if (irq_server == -1) { char cpulist[128]; cpumask_scnprintf(cpulist, sizeof(cpulist), cpumask); diff --git a/arch/powerpc/sysdev/commproc.c b/arch/powerpc/sysdev/commproc.c index 4f67b89ba1d..dd5417aec1b 100644 --- a/arch/powerpc/sysdev/commproc.c +++ b/arch/powerpc/sysdev/commproc.c @@ -395,4 +395,4 @@ uint cpm_dpram_phys(u8* addr) { return (dpram_pbase + (uint)(addr - dpram_vbase)); } -EXPORT_SYMBOL(cpm_dpram_addr); +EXPORT_SYMBOL(cpm_dpram_phys); diff --git a/arch/ppc/8xx_io/commproc.c b/arch/ppc/8xx_io/commproc.c index 7088428e1fe..9da880be4dc 100644 --- a/arch/ppc/8xx_io/commproc.c +++ b/arch/ppc/8xx_io/commproc.c @@ -459,7 +459,7 @@ EXPORT_SYMBOL(cpm_dpdump); void *cpm_dpram_addr(unsigned long offset) { - return ((immap_t *)IMAP_ADDR)->im_cpm.cp_dpmem + offset; + return (void *)(dpram_vbase + offset); } EXPORT_SYMBOL(cpm_dpram_addr); diff --git a/arch/sparc/kernel/ebus.c b/arch/sparc/kernel/ebus.c index e2d02fd13f3..d850785b208 100644 --- a/arch/sparc/kernel/ebus.c +++ b/arch/sparc/kernel/ebus.c @@ -156,6 +156,8 @@ void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_device *d dev->prom_node = dp; regs = of_get_property(dp, "reg", &len); + if (!regs) + len = 0; if (len % sizeof(struct linux_prom_registers)) { prom_printf("UGH: proplen for %s was %d, need multiple of %d\n", dev->prom_node->name, len, diff --git a/arch/sparc64/kernel/binfmt_aout32.c b/arch/sparc64/kernel/binfmt_aout32.c index f205fc7cbcd..d208cc7804f 100644 --- a/arch/sparc64/kernel/binfmt_aout32.c +++ b/arch/sparc64/kernel/binfmt_aout32.c @@ -177,7 +177,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr get_user(c,p++); } while (c); } - put_user(NULL,argv); + put_user(0,argv); current->mm->arg_end = current->mm->env_start = (unsigned long) p; while (envc-->0) { char c; @@ -186,7 +186,7 @@ static u32 __user *create_aout32_tables(char __user *p, struct linux_binprm *bpr get_user(c,p++); } while (c); } - put_user(NULL,envp); + put_user(0,envp); current->mm->env_end = (unsigned long) p; return sp; } diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index bc9ae36f7a4..04ab81cb4f4 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c @@ -375,7 +375,10 @@ static void __init fill_ebus_device(struct device_node *dp, struct linux_ebus_de dev->num_addrs = 0; dev->num_irqs = 0; } else { - (void) of_get_property(dp, "reg", &len); + const int *regs = of_get_property(dp, "reg", &len); + + if (!regs) + len = 0; dev->num_addrs = len / sizeof(struct linux_prom_registers); for (i = 0; i < dev->num_addrs; i++) diff --git a/arch/sparc64/kernel/pci_common.c b/arch/sparc64/kernel/pci_common.c index 2f61c4b1259..c76bfbb7da0 100644 --- a/arch/sparc64/kernel/pci_common.c +++ b/arch/sparc64/kernel/pci_common.c @@ -264,7 +264,7 @@ static int sun4v_read_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, unsigned int func = PCI_FUNC(devfn); unsigned long ret; - if (bus_dev == pbm->pci_bus && devfn == 0x00) + if (!bus && devfn == 0x00) return pci_host_bridge_read_pci_cfg(bus_dev, devfn, where, size, value); if (config_out_of_range(pbm, bus, devfn, where)) { @@ -300,7 +300,7 @@ static int sun4v_write_pci_cfg(struct pci_bus *bus_dev, unsigned int devfn, unsigned int func = PCI_FUNC(devfn); unsigned long ret; - if (bus_dev == pbm->pci_bus && devfn == 0x00) + if (!bus && devfn == 0x00) return pci_host_bridge_write_pci_cfg(bus_dev, devfn, where, size, value); if (config_out_of_range(pbm, bus, devfn, where)) { diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 0614dff63d7..a246e962e5a 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c @@ -1046,7 +1046,8 @@ static void __init irq_trans_init(struct device_node *dp) if (!strcmp(dp->name, "fhc") && !strcmp(dp->parent->name, "central")) return central_irq_trans_init(dp); - if (!strcmp(dp->name, "virtual-devices")) + if (!strcmp(dp->name, "virtual-devices") || + !strcmp(dp->name, "niu")) return sun4v_vdev_irq_trans_init(dp); } diff --git a/arch/sparc64/kernel/smp.c b/arch/sparc64/kernel/smp.c index b84c49e3697..c73b7a48b03 100644 --- a/arch/sparc64/kernel/smp.c +++ b/arch/sparc64/kernel/smp.c @@ -353,6 +353,8 @@ static int __devinit smp_boot_one_cpu(unsigned int cpu) int timeout, ret; p = fork_idle(cpu); + if (IS_ERR(p)) + return PTR_ERR(p); callin_flag = 0; cpu_new_thread = task_thread_info(p); diff --git a/arch/sparc64/kernel/vio.c b/arch/sparc64/kernel/vio.c index 1550ac5673d..0c1ee619d81 100644 --- a/arch/sparc64/kernel/vio.c +++ b/arch/sparc64/kernel/vio.c @@ -292,7 +292,7 @@ static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, } vdev->dp = dp; - printk(KERN_ERR "VIO: Adding device %s\n", vdev->dev.bus_id); + printk(KERN_INFO "VIO: Adding device %s\n", vdev->dev.bus_id); err = device_register(&vdev->dev); if (err) { @@ -342,8 +342,33 @@ static struct mdesc_notifier_client vio_device_notifier = { .node_name = "virtual-device-port", }; +/* We are only interested in domain service ports under the + * "domain-services" node. On control nodes there is another port + * under "openboot" that we should not mess with as aparently that is + * reserved exclusively for OBP use. + */ +static void vio_add_ds(struct mdesc_handle *hp, u64 node) +{ + int found; + u64 a; + + found = 0; + mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) { + u64 target = mdesc_arc_target(hp, a); + const char *name = mdesc_node_name(hp, target); + + if (!strcmp(name, "domain-services")) { + found = 1; + break; + } + } + + if (found) + (void) vio_create_one(hp, node, &root_vdev->dev); +} + static struct mdesc_notifier_client vio_ds_notifier = { - .add = vio_add, + .add = vio_add_ds, .remove = vio_remove, .node_name = "domain-services-port", }; diff --git a/arch/sparc64/lib/NGcopy_from_user.S b/arch/sparc64/lib/NGcopy_from_user.S index 2d93456f76d..e7f433f71b4 100644 --- a/arch/sparc64/lib/NGcopy_from_user.S +++ b/arch/sparc64/lib/NGcopy_from_user.S @@ -1,6 +1,6 @@ /* NGcopy_from_user.S: Niagara optimized copy from userspace. * - * Copyright (C) 2006 David S. Miller (davem@davemloft.net) + * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) */ #define EX_LD(x) \ @@ -8,8 +8,8 @@ .section .fixup; \ .align 4; \ 99: wr %g0, ASI_AIUS, %asi;\ - retl; \ - mov 1, %o0; \ + ret; \ + restore %g0, 1, %o0; \ .section __ex_table,"a";\ .align 4; \ .word 98b, 99b; \ @@ -24,7 +24,7 @@ #define LOAD(type,addr,dest) type##a [addr] ASI_AIUS, dest #define LOAD_TWIN(addr_reg,dest0,dest1) \ ldda [addr_reg] ASI_BLK_INIT_QUAD_LDD_AIUS, dest0 -#define EX_RETVAL(x) 0 +#define EX_RETVAL(x) %g0 #ifdef __KERNEL__ #define PREAMBLE \ diff --git a/arch/sparc64/lib/NGcopy_to_user.S b/arch/sparc64/lib/NGcopy_to_user.S index 34112d5054e..6ea01c5532a 100644 --- a/arch/sparc64/lib/NGcopy_to_user.S +++ b/arch/sparc64/lib/NGcopy_to_user.S @@ -1,6 +1,6 @@ /* NGcopy_to_user.S: Niagara optimized copy to userspace. * - * Copyright (C) 2006 David S. Miller (davem@davemloft.net) + * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) */ #define EX_ST(x) \ @@ -8,8 +8,8 @@ .section .fixup; \ .align 4; \ 99: wr %g0, ASI_AIUS, %asi;\ - retl; \ - mov 1, %o0; \ + ret; \ + restore %g0, 1, %o0; \ .section __ex_table,"a";\ .align 4; \ .word 98b, 99b; \ @@ -23,7 +23,7 @@ #define FUNC_NAME NGcopy_to_user #define STORE(type,src,addr) type##a src, [addr] ASI_AIUS #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_AIUS -#define EX_RETVAL(x) 0 +#define EX_RETVAL(x) %g0 #ifdef __KERNEL__ /* Writing to %asi is _expensive_ so we hardcode it. diff --git a/arch/sparc64/lib/NGmemcpy.S b/arch/sparc64/lib/NGmemcpy.S index 66063a9a66b..96a14caf696 100644 --- a/arch/sparc64/lib/NGmemcpy.S +++ b/arch/sparc64/lib/NGmemcpy.S @@ -1,6 +1,6 @@ /* NGmemcpy.S: Niagara optimized memcpy. * - * Copyright (C) 2006 David S. Miller (davem@davemloft.net) + * Copyright (C) 2006, 2007 David S. Miller (davem@davemloft.net) */ #ifdef __KERNEL__ @@ -16,6 +16,12 @@ wr %g0, ASI_PNF, %asi #endif +#ifdef __sparc_v9__ +#define SAVE_AMOUNT 128 +#else +#define SAVE_AMOUNT 64 +#endif + #ifndef STORE_ASI #define STORE_ASI ASI_BLK_INIT_QUAD_LDD_P #endif @@ -50,7 +56,11 @@ #endif #ifndef STORE_INIT +#ifndef SIMULATE_NIAGARA_ON_NON_NIAGARA #define STORE_INIT(src,addr) stxa src, [addr] %asi +#else +#define STORE_INIT(src,addr) stx src, [addr + 0x00] +#endif #endif #ifndef FUNC_NAME @@ -73,18 +83,19 @@ .globl FUNC_NAME .type FUNC_NAME,#function -FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ - srlx %o2, 31, %g2 +FUNC_NAME: /* %i0=dst, %i1=src, %i2=len */ + PREAMBLE + save %sp, -SAVE_AMOUNT, %sp + srlx %i2, 31, %g2 cmp %g2, 0 tne %xcc, 5 - PREAMBLE - mov %o0, GLOBAL_SPARE - cmp %o2, 0 + mov %i0, %o0 + cmp %i2, 0 be,pn %XCC, 85f - or %o0, %o1, %o3 - cmp %o2, 16 + or %o0, %i1, %i3 + cmp %i2, 16 blu,a,pn %XCC, 80f - or %o3, %o2, %o3 + or %i3, %i2, %i3 /* 2 blocks (128 bytes) is the minimum we can do the block * copy with. We need to ensure that we'll iterate at least @@ -93,31 +104,31 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ * to (64 - 1) bytes from the length before we perform the * block copy loop. */ - cmp %o2, (2 * 64) + cmp %i2, (2 * 64) blu,pt %XCC, 70f - andcc %o3, 0x7, %g0 + andcc %i3, 0x7, %g0 /* %o0: dst - * %o1: src - * %o2: len (known to be >= 128) + * %i1: src + * %i2: len (known to be >= 128) * - * The block copy loops will use %o4/%o5,%g2/%g3 as + * The block copy loops will use %i4/%i5,%g2/%g3 as * temporaries while copying the data. */ - LOAD(prefetch, %o1, #one_read) + LOAD(prefetch, %i1, #one_read) wr %g0, STORE_ASI, %asi /* Align destination on 64-byte boundary. */ - andcc %o0, (64 - 1), %o4 + andcc %o0, (64 - 1), %i4 be,pt %XCC, 2f - sub %o4, 64, %o4 - sub %g0, %o4, %o4 ! bytes to align dst - sub %o2, %o4, %o2 -1: subcc %o4, 1, %o4 - EX_LD(LOAD(ldub, %o1, %g1)) + sub %i4, 64, %i4 + sub %g0, %i4, %i4 ! bytes to align dst + sub %i2, %i4, %i2 +1: subcc %i4, 1, %i4 + EX_LD(LOAD(ldub, %i1, %g1)) EX_ST(STORE(stb, %g1, %o0)) - add %o1, 1, %o1 + add %i1, 1, %i1 bne,pt %XCC, 1b add %o0, 1, %o0 @@ -136,111 +147,155 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ * aligned store data at a time, this is easy to ensure. */ 2: - andcc %o1, (16 - 1), %o4 - andn %o2, (64 - 1), %g1 ! block copy loop iterator - sub %o2, %g1, %o2 ! final sub-block copy bytes + andcc %i1, (16 - 1), %i4 + andn %i2, (64 - 1), %g1 ! block copy loop iterator be,pt %XCC, 50f - cmp %o4, 8 - be,a,pt %XCC, 10f - sub %o1, 0x8, %o1 + sub %i2, %g1, %i2 ! final sub-block copy bytes + + cmp %i4, 8 + be,pt %XCC, 10f + sub %i1, %i4, %i1 /* Neither 8-byte nor 16-byte aligned, shift and mask. */ - mov %g1, %o4 - and %o1, 0x7, %g1 - sll %g1, 3, %g1 - mov 64, %o3 - andn %o1, 0x7, %o1 - EX_LD(LOAD(ldx, %o1, %g2)) - sub %o3, %g1, %o3 - sllx %g2, %g1, %g2 + and %i4, 0x7, GLOBAL_SPARE + sll GLOBAL_SPARE, 3, GLOBAL_SPARE + mov 64, %i5 + EX_LD(LOAD_TWIN(%i1, %g2, %g3)) + sub %i5, GLOBAL_SPARE, %i5 + mov 16, %o4 + mov 32, %o5 + mov 48, %o7 + mov 64, %i3 + + bg,pn %XCC, 9f + nop -#define SWIVEL_ONE_DWORD(SRC, TMP1, TMP2, PRE_VAL, PRE_SHIFT, POST_SHIFT, DST)\ - EX_LD(LOAD(ldx, SRC, TMP1)); \ - srlx TMP1, PRE_SHIFT, TMP2; \ - or TMP2, PRE_VAL, TMP2; \ - EX_ST(STORE_INIT(TMP2, DST)); \ - sllx TMP1, POST_SHIFT, PRE_VAL; - -1: add %o1, 0x8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x00) - add %o1, 0x8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x08) - add %o1, 0x8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x10) - add %o1, 0x8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x18) - add %o1, 32, %o1 - LOAD(prefetch, %o1, #one_read) - sub %o1, 32 - 8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x20) - add %o1, 8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x28) - add %o1, 8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x30) - add %o1, 8, %o1 - SWIVEL_ONE_DWORD(%o1, %g3, %o5, %g2, %o3, %g1, %o0 + 0x38) - subcc %o4, 64, %o4 - bne,pt %XCC, 1b +#define MIX_THREE_WORDS(WORD1, WORD2, WORD3, PRE_SHIFT, POST_SHIFT, TMP) \ + sllx WORD1, POST_SHIFT, WORD1; \ + srlx WORD2, PRE_SHIFT, TMP; \ + sllx WORD2, POST_SHIFT, WORD2; \ + or WORD1, TMP, WORD1; \ + srlx WORD3, PRE_SHIFT, TMP; \ + or WORD2, TMP, WORD2; + +8: EX_LD(LOAD_TWIN(%i1 + %o4, %o2, %o3)) + MIX_THREE_WORDS(%g2, %g3, %o2, %i5, GLOBAL_SPARE, %o1) + LOAD(prefetch, %i1 + %i3, #one_read) + + EX_ST(STORE_INIT(%g2, %o0 + 0x00)) + EX_ST(STORE_INIT(%g3, %o0 + 0x08)) + + EX_LD(LOAD_TWIN(%i1 + %o5, %g2, %g3)) + MIX_THREE_WORDS(%o2, %o3, %g2, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%o2, %o0 + 0x10)) + EX_ST(STORE_INIT(%o3, %o0 + 0x18)) + + EX_LD(LOAD_TWIN(%i1 + %o7, %o2, %o3)) + MIX_THREE_WORDS(%g2, %g3, %o2, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%g2, %o0 + 0x20)) + EX_ST(STORE_INIT(%g3, %o0 + 0x28)) + + EX_LD(LOAD_TWIN(%i1 + %i3, %g2, %g3)) + add %i1, 64, %i1 + MIX_THREE_WORDS(%o2, %o3, %g2, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%o2, %o0 + 0x30)) + EX_ST(STORE_INIT(%o3, %o0 + 0x38)) + + subcc %g1, 64, %g1 + bne,pt %XCC, 8b add %o0, 64, %o0 -#undef SWIVEL_ONE_DWORD + ba,pt %XCC, 60f + add %i1, %i4, %i1 + +9: EX_LD(LOAD_TWIN(%i1 + %o4, %o2, %o3)) + MIX_THREE_WORDS(%g3, %o2, %o3, %i5, GLOBAL_SPARE, %o1) + LOAD(prefetch, %i1 + %i3, #one_read) + + EX_ST(STORE_INIT(%g3, %o0 + 0x00)) + EX_ST(STORE_INIT(%o2, %o0 + 0x08)) + + EX_LD(LOAD_TWIN(%i1 + %o5, %g2, %g3)) + MIX_THREE_WORDS(%o3, %g2, %g3, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%o3, %o0 + 0x10)) + EX_ST(STORE_INIT(%g2, %o0 + 0x18)) + + EX_LD(LOAD_TWIN(%i1 + %o7, %o2, %o3)) + MIX_THREE_WORDS(%g3, %o2, %o3, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%g3, %o0 + 0x20)) + EX_ST(STORE_INIT(%o2, %o0 + 0x28)) + + EX_LD(LOAD_TWIN(%i1 + %i3, %g2, %g3)) + add %i1, 64, %i1 + MIX_THREE_WORDS(%o3, %g2, %g3, %i5, GLOBAL_SPARE, %o1) + + EX_ST(STORE_INIT(%o3, %o0 + 0x30)) + EX_ST(STORE_INIT(%g2, %o0 + 0x38)) + + subcc %g1, 64, %g1 + bne,pt %XCC, 9b + add %o0, 64, %o0 - srl %g1, 3, %g1 ba,pt %XCC, 60f - add %o1, %g1, %o1 + add %i1, %i4, %i1 10: /* Destination is 64-byte aligned, source was only 8-byte * aligned but it has been subtracted by 8 and we perform * one twin load ahead, then add 8 back into source when * we finish the loop. */ - EX_LD(LOAD_TWIN(%o1, %o4, %o5)) -1: add %o1, 16, %o1 - EX_LD(LOAD_TWIN(%o1, %g2, %g3)) - add %o1, 16 + 32, %o1 - LOAD(prefetch, %o1, #one_read) - sub %o1, 32, %o1 + EX_LD(LOAD_TWIN(%i1, %o4, %o5)) + mov 16, %o7 + mov 32, %g2 + mov 48, %g3 + mov 64, %o1 +1: EX_LD(LOAD_TWIN(%i1 + %o7, %o2, %o3)) + LOAD(prefetch, %i1 + %o1, #one_read) EX_ST(STORE_INIT(%o5, %o0 + 0x00)) ! initializes cache line - EX_ST(STORE_INIT(%g2, %o0 + 0x08)) - EX_LD(LOAD_TWIN(%o1, %o4, %o5)) - add %o1, 16, %o1 - EX_ST(STORE_INIT(%g3, %o0 + 0x10)) + EX_ST(STORE_INIT(%o2, %o0 + 0x08)) + EX_LD(LOAD_TWIN(%i1 + %g2, %o4, %o5)) + EX_ST(STORE_INIT(%o3, %o0 + 0x10)) EX_ST(STORE_INIT(%o4, %o0 + 0x18)) - EX_LD(LOAD_TWIN(%o1, %g2, %g3)) - add %o1, 16, %o1 + EX_LD(LOAD_TWIN(%i1 + %g3, %o2, %o3)) EX_ST(STORE_INIT(%o5, %o0 + 0x20)) - EX_ST(STORE_INIT(%g2, %o0 + 0x28)) - EX_LD(LOAD_TWIN(%o1, %o4, %o5)) - EX_ST(STORE_INIT(%g3, %o0 + 0x30)) + EX_ST(STORE_INIT(%o2, %o0 + 0x28)) + EX_LD(LOAD_TWIN(%i1 + %o1, %o4, %o5)) + add %i1, 64, %i1 + EX_ST(STORE_INIT(%o3, %o0 + 0x30)) EX_ST(STORE_INIT(%o4, %o0 + 0x38)) subcc %g1, 64, %g1 bne,pt %XCC, 1b add %o0, 64, %o0 ba,pt %XCC, 60f - add %o1, 0x8, %o1 + add %i1, 0x8, %i1 50: /* Destination is 64-byte aligned, and source is 16-byte * aligned. */ -1: EX_LD(LOAD_TWIN(%o1, %o4, %o5)) - add %o1, 16, %o1 - EX_LD(LOAD_TWIN(%o1, %g2, %g3)) - add %o1, 16 + 32, %o1 - LOAD(prefetch, %o1, #one_read) - sub %o1, 32, %o1 + mov 16, %o7 + mov 32, %g2 + mov 48, %g3 + mov 64, %o1 +1: EX_LD(LOAD_TWIN(%i1 + %g0, %o4, %o5)) + EX_LD(LOAD_TWIN(%i1 + %o7, %o2, %o3)) + LOAD(prefetch, %i1 + %o1, #one_read) EX_ST(STORE_INIT(%o4, %o0 + 0x00)) ! initializes cache line EX_ST(STORE_INIT(%o5, %o0 + 0x08)) - EX_LD(LOAD_TWIN(%o1, %o4, %o5)) - add %o1, 16, %o1 - EX_ST(STORE_INIT(%g2, %o0 + 0x10)) - EX_ST(STORE_INIT(%g3, %o0 + 0x18)) - EX_LD(LOAD_TWIN(%o1, %g2, %g3)) - add %o1, 16, %o1 + EX_LD(LOAD_TWIN(%i1 + %g2, %o4, %o5)) + EX_ST(STORE_INIT(%o2, %o0 + 0x10)) + EX_ST(STORE_INIT(%o3, %o0 + 0x18)) + EX_LD(LOAD_TWIN(%i1 + %g3, %o2, %o3)) + add %i1, 64, %i1 EX_ST(STORE_INIT(%o4, %o0 + 0x20)) EX_ST(STORE_INIT(%o5, %o0 + 0x28)) - EX_ST(STORE_INIT(%g2, %o0 + 0x30)) - EX_ST(STORE_INIT(%g3, %o0 + 0x38)) + EX_ST(STORE_INIT(%o2, %o0 + 0x30)) + EX_ST(STORE_INIT(%o3, %o0 + 0x38)) subcc %g1, 64, %g1 bne,pt %XCC, 1b add %o0, 64, %o0 @@ -249,47 +304,47 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ 60: membar #Sync - /* %o2 contains any final bytes still needed to be copied + /* %i2 contains any final bytes still needed to be copied * over. If anything is left, we copy it one byte at a time. */ - RESTORE_ASI(%o3) - brz,pt %o2, 85f - sub %o0, %o1, %o3 + RESTORE_ASI(%i3) + brz,pt %i2, 85f + sub %o0, %i1, %i3 ba,a,pt %XCC, 90f .align 64 70: /* 16 < len <= 64 */ bne,pn %XCC, 75f - sub %o0, %o1, %o3 + sub %o0, %i1, %i3 72: - andn %o2, 0xf, %o4 - and %o2, 0xf, %o2 -1: subcc %o4, 0x10, %o4 - EX_LD(LOAD(ldx, %o1, %o5)) - add %o1, 0x08, %o1 - EX_LD(LOAD(ldx, %o1, %g1)) - sub %o1, 0x08, %o1 - EX_ST(STORE(stx, %o5, %o1 + %o3)) - add %o1, 0x8, %o1 - EX_ST(STORE(stx, %g1, %o1 + %o3)) + andn %i2, 0xf, %i4 + and %i2, 0xf, %i2 +1: subcc %i4, 0x10, %i4 + EX_LD(LOAD(ldx, %i1, %o4)) + add %i1, 0x08, %i1 + EX_LD(LOAD(ldx, %i1, %g1)) + sub %i1, 0x08, %i1 + EX_ST(STORE(stx, %o4, %i1 + %i3)) + add %i1, 0x8, %i1 + EX_ST(STORE(stx, %g1, %i1 + %i3)) bgu,pt %XCC, 1b - add %o1, 0x8, %o1 -73: andcc %o2, 0x8, %g0 + add %i1, 0x8, %i1 +73: andcc %i2, 0x8, %g0 be,pt %XCC, 1f nop - sub %o2, 0x8, %o2 - EX_LD(LOAD(ldx, %o1, %o5)) - EX_ST(STORE(stx, %o5, %o1 + %o3)) - add %o1, 0x8, %o1 -1: andcc %o2, 0x4, %g0 + sub %i2, 0x8, %i2 + EX_LD(LOAD(ldx, %i1, %o4)) + EX_ST(STORE(stx, %o4, %i1 + %i3)) + add %i1, 0x8, %i1 +1: andcc %i2, 0x4, %g0 be,pt %XCC, 1f nop - sub %o2, 0x4, %o2 - EX_LD(LOAD(lduw, %o1, %o5)) - EX_ST(STORE(stw, %o5, %o1 + %o3)) - add %o1, 0x4, %o1 -1: cmp %o2, 0 + sub %i2, 0x4, %i2 + EX_LD(LOAD(lduw, %i1, %i5)) + EX_ST(STORE(stw, %i5, %i1 + %i3)) + add %i1, 0x4, %i1 +1: cmp %i2, 0 be,pt %XCC, 85f nop ba,pt %xcc, 90f @@ -300,71 +355,71 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ sub %g1, 0x8, %g1 be,pn %icc, 2f sub %g0, %g1, %g1 - sub %o2, %g1, %o2 + sub %i2, %g1, %i2 1: subcc %g1, 1, %g1 - EX_LD(LOAD(ldub, %o1, %o5)) - EX_ST(STORE(stb, %o5, %o1 + %o3)) + EX_LD(LOAD(ldub, %i1, %i5)) + EX_ST(STORE(stb, %i5, %i1 + %i3)) bgu,pt %icc, 1b - add %o1, 1, %o1 + add %i1, 1, %i1 -2: add %o1, %o3, %o0 - andcc %o1, 0x7, %g1 +2: add %i1, %i3, %o0 + andcc %i1, 0x7, %g1 bne,pt %icc, 8f sll %g1, 3, %g1 - cmp %o2, 16 + cmp %i2, 16 bgeu,pt %icc, 72b nop ba,a,pt %xcc, 73b -8: mov 64, %o3 - andn %o1, 0x7, %o1 - EX_LD(LOAD(ldx, %o1, %g2)) - sub %o3, %g1, %o3 - andn %o2, 0x7, %o4 +8: mov 64, %i3 + andn %i1, 0x7, %i1 + EX_LD(LOAD(ldx, %i1, %g2)) + sub %i3, %g1, %i3 + andn %i2, 0x7, %i4 sllx %g2, %g1, %g2 -1: add %o1, 0x8, %o1 - EX_LD(LOAD(ldx, %o1, %g3)) - subcc %o4, 0x8, %o4 - srlx %g3, %o3, %o5 - or %o5, %g2, %o5 - EX_ST(STORE(stx, %o5, %o0)) +1: add %i1, 0x8, %i1 + EX_LD(LOAD(ldx, %i1, %g3)) + subcc %i4, 0x8, %i4 + srlx %g3, %i3, %i5 + or %i5, %g2, %i5 + EX_ST(STORE(stx, %i5, %o0)) add %o0, 0x8, %o0 bgu,pt %icc, 1b sllx %g3, %g1, %g2 srl %g1, 3, %g1 - andcc %o2, 0x7, %o2 + andcc %i2, 0x7, %i2 be,pn %icc, 85f - add %o1, %g1, %o1 + add %i1, %g1, %i1 ba,pt %xcc, 90f - sub %o0, %o1, %o3 + sub %o0, %i1, %i3 .align 64 80: /* 0 < len <= 16 */ - andcc %o3, 0x3, %g0 + andcc %i3, 0x3, %g0 bne,pn %XCC, 90f - sub %o0, %o1, %o3 + sub %o0, %i1, %i3 1: - subcc %o2, 4, %o2 - EX_LD(LOAD(lduw, %o1, %g1)) - EX_ST(STORE(stw, %g1, %o1 + %o3)) + subcc %i2, 4, %i2 + EX_LD(LOAD(lduw, %i1, %g1)) + EX_ST(STORE(stw, %g1, %i1 + %i3)) bgu,pt %XCC, 1b - add %o1, 4, %o1 + add %i1, 4, %i1 -85: retl - mov EX_RETVAL(GLOBAL_SPARE), %o0 +85: ret + restore EX_RETVAL(%i0), %g0, %o0 .align 32 90: - subcc %o2, 1, %o2 - EX_LD(LOAD(ldub, %o1, %g1)) - EX_ST(STORE(stb, %g1, %o1 + %o3)) + subcc %i2, 1, %i2 + EX_LD(LOAD(ldub, %i1, %g1)) + EX_ST(STORE(stb, %g1, %i1 + %i3)) bgu,pt %XCC, 90b - add %o1, 1, %o1 - retl - mov EX_RETVAL(GLOBAL_SPARE), %o0 + add %i1, 1, %i1 + ret + restore EX_RETVAL(%i0), %g0, %o0 .size FUNC_NAME, .-FUNC_NAME diff --git a/arch/um/sys-i386/sys_call_table.S b/arch/um/sys-i386/sys_call_table.S index 2497554b7b9..12d4148dba3 100644 --- a/arch/um/sys-i386/sys_call_table.S +++ b/arch/um/sys-i386/sys_call_table.S @@ -9,4 +9,4 @@ #define old_mmap old_mmap_i386 -#include "../../i386/kernel/syscall_table.S" +#include "../../x86/kernel/syscall_table_32.S" diff --git a/arch/um/sys-x86_64/syscall_table.c b/arch/um/sys-x86_64/syscall_table.c index 5133988d361..71b2ae4ad5d 100644 --- a/arch/um/sys-x86_64/syscall_table.c +++ b/arch/um/sys-x86_64/syscall_table.c @@ -36,7 +36,7 @@ #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; #undef _ASM_X86_64_UNISTD_H_ -#include <asm-x86_64/unistd.h> +#include <asm-x86/unistd_64.h> #undef __SYSCALL #define __SYSCALL(nr, sym) [ nr ] = sym, @@ -49,5 +49,5 @@ extern void sys_ni_syscall(void); sys_call_ptr_t sys_call_table[UM_NR_syscall_max+1] __cacheline_aligned = { /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ [0 ... UM_NR_syscall_max] = &sys_ni_syscall, -#include <asm-x86_64/unistd.h> +#include <asm-x86/unistd_64.h> }; diff --git a/arch/i386/boot/.gitignore b/arch/x86/boot/.gitignore index 18465143cfa..18465143cfa 100644 --- a/arch/i386/boot/.gitignore +++ b/arch/x86/boot/.gitignore diff --git a/arch/x86/boot/Makefile b/arch/x86/boot/Makefile new file mode 100644 index 00000000000..cb1035f2b7e --- /dev/null +++ b/arch/x86/boot/Makefile @@ -0,0 +1,171 @@ +# +# arch/x86/boot/Makefile +# +# This file is subject to the terms and conditions of the GNU General Public +# License. See the file "COPYING" in the main directory of this archive +# for more details. +# +# Copyright (C) 1994 by Linus Torvalds +# + +# ROOT_DEV specifies the default root-device when making the image. +# This can be either FLOPPY, CURRENT, /dev/xxxx or empty, in which case +# the default of FLOPPY is used by 'build'. + +ROOT_DEV := CURRENT + +# If you want to preset the SVGA mode, uncomment the next line and +# set SVGA_MODE to whatever number you want. +# Set it to -DSVGA_MODE=NORMAL_VGA if you just want the EGA/VGA mode. +# The number is the same as you would ordinarily press at bootup. + +SVGA_MODE := -DSVGA_MODE=NORMAL_VGA + +# If you want the RAM disk device, define this to be the size in blocks. + +#RAMDISK := -DRAMDISK=512 + +targets := vmlinux.bin setup.bin setup.elf zImage bzImage +subdir- := compressed + +setup-y += a20.o apm.o cmdline.o copy.o cpu.o cpucheck.o edd.o +setup-y += header.o main.o mca.o memory.o pm.o pmjump.o +setup-y += printf.o string.o tty.o video.o version.o voyager.o + +# The link order of the video-*.o modules can matter. In particular, +# video-vga.o *must* be listed first, followed by video-vesa.o. +# Hardware-specific drivers should follow in the order they should be +# probed, and video-bios.o should typically be last. +setup-y += video-vga.o +setup-y += video-vesa.o +setup-y += video-bios.o +targets += $(setup-y) +hostprogs-y := tools/build + +HOSTCFLAGS_build.o := $(LINUXINCLUDE) + +# --------------------------------------------------------------------------- + +# How to compile the 16-bit code. Note we always compile for -march=i386, +# that way we can complain to the user if the CPU is insufficient. +cflags-i386 := +cflags-x86_64 := -m32 +CFLAGS := $(LINUXINCLUDE) -g -Os -D_SETUP -D__KERNEL__ \ + $(cflags-$(ARCH)) \ + -Wall -Wstrict-prototypes \ + -march=i386 -mregparm=3 \ + -include $(srctree)/$(src)/code16gcc.h \ + -fno-strict-aliasing -fomit-frame-pointer \ + $(call cc-option, -ffreestanding) \ + $(call cc-option, -fno-toplevel-reorder,\ + $(call cc-option, -fno-unit-at-a-time)) \ + $(call cc-option, -fno-stack-protector) \ + $(call cc-option, -mpreferred-stack-boundary=2) +AFLAGS := $(CFLAGS) -D__ASSEMBLY__ + +$(obj)/zImage: IMAGE_OFFSET := 0x1000 +$(obj)/zImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) +$(obj)/bzImage: IMAGE_OFFSET := 0x100000 +$(obj)/bzImage: EXTRA_CFLAGS := -D__BIG_KERNEL__ +$(obj)/bzImage: EXTRA_AFLAGS := $(SVGA_MODE) $(RAMDISK) -D__BIG_KERNEL__ +$(obj)/bzImage: BUILDFLAGS := -b + +quiet_cmd_image = BUILD $@ +cmd_image = $(obj)/tools/build $(BUILDFLAGS) $(obj)/setup.bin \ + $(obj)/vmlinux.bin $(ROOT_DEV) > $@ + +$(obj)/zImage $(obj)/bzImage: $(obj)/setup.bin \ + $(obj)/vmlinux.bin $(obj)/tools/build FORCE + $(call if_changed,image) + @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' + +$(obj)/vmlinux.bin: $(obj)/compressed/vmlinux FORCE + $(call if_changed,objcopy) + +SETUP_OBJS = $(addprefix $(obj)/,$(setup-y)) + +LDFLAGS_setup.elf := -T +$(obj)/setup.elf: $(src)/setup.ld $(SETUP_OBJS) FORCE + $(call if_changed,ld) + +OBJCOPYFLAGS_setup.bin := -O binary + +$(obj)/setup.bin: $(obj)/setup.elf FORCE + $(call if_changed,objcopy) + +$(obj)/compressed/vmlinux: FORCE + $(Q)$(MAKE) $(build)=$(obj)/compressed IMAGE_OFFSET=$(IMAGE_OFFSET) $@ + +# Set this if you want to pass append arguments to the zdisk/fdimage/isoimage kernel +FDARGS = +# Set this if you want an initrd included with the zdisk/fdimage/isoimage kernel +FDINITRD = + +image_cmdline = default linux $(FDARGS) $(if $(FDINITRD),initrd=initrd.img,) + +$(obj)/mtools.conf: $(src)/mtools.conf.in + sed -e 's|@OBJ@|$(obj)|g' < $< > $@ + +# This requires write access to /dev/fd0 +zdisk: $(BOOTIMAGE) $(obj)/mtools.conf + MTOOLSRC=$(obj)/mtools.conf mformat a: ; sync + syslinux /dev/fd0 ; sync + echo '$(image_cmdline)' | \ + MTOOLSRC=$(src)/mtools.conf mcopy - a:syslinux.cfg + if [ -f '$(FDINITRD)' ] ; then \ + MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' a:initrd.img ; \ + fi + MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) a:linux ; sync + +# These require being root or having syslinux 2.02 or higher installed +fdimage fdimage144: $(BOOTIMAGE) $(obj)/mtools.conf + dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=1440 + MTOOLSRC=$(obj)/mtools.conf mformat v: ; sync + syslinux $(obj)/fdimage ; sync + echo '$(image_cmdline)' | \ + MTOOLSRC=$(obj)/mtools.conf mcopy - v:syslinux.cfg + if [ -f '$(FDINITRD)' ] ; then \ + MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' v:initrd.img ; \ + fi + MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) v:linux ; sync + +fdimage288: $(BOOTIMAGE) $(obj)/mtools.conf + dd if=/dev/zero of=$(obj)/fdimage bs=1024 count=2880 + MTOOLSRC=$(obj)/mtools.conf mformat w: ; sync + syslinux $(obj)/fdimage ; sync + echo '$(image_cmdline)' | \ + MTOOLSRC=$(obj)/mtools.conf mcopy - w:syslinux.cfg + if [ -f '$(FDINITRD)' ] ; then \ + MTOOLSRC=$(obj)/mtools.conf mcopy '$(FDINITRD)' w:initrd.img ; \ + fi + MTOOLSRC=$(obj)/mtools.conf mcopy $(BOOTIMAGE) w:linux ; sync + +isoimage: $(BOOTIMAGE) + -rm -rf $(obj)/isoimage + mkdir $(obj)/isoimage + for i in lib lib64 share end ; do \ + if [ -f /usr/$$i/syslinux/isolinux.bin ] ; then \ + cp /usr/$$i/syslinux/isolinux.bin $(obj)/isoimage ; \ + break ; \ + fi ; \ + if [ $$i = end ] ; then exit 1 ; fi ; \ + done + cp $(BOOTIMAGE) $(obj)/isoimage/linux + echo '$(image_cmdline)' > $(obj)/isoimage/isolinux.cfg + if [ -f '$(FDINITRD)' ] ; then \ + cp '$(FDINITRD)' $(obj)/isoimage/initrd.img ; \ + fi + mkisofs -J -r -o $(obj)/image.iso -b isolinux.bin -c boot.cat \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + $(obj)/isoimage + rm -rf $(obj)/isoimage + +zlilo: $(BOOTIMAGE) + if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi + if [ -f $(INSTALL_PATH)/System.map ]; then mv $(INSTALL_PATH)/System.map $(INSTALL_PATH)/System.old; fi + cat $(BOOTIMAGE) > $(INSTALL_PATH)/vmlinuz + cp System.map $(INSTALL_PATH)/ + if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi + +install: + sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)" diff --git a/arch/i386/boot/a20.c b/arch/x86/boot/a20.c index 31348d054fc..31348d054fc 100644 --- a/arch/i386/boot/a20.c +++ b/arch/x86/boot/a20.c diff --git a/arch/i386/boot/apm.c b/arch/x86/boot/apm.c index eab50c55a3a..eab50c55a3a 100644 --- a/arch/i386/boot/apm.c +++ b/arch/x86/boot/apm.c diff --git a/arch/i386/boot/bitops.h b/arch/x86/boot/bitops.h index 8dcc8dc7db8..8dcc8dc7db8 100644 --- a/arch/i386/boot/bitops.h +++ b/arch/x86/boot/bitops.h diff --git a/arch/i386/boot/boot.h b/arch/x86/boot/boot.h index 20bab9431ac..20bab9431ac 100644 --- a/arch/i386/boot/boot.h +++ b/arch/x86/boot/boot.h diff --git a/arch/i386/boot/cmdline.c b/arch/x86/boot/cmdline.c index 34bb778c435..34bb778c435 100644 --- a/arch/i386/boot/cmdline.c +++ b/arch/x86/boot/cmdline.c diff --git a/arch/i386/boot/code16gcc.h b/arch/x86/boot/code16gcc.h index d93e48010b6..d93e48010b6 100644 --- a/arch/i386/boot/code16gcc.h +++ b/arch/x86/boot/code16gcc.h diff --git a/arch/i386/boot/compressed/.gitignore b/arch/x86/boot/compressed/.gitignore index be0ed065249..be0ed065249 100644 --- a/arch/i386/boot/compressed/.gitignore +++ b/arch/x86/boot/compressed/.gitignore diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile new file mode 100644 index 00000000000..52c1db85452 --- /dev/null +++ b/arch/x86/boot/compressed/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/boot/compressed/Makefile_32 +else +include ${srctree}/arch/x86/boot/compressed/Makefile_64 +endif diff --git a/arch/x86/boot/compressed/Makefile_32 b/arch/x86/boot/compressed/Makefile_32 new file mode 100644 index 00000000000..22613c652d2 --- /dev/null +++ b/arch/x86/boot/compressed/Makefile_32 @@ -0,0 +1,50 @@ +# +# linux/arch/x86/boot/compressed/Makefile +# +# create a compressed vmlinux image from the original vmlinux +# + +targets := vmlinux vmlinux.bin vmlinux.bin.gz head_32.o misc_32.o piggy.o \ + vmlinux.bin.all vmlinux.relocs +EXTRA_AFLAGS := -traditional + +LDFLAGS_vmlinux := -T +hostprogs-y := relocs + +CFLAGS := -m32 -D__KERNEL__ $(LINUX_INCLUDE) -O2 \ + -fno-strict-aliasing -fPIC \ + $(call cc-option,-ffreestanding) \ + $(call cc-option,-fno-stack-protector) +LDFLAGS := -m elf_i386 + +$(obj)/vmlinux: $(src)/vmlinux_32.lds $(obj)/head_32.o $(obj)/misc_32.o $(obj)/piggy.o FORCE + $(call if_changed,ld) + @: + +$(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + +quiet_cmd_relocs = RELOCS $@ + cmd_relocs = $(obj)/relocs $< > $@;$(obj)/relocs --abs-relocs $< +$(obj)/vmlinux.relocs: vmlinux $(obj)/relocs FORCE + $(call if_changed,relocs) + +vmlinux.bin.all-y := $(obj)/vmlinux.bin +vmlinux.bin.all-$(CONFIG_RELOCATABLE) += $(obj)/vmlinux.relocs +quiet_cmd_relocbin = BUILD $@ + cmd_relocbin = cat $(filter-out FORCE,$^) > $@ +$(obj)/vmlinux.bin.all: $(vmlinux.bin.all-y) FORCE + $(call if_changed,relocbin) + +ifdef CONFIG_RELOCATABLE +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin.all FORCE + $(call if_changed,gzip) +else +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE + $(call if_changed,gzip) +endif + +LDFLAGS_piggy.o := -r --format binary --oformat elf32-i386 -T + +$(obj)/piggy.o: $(src)/vmlinux_32.scr $(obj)/vmlinux.bin.gz FORCE + $(call if_changed,ld) diff --git a/arch/x86/boot/compressed/Makefile_64 b/arch/x86/boot/compressed/Makefile_64 new file mode 100644 index 00000000000..dc6b3380cc4 --- /dev/null +++ b/arch/x86/boot/compressed/Makefile_64 @@ -0,0 +1,30 @@ +# +# linux/arch/x86/boot/compressed/Makefile +# +# create a compressed vmlinux image from the original vmlinux +# + +targets := vmlinux vmlinux.bin vmlinux.bin.gz head_64.o misc_64.o piggy.o + +CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \ + -fno-strict-aliasing -fPIC -mcmodel=small \ + $(call cc-option, -ffreestanding) \ + $(call cc-option, -fno-stack-protector) +AFLAGS := $(CFLAGS) -D__ASSEMBLY__ +LDFLAGS := -m elf_x86_64 + +LDFLAGS_vmlinux := -T +$(obj)/vmlinux: $(src)/vmlinux_64.lds $(obj)/head_64.o $(obj)/misc_64.o $(obj)/piggy.o FORCE + $(call if_changed,ld) + @: + +$(obj)/vmlinux.bin: vmlinux FORCE + $(call if_changed,objcopy) + +$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE + $(call if_changed,gzip) + +LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T + +$(obj)/piggy.o: $(obj)/vmlinux_64.scr $(obj)/vmlinux.bin.gz FORCE + $(call if_changed,ld) diff --git a/arch/i386/boot/compressed/head.S b/arch/x86/boot/compressed/head_32.S index f35ea223752..f35ea223752 100644 --- a/arch/i386/boot/compressed/head.S +++ b/arch/x86/boot/compressed/head_32.S diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S new file mode 100644 index 00000000000..49467640751 --- /dev/null +++ b/arch/x86/boot/compressed/head_64.S @@ -0,0 +1,311 @@ +/* + * linux/boot/head.S + * + * Copyright (C) 1991, 1992, 1993 Linus Torvalds + */ + +/* + * head.S contains the 32-bit startup code. + * + * NOTE!!! Startup happens at absolute address 0x00001000, which is also where + * the page directory will exist. The startup code will be overwritten by + * the page directory. [According to comments etc elsewhere on a compressed + * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC] + * + * Page 0 is deliberately kept safe, since System Management Mode code in + * laptops may need to access the BIOS data stored there. This is also + * useful for future device drivers that either access the BIOS via VM86 + * mode. + */ + +/* + * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 + */ +.code32 +.text + +#include <linux/linkage.h> +#include <asm/segment.h> +#include <asm/pgtable.h> +#include <asm/page.h> +#include <asm/msr.h> + +.section ".text.head" + .code32 + .globl startup_32 + +startup_32: + cld + cli + movl $(__KERNEL_DS), %eax + movl %eax, %ds + movl %eax, %es + movl %eax, %ss + +/* Calculate the delta between where we were compiled to run + * at and where we were actually loaded at. This can only be done + * with a short local call on x86. Nothing else will tell us what + * address we are running at. The reserved chunk of the real-mode + * data at 0x1e4 (defined as a scratch field) are used as the stack + * for this calculation. Only 4 bytes are needed. + */ + leal (0x1e4+4)(%esi), %esp + call 1f +1: popl %ebp + subl $1b, %ebp + +/* setup a stack and make sure cpu supports long mode. */ + movl $user_stack_end, %eax + addl %ebp, %eax + movl %eax, %esp + + call verify_cpu + testl %eax, %eax + jnz no_longmode + +/* Compute the delta between where we were compiled to run at + * and where the code will actually run at. + */ +/* %ebp contains the address we are loaded at by the boot loader and %ebx + * contains the address where we should move the kernel image temporarily + * for safe in-place decompression. + */ + +#ifdef CONFIG_RELOCATABLE + movl %ebp, %ebx + addl $(LARGE_PAGE_SIZE -1), %ebx + andl $LARGE_PAGE_MASK, %ebx +#else + movl $CONFIG_PHYSICAL_START, %ebx +#endif + + /* Replace the compressed data size with the uncompressed size */ + subl input_len(%ebp), %ebx + movl output_len(%ebp), %eax + addl %eax, %ebx + /* Add 8 bytes for every 32K input block */ + shrl $12, %eax + addl %eax, %ebx + /* Add 32K + 18 bytes of extra slack and align on a 4K boundary */ + addl $(32768 + 18 + 4095), %ebx + andl $~4095, %ebx + +/* + * Prepare for entering 64 bit mode + */ + + /* Load new GDT with the 64bit segments using 32bit descriptor */ + leal gdt(%ebp), %eax + movl %eax, gdt+2(%ebp) + lgdt gdt(%ebp) + + /* Enable PAE mode */ + xorl %eax, %eax + orl $(1 << 5), %eax + movl %eax, %cr4 + + /* + * Build early 4G boot pagetable + */ + /* Initialize Page tables to 0*/ + leal pgtable(%ebx), %edi + xorl %eax, %eax + movl $((4096*6)/4), %ecx + rep stosl + + /* Build Level 4 */ + leal pgtable + 0(%ebx), %edi + leal 0x1007 (%edi), %eax + movl %eax, 0(%edi) + + /* Build Level 3 */ + leal pgtable + 0x1000(%ebx), %edi + leal 0x1007(%edi), %eax + movl $4, %ecx +1: movl %eax, 0x00(%edi) + addl $0x00001000, %eax + addl $8, %edi + decl %ecx + jnz 1b + + /* Build Level 2 */ + leal pgtable + 0x2000(%ebx), %edi + movl $0x00000183, %eax + movl $2048, %ecx +1: movl %eax, 0(%edi) + addl $0x00200000, %eax + addl $8, %edi + decl %ecx + jnz 1b + + /* Enable the boot page tables */ + leal pgtable(%ebx), %eax + movl %eax, %cr3 + + /* Enable Long mode in EFER (Extended Feature Enable Register) */ + movl $MSR_EFER, %ecx + rdmsr + btsl $_EFER_LME, %eax + wrmsr + + /* Setup for the jump to 64bit mode + * + * When the jump is performend we will be in long mode but + * in 32bit compatibility mode with EFER.LME = 1, CS.L = 0, CS.D = 1 + * (and in turn EFER.LMA = 1). To jump into 64bit mode we use + * the new gdt/idt that has __KERNEL_CS with CS.L = 1. + * We place all of the values on our mini stack so lret can + * used to perform that far jump. + */ + pushl $__KERNEL_CS + leal startup_64(%ebp), %eax + pushl %eax + + /* Enter paged protected Mode, activating Long Mode */ + movl $0x80000001, %eax /* Enable Paging and Protected mode */ + movl %eax, %cr0 + + /* Jump from 32bit compatibility mode into 64bit mode. */ + lret + +no_longmode: + /* This isn't an x86-64 CPU so hang */ +1: + hlt + jmp 1b + +#include "../../kernel/verify_cpu_64.S" + + /* Be careful here startup_64 needs to be at a predictable + * address so I can export it in an ELF header. Bootloaders + * should look at the ELF header to find this address, as + * it may change in the future. + */ + .code64 + .org 0x200 +ENTRY(startup_64) + /* We come here either from startup_32 or directly from a + * 64bit bootloader. If we come here from a bootloader we depend on + * an identity mapped page table being provied that maps our + * entire text+data+bss and hopefully all of memory. + */ + + /* Setup data segments. */ + xorl %eax, %eax + movl %eax, %ds + movl %eax, %es + movl %eax, %ss + movl %eax, %fs + movl %eax, %gs + lldt %ax + movl $0x20, %eax + ltr %ax + + /* Compute the decompressed kernel start address. It is where + * we were loaded at aligned to a 2M boundary. %rbp contains the + * decompressed kernel start address. + * + * If it is a relocatable kernel then decompress and run the kernel + * from load address aligned to 2MB addr, otherwise decompress and + * run the kernel from CONFIG_PHYSICAL_START + */ + + /* Start with the delta to where the kernel will run at. */ +#ifdef CONFIG_RELOCATABLE + leaq startup_32(%rip) /* - $startup_32 */, %rbp + addq $(LARGE_PAGE_SIZE - 1), %rbp + andq $LARGE_PAGE_MASK, %rbp + movq %rbp, %rbx +#else + movq $CONFIG_PHYSICAL_START, %rbp + movq %rbp, %rbx +#endif + + /* Replace the compressed data size with the uncompressed size */ + movl input_len(%rip), %eax + subq %rax, %rbx + movl output_len(%rip), %eax + addq %rax, %rbx + /* Add 8 bytes for every 32K input block */ + shrq $12, %rax + addq %rax, %rbx + /* Add 32K + 18 bytes of extra slack and align on a 4K boundary */ + addq $(32768 + 18 + 4095), %rbx + andq $~4095, %rbx + +/* Copy the compressed kernel to the end of our buffer + * where decompression in place becomes safe. + */ + leaq _end(%rip), %r8 + leaq _end(%rbx), %r9 + movq $_end /* - $startup_32 */, %rcx +1: subq $8, %r8 + subq $8, %r9 + movq 0(%r8), %rax + movq %rax, 0(%r9) + subq $8, %rcx + jnz 1b + +/* + * Jump to the relocated address. + */ + leaq relocated(%rbx), %rax + jmp *%rax + +.section ".text" +relocated: + +/* + * Clear BSS + */ + xorq %rax, %rax + leaq _edata(%rbx), %rdi + leaq _end(%rbx), %rcx + subq %rdi, %rcx + cld + rep + stosb + + /* Setup the stack */ + leaq user_stack_end(%rip), %rsp + + /* zero EFLAGS after setting rsp */ + pushq $0 + popfq + +/* + * Do the decompression, and jump to the new kernel.. + */ + pushq %rsi # Save the real mode argument + movq %rsi, %rdi # real mode address + leaq _heap(%rip), %rsi # _heap + leaq input_data(%rip), %rdx # input_data + movl input_len(%rip), %eax + movq %rax, %rcx # input_len + movq %rbp, %r8 # output + call decompress_kernel + popq %rsi + + +/* + * Jump to the decompressed kernel. + */ + jmp *%rbp + + .data +gdt: + .word gdt_end - gdt + .long gdt + .word 0 + .quad 0x0000000000000000 /* NULL descriptor */ + .quad 0x00af9a000000ffff /* __KERNEL_CS */ + .quad 0x00cf92000000ffff /* __KERNEL_DS */ + .quad 0x0080890000000000 /* TS descriptor */ + .quad 0x0000000000000000 /* TS continued */ +gdt_end: + .bss +/* Stack for uncompression */ + .balign 4 +user_stack: + .fill 4096,4,0 +user_stack_end: diff --git a/arch/i386/boot/compressed/misc.c b/arch/x86/boot/compressed/misc_32.c index b28505c544c..b28505c544c 100644 --- a/arch/i386/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc_32.c diff --git a/arch/x86_64/boot/compressed/misc.c b/arch/x86/boot/compressed/misc_64.c index f932b0e8909..f932b0e8909 100644 --- a/arch/x86_64/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc_64.c diff --git a/arch/i386/boot/compressed/relocs.c b/arch/x86/boot/compressed/relocs.c index 2d77ee728f9..2d77ee728f9 100644 --- a/arch/i386/boot/compressed/relocs.c +++ b/arch/x86/boot/compressed/relocs.c diff --git a/arch/i386/boot/compressed/vmlinux.lds b/arch/x86/boot/compressed/vmlinux_32.lds index cc4854f6c6c..cc4854f6c6c 100644 --- a/arch/i386/boot/compressed/vmlinux.lds +++ b/arch/x86/boot/compressed/vmlinux_32.lds diff --git a/arch/i386/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux_32.scr index 707a88f7f29..707a88f7f29 100644 --- a/arch/i386/boot/compressed/vmlinux.scr +++ b/arch/x86/boot/compressed/vmlinux_32.scr diff --git a/arch/x86_64/boot/compressed/vmlinux.lds b/arch/x86/boot/compressed/vmlinux_64.lds index 94c13e557fb..94c13e557fb 100644 --- a/arch/x86_64/boot/compressed/vmlinux.lds +++ b/arch/x86/boot/compressed/vmlinux_64.lds diff --git a/arch/x86_64/boot/compressed/vmlinux.scr b/arch/x86/boot/compressed/vmlinux_64.scr index bd1429ce193..bd1429ce193 100644 --- a/arch/x86_64/boot/compressed/vmlinux.scr +++ b/arch/x86/boot/compressed/vmlinux_64.scr diff --git a/arch/i386/boot/copy.S b/arch/x86/boot/copy.S index ef127e56a3c..ef127e56a3c 100644 --- a/arch/i386/boot/copy.S +++ b/arch/x86/boot/copy.S diff --git a/arch/i386/boot/cpu.c b/arch/x86/boot/cpu.c index 2a5c32da585..2a5c32da585 100644 --- a/arch/i386/boot/cpu.c +++ b/arch/x86/boot/cpu.c diff --git a/arch/i386/boot/cpucheck.c b/arch/x86/boot/cpucheck.c index e655a89c551..e655a89c551 100644 --- a/arch/i386/boot/cpucheck.c +++ b/arch/x86/boot/cpucheck.c diff --git a/arch/i386/boot/edd.c b/arch/x86/boot/edd.c index bd138e442ec..bd138e442ec 100644 --- a/arch/i386/boot/edd.c +++ b/arch/x86/boot/edd.c diff --git a/arch/i386/boot/header.S b/arch/x86/boot/header.S index f3140e596d4..f3140e596d4 100644 --- a/arch/i386/boot/header.S +++ b/arch/x86/boot/header.S diff --git a/arch/i386/boot/install.sh b/arch/x86/boot/install.sh index 88d77761d01..88d77761d01 100644 --- a/arch/i386/boot/install.sh +++ b/arch/x86/boot/install.sh diff --git a/arch/i386/boot/main.c b/arch/x86/boot/main.c index 0eeef3989a1..0eeef3989a1 100644 --- a/arch/i386/boot/main.c +++ b/arch/x86/boot/main.c diff --git a/arch/i386/boot/mca.c b/arch/x86/boot/mca.c index 68222f2d4b6..68222f2d4b6 100644 --- a/arch/i386/boot/mca.c +++ b/arch/x86/boot/mca.c diff --git a/arch/x86/boot/memory.c b/arch/x86/boot/memory.c new file mode 100644 index 00000000000..378353956b5 --- /dev/null +++ b/arch/x86/boot/memory.c @@ -0,0 +1,118 @@ +/* -*- linux-c -*- ------------------------------------------------------- * + * + * Copyright (C) 1991, 1992 Linus Torvalds + * Copyright 2007 rPath, Inc. - All Rights Reserved + * + * This file is part of the Linux kernel, and is made available under + * the terms of the GNU General Public License version 2. + * + * ----------------------------------------------------------------------- */ + +/* + * arch/i386/boot/memory.c + * + * Memory detection code + */ + +#include "boot.h" + +#define SMAP 0x534d4150 /* ASCII "SMAP" */ + +static int detect_memory_e820(void) +{ + int count = 0; + u32 next = 0; + u32 size, id; + u8 err; + struct e820entry *desc = boot_params.e820_map; + + do { + size = sizeof(struct e820entry); + + /* Important: %edx is clobbered by some BIOSes, + so it must be either used for the error output + or explicitly marked clobbered. */ + asm("int $0x15; setc %0" + : "=d" (err), "+b" (next), "=a" (id), "+c" (size), + "=m" (*desc) + : "D" (desc), "d" (SMAP), "a" (0xe820)); + + /* Some BIOSes stop returning SMAP in the middle of + the search loop. We don't know exactly how the BIOS + screwed up the map at that point, we might have a + partial map, the full map, or complete garbage, so + just return failure. */ + if (id != SMAP) { + count = 0; + break; + } + + if (err) + break; + + count++; + desc++; + } while (next && count < E820MAX); + + return boot_params.e820_entries = count; +} + +static int detect_memory_e801(void) +{ + u16 ax, bx, cx, dx; + u8 err; + + bx = cx = dx = 0; + ax = 0xe801; + asm("stc; int $0x15; setc %0" + : "=m" (err), "+a" (ax), "+b" (bx), "+c" (cx), "+d" (dx)); + + if (err) + return -1; + + /* Do we really need to do this? */ + if (cx || dx) { + ax = cx; + bx = dx; + } + + if (ax > 15*1024) + return -1; /* Bogus! */ + + /* This ignores memory above 16MB if we have a memory hole + there. If someone actually finds a machine with a memory + hole at 16MB and no support for 0E820h they should probably + generate a fake e820 map. */ + boot_params.alt_mem_k = (ax == 15*1024) ? (dx << 6)+ax : ax; + + return 0; +} + +static int detect_memory_88(void) +{ + u16 ax; + u8 err; + + ax = 0x8800; + asm("stc; int $0x15; setc %0" : "=bcdm" (err), "+a" (ax)); + + boot_params.screen_info.ext_mem_k = ax; + + return -err; +} + +int detect_memory(void) +{ + int err = -1; + + if (detect_memory_e820() > 0) + err = 0; + + if (!detect_memory_e801()) + err = 0; + + if (!detect_memory_88()) + err = 0; + + return err; +} diff --git a/arch/i386/boot/mtools.conf.in b/arch/x86/boot/mtools.conf.in index efd6d2490c1..efd6d2490c1 100644 --- a/arch/i386/boot/mtools.conf.in +++ b/arch/x86/boot/mtools.conf.in diff --git a/arch/i386/boot/pm.c b/arch/x86/boot/pm.c index 09fb342cc62..09fb342cc62 100644 --- a/arch/i386/boot/pm.c +++ b/arch/x86/boot/pm.c diff --git a/arch/i386/boot/pmjump.S b/arch/x86/boot/pmjump.S index 2e559233725..2e559233725 100644 --- a/arch/i386/boot/pmjump.S +++ b/arch/x86/boot/pmjump.S diff --git a/arch/i386/boot/printf.c b/arch/x86/boot/printf.c index 1a09f9309d3..1a09f9309d3 100644 --- a/arch/i386/boot/printf.c +++ b/arch/x86/boot/printf.c diff --git a/arch/i386/boot/setup.ld b/arch/x86/boot/setup.ld index df9234b3a5e..df9234b3a5e 100644 --- a/arch/i386/boot/setup.ld +++ b/arch/x86/boot/setup.ld diff --git a/arch/i386/boot/string.c b/arch/x86/boot/string.c index 481a2209778..481a2209778 100644 --- a/arch/i386/boot/string.c +++ b/arch/x86/boot/string.c diff --git a/arch/i386/boot/tools/.gitignore b/arch/x86/boot/tools/.gitignore index 378eac25d31..378eac25d31 100644 --- a/arch/i386/boot/tools/.gitignore +++ b/arch/x86/boot/tools/.gitignore diff --git a/arch/i386/boot/tools/build.c b/arch/x86/boot/tools/build.c index b4248740ff0..b4248740ff0 100644 --- a/arch/i386/boot/tools/build.c +++ b/arch/x86/boot/tools/build.c diff --git a/arch/i386/boot/tty.c b/arch/x86/boot/tty.c index f3f14bd2637..f3f14bd2637 100644 --- a/arch/i386/boot/tty.c +++ b/arch/x86/boot/tty.c diff --git a/arch/i386/boot/version.c b/arch/x86/boot/version.c index c61462f7d9a..c61462f7d9a 100644 --- a/arch/i386/boot/version.c +++ b/arch/x86/boot/version.c diff --git a/arch/i386/boot/vesa.h b/arch/x86/boot/vesa.h index ff5b73cd406..ff5b73cd406 100644 --- a/arch/i386/boot/vesa.h +++ b/arch/x86/boot/vesa.h diff --git a/arch/i386/boot/video-bios.c b/arch/x86/boot/video-bios.c index 68e65d95cdf..68e65d95cdf 100644 --- a/arch/i386/boot/video-bios.c +++ b/arch/x86/boot/video-bios.c diff --git a/arch/i386/boot/video-vesa.c b/arch/x86/boot/video-vesa.c index 19219071071..19219071071 100644 --- a/arch/i386/boot/video-vesa.c +++ b/arch/x86/boot/video-vesa.c diff --git a/arch/i386/boot/video-vga.c b/arch/x86/boot/video-vga.c index aef02f9ec0c..aef02f9ec0c 100644 --- a/arch/i386/boot/video-vga.c +++ b/arch/x86/boot/video-vga.c diff --git a/arch/i386/boot/video.c b/arch/x86/boot/video.c index e4ba897bf9a..e4ba897bf9a 100644 --- a/arch/i386/boot/video.c +++ b/arch/x86/boot/video.c diff --git a/arch/i386/boot/video.h b/arch/x86/boot/video.h index b92447d5121..b92447d5121 100644 --- a/arch/i386/boot/video.h +++ b/arch/x86/boot/video.h diff --git a/arch/i386/boot/voyager.c b/arch/x86/boot/voyager.c index 61c8fe0453b..61c8fe0453b 100644 --- a/arch/i386/boot/voyager.c +++ b/arch/x86/boot/voyager.c diff --git a/arch/x86/crypto/Makefile b/arch/x86/crypto/Makefile new file mode 100644 index 00000000000..18dcdc6fb7a --- /dev/null +++ b/arch/x86/crypto/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/crypto/Makefile_32 +else +include ${srctree}/arch/x86/crypto/Makefile_64 +endif diff --git a/arch/x86/crypto/Makefile_32 b/arch/x86/crypto/Makefile_32 new file mode 100644 index 00000000000..2d873a2388e --- /dev/null +++ b/arch/x86/crypto/Makefile_32 @@ -0,0 +1,12 @@ +# +# x86/crypto/Makefile +# +# Arch-specific CryptoAPI modules. +# + +obj-$(CONFIG_CRYPTO_AES_586) += aes-i586.o +obj-$(CONFIG_CRYPTO_TWOFISH_586) += twofish-i586.o + +aes-i586-y := aes-i586-asm_32.o aes_32.o +twofish-i586-y := twofish-i586-asm_32.o twofish_32.o + diff --git a/arch/x86/crypto/Makefile_64 b/arch/x86/crypto/Makefile_64 new file mode 100644 index 00000000000..b40896276e9 --- /dev/null +++ b/arch/x86/crypto/Makefile_64 @@ -0,0 +1,12 @@ +# +# x86/crypto/Makefile +# +# Arch-specific CryptoAPI modules. +# + +obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o +obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o + +aes-x86_64-y := aes-x86_64-asm_64.o aes_64.o +twofish-x86_64-y := twofish-x86_64-asm_64.o twofish_64.o + diff --git a/arch/i386/crypto/aes-i586-asm.S b/arch/x86/crypto/aes-i586-asm_32.S index f942f0c8f63..f942f0c8f63 100644 --- a/arch/i386/crypto/aes-i586-asm.S +++ b/arch/x86/crypto/aes-i586-asm_32.S diff --git a/arch/x86_64/crypto/aes-x86_64-asm.S b/arch/x86/crypto/aes-x86_64-asm_64.S index 26b40de4d0b..26b40de4d0b 100644 --- a/arch/x86_64/crypto/aes-x86_64-asm.S +++ b/arch/x86/crypto/aes-x86_64-asm_64.S diff --git a/arch/i386/crypto/aes.c b/arch/x86/crypto/aes_32.c index 49aad9397f1..49aad9397f1 100644 --- a/arch/i386/crypto/aes.c +++ b/arch/x86/crypto/aes_32.c diff --git a/arch/x86_64/crypto/aes.c b/arch/x86/crypto/aes_64.c index 5cdb13ea5cc..5cdb13ea5cc 100644 --- a/arch/x86_64/crypto/aes.c +++ b/arch/x86/crypto/aes_64.c diff --git a/arch/i386/crypto/twofish-i586-asm.S b/arch/x86/crypto/twofish-i586-asm_32.S index 39b98ed2c1b..39b98ed2c1b 100644 --- a/arch/i386/crypto/twofish-i586-asm.S +++ b/arch/x86/crypto/twofish-i586-asm_32.S diff --git a/arch/x86_64/crypto/twofish-x86_64-asm.S b/arch/x86/crypto/twofish-x86_64-asm_64.S index 35974a58661..35974a58661 100644 --- a/arch/x86_64/crypto/twofish-x86_64-asm.S +++ b/arch/x86/crypto/twofish-x86_64-asm_64.S diff --git a/arch/i386/crypto/twofish.c b/arch/x86/crypto/twofish_32.c index e3004dfe9c7..e3004dfe9c7 100644 --- a/arch/i386/crypto/twofish.c +++ b/arch/x86/crypto/twofish_32.c diff --git a/arch/x86_64/crypto/twofish.c b/arch/x86/crypto/twofish_64.c index 182d91d5cfb..182d91d5cfb 100644 --- a/arch/x86_64/crypto/twofish.c +++ b/arch/x86/crypto/twofish_64.c diff --git a/arch/x86_64/ia32/Makefile b/arch/x86/ia32/Makefile index cdae36435e2..cdae36435e2 100644 --- a/arch/x86_64/ia32/Makefile +++ b/arch/x86/ia32/Makefile diff --git a/arch/x86/ia32/audit.c b/arch/x86/ia32/audit.c new file mode 100644 index 00000000000..91b7b5922df --- /dev/null +++ b/arch/x86/ia32/audit.c @@ -0,0 +1,42 @@ +#include <asm/unistd_32.h> + +unsigned ia32_dir_class[] = { +#include <asm-generic/audit_dir_write.h> +~0U +}; + +unsigned ia32_chattr_class[] = { +#include <asm-generic/audit_change_attr.h> +~0U +}; + +unsigned ia32_write_class[] = { +#include <asm-generic/audit_write.h> +~0U +}; + +unsigned ia32_read_class[] = { +#include <asm-generic/audit_read.h> +~0U +}; + +unsigned ia32_signal_class[] = { +#include <asm-generic/audit_signal.h> +~0U +}; + +int ia32_classify_syscall(unsigned syscall) +{ + switch(syscall) { + case __NR_open: + return 2; + case __NR_openat: + return 3; + case __NR_socketcall: + return 4; + case __NR_execve: + return 5; + default: + return 1; + } +} diff --git a/arch/x86_64/ia32/fpu32.c b/arch/x86/ia32/fpu32.c index 2c8209a3605..2c8209a3605 100644 --- a/arch/x86_64/ia32/fpu32.c +++ b/arch/x86/ia32/fpu32.c diff --git a/arch/x86_64/ia32/ia32_aout.c b/arch/x86/ia32/ia32_aout.c index 08781370256..08781370256 100644 --- a/arch/x86_64/ia32/ia32_aout.c +++ b/arch/x86/ia32/ia32_aout.c diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86/ia32/ia32_binfmt.c index dffd2ac7274..dffd2ac7274 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86/ia32/ia32_binfmt.c diff --git a/arch/x86_64/ia32/ia32_signal.c b/arch/x86/ia32/ia32_signal.c index 6ea19c25f90..6ea19c25f90 100644 --- a/arch/x86_64/ia32/ia32_signal.c +++ b/arch/x86/ia32/ia32_signal.c diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86/ia32/ia32entry.S index 18b23181090..18b23181090 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86/ia32/ia32entry.S diff --git a/arch/x86/ia32/ipc32.c b/arch/x86/ia32/ipc32.c new file mode 100644 index 00000000000..2e1869ec4db --- /dev/null +++ b/arch/x86/ia32/ipc32.c @@ -0,0 +1,57 @@ +#include <linux/kernel.h> +#include <linux/spinlock.h> +#include <linux/list.h> +#include <linux/syscalls.h> +#include <linux/time.h> +#include <linux/sem.h> +#include <linux/msg.h> +#include <linux/shm.h> +#include <linux/ipc.h> +#include <linux/compat.h> + +#include <asm/ipc.h> + +asmlinkage long +sys32_ipc(u32 call, int first, int second, int third, + compat_uptr_t ptr, u32 fifth) +{ + int version; + + version = call >> 16; /* hack for backward compatibility */ + call &= 0xffff; + + switch (call) { + case SEMOP: + /* struct sembuf is the same on 32 and 64bit :)) */ + return sys_semtimedop(first, compat_ptr(ptr), second, NULL); + case SEMTIMEDOP: + return compat_sys_semtimedop(first, compat_ptr(ptr), second, + compat_ptr(fifth)); + case SEMGET: + return sys_semget(first, second, third); + case SEMCTL: + return compat_sys_semctl(first, second, third, compat_ptr(ptr)); + + case MSGSND: + return compat_sys_msgsnd(first, second, third, compat_ptr(ptr)); + case MSGRCV: + return compat_sys_msgrcv(first, second, fifth, third, + version, compat_ptr(ptr)); + case MSGGET: + return sys_msgget((key_t) first, second); + case MSGCTL: + return compat_sys_msgctl(first, second, compat_ptr(ptr)); + + case SHMAT: + return compat_sys_shmat(first, second, third, version, + compat_ptr(ptr)); + break; + case SHMDT: + return sys_shmdt(compat_ptr(ptr)); + case SHMGET: + return sys_shmget(first, (unsigned)second, third); + case SHMCTL: + return compat_sys_shmctl(first, second, compat_ptr(ptr)); + } + return -ENOSYS; +} diff --git a/arch/x86_64/ia32/mmap32.c b/arch/x86/ia32/mmap32.c index e4b84b4a417..e4b84b4a417 100644 --- a/arch/x86_64/ia32/mmap32.c +++ b/arch/x86/ia32/mmap32.c diff --git a/arch/x86_64/ia32/ptrace32.c b/arch/x86/ia32/ptrace32.c index 4a233ad6269..4a233ad6269 100644 --- a/arch/x86_64/ia32/ptrace32.c +++ b/arch/x86/ia32/ptrace32.c diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index bee96d61443..bee96d61443 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86/ia32/syscall32.c index 15013bac181..15013bac181 100644 --- a/arch/x86_64/ia32/syscall32.c +++ b/arch/x86/ia32/syscall32.c diff --git a/arch/x86/ia32/syscall32_syscall.S b/arch/x86/ia32/syscall32_syscall.S new file mode 100644 index 00000000000..933f0f08b1c --- /dev/null +++ b/arch/x86/ia32/syscall32_syscall.S @@ -0,0 +1,17 @@ +/* 32bit VDSOs mapped into user space. */ + + .section ".init.data","aw" + + .globl syscall32_syscall + .globl syscall32_syscall_end + +syscall32_syscall: + .incbin "arch/x86/ia32/vsyscall-syscall.so" +syscall32_syscall_end: + + .globl syscall32_sysenter + .globl syscall32_sysenter_end + +syscall32_sysenter: + .incbin "arch/x86/ia32/vsyscall-sysenter.so" +syscall32_sysenter_end: diff --git a/arch/x86_64/ia32/tls32.c b/arch/x86/ia32/tls32.c index 1cc4340de3c..1cc4340de3c 100644 --- a/arch/x86_64/ia32/tls32.c +++ b/arch/x86/ia32/tls32.c diff --git a/arch/x86/ia32/vsyscall-sigreturn.S b/arch/x86/ia32/vsyscall-sigreturn.S new file mode 100644 index 00000000000..b383be00bae --- /dev/null +++ b/arch/x86/ia32/vsyscall-sigreturn.S @@ -0,0 +1,143 @@ +/* + * Common code for the sigreturn entry points on the vsyscall page. + * This code uses SYSCALL_ENTER_KERNEL (either syscall or int $0x80) + * to enter the kernel. + * This file is #include'd by vsyscall-*.S to define them after the + * vsyscall entry point. The addresses we get for these entry points + * by doing ".balign 32" must match in both versions of the page. + */ + + .code32 + .section .text.sigreturn,"ax" + .balign 32 + .globl __kernel_sigreturn + .type __kernel_sigreturn,@function +__kernel_sigreturn: +.LSTART_sigreturn: + popl %eax + movl $__NR_ia32_sigreturn, %eax + SYSCALL_ENTER_KERNEL +.LEND_sigreturn: + .size __kernel_sigreturn,.-.LSTART_sigreturn + + .section .text.rtsigreturn,"ax" + .balign 32 + .globl __kernel_rt_sigreturn + .type __kernel_rt_sigreturn,@function +__kernel_rt_sigreturn: +.LSTART_rt_sigreturn: + movl $__NR_ia32_rt_sigreturn, %eax + SYSCALL_ENTER_KERNEL +.LEND_rt_sigreturn: + .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn + + .section .eh_frame,"a",@progbits +.LSTARTFRAMES: + .long .LENDCIES-.LSTARTCIES +.LSTARTCIES: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zRS" /* NUL-terminated augmentation string */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 + .align 4 +.LENDCIES: + + .long .LENDFDE2-.LSTARTFDE2 /* Length FDE */ +.LSTARTFDE2: + .long .LSTARTFDE2-.LSTARTFRAMES /* CIE pointer */ + /* HACK: The dwarf2 unwind routines will subtract 1 from the + return address to get an address in the middle of the + presumed call instruction. Since we didn't get here via + a call, we need to include the nop before the real start + to make up for it. */ + .long .LSTART_sigreturn-1-. /* PC-relative start address */ + .long .LEND_sigreturn-.LSTART_sigreturn+1 + .uleb128 0 /* Augmentation length */ + /* What follows are the instructions for the table generation. + We record the locations of each register saved. This is + complicated by the fact that the "CFA" is always assumed to + be the value of the stack pointer in the caller. This means + that we must define the CFA of this body of code to be the + saved value of the stack pointer in the sigcontext. Which + also means that there is no fixed relation to the other + saved registers, which means that we must use DW_CFA_expression + to compute their addresses. It also means that when we + adjust the stack with the popl, we have to do it all over again. */ + +#define do_cfa_expr(offset) \ + .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ + .uleb128 1f-0f; /* length */ \ +0: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ + .byte 0x06; /* DW_OP_deref */ \ +1: + +#define do_expr(regno, offset) \ + .byte 0x10; /* DW_CFA_expression */ \ + .uleb128 regno; /* regno */ \ + .uleb128 1f-0f; /* length */ \ +0: .byte 0x74; /* DW_OP_breg4 */ \ + .sleb128 offset; /* offset */ \ +1: + + do_cfa_expr(IA32_SIGCONTEXT_esp+4) + do_expr(0, IA32_SIGCONTEXT_eax+4) + do_expr(1, IA32_SIGCONTEXT_ecx+4) + do_expr(2, IA32_SIGCONTEXT_edx+4) + do_expr(3, IA32_SIGCONTEXT_ebx+4) + do_expr(5, IA32_SIGCONTEXT_ebp+4) + do_expr(6, IA32_SIGCONTEXT_esi+4) + do_expr(7, IA32_SIGCONTEXT_edi+4) + do_expr(8, IA32_SIGCONTEXT_eip+4) + + .byte 0x42 /* DW_CFA_advance_loc 2 -- nop; popl eax. */ + + do_cfa_expr(IA32_SIGCONTEXT_esp) + do_expr(0, IA32_SIGCONTEXT_eax) + do_expr(1, IA32_SIGCONTEXT_ecx) + do_expr(2, IA32_SIGCONTEXT_edx) + do_expr(3, IA32_SIGCONTEXT_ebx) + do_expr(5, IA32_SIGCONTEXT_ebp) + do_expr(6, IA32_SIGCONTEXT_esi) + do_expr(7, IA32_SIGCONTEXT_edi) + do_expr(8, IA32_SIGCONTEXT_eip) + + .align 4 +.LENDFDE2: + + .long .LENDFDE3-.LSTARTFDE3 /* Length FDE */ +.LSTARTFDE3: + .long .LSTARTFDE3-.LSTARTFRAMES /* CIE pointer */ + /* HACK: See above wrt unwind library assumptions. */ + .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */ + .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1 + .uleb128 0 /* Augmentation */ + /* What follows are the instructions for the table generation. + We record the locations of each register saved. This is + slightly less complicated than the above, since we don't + modify the stack pointer in the process. */ + + do_cfa_expr(IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esp) + do_expr(0, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eax) + do_expr(1, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ecx) + do_expr(2, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edx) + do_expr(3, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebx) + do_expr(5, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebp) + do_expr(6, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esi) + do_expr(7, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edi) + do_expr(8, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eip) + + .align 4 +.LENDFDE3: + +#include "../../x86/kernel/vsyscall-note_32.S" + diff --git a/arch/x86_64/ia32/vsyscall-syscall.S b/arch/x86/ia32/vsyscall-syscall.S index cf9ef678de3..cf9ef678de3 100644 --- a/arch/x86_64/ia32/vsyscall-syscall.S +++ b/arch/x86/ia32/vsyscall-syscall.S diff --git a/arch/x86_64/ia32/vsyscall-sysenter.S b/arch/x86/ia32/vsyscall-sysenter.S index ae056e553d1..ae056e553d1 100644 --- a/arch/x86_64/ia32/vsyscall-sysenter.S +++ b/arch/x86/ia32/vsyscall-sysenter.S diff --git a/arch/x86_64/ia32/vsyscall.lds b/arch/x86/ia32/vsyscall.lds index 1dc86ff5bcb..1dc86ff5bcb 100644 --- a/arch/x86_64/ia32/vsyscall.lds +++ b/arch/x86/ia32/vsyscall.lds diff --git a/arch/i386/kernel/.gitignore b/arch/x86/kernel/.gitignore index 40836ad9079..40836ad9079 100644 --- a/arch/i386/kernel/.gitignore +++ b/arch/x86/kernel/.gitignore diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile new file mode 100644 index 00000000000..45855c97923 --- /dev/null +++ b/arch/x86/kernel/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/kernel/Makefile_32 +else +include ${srctree}/arch/x86/kernel/Makefile_64 +endif diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32 new file mode 100644 index 00000000000..c624193740f --- /dev/null +++ b/arch/x86/kernel/Makefile_32 @@ -0,0 +1,86 @@ +# +# Makefile for the linux kernel. +# + +extra-y := head_32.o init_task_32.o vmlinux.lds + +obj-y := process_32.o signal_32.o entry_32.o traps_32.o irq_32.o \ + ptrace_32.o time_32.o ioport_32.o ldt_32.o setup_32.o i8259_32.o sys_i386_32.o \ + pci-dma_32.o i386_ksyms_32.o i387_32.o bootflag.o e820_32.o\ + quirks.o i8237.o topology.o alternative.o i8253_32.o tsc_32.o + +obj-$(CONFIG_STACKTRACE) += stacktrace.o +obj-y += cpu/ +obj-y += acpi/ +obj-$(CONFIG_X86_BIOS_REBOOT) += reboot_32.o +obj-$(CONFIG_MCA) += mca_32.o +obj-$(CONFIG_X86_MSR) += msr.o +obj-$(CONFIG_X86_CPUID) += cpuid.o +obj-$(CONFIG_MICROCODE) += microcode.o +obj-$(CONFIG_APM) += apm_32.o +obj-$(CONFIG_X86_SMP) += smp_32.o smpboot_32.o tsc_sync.o +obj-$(CONFIG_SMP) += smpcommon_32.o +obj-$(CONFIG_X86_TRAMPOLINE) += trampoline_32.o +obj-$(CONFIG_X86_MPPARSE) += mpparse_32.o +obj-$(CONFIG_X86_LOCAL_APIC) += apic_32.o nmi_32.o +obj-$(CONFIG_X86_IO_APIC) += io_apic_32.o +obj-$(CONFIG_X86_REBOOTFIXUPS) += reboot_fixups_32.o +obj-$(CONFIG_KEXEC) += machine_kexec_32.o relocate_kernel_32.o crash_32.o +obj-$(CONFIG_CRASH_DUMP) += crash_dump_32.o +obj-$(CONFIG_X86_NUMAQ) += numaq_32.o +obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o +obj-$(CONFIG_KPROBES) += kprobes_32.o +obj-$(CONFIG_MODULES) += module_32.o +obj-y += sysenter_32.o vsyscall_32.o +obj-$(CONFIG_ACPI_SRAT) += srat_32.o +obj-$(CONFIG_EFI) += efi_32.o efi_stub_32.o +obj-$(CONFIG_DOUBLEFAULT) += doublefault_32.o +obj-$(CONFIG_VM86) += vm86_32.o +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-$(CONFIG_HPET_TIMER) += hpet_32.o +obj-$(CONFIG_K8_NB) += k8.o +obj-$(CONFIG_MGEODE_LX) += geode_32.o + +obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o +obj-$(CONFIG_PARAVIRT) += paravirt_32.o +obj-y += pcspeaker.o + +obj-$(CONFIG_SCx200) += scx200_32.o + +# vsyscall_32.o contains the vsyscall DSO images as __initdata. +# We must build both images before we can assemble it. +# Note: kbuild does not track this dependency due to usage of .incbin +$(obj)/vsyscall_32.o: $(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so +targets += $(foreach F,int80 sysenter,vsyscall-$F.o vsyscall-$F.so) +targets += vsyscall-note_32.o vsyscall_32.lds + +# The DSO images are built using a special linker script. +quiet_cmd_syscall = SYSCALL $@ + cmd_syscall = $(CC) -m elf_i386 -nostdlib $(SYSCFLAGS_$(@F)) \ + -Wl,-T,$(filter-out FORCE,$^) -o $@ + +export CPPFLAGS_vsyscall_32.lds += -P -C -U$(ARCH) + +vsyscall-flags = -shared -s -Wl,-soname=linux-gate.so.1 \ + $(call ld-option, -Wl$(comma)--hash-style=sysv) +SYSCFLAGS_vsyscall-sysenter_32.so = $(vsyscall-flags) +SYSCFLAGS_vsyscall-int80_32.so = $(vsyscall-flags) + +$(obj)/vsyscall-int80_32.so $(obj)/vsyscall-sysenter_32.so: \ +$(obj)/vsyscall-%.so: $(src)/vsyscall_32.lds \ + $(obj)/vsyscall-%.o $(obj)/vsyscall-note_32.o FORCE + $(call if_changed,syscall) + +# We also create a special relocatable object that should mirror the symbol +# table and layout of the linked DSO. With ld -R we can then refer to +# these symbols in the kernel code rather than hand-coded addresses. +extra-y += vsyscall-syms.o +$(obj)/built-in.o: $(obj)/vsyscall-syms.o +$(obj)/built-in.o: ld_flags += -R $(obj)/vsyscall-syms.o + +SYSCFLAGS_vsyscall-syms.o = -r +$(obj)/vsyscall-syms.o: $(src)/vsyscall_32.lds \ + $(obj)/vsyscall-sysenter_32.o $(obj)/vsyscall-note_32.o FORCE + $(call if_changed,syscall) + + diff --git a/arch/x86/kernel/Makefile_64 b/arch/x86/kernel/Makefile_64 new file mode 100644 index 00000000000..3ab017a0a3b --- /dev/null +++ b/arch/x86/kernel/Makefile_64 @@ -0,0 +1,54 @@ +# +# Makefile for the linux kernel. +# + +extra-y := head_64.o head64.o init_task_64.o vmlinux.lds +EXTRA_AFLAGS := -traditional +obj-y := process_64.o signal_64.o entry_64.o traps_64.o irq_64.o \ + ptrace_64.o time_64.o ioport_64.o ldt_64.o setup_64.o i8259_64.o sys_x86_64.o \ + x8664_ksyms_64.o i387_64.o syscall_64.o vsyscall_64.o \ + setup64.o bootflag.o e820_64.o reboot_64.o quirks.o i8237.o \ + pci-dma_64.o pci-nommu_64.o alternative.o hpet_64.o tsc_64.o bugs_64.o \ + perfctr-watchdog.o + +obj-$(CONFIG_STACKTRACE) += stacktrace.o +obj-$(CONFIG_X86_MCE) += mce_64.o therm_throt.o +obj-$(CONFIG_X86_MCE_INTEL) += mce_intel_64.o +obj-$(CONFIG_X86_MCE_AMD) += mce_amd_64.o +obj-$(CONFIG_MTRR) += cpu/mtrr/ +obj-$(CONFIG_ACPI) += acpi/ +obj-$(CONFIG_X86_MSR) += msr.o +obj-$(CONFIG_MICROCODE) += microcode.o +obj-$(CONFIG_X86_CPUID) += cpuid.o +obj-$(CONFIG_SMP) += smp_64.o smpboot_64.o trampoline_64.o tsc_sync.o +obj-y += apic_64.o nmi_64.o +obj-y += io_apic_64.o mpparse_64.o genapic_64.o genapic_flat_64.o +obj-$(CONFIG_KEXEC) += machine_kexec_64.o relocate_kernel_64.o crash_64.o +obj-$(CONFIG_CRASH_DUMP) += crash_dump_64.o +obj-$(CONFIG_PM) += suspend_64.o +obj-$(CONFIG_HIBERNATION) += suspend_asm_64.o +obj-$(CONFIG_CPU_FREQ) += cpu/cpufreq/ +obj-$(CONFIG_EARLY_PRINTK) += early_printk.o +obj-$(CONFIG_IOMMU) += pci-gart_64.o aperture_64.o +obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary_64.o tce_64.o +obj-$(CONFIG_SWIOTLB) += pci-swiotlb_64.o +obj-$(CONFIG_KPROBES) += kprobes_64.o +obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o +obj-$(CONFIG_X86_VSMP) += vsmp_64.o +obj-$(CONFIG_K8_NB) += k8.o +obj-$(CONFIG_AUDIT) += audit_64.o + +obj-$(CONFIG_MODULES) += module_64.o +obj-$(CONFIG_PCI) += early-quirks_64.o + +obj-y += topology.o +obj-y += intel_cacheinfo.o +obj-y += addon_cpuid_features.o +obj-y += pcspeaker.o + +CFLAGS_vsyscall_64.o := $(PROFILING) -g0 + +therm_throt-y += cpu/mcheck/therm_throt.o +intel_cacheinfo-y += cpu/intel_cacheinfo.o +addon_cpuid_features-y += cpu/addon_cpuid_features.o +perfctr-watchdog-y += cpu/perfctr-watchdog.o diff --git a/arch/x86/kernel/acpi/Makefile b/arch/x86/kernel/acpi/Makefile new file mode 100644 index 00000000000..3d567193954 --- /dev/null +++ b/arch/x86/kernel/acpi/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/kernel/acpi/Makefile_32 +else +include ${srctree}/arch/x86/kernel/acpi/Makefile_64 +endif diff --git a/arch/x86/kernel/acpi/Makefile_32 b/arch/x86/kernel/acpi/Makefile_32 new file mode 100644 index 00000000000..a4852a2e919 --- /dev/null +++ b/arch/x86/kernel/acpi/Makefile_32 @@ -0,0 +1,10 @@ +obj-$(CONFIG_ACPI) += boot.o +ifneq ($(CONFIG_PCI),) +obj-$(CONFIG_X86_IO_APIC) += earlyquirk_32.o +endif +obj-$(CONFIG_ACPI_SLEEP) += sleep_32.o wakeup_32.o + +ifneq ($(CONFIG_ACPI_PROCESSOR),) +obj-y += cstate.o processor.o +endif + diff --git a/arch/x86/kernel/acpi/Makefile_64 b/arch/x86/kernel/acpi/Makefile_64 new file mode 100644 index 00000000000..629425bc002 --- /dev/null +++ b/arch/x86/kernel/acpi/Makefile_64 @@ -0,0 +1,7 @@ +obj-y := boot.o +obj-$(CONFIG_ACPI_SLEEP) += sleep_64.o wakeup_64.o + +ifneq ($(CONFIG_ACPI_PROCESSOR),) +obj-y += processor.o cstate.o +endif + diff --git a/arch/i386/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index cacdd883bf2..cacdd883bf2 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c diff --git a/arch/i386/kernel/acpi/cstate.c b/arch/x86/kernel/acpi/cstate.c index 2d39f55d29a..2d39f55d29a 100644 --- a/arch/i386/kernel/acpi/cstate.c +++ b/arch/x86/kernel/acpi/cstate.c diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/x86/kernel/acpi/earlyquirk_32.c index 23f78efc577..23f78efc577 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/x86/kernel/acpi/earlyquirk_32.c diff --git a/arch/i386/kernel/acpi/processor.c b/arch/x86/kernel/acpi/processor.c index b54fded4983..b54fded4983 100644 --- a/arch/i386/kernel/acpi/processor.c +++ b/arch/x86/kernel/acpi/processor.c diff --git a/arch/i386/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep_32.c index c42b5ab49de..c42b5ab49de 100644 --- a/arch/i386/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep_32.c diff --git a/arch/x86_64/kernel/acpi/sleep.c b/arch/x86/kernel/acpi/sleep_64.c index 79475d23707..79475d23707 100644 --- a/arch/x86_64/kernel/acpi/sleep.c +++ b/arch/x86/kernel/acpi/sleep_64.c diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/x86/kernel/acpi/wakeup_32.S index f22ba8534d2..f22ba8534d2 100644 --- a/arch/i386/kernel/acpi/wakeup.S +++ b/arch/x86/kernel/acpi/wakeup_32.S diff --git a/arch/x86/kernel/acpi/wakeup_64.S b/arch/x86/kernel/acpi/wakeup_64.S new file mode 100644 index 00000000000..8b4357e1efe --- /dev/null +++ b/arch/x86/kernel/acpi/wakeup_64.S @@ -0,0 +1,456 @@ +.text +#include <linux/linkage.h> +#include <asm/segment.h> +#include <asm/pgtable.h> +#include <asm/page.h> +#include <asm/msr.h> + +# Copyright 2003 Pavel Machek <pavel@suse.cz>, distribute under GPLv2 +# +# wakeup_code runs in real mode, and at unknown address (determined at run-time). +# Therefore it must only use relative jumps/calls. +# +# Do we need to deal with A20? It is okay: ACPI specs says A20 must be enabled +# +# If physical address of wakeup_code is 0x12345, BIOS should call us with +# cs = 0x1234, eip = 0x05 +# + +#define BEEP \ + inb $97, %al; \ + outb %al, $0x80; \ + movb $3, %al; \ + outb %al, $97; \ + outb %al, $0x80; \ + movb $-74, %al; \ + outb %al, $67; \ + outb %al, $0x80; \ + movb $-119, %al; \ + outb %al, $66; \ + outb %al, $0x80; \ + movb $15, %al; \ + outb %al, $66; + + +ALIGN + .align 16 +ENTRY(wakeup_start) +wakeup_code: + wakeup_code_start = . + .code16 + +# Running in *copy* of this code, somewhere in low 1MB. + + movb $0xa1, %al ; outb %al, $0x80 + cli + cld + # setup data segment + movw %cs, %ax + movw %ax, %ds # Make ds:0 point to wakeup_start + movw %ax, %ss + + # Data segment must be set up before we can see whether to beep. + testl $4, realmode_flags - wakeup_code + jz 1f + BEEP +1: + + # Private stack is needed for ASUS board + mov $(wakeup_stack - wakeup_code), %sp + + pushl $0 # Kill any dangerous flags + popfl + + movl real_magic - wakeup_code, %eax + cmpl $0x12345678, %eax + jne bogus_real_magic + + call verify_cpu # Verify the cpu supports long + # mode + testl %eax, %eax + jnz no_longmode + + testl $1, realmode_flags - wakeup_code + jz 1f + lcall $0xc000,$3 + movw %cs, %ax + movw %ax, %ds # Bios might have played with that + movw %ax, %ss +1: + + testl $2, realmode_flags - wakeup_code + jz 1f + mov video_mode - wakeup_code, %ax + call mode_set +1: + + movw $0xb800, %ax + movw %ax,%fs + movw $0x0e00 + 'L', %fs:(0x10) + + movb $0xa2, %al ; outb %al, $0x80 + + mov %ds, %ax # Find 32bit wakeup_code addr + movzx %ax, %esi # (Convert %ds:gdt to a liner ptr) + shll $4, %esi + # Fix up the vectors + addl %esi, wakeup_32_vector - wakeup_code + addl %esi, wakeup_long64_vector - wakeup_code + addl %esi, gdt_48a + 2 - wakeup_code # Fixup the gdt pointer + + lidtl %ds:idt_48a - wakeup_code + lgdtl %ds:gdt_48a - wakeup_code # load gdt with whatever is + # appropriate + + movl $1, %eax # protected mode (PE) bit + lmsw %ax # This is it! + jmp 1f +1: + + ljmpl *(wakeup_32_vector - wakeup_code) + + .balign 4 +wakeup_32_vector: + .long wakeup_32 - wakeup_code + .word __KERNEL32_CS, 0 + + .code32 +wakeup_32: +# Running in this code, but at low address; paging is not yet turned on. + movb $0xa5, %al ; outb %al, $0x80 + + movl $__KERNEL_DS, %eax + movl %eax, %ds + + movw $0x0e00 + 'i', %ds:(0xb8012) + movb $0xa8, %al ; outb %al, $0x80; + + /* + * Prepare for entering 64bits mode + */ + + /* Enable PAE */ + xorl %eax, %eax + btsl $5, %eax + movl %eax, %cr4 + + /* Setup early boot stage 4 level pagetables */ + leal (wakeup_level4_pgt - wakeup_code)(%esi), %eax + movl %eax, %cr3 + + /* Check if nx is implemented */ + movl $0x80000001, %eax + cpuid + movl %edx,%edi + + /* Enable Long Mode */ + xorl %eax, %eax + btsl $_EFER_LME, %eax + + /* No Execute supported? */ + btl $20,%edi + jnc 1f + btsl $_EFER_NX, %eax + + /* Make changes effective */ +1: movl $MSR_EFER, %ecx + xorl %edx, %edx + wrmsr + + xorl %eax, %eax + btsl $31, %eax /* Enable paging and in turn activate Long Mode */ + btsl $0, %eax /* Enable protected mode */ + + /* Make changes effective */ + movl %eax, %cr0 + + /* At this point: + CR4.PAE must be 1 + CS.L must be 0 + CR3 must point to PML4 + Next instruction must be a branch + This must be on identity-mapped page + */ + /* + * At this point we're in long mode but in 32bit compatibility mode + * with EFER.LME = 1, CS.L = 0, CS.D = 1 (and in turn + * EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we load + * the new gdt/idt that has __KERNEL_CS with CS.L = 1. + */ + + /* Finally jump in 64bit mode */ + ljmp *(wakeup_long64_vector - wakeup_code)(%esi) + + .balign 4 +wakeup_long64_vector: + .long wakeup_long64 - wakeup_code + .word __KERNEL_CS, 0 + +.code64 + + /* Hooray, we are in Long 64-bit mode (but still running in + * low memory) + */ +wakeup_long64: + /* + * We must switch to a new descriptor in kernel space for the GDT + * because soon the kernel won't have access anymore to the userspace + * addresses where we're currently running on. We have to do that here + * because in 32bit we couldn't load a 64bit linear address. + */ + lgdt cpu_gdt_descr + + movw $0x0e00 + 'n', %ds:(0xb8014) + movb $0xa9, %al ; outb %al, $0x80 + + movq saved_magic, %rax + movq $0x123456789abcdef0, %rdx + cmpq %rdx, %rax + jne bogus_64_magic + + movw $0x0e00 + 'u', %ds:(0xb8016) + + nop + nop + movw $__KERNEL_DS, %ax + movw %ax, %ss + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movq saved_rsp, %rsp + + movw $0x0e00 + 'x', %ds:(0xb8018) + movq saved_rbx, %rbx + movq saved_rdi, %rdi + movq saved_rsi, %rsi + movq saved_rbp, %rbp + + movw $0x0e00 + '!', %ds:(0xb801a) + movq saved_rip, %rax + jmp *%rax + +.code32 + + .align 64 +gdta: + /* Its good to keep gdt in sync with one in trampoline.S */ + .word 0, 0, 0, 0 # dummy + /* ??? Why I need the accessed bit set in order for this to work? */ + .quad 0x00cf9b000000ffff # __KERNEL32_CS + .quad 0x00af9b000000ffff # __KERNEL_CS + .quad 0x00cf93000000ffff # __KERNEL_DS + +idt_48a: + .word 0 # idt limit = 0 + .word 0, 0 # idt base = 0L + +gdt_48a: + .word 0x800 # gdt limit=2048, + # 256 GDT entries + .long gdta - wakeup_code # gdt base (relocated in later) + +real_magic: .quad 0 +video_mode: .quad 0 +realmode_flags: .quad 0 + +.code16 +bogus_real_magic: + movb $0xba,%al ; outb %al,$0x80 + jmp bogus_real_magic + +.code64 +bogus_64_magic: + movb $0xb3,%al ; outb %al,$0x80 + jmp bogus_64_magic + +.code16 +no_longmode: + movb $0xbc,%al ; outb %al,$0x80 + jmp no_longmode + +#include "../verify_cpu_64.S" + +/* This code uses an extended set of video mode numbers. These include: + * Aliases for standard modes + * NORMAL_VGA (-1) + * EXTENDED_VGA (-2) + * ASK_VGA (-3) + * Video modes numbered by menu position -- NOT RECOMMENDED because of lack + * of compatibility when extending the table. These are between 0x00 and 0xff. + */ +#define VIDEO_FIRST_MENU 0x0000 + +/* Standard BIOS video modes (BIOS number + 0x0100) */ +#define VIDEO_FIRST_BIOS 0x0100 + +/* VESA BIOS video modes (VESA number + 0x0200) */ +#define VIDEO_FIRST_VESA 0x0200 + +/* Video7 special modes (BIOS number + 0x0900) */ +#define VIDEO_FIRST_V7 0x0900 + +# Setting of user mode (AX=mode ID) => CF=success + +# For now, we only handle VESA modes (0x0200..0x03ff). To handle other +# modes, we should probably compile in the video code from the boot +# directory. +.code16 +mode_set: + movw %ax, %bx + subb $VIDEO_FIRST_VESA>>8, %bh + cmpb $2, %bh + jb check_vesa + +setbad: + clc + ret + +check_vesa: + orw $0x4000, %bx # Use linear frame buffer + movw $0x4f02, %ax # VESA BIOS mode set call + int $0x10 + cmpw $0x004f, %ax # AL=4f if implemented + jnz setbad # AH=0 if OK + + stc + ret + +wakeup_stack_begin: # Stack grows down + +.org 0xff0 +wakeup_stack: # Just below end of page + +.org 0x1000 +ENTRY(wakeup_level4_pgt) + .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE + .fill 510,8,0 + /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ + .quad level3_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE + +ENTRY(wakeup_end) + +## +# acpi_copy_wakeup_routine +# +# Copy the above routine to low memory. +# +# Parameters: +# %rdi: place to copy wakeup routine to +# +# Returned address is location of code in low memory (past data and stack) +# + .code64 +ENTRY(acpi_copy_wakeup_routine) + pushq %rax + pushq %rdx + + movl saved_video_mode, %edx + movl %edx, video_mode - wakeup_start (,%rdi) + movl acpi_realmode_flags, %edx + movl %edx, realmode_flags - wakeup_start (,%rdi) + movq $0x12345678, real_magic - wakeup_start (,%rdi) + movq $0x123456789abcdef0, %rdx + movq %rdx, saved_magic + + movq saved_magic, %rax + movq $0x123456789abcdef0, %rdx + cmpq %rdx, %rax + jne bogus_64_magic + + # restore the regs we used + popq %rdx + popq %rax +ENTRY(do_suspend_lowlevel_s4bios) + ret + + .align 2 + .p2align 4,,15 +.globl do_suspend_lowlevel + .type do_suspend_lowlevel,@function +do_suspend_lowlevel: +.LFB5: + subq $8, %rsp + xorl %eax, %eax + call save_processor_state + + movq %rsp, saved_context_esp(%rip) + movq %rax, saved_context_eax(%rip) + movq %rbx, saved_context_ebx(%rip) + movq %rcx, saved_context_ecx(%rip) + movq %rdx, saved_context_edx(%rip) + movq %rbp, saved_context_ebp(%rip) + movq %rsi, saved_context_esi(%rip) + movq %rdi, saved_context_edi(%rip) + movq %r8, saved_context_r08(%rip) + movq %r9, saved_context_r09(%rip) + movq %r10, saved_context_r10(%rip) + movq %r11, saved_context_r11(%rip) + movq %r12, saved_context_r12(%rip) + movq %r13, saved_context_r13(%rip) + movq %r14, saved_context_r14(%rip) + movq %r15, saved_context_r15(%rip) + pushfq ; popq saved_context_eflags(%rip) + + movq $.L97, saved_rip(%rip) + + movq %rsp,saved_rsp + movq %rbp,saved_rbp + movq %rbx,saved_rbx + movq %rdi,saved_rdi + movq %rsi,saved_rsi + + addq $8, %rsp + movl $3, %edi + xorl %eax, %eax + jmp acpi_enter_sleep_state +.L97: + .p2align 4,,7 +.L99: + .align 4 + movl $24, %eax + movw %ax, %ds + movq saved_context+58(%rip), %rax + movq %rax, %cr4 + movq saved_context+50(%rip), %rax + movq %rax, %cr3 + movq saved_context+42(%rip), %rax + movq %rax, %cr2 + movq saved_context+34(%rip), %rax + movq %rax, %cr0 + pushq saved_context_eflags(%rip) ; popfq + movq saved_context_esp(%rip), %rsp + movq saved_context_ebp(%rip), %rbp + movq saved_context_eax(%rip), %rax + movq saved_context_ebx(%rip), %rbx + movq saved_context_ecx(%rip), %rcx + movq saved_context_edx(%rip), %rdx + movq saved_context_esi(%rip), %rsi + movq saved_context_edi(%rip), %rdi + movq saved_context_r08(%rip), %r8 + movq saved_context_r09(%rip), %r9 + movq saved_context_r10(%rip), %r10 + movq saved_context_r11(%rip), %r11 + movq saved_context_r12(%rip), %r12 + movq saved_context_r13(%rip), %r13 + movq saved_context_r14(%rip), %r14 + movq saved_context_r15(%rip), %r15 + + xorl %eax, %eax + addq $8, %rsp + jmp restore_processor_state +.LFE5: +.Lfe5: + .size do_suspend_lowlevel,.Lfe5-do_suspend_lowlevel + +.data +ALIGN +ENTRY(saved_rbp) .quad 0 +ENTRY(saved_rsi) .quad 0 +ENTRY(saved_rdi) .quad 0 +ENTRY(saved_rbx) .quad 0 + +ENTRY(saved_rip) .quad 0 +ENTRY(saved_rsp) .quad 0 + +ENTRY(saved_magic) .quad 0 diff --git a/arch/i386/kernel/alternative.c b/arch/x86/kernel/alternative.c index bd72d94e713..bd72d94e713 100644 --- a/arch/i386/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c diff --git a/arch/x86_64/kernel/aperture.c b/arch/x86/kernel/aperture_64.c index 8f681cae7bf..8f681cae7bf 100644 --- a/arch/x86_64/kernel/aperture.c +++ b/arch/x86/kernel/aperture_64.c diff --git a/arch/i386/kernel/apic.c b/arch/x86/kernel/apic_32.c index 3d67ae18d76..3d67ae18d76 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/x86/kernel/apic_32.c diff --git a/arch/x86_64/kernel/apic.c b/arch/x86/kernel/apic_64.c index 925758dbca0..925758dbca0 100644 --- a/arch/x86_64/kernel/apic.c +++ b/arch/x86/kernel/apic_64.c diff --git a/arch/i386/kernel/apm.c b/arch/x86/kernel/apm_32.c index f02a8aca826..f02a8aca826 100644 --- a/arch/i386/kernel/apm.c +++ b/arch/x86/kernel/apm_32.c diff --git a/arch/x86/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets.c new file mode 100644 index 00000000000..cfa82c899f4 --- /dev/null +++ b/arch/x86/kernel/asm-offsets.c @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "asm-offsets_32.c" +#else +# include "asm-offsets_64.c" +#endif diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c new file mode 100644 index 00000000000..8029742c0fc --- /dev/null +++ b/arch/x86/kernel/asm-offsets_32.c @@ -0,0 +1,147 @@ +/* + * Generate definitions needed by assembly language modules. + * This code generates raw asm output which is post-processed + * to extract and format the required data. + */ + +#include <linux/crypto.h> +#include <linux/sched.h> +#include <linux/signal.h> +#include <linux/personality.h> +#include <linux/suspend.h> +#include <asm/ucontext.h> +#include "sigframe_32.h" +#include <asm/pgtable.h> +#include <asm/fixmap.h> +#include <asm/processor.h> +#include <asm/thread_info.h> +#include <asm/elf.h> + +#include <xen/interface/xen.h> + +#ifdef CONFIG_LGUEST_GUEST +#include <linux/lguest.h> +#include "../../../drivers/lguest/lg.h" +#endif + +#define DEFINE(sym, val) \ + asm volatile("\n->" #sym " %0 " #val : : "i" (val)) + +#define BLANK() asm volatile("\n->" : : ) + +#define OFFSET(sym, str, mem) \ + DEFINE(sym, offsetof(struct str, mem)); + +/* workaround for a warning with -Wmissing-prototypes */ +void foo(void); + +void foo(void) +{ + OFFSET(SIGCONTEXT_eax, sigcontext, eax); + OFFSET(SIGCONTEXT_ebx, sigcontext, ebx); + OFFSET(SIGCONTEXT_ecx, sigcontext, ecx); + OFFSET(SIGCONTEXT_edx, sigcontext, edx); + OFFSET(SIGCONTEXT_esi, sigcontext, esi); + OFFSET(SIGCONTEXT_edi, sigcontext, edi); + OFFSET(SIGCONTEXT_ebp, sigcontext, ebp); + OFFSET(SIGCONTEXT_esp, sigcontext, esp); + OFFSET(SIGCONTEXT_eip, sigcontext, eip); + BLANK(); + + OFFSET(CPUINFO_x86, cpuinfo_x86, x86); + OFFSET(CPUINFO_x86_vendor, cpuinfo_x86, x86_vendor); + OFFSET(CPUINFO_x86_model, cpuinfo_x86, x86_model); + OFFSET(CPUINFO_x86_mask, cpuinfo_x86, x86_mask); + OFFSET(CPUINFO_hard_math, cpuinfo_x86, hard_math); + OFFSET(CPUINFO_cpuid_level, cpuinfo_x86, cpuid_level); + OFFSET(CPUINFO_x86_capability, cpuinfo_x86, x86_capability); + OFFSET(CPUINFO_x86_vendor_id, cpuinfo_x86, x86_vendor_id); + BLANK(); + + OFFSET(TI_task, thread_info, task); + OFFSET(TI_exec_domain, thread_info, exec_domain); + OFFSET(TI_flags, thread_info, flags); + OFFSET(TI_status, thread_info, status); + OFFSET(TI_preempt_count, thread_info, preempt_count); + OFFSET(TI_addr_limit, thread_info, addr_limit); + OFFSET(TI_restart_block, thread_info, restart_block); + OFFSET(TI_sysenter_return, thread_info, sysenter_return); + OFFSET(TI_cpu, thread_info, cpu); + BLANK(); + + OFFSET(GDS_size, Xgt_desc_struct, size); + OFFSET(GDS_address, Xgt_desc_struct, address); + OFFSET(GDS_pad, Xgt_desc_struct, pad); + BLANK(); + + OFFSET(PT_EBX, pt_regs, ebx); + OFFSET(PT_ECX, pt_regs, ecx); + OFFSET(PT_EDX, pt_regs, edx); + OFFSET(PT_ESI, pt_regs, esi); + OFFSET(PT_EDI, pt_regs, edi); + OFFSET(PT_EBP, pt_regs, ebp); + OFFSET(PT_EAX, pt_regs, eax); + OFFSET(PT_DS, pt_regs, xds); + OFFSET(PT_ES, pt_regs, xes); + OFFSET(PT_FS, pt_regs, xfs); + OFFSET(PT_ORIG_EAX, pt_regs, orig_eax); + OFFSET(PT_EIP, pt_regs, eip); + OFFSET(PT_CS, pt_regs, xcs); + OFFSET(PT_EFLAGS, pt_regs, eflags); + OFFSET(PT_OLDESP, pt_regs, esp); + OFFSET(PT_OLDSS, pt_regs, xss); + BLANK(); + + OFFSET(EXEC_DOMAIN_handler, exec_domain, handler); + OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext); + BLANK(); + + OFFSET(pbe_address, pbe, address); + OFFSET(pbe_orig_address, pbe, orig_address); + OFFSET(pbe_next, pbe, next); + + /* Offset from the sysenter stack to tss.esp0 */ + DEFINE(TSS_sysenter_esp0, offsetof(struct tss_struct, x86_tss.esp0) - + sizeof(struct tss_struct)); + + DEFINE(PAGE_SIZE_asm, PAGE_SIZE); + DEFINE(PAGE_SHIFT_asm, PAGE_SHIFT); + DEFINE(PTRS_PER_PTE, PTRS_PER_PTE); + DEFINE(PTRS_PER_PMD, PTRS_PER_PMD); + DEFINE(PTRS_PER_PGD, PTRS_PER_PGD); + + DEFINE(VDSO_PRELINK_asm, VDSO_PRELINK); + + OFFSET(crypto_tfm_ctx_offset, crypto_tfm, __crt_ctx); + +#ifdef CONFIG_PARAVIRT + BLANK(); + OFFSET(PARAVIRT_enabled, paravirt_ops, paravirt_enabled); + OFFSET(PARAVIRT_irq_disable, paravirt_ops, irq_disable); + OFFSET(PARAVIRT_irq_enable, paravirt_ops, irq_enable); + OFFSET(PARAVIRT_irq_enable_sysexit, paravirt_ops, irq_enable_sysexit); + OFFSET(PARAVIRT_iret, paravirt_ops, iret); + OFFSET(PARAVIRT_read_cr0, paravirt_ops, read_cr0); +#endif + +#ifdef CONFIG_XEN + BLANK(); + OFFSET(XEN_vcpu_info_mask, vcpu_info, evtchn_upcall_mask); + OFFSET(XEN_vcpu_info_pending, vcpu_info, evtchn_upcall_pending); +#endif + +#ifdef CONFIG_LGUEST_GUEST + BLANK(); + OFFSET(LGUEST_DATA_irq_enabled, lguest_data, irq_enabled); + OFFSET(LGUEST_PAGES_host_gdt_desc, lguest_pages, state.host_gdt_desc); + OFFSET(LGUEST_PAGES_host_idt_desc, lguest_pages, state.host_idt_desc); + OFFSET(LGUEST_PAGES_host_cr3, lguest_pages, state.host_cr3); + OFFSET(LGUEST_PAGES_host_sp, lguest_pages, state.host_sp); + OFFSET(LGUEST_PAGES_guest_gdt_desc, lguest_pages,state.guest_gdt_desc); + OFFSET(LGUEST_PAGES_guest_idt_desc, lguest_pages,state.guest_idt_desc); + OFFSET(LGUEST_PAGES_guest_gdt, lguest_pages, state.guest_gdt); + OFFSET(LGUEST_PAGES_regs_trapnum, lguest_pages, regs.trapnum); + OFFSET(LGUEST_PAGES_regs_errcode, lguest_pages, regs.errcode); + OFFSET(LGUEST_PAGES_regs, lguest_pages, regs); +#endif +} diff --git a/arch/x86_64/kernel/asm-offsets.c b/arch/x86/kernel/asm-offsets_64.c index 778953bc636..778953bc636 100644 --- a/arch/x86_64/kernel/asm-offsets.c +++ b/arch/x86/kernel/asm-offsets_64.c diff --git a/arch/x86_64/kernel/audit.c b/arch/x86/kernel/audit_64.c index 06d3e5a14d9..06d3e5a14d9 100644 --- a/arch/x86_64/kernel/audit.c +++ b/arch/x86/kernel/audit_64.c diff --git a/arch/i386/kernel/bootflag.c b/arch/x86/kernel/bootflag.c index 0b9860530a6..0b9860530a6 100644 --- a/arch/i386/kernel/bootflag.c +++ b/arch/x86/kernel/bootflag.c diff --git a/arch/x86_64/kernel/bugs.c b/arch/x86/kernel/bugs_64.c index 4e5e9d364d6..4e5e9d364d6 100644 --- a/arch/x86_64/kernel/bugs.c +++ b/arch/x86/kernel/bugs_64.c diff --git a/arch/i386/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index 778396c78d6..778396c78d6 100644 --- a/arch/i386/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile diff --git a/arch/i386/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 3e91d3ee26e..3e91d3ee26e 100644 --- a/arch/i386/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c diff --git a/arch/i386/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c index dcf6bbb1c7c..dcf6bbb1c7c 100644 --- a/arch/i386/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.c diff --git a/arch/i386/kernel/cpu/bugs.c b/arch/x86/kernel/cpu/bugs.c index 59266f03d1c..59266f03d1c 100644 --- a/arch/i386/kernel/cpu/bugs.c +++ b/arch/x86/kernel/cpu/bugs.c diff --git a/arch/i386/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 473eac883c7..473eac883c7 100644 --- a/arch/i386/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c diff --git a/arch/i386/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index d506201d397..d506201d397 100644 --- a/arch/i386/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c diff --git a/arch/i386/kernel/cpu/cpu.h b/arch/x86/kernel/cpu/cpu.h index 2f6432cef6f..2f6432cef6f 100644 --- a/arch/i386/kernel/cpu/cpu.h +++ b/arch/x86/kernel/cpu/cpu.h diff --git a/arch/i386/kernel/cpu/cpufreq/Kconfig b/arch/x86/kernel/cpu/cpufreq/Kconfig index d8c6f132dc7..d8c6f132dc7 100644 --- a/arch/i386/kernel/cpu/cpufreq/Kconfig +++ b/arch/x86/kernel/cpu/cpufreq/Kconfig diff --git a/arch/i386/kernel/cpu/cpufreq/Makefile b/arch/x86/kernel/cpu/cpufreq/Makefile index 560f7760dae..560f7760dae 100644 --- a/arch/i386/kernel/cpu/cpufreq/Makefile +++ b/arch/x86/kernel/cpu/cpufreq/Makefile diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c index 705e13a3078..705e13a3078 100644 --- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c index 66acd503991..66acd503991 100644 --- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/arch/x86/kernel/cpu/cpufreq/cpufreq-nforce2.c diff --git a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c index f43d98e11cc..f43d98e11cc 100644 --- a/arch/i386/kernel/cpu/cpufreq/e_powersaver.c +++ b/arch/x86/kernel/cpu/cpufreq/e_powersaver.c diff --git a/arch/i386/kernel/cpu/cpufreq/elanfreq.c b/arch/x86/kernel/cpu/cpufreq/elanfreq.c index f317276afa7..f317276afa7 100644 --- a/arch/i386/kernel/cpu/cpufreq/elanfreq.c +++ b/arch/x86/kernel/cpu/cpufreq/elanfreq.c diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c index 461dabc4e49..461dabc4e49 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/x86/kernel/cpu/cpufreq/gx-suspmod.c diff --git a/arch/x86/kernel/cpu/cpufreq/longhaul.c b/arch/x86/kernel/cpu/cpufreq/longhaul.c new file mode 100644 index 00000000000..f0cce3c2dc3 --- /dev/null +++ b/arch/x86/kernel/cpu/cpufreq/longhaul.c @@ -0,0 +1,1024 @@ +/* + * (C) 2001-2004 Dave Jones. <davej@codemonkey.org.uk> + * (C) 2002 Padraig Brady. <padraig@antefacto.com> + * + * Licensed under the terms of the GNU GPL License version 2. + * Based upon datasheets & sample CPUs kindly provided by VIA. + * + * VIA have currently 3 different versions of Longhaul. + * Version 1 (Longhaul) uses the BCR2 MSR at 0x1147. + * It is present only in Samuel 1 (C5A), Samuel 2 (C5B) stepping 0. + * Version 2 of longhaul is backward compatible with v1, but adds + * LONGHAUL MSR for purpose of both frequency and voltage scaling. + * Present in Samuel 2 (steppings 1-7 only) (C5B), and Ezra (C5C). + * Version 3 of longhaul got renamed to Powersaver and redesigned + * to use only the POWERSAVER MSR at 0x110a. + * It is present in Ezra-T (C5M), Nehemiah (C5X) and above. + * It's pretty much the same feature wise to longhaul v2, though + * there is provision for scaling FSB too, but this doesn't work + * too well in practice so we don't even try to use this. + * + * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* + */ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/moduleparam.h> +#include <linux/init.h> +#include <linux/cpufreq.h> +#include <linux/pci.h> +#include <linux/slab.h> +#include <linux/string.h> +#include <linux/delay.h> + +#include <asm/msr.h> +#include <asm/timex.h> +#include <asm/io.h> +#include <asm/acpi.h> +#include <linux/acpi.h> +#include <acpi/processor.h> + +#include "longhaul.h" + +#define PFX "longhaul: " + +#define TYPE_LONGHAUL_V1 1 +#define TYPE_LONGHAUL_V2 2 +#define TYPE_POWERSAVER 3 + +#define CPU_SAMUEL 1 +#define CPU_SAMUEL2 2 +#define CPU_EZRA 3 +#define CPU_EZRA_T 4 +#define CPU_NEHEMIAH 5 +#define CPU_NEHEMIAH_C 6 + +/* Flags */ +#define USE_ACPI_C3 (1 << 1) +#define USE_NORTHBRIDGE (1 << 2) + +static int cpu_model; +static unsigned int numscales=16; +static unsigned int fsb; + +static const struct mV_pos *vrm_mV_table; +static const unsigned char *mV_vrm_table; + +static unsigned int highest_speed, lowest_speed; /* kHz */ +static unsigned int minmult, maxmult; +static int can_scale_voltage; +static struct acpi_processor *pr = NULL; +static struct acpi_processor_cx *cx = NULL; +static u32 acpi_regs_addr; +static u8 longhaul_flags; +static unsigned int longhaul_index; + +/* Module parameters */ +static int scale_voltage; +static int disable_acpi_c3; +static int revid_errata; + +#define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "longhaul", msg) + + +/* Clock ratios multiplied by 10 */ +static int clock_ratio[32]; +static int eblcr_table[32]; +static int longhaul_version; +static struct cpufreq_frequency_table *longhaul_table; + +#ifdef CONFIG_CPU_FREQ_DEBUG +static char speedbuffer[8]; + +static char *print_speed(int speed) +{ + if (speed < 1000) { + snprintf(speedbuffer, sizeof(speedbuffer),"%dMHz", speed); + return speedbuffer; + } + + if (speed%1000 == 0) + snprintf(speedbuffer, sizeof(speedbuffer), + "%dGHz", speed/1000); + else + snprintf(speedbuffer, sizeof(speedbuffer), + "%d.%dGHz", speed/1000, (speed%1000)/100); + + return speedbuffer; +} +#endif + + +static unsigned int calc_speed(int mult) +{ + int khz; + khz = (mult/10)*fsb; + if (mult%10) + khz += fsb/2; + khz *= 1000; + return khz; +} + + +static int longhaul_get_cpu_mult(void) +{ + unsigned long invalue=0,lo, hi; + + rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); + invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22; + if (longhaul_version==TYPE_LONGHAUL_V2 || longhaul_version==TYPE_POWERSAVER) { + if (lo & (1<<27)) + invalue+=16; + } + return eblcr_table[invalue]; +} + +/* For processor with BCR2 MSR */ + +static void do_longhaul1(unsigned int clock_ratio_index) +{ + union msr_bcr2 bcr2; + + rdmsrl(MSR_VIA_BCR2, bcr2.val); + /* Enable software clock multiplier */ + bcr2.bits.ESOFTBF = 1; + bcr2.bits.CLOCKMUL = clock_ratio_index & 0xff; + + /* Sync to timer tick */ + safe_halt(); + /* Change frequency on next halt or sleep */ + wrmsrl(MSR_VIA_BCR2, bcr2.val); + /* Invoke transition */ + ACPI_FLUSH_CPU_CACHE(); + halt(); + + /* Disable software clock multiplier */ + local_irq_disable(); + rdmsrl(MSR_VIA_BCR2, bcr2.val); + bcr2.bits.ESOFTBF = 0; + wrmsrl(MSR_VIA_BCR2, bcr2.val); +} + +/* For processor with Longhaul MSR */ + +static void do_powersaver(int cx_address, unsigned int clock_ratio_index, + unsigned int dir) +{ + union msr_longhaul longhaul; + u32 t; + + rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); + /* Setup new frequency */ + if (!revid_errata) + longhaul.bits.RevisionKey = longhaul.bits.RevisionID; + else + longhaul.bits.RevisionKey = 0; + longhaul.bits.SoftBusRatio = clock_ratio_index & 0xf; + longhaul.bits.SoftBusRatio4 = (clock_ratio_index & 0x10) >> 4; + /* Setup new voltage */ + if (can_scale_voltage) + longhaul.bits.SoftVID = (clock_ratio_index >> 8) & 0x1f; + /* Sync to timer tick */ + safe_halt(); + /* Raise voltage if necessary */ + if (can_scale_voltage && dir) { + longhaul.bits.EnableSoftVID = 1; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + /* Change voltage */ + if (!cx_address) { + ACPI_FLUSH_CPU_CACHE(); + halt(); + } else { + ACPI_FLUSH_CPU_CACHE(); + /* Invoke C3 */ + inb(cx_address); + /* Dummy op - must do something useless after P_LVL3 + * read */ + t = inl(acpi_gbl_FADT.xpm_timer_block.address); + } + longhaul.bits.EnableSoftVID = 0; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + } + + /* Change frequency on next halt or sleep */ + longhaul.bits.EnableSoftBusRatio = 1; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + if (!cx_address) { + ACPI_FLUSH_CPU_CACHE(); + halt(); + } else { + ACPI_FLUSH_CPU_CACHE(); + /* Invoke C3 */ + inb(cx_address); + /* Dummy op - must do something useless after P_LVL3 read */ + t = inl(acpi_gbl_FADT.xpm_timer_block.address); + } + /* Disable bus ratio bit */ + longhaul.bits.EnableSoftBusRatio = 0; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + + /* Reduce voltage if necessary */ + if (can_scale_voltage && !dir) { + longhaul.bits.EnableSoftVID = 1; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + /* Change voltage */ + if (!cx_address) { + ACPI_FLUSH_CPU_CACHE(); + halt(); + } else { + ACPI_FLUSH_CPU_CACHE(); + /* Invoke C3 */ + inb(cx_address); + /* Dummy op - must do something useless after P_LVL3 + * read */ + t = inl(acpi_gbl_FADT.xpm_timer_block.address); + } + longhaul.bits.EnableSoftVID = 0; + wrmsrl(MSR_VIA_LONGHAUL, longhaul.val); + } +} + +/** + * longhaul_set_cpu_frequency() + * @clock_ratio_index : bitpattern of the new multiplier. + * + * Sets a new clock ratio. + */ + +static void longhaul_setstate(unsigned int table_index) +{ + unsigned int clock_ratio_index; + int speed, mult; + struct cpufreq_freqs freqs; + unsigned long flags; + unsigned int pic1_mask, pic2_mask; + u16 bm_status = 0; + u32 bm_timeout = 1000; + unsigned int dir = 0; + + clock_ratio_index = longhaul_table[table_index].index; + /* Safety precautions */ + mult = clock_ratio[clock_ratio_index & 0x1f]; + if (mult == -1) + return; + speed = calc_speed(mult); + if ((speed > highest_speed) || (speed < lowest_speed)) + return; + /* Voltage transition before frequency transition? */ + if (can_scale_voltage && longhaul_index < table_index) + dir = 1; + + freqs.old = calc_speed(longhaul_get_cpu_mult()); + freqs.new = speed; + freqs.cpu = 0; /* longhaul.c is UP only driver */ + + cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); + + dprintk ("Setting to FSB:%dMHz Mult:%d.%dx (%s)\n", + fsb, mult/10, mult%10, print_speed(speed/1000)); +retry_loop: + preempt_disable(); + local_irq_save(flags); + + pic2_mask = inb(0xA1); + pic1_mask = inb(0x21); /* works on C3. save mask. */ + outb(0xFF,0xA1); /* Overkill */ + outb(0xFE,0x21); /* TMR0 only */ + + /* Wait while PCI bus is busy. */ + if (acpi_regs_addr && (longhaul_flags & USE_NORTHBRIDGE + || ((pr != NULL) && pr->flags.bm_control))) { + bm_status = inw(acpi_regs_addr); + bm_status &= 1 << 4; + while (bm_status && bm_timeout) { + outw(1 << 4, acpi_regs_addr); + bm_timeout--; + bm_status = inw(acpi_regs_addr); + bm_status &= 1 << 4; + } + } + + if (longhaul_flags & USE_NORTHBRIDGE) { + /* Disable AGP and PCI arbiters */ + outb(3, 0x22); + } else if ((pr != NULL) && pr->flags.bm_control) { + /* Disable bus master arbitration */ + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1); + } + switch (longhaul_version) { + + /* + * Longhaul v1. (Samuel[C5A] and Samuel2 stepping 0[C5B]) + * Software controlled multipliers only. + */ + case TYPE_LONGHAUL_V1: + do_longhaul1(clock_ratio_index); + break; + + /* + * Longhaul v2 appears in Samuel2 Steppings 1->7 [C5B] and Ezra [C5C] + * + * Longhaul v3 (aka Powersaver). (Ezra-T [C5M] & Nehemiah [C5N]) + * Nehemiah can do FSB scaling too, but this has never been proven + * to work in practice. + */ + case TYPE_LONGHAUL_V2: + case TYPE_POWERSAVER: + if (longhaul_flags & USE_ACPI_C3) { + /* Don't allow wakeup */ + acpi_set_register(ACPI_BITREG_BUS_MASTER_RLD, 0); + do_powersaver(cx->address, clock_ratio_index, dir); + } else { + do_powersaver(0, clock_ratio_index, dir); + } + break; + } + + if (longhaul_flags & USE_NORTHBRIDGE) { + /* Enable arbiters */ + outb(0, 0x22); + } else if ((pr != NULL) && pr->flags.bm_control) { + /* Enable bus master arbitration */ + acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); + } + outb(pic2_mask,0xA1); /* restore mask */ + outb(pic1_mask,0x21); + + local_irq_restore(flags); + preempt_enable(); + + freqs.new = calc_speed(longhaul_get_cpu_mult()); + /* Check if requested frequency is set. */ + if (unlikely(freqs.new != speed)) { + printk(KERN_INFO PFX "Failed to set requested frequency!\n"); + /* Revision ID = 1 but processor is expecting revision key + * equal to 0. Jumpers at the bottom of processor will change + * multiplier and FSB, but will not change bits in Longhaul + * MSR nor enable voltage scaling. */ + if (!revid_errata) { + printk(KERN_INFO PFX "Enabling \"Ignore Revision ID\" " + "option.\n"); + revid_errata = 1; + msleep(200); + goto retry_loop; + } + /* Why ACPI C3 sometimes doesn't work is a mystery for me. + * But it does happen. Processor is entering ACPI C3 state, + * but it doesn't change frequency. I tried poking various + * bits in northbridge registers, but without success. */ + if (longhaul_flags & USE_ACPI_C3) { + printk(KERN_INFO PFX "Disabling ACPI C3 support.\n"); + longhaul_flags &= ~USE_ACPI_C3; + if (revid_errata) { + printk(KERN_INFO PFX "Disabling \"Ignore " + "Revision ID\" option.\n"); + revid_errata = 0; + } + msleep(200); + goto retry_loop; + } + /* This shouldn't happen. Longhaul ver. 2 was reported not + * working on processors without voltage scaling, but with + * RevID = 1. RevID errata will make things right. Just + * to be 100% sure. */ + if (longhaul_version == TYPE_LONGHAUL_V2) { + printk(KERN_INFO PFX "Switching to Longhaul ver. 1\n"); + longhaul_version = TYPE_LONGHAUL_V1; + msleep(200); + goto retry_loop; + } + } + /* Report true CPU frequency */ + cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); + + if (!bm_timeout) + printk(KERN_INFO PFX "Warning: Timeout while waiting for idle PCI bus.\n"); +} + +/* + * Centaur decided to make life a little more tricky. + * Only longhaul v1 is allowed to read EBLCR BSEL[0:1]. + * Samuel2 and above have to try and guess what the FSB is. + * We do this by assuming we booted at maximum multiplier, and interpolate + * between that value multiplied by possible FSBs and cpu_mhz which + * was calculated at boot time. Really ugly, but no other way to do this. + */ + +#define ROUNDING 0xf + +static int guess_fsb(int mult) +{ + int speed = cpu_khz / 1000; + int i; + int speeds[] = { 666, 1000, 1333, 2000 }; + int f_max, f_min; + + for (i = 0; i < 4; i++) { + f_max = ((speeds[i] * mult) + 50) / 100; + f_max += (ROUNDING / 2); + f_min = f_max - ROUNDING; + if ((speed <= f_max) && (speed >= f_min)) + return speeds[i] / 10; + } + return 0; +} + + +static int __init longhaul_get_ranges(void) +{ + unsigned int i, j, k = 0; + unsigned int ratio; + int mult; + + /* Get current frequency */ + mult = longhaul_get_cpu_mult(); + if (mult == -1) { + printk(KERN_INFO PFX "Invalid (reserved) multiplier!\n"); + return -EINVAL; + } + fsb = guess_fsb(mult); + if (fsb == 0) { + printk(KERN_INFO PFX "Invalid (reserved) FSB!\n"); + return -EINVAL; + } + /* Get max multiplier - as we always did. + * Longhaul MSR is usefull only when voltage scaling is enabled. + * C3 is booting at max anyway. */ + maxmult = mult; + /* Get min multiplier */ + switch (cpu_model) { + case CPU_NEHEMIAH: + minmult = 50; + break; + case CPU_NEHEMIAH_C: + minmult = 40; + break; + default: + minmult = 30; + break; + } + + dprintk ("MinMult:%d.%dx MaxMult:%d.%dx\n", + minmult/10, minmult%10, maxmult/10, maxmult%10); + + highest_speed = calc_speed(maxmult); + lowest_speed = calc_speed(minmult); + dprintk ("FSB:%dMHz Lowest speed: %s Highest speed:%s\n", fsb, + print_speed(lowest_speed/1000), + print_speed(highest_speed/1000)); + + if (lowest_speed == highest_speed) { + printk (KERN_INFO PFX "highestspeed == lowest, aborting.\n"); + return -EINVAL; + } + if (lowest_speed > highest_speed) { + printk (KERN_INFO PFX "nonsense! lowest (%d > %d) !\n", + lowest_speed, highest_speed); + return -EINVAL; + } + + longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); + if(!longhaul_table) + return -ENOMEM; + + for (j = 0; j < numscales; j++) { + ratio = clock_ratio[j]; + if (ratio == -1) + continue; + if (ratio > maxmult || ratio < minmult) + continue; + longhaul_table[k].frequency = calc_speed(ratio); + longhaul_table[k].index = j; + k++; + } + if (k <= 1) { + kfree(longhaul_table); + return -ENODEV; + } + /* Sort */ + for (j = 0; j < k - 1; j++) { + unsigned int min_f, min_i; + min_f = longhaul_table[j].frequency; + min_i = j; + for (i = j + 1; i < k; i++) { + if (longhaul_table[i].frequency < min_f) { + min_f = longhaul_table[i].frequency; + min_i = i; + } + } + if (min_i != j) { + unsigned int temp; + temp = longhaul_table[j].frequency; + longhaul_table[j].frequency = longhaul_table[min_i].frequency; + longhaul_table[min_i].frequency = temp; + temp = longhaul_table[j].index; + longhaul_table[j].index = longhaul_table[min_i].index; + longhaul_table[min_i].index = temp; + } + } + + longhaul_table[k].frequency = CPUFREQ_TABLE_END; + + /* Find index we are running on */ + for (j = 0; j < k; j++) { + if (clock_ratio[longhaul_table[j].index & 0x1f] == mult) { + longhaul_index = j; + break; + } + } + return 0; +} + + +static void __init longhaul_setup_voltagescaling(void) +{ + union msr_longhaul longhaul; + struct mV_pos minvid, maxvid, vid; + unsigned int j, speed, pos, kHz_step, numvscales; + int min_vid_speed; + + rdmsrl(MSR_VIA_LONGHAUL, longhaul.val); + if (!(longhaul.bits.RevisionID & 1)) { + printk(KERN_INFO PFX "Voltage scaling not supported by CPU.\n"); + return; + } + + if (!longhaul.bits.VRMRev) { + printk(KERN_INFO PFX "VRM 8.5\n"); + vrm_mV_table = &vrm85_mV[0]; + mV_vrm_table = &mV_vrm85[0]; + } else { + printk(KERN_INFO PFX "Mobile VRM\n"); + if (cpu_model < CPU_NEHEMIAH) + return; + vrm_mV_table = &mobilevrm_mV[0]; + mV_vrm_table = &mV_mobilevrm[0]; + } + + minvid = vrm_mV_table[longhaul.bits.MinimumVID]; + maxvid = vrm_mV_table[longhaul.bits.MaximumVID]; + + if (minvid.mV == 0 || maxvid.mV == 0 || minvid.mV > maxvid.mV) { + printk (KERN_INFO PFX "Bogus values Min:%d.%03d Max:%d.%03d. " + "Voltage scaling disabled.\n", + minvid.mV/1000, minvid.mV%1000, maxvid.mV/1000, maxvid.mV%1000); + return; + } + + if (minvid.mV == maxvid.mV) { + printk (KERN_INFO PFX "Claims to support voltage scaling but min & max are " + "both %d.%03d. Voltage scaling disabled\n", + maxvid.mV/1000, maxvid.mV%1000); + return; + } + + /* How many voltage steps */ + numvscales = maxvid.pos - minvid.pos + 1; + printk(KERN_INFO PFX + "Max VID=%d.%03d " + "Min VID=%d.%03d, " + "%d possible voltage scales\n", + maxvid.mV/1000, maxvid.mV%1000, + minvid.mV/1000, minvid.mV%1000, + numvscales); + + /* Calculate max frequency at min voltage */ + j = longhaul.bits.MinMHzBR; + if (longhaul.bits.MinMHzBR4) + j += 16; + min_vid_speed = eblcr_table[j]; + if (min_vid_speed == -1) + return; + switch (longhaul.bits.MinMHzFSB) { + case 0: + min_vid_speed *= 13333; + break; + case 1: + min_vid_speed *= 10000; + break; + case 3: + min_vid_speed *= 6666; + break; + default: + return; + break; + } + if (min_vid_speed >= highest_speed) + return; + /* Calculate kHz for one voltage step */ + kHz_step = (highest_speed - min_vid_speed) / numvscales; + + j = 0; + while (longhaul_table[j].frequency != CPUFREQ_TABLE_END) { + speed = longhaul_table[j].frequency; + if (speed > min_vid_speed) + pos = (speed - min_vid_speed) / kHz_step + minvid.pos; + else + pos = minvid.pos; + longhaul_table[j].index |= mV_vrm_table[pos] << 8; + vid = vrm_mV_table[mV_vrm_table[pos]]; + printk(KERN_INFO PFX "f: %d kHz, index: %d, vid: %d mV\n", speed, j, vid.mV); + j++; + } + + can_scale_voltage = 1; + printk(KERN_INFO PFX "Voltage scaling enabled.\n"); +} + + +static int longhaul_verify(struct cpufreq_policy *policy) +{ + return cpufreq_frequency_table_verify(policy, longhaul_table); +} + + +static int longhaul_target(struct cpufreq_policy *policy, + unsigned int target_freq, unsigned int relation) +{ + unsigned int table_index = 0; + unsigned int i; + unsigned int dir = 0; + u8 vid, current_vid; + + if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, relation, &table_index)) + return -EINVAL; + + /* Don't set same frequency again */ + if (longhaul_index == table_index) + return 0; + + if (!can_scale_voltage) + longhaul_setstate(table_index); + else { + /* On test system voltage transitions exceeding single + * step up or down were turning motherboard off. Both + * "ondemand" and "userspace" are unsafe. C7 is doing + * this in hardware, C3 is old and we need to do this + * in software. */ + i = longhaul_index; + current_vid = (longhaul_table[longhaul_index].index >> 8) & 0x1f; + if (table_index > longhaul_index) + dir = 1; + while (i != table_index) { + vid = (longhaul_table[i].index >> 8) & 0x1f; + if (vid != current_vid) { + longhaul_setstate(i); + current_vid = vid; + msleep(200); + } + if (dir) + i++; + else + i--; + } + longhaul_setstate(table_index); + } + longhaul_index = table_index; + return 0; +} + + +static unsigned int longhaul_get(unsigned int cpu) +{ + if (cpu) + return 0; + return calc_speed(longhaul_get_cpu_mult()); +} + +static acpi_status longhaul_walk_callback(acpi_handle obj_handle, + u32 nesting_level, + void *context, void **return_value) +{ + struct acpi_device *d; + + if ( acpi_bus_get_device(obj_handle, &d) ) { + return 0; + } + *return_value = (void *)acpi_driver_data(d); + return 1; +} + +/* VIA don't support PM2 reg, but have something similar */ +static int enable_arbiter_disable(void) +{ + struct pci_dev *dev; + int status = 1; + int reg; + u8 pci_cmd; + + /* Find PLE133 host bridge */ + reg = 0x78; + dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8601_0, + NULL); + /* Find CLE266 host bridge */ + if (dev == NULL) { + reg = 0x76; + dev = pci_get_device(PCI_VENDOR_ID_VIA, + PCI_DEVICE_ID_VIA_862X_0, NULL); + /* Find CN400 V-Link host bridge */ + if (dev == NULL) + dev = pci_get_device(PCI_VENDOR_ID_VIA, 0x7259, NULL); + } + if (dev != NULL) { + /* Enable access to port 0x22 */ + pci_read_config_byte(dev, reg, &pci_cmd); + if (!(pci_cmd & 1<<7)) { + pci_cmd |= 1<<7; + pci_write_config_byte(dev, reg, pci_cmd); + pci_read_config_byte(dev, reg, &pci_cmd); + if (!(pci_cmd & 1<<7)) { + printk(KERN_ERR PFX + "Can't enable access to port 0x22.\n"); + status = 0; + } + } + pci_dev_put(dev); + return status; + } + return 0; +} + +static int longhaul_setup_southbridge(void) +{ + struct pci_dev *dev; + u8 pci_cmd; + + /* Find VT8235 southbridge */ + dev = pci_get_device(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8235, NULL); + if (dev == NULL) + /* Find VT8237 southbridge */ + dev = pci_get_device(PCI_VENDOR_ID_VIA, + PCI_DEVICE_ID_VIA_8237, NULL); + if (dev != NULL) { + /* Set transition time to max */ + pci_read_config_byte(dev, 0xec, &pci_cmd); + pci_cmd &= ~(1 << 2); + pci_write_config_byte(dev, 0xec, pci_cmd); + pci_read_config_byte(dev, 0xe4, &pci_cmd); + pci_cmd &= ~(1 << 7); + pci_write_config_byte(dev, 0xe4, pci_cmd); + pci_read_config_byte(dev, 0xe5, &pci_cmd); + pci_cmd |= 1 << 7; + pci_write_config_byte(dev, 0xe5, pci_cmd); + /* Get address of ACPI registers block*/ + pci_read_config_byte(dev, 0x81, &pci_cmd); + if (pci_cmd & 1 << 7) { + pci_read_config_dword(dev, 0x88, &acpi_regs_addr); + acpi_regs_addr &= 0xff00; + printk(KERN_INFO PFX "ACPI I/O at 0x%x\n", acpi_regs_addr); + } + + pci_dev_put(dev); + return 1; + } + return 0; +} + +static int __init longhaul_cpu_init(struct cpufreq_policy *policy) +{ + struct cpuinfo_x86 *c = cpu_data; + char *cpuname=NULL; + int ret; + u32 lo, hi; + + /* Check what we have on this motherboard */ + switch (c->x86_model) { + case 6: + cpu_model = CPU_SAMUEL; + cpuname = "C3 'Samuel' [C5A]"; + longhaul_version = TYPE_LONGHAUL_V1; + memcpy (clock_ratio, samuel1_clock_ratio, sizeof(samuel1_clock_ratio)); + memcpy (eblcr_table, samuel1_eblcr, sizeof(samuel1_eblcr)); + break; + + case 7: + switch (c->x86_mask) { + case 0: + longhaul_version = TYPE_LONGHAUL_V1; + cpu_model = CPU_SAMUEL2; + cpuname = "C3 'Samuel 2' [C5B]"; + /* Note, this is not a typo, early Samuel2's had + * Samuel1 ratios. */ + memcpy(clock_ratio, samuel1_clock_ratio, + sizeof(samuel1_clock_ratio)); + memcpy(eblcr_table, samuel2_eblcr, + sizeof(samuel2_eblcr)); + break; + case 1 ... 15: + longhaul_version = TYPE_LONGHAUL_V1; + if (c->x86_mask < 8) { + cpu_model = CPU_SAMUEL2; + cpuname = "C3 'Samuel 2' [C5B]"; + } else { + cpu_model = CPU_EZRA; + cpuname = "C3 'Ezra' [C5C]"; + } + memcpy(clock_ratio, ezra_clock_ratio, + sizeof(ezra_clock_ratio)); + memcpy(eblcr_table, ezra_eblcr, + sizeof(ezra_eblcr)); + break; + } + break; + + case 8: + cpu_model = CPU_EZRA_T; + cpuname = "C3 'Ezra-T' [C5M]"; + longhaul_version = TYPE_POWERSAVER; + numscales=32; + memcpy (clock_ratio, ezrat_clock_ratio, sizeof(ezrat_clock_ratio)); + memcpy (eblcr_table, ezrat_eblcr, sizeof(ezrat_eblcr)); + break; + + case 9: + longhaul_version = TYPE_POWERSAVER; + numscales = 32; + memcpy(clock_ratio, + nehemiah_clock_ratio, + sizeof(nehemiah_clock_ratio)); + memcpy(eblcr_table, nehemiah_eblcr, sizeof(nehemiah_eblcr)); + switch (c->x86_mask) { + case 0 ... 1: + cpu_model = CPU_NEHEMIAH; + cpuname = "C3 'Nehemiah A' [C5XLOE]"; + break; + case 2 ... 4: + cpu_model = CPU_NEHEMIAH; + cpuname = "C3 'Nehemiah B' [C5XLOH]"; + break; + case 5 ... 15: + cpu_model = CPU_NEHEMIAH_C; + cpuname = "C3 'Nehemiah C' [C5P]"; + break; + } + break; + + default: + cpuname = "Unknown"; + break; + } + /* Check Longhaul ver. 2 */ + if (longhaul_version == TYPE_LONGHAUL_V2) { + rdmsr(MSR_VIA_LONGHAUL, lo, hi); + if (lo == 0 && hi == 0) + /* Looks like MSR isn't present */ + longhaul_version = TYPE_LONGHAUL_V1; + } + + printk (KERN_INFO PFX "VIA %s CPU detected. ", cpuname); + switch (longhaul_version) { + case TYPE_LONGHAUL_V1: + case TYPE_LONGHAUL_V2: + printk ("Longhaul v%d supported.\n", longhaul_version); + break; + case TYPE_POWERSAVER: + printk ("Powersaver supported.\n"); + break; + }; + + /* Doesn't hurt */ + longhaul_setup_southbridge(); + + /* Find ACPI data for processor */ + acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT, + ACPI_UINT32_MAX, &longhaul_walk_callback, + NULL, (void *)&pr); + + /* Check ACPI support for C3 state */ + if (pr != NULL && longhaul_version == TYPE_POWERSAVER) { + cx = &pr->power.states[ACPI_STATE_C3]; + if (cx->address > 0 && cx->latency <= 1000) + longhaul_flags |= USE_ACPI_C3; + } + /* Disable if it isn't working */ + if (disable_acpi_c3) + longhaul_flags &= ~USE_ACPI_C3; + /* Check if northbridge is friendly */ + if (enable_arbiter_disable()) + longhaul_flags |= USE_NORTHBRIDGE; + + /* Check ACPI support for bus master arbiter disable */ + if (!(longhaul_flags & USE_ACPI_C3 + || longhaul_flags & USE_NORTHBRIDGE) + && ((pr == NULL) || !(pr->flags.bm_control))) { + printk(KERN_ERR PFX + "No ACPI support. Unsupported northbridge.\n"); + return -ENODEV; + } + + if (longhaul_flags & USE_NORTHBRIDGE) + printk(KERN_INFO PFX "Using northbridge support.\n"); + if (longhaul_flags & USE_ACPI_C3) + printk(KERN_INFO PFX "Using ACPI support.\n"); + + ret = longhaul_get_ranges(); + if (ret != 0) + return ret; + + if ((longhaul_version != TYPE_LONGHAUL_V1) && (scale_voltage != 0)) + longhaul_setup_voltagescaling(); + + policy->governor = CPUFREQ_DEFAULT_GOVERNOR; + policy->cpuinfo.transition_latency = 200000; /* nsec */ + policy->cur = calc_speed(longhaul_get_cpu_mult()); + + ret = cpufreq_frequency_table_cpuinfo(policy, longhaul_table); + if (ret) + return ret; + + cpufreq_frequency_table_get_attr(longhaul_table, policy->cpu); + + return 0; +} + +static int __devexit longhaul_cpu_exit(struct cpufreq_policy *policy) +{ + cpufreq_frequency_table_put_attr(policy->cpu); + return 0; +} + +static struct freq_attr* longhaul_attr[] = { + &cpufreq_freq_attr_scaling_available_freqs, + NULL, +}; + +static struct cpufreq_driver longhaul_driver = { + .verify = longhaul_verify, + .target = longhaul_target, + .get = longhaul_get, + .init = longhaul_cpu_init, + .exit = __devexit_p(longhaul_cpu_exit), + .name = "longhaul", + .owner = THIS_MODULE, + .attr = longhaul_attr, +}; + + +static int __init longhaul_init(void) +{ + struct cpuinfo_x86 *c = cpu_data; + + if (c->x86_vendor != X86_VENDOR_CENTAUR || c->x86 != 6) + return -ENODEV; + +#ifdef CONFIG_SMP + if (num_online_cpus() > 1) { + printk(KERN_ERR PFX "More than 1 CPU detected, longhaul disabled.\n"); + return -ENODEV; + } +#endif +#ifdef CONFIG_X86_IO_APIC + if (cpu_has_apic) { + printk(KERN_ERR PFX "APIC detected. Longhaul is currently broken in this configuration.\n"); + return -ENODEV; + } +#endif + switch (c->x86_model) { + case 6 ... 9: + return cpufreq_register_driver(&longhaul_driver); + case 10: + printk(KERN_ERR PFX "Use acpi-cpufreq driver for VIA C7\n"); + default: + ;; + } + + return -ENODEV; +} + + +static void __exit longhaul_exit(void) +{ + int i; + + for (i=0; i < numscales; i++) { + if (clock_ratio[i] == maxmult) { + longhaul_setstate(i); + break; + } + } + + cpufreq_unregister_driver(&longhaul_driver); + kfree(longhaul_table); +} + +/* Even if BIOS is exporting ACPI C3 state, and it is used + * with success when CPU is idle, this state doesn't + * trigger frequency transition in some cases. */ +module_param (disable_acpi_c3, int, 0644); +MODULE_PARM_DESC(disable_acpi_c3, "Don't use ACPI C3 support"); +/* Change CPU voltage with frequency. Very usefull to save + * power, but most VIA C3 processors aren't supporting it. */ +module_param (scale_voltage, int, 0644); +MODULE_PARM_DESC(scale_voltage, "Scale voltage of processor"); +/* Force revision key to 0 for processors which doesn't + * support voltage scaling, but are introducing itself as + * such. */ +module_param(revid_errata, int, 0644); +MODULE_PARM_DESC(revid_errata, "Ignore CPU Revision ID"); + +MODULE_AUTHOR ("Dave Jones <davej@codemonkey.org.uk>"); +MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); +MODULE_LICENSE ("GPL"); + +late_initcall(longhaul_init); +module_exit(longhaul_exit); diff --git a/arch/i386/kernel/cpu/cpufreq/longhaul.h b/arch/x86/kernel/cpu/cpufreq/longhaul.h index 4fcc320997d..4fcc320997d 100644 --- a/arch/i386/kernel/cpu/cpufreq/longhaul.h +++ b/arch/x86/kernel/cpu/cpufreq/longhaul.h diff --git a/arch/i386/kernel/cpu/cpufreq/longrun.c b/arch/x86/kernel/cpu/cpufreq/longrun.c index b2689514295..b2689514295 100644 --- a/arch/i386/kernel/cpu/cpufreq/longrun.c +++ b/arch/x86/kernel/cpu/cpufreq/longrun.c diff --git a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c index 4c76b511e19..4c76b511e19 100644 --- a/arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +++ b/arch/x86/kernel/cpu/cpufreq/p4-clockmod.c diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c index f89524051e4..f89524051e4 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k6.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k6.c diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c index ca3e1d34188..ca3e1d34188 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.c diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k7.h b/arch/x86/kernel/cpu/cpufreq/powernow-k7.h index f8a63b3664e..f8a63b3664e 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k7.h +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k7.h diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c index 34ed53a0673..34ed53a0673 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.c +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.c diff --git a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h index b06c812208c..b06c812208c 100644 --- a/arch/i386/kernel/cpu/cpufreq/powernow-k8.h +++ b/arch/x86/kernel/cpu/cpufreq/powernow-k8.h diff --git a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c index b8fb4b521c6..b8fb4b521c6 100644 --- a/arch/i386/kernel/cpu/cpufreq/sc520_freq.c +++ b/arch/x86/kernel/cpu/cpufreq/sc520_freq.c diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c index 6c5dc2c85ae..6c5dc2c85ae 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c index a5b2346faf1..a5b2346faf1 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-ich.c diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c index b1acc8ce316..b1acc8ce316 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.c diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h index b11bcc608ca..b11bcc608ca 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-lib.h +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-lib.h diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c index e1c509aa305..e1c509aa305 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +++ b/arch/x86/kernel/cpu/cpufreq/speedstep-smi.c diff --git a/arch/i386/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index 122d2d75aa9..122d2d75aa9 100644 --- a/arch/i386/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c diff --git a/arch/i386/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c index dc4e08147b1..dc4e08147b1 100644 --- a/arch/i386/kernel/cpu/intel.c +++ b/arch/x86/kernel/cpu/intel.c diff --git a/arch/i386/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c index db6c25aa577..db6c25aa577 100644 --- a/arch/i386/kernel/cpu/intel_cacheinfo.c +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c diff --git a/arch/i386/kernel/cpu/mcheck/Makefile b/arch/x86/kernel/cpu/mcheck/Makefile index f1ebe1c1c17..f1ebe1c1c17 100644 --- a/arch/i386/kernel/cpu/mcheck/Makefile +++ b/arch/x86/kernel/cpu/mcheck/Makefile diff --git a/arch/i386/kernel/cpu/mcheck/k7.c b/arch/x86/kernel/cpu/mcheck/k7.c index eef63e3630c..eef63e3630c 100644 --- a/arch/i386/kernel/cpu/mcheck/k7.c +++ b/arch/x86/kernel/cpu/mcheck/k7.c diff --git a/arch/i386/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 34c781eddee..34c781eddee 100644 --- a/arch/i386/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c diff --git a/arch/i386/kernel/cpu/mcheck/mce.h b/arch/x86/kernel/cpu/mcheck/mce.h index 81fb6e2d35f..81fb6e2d35f 100644 --- a/arch/i386/kernel/cpu/mcheck/mce.h +++ b/arch/x86/kernel/cpu/mcheck/mce.h diff --git a/arch/i386/kernel/cpu/mcheck/non-fatal.c b/arch/x86/kernel/cpu/mcheck/non-fatal.c index bf39409b383..bf39409b383 100644 --- a/arch/i386/kernel/cpu/mcheck/non-fatal.c +++ b/arch/x86/kernel/cpu/mcheck/non-fatal.c diff --git a/arch/i386/kernel/cpu/mcheck/p4.c b/arch/x86/kernel/cpu/mcheck/p4.c index 1509edfb231..1509edfb231 100644 --- a/arch/i386/kernel/cpu/mcheck/p4.c +++ b/arch/x86/kernel/cpu/mcheck/p4.c diff --git a/arch/i386/kernel/cpu/mcheck/p5.c b/arch/x86/kernel/cpu/mcheck/p5.c index 94bc43d950c..94bc43d950c 100644 --- a/arch/i386/kernel/cpu/mcheck/p5.c +++ b/arch/x86/kernel/cpu/mcheck/p5.c diff --git a/arch/i386/kernel/cpu/mcheck/p6.c b/arch/x86/kernel/cpu/mcheck/p6.c index deeae42ce19..deeae42ce19 100644 --- a/arch/i386/kernel/cpu/mcheck/p6.c +++ b/arch/x86/kernel/cpu/mcheck/p6.c diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c index 1203dc5ab87..1203dc5ab87 100644 --- a/arch/i386/kernel/cpu/mcheck/therm_throt.c +++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c diff --git a/arch/i386/kernel/cpu/mcheck/winchip.c b/arch/x86/kernel/cpu/mcheck/winchip.c index 9e424b6c293..9e424b6c293 100644 --- a/arch/i386/kernel/cpu/mcheck/winchip.c +++ b/arch/x86/kernel/cpu/mcheck/winchip.c diff --git a/arch/i386/kernel/cpu/mtrr/Makefile b/arch/x86/kernel/cpu/mtrr/Makefile index 191fc053364..191fc053364 100644 --- a/arch/i386/kernel/cpu/mtrr/Makefile +++ b/arch/x86/kernel/cpu/mtrr/Makefile diff --git a/arch/i386/kernel/cpu/mtrr/amd.c b/arch/x86/kernel/cpu/mtrr/amd.c index 0949cdbf848..0949cdbf848 100644 --- a/arch/i386/kernel/cpu/mtrr/amd.c +++ b/arch/x86/kernel/cpu/mtrr/amd.c diff --git a/arch/i386/kernel/cpu/mtrr/centaur.c b/arch/x86/kernel/cpu/mtrr/centaur.c index cb9aa3a7a7a..cb9aa3a7a7a 100644 --- a/arch/i386/kernel/cpu/mtrr/centaur.c +++ b/arch/x86/kernel/cpu/mtrr/centaur.c diff --git a/arch/i386/kernel/cpu/mtrr/cyrix.c b/arch/x86/kernel/cpu/mtrr/cyrix.c index 2287d4863a8..2287d4863a8 100644 --- a/arch/i386/kernel/cpu/mtrr/cyrix.c +++ b/arch/x86/kernel/cpu/mtrr/cyrix.c diff --git a/arch/i386/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 56f64e34829..56f64e34829 100644 --- a/arch/i386/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c diff --git a/arch/i386/kernel/cpu/mtrr/if.c b/arch/x86/kernel/cpu/mtrr/if.c index c7d8f175674..c7d8f175674 100644 --- a/arch/i386/kernel/cpu/mtrr/if.c +++ b/arch/x86/kernel/cpu/mtrr/if.c diff --git a/arch/i386/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index c48b6fea5ab..c48b6fea5ab 100644 --- a/arch/i386/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c diff --git a/arch/i386/kernel/cpu/mtrr/mtrr.h b/arch/x86/kernel/cpu/mtrr/mtrr.h index 289dfe6030e..289dfe6030e 100644 --- a/arch/i386/kernel/cpu/mtrr/mtrr.h +++ b/arch/x86/kernel/cpu/mtrr/mtrr.h diff --git a/arch/x86/kernel/cpu/mtrr/state.c b/arch/x86/kernel/cpu/mtrr/state.c new file mode 100644 index 00000000000..49e20c2afcd --- /dev/null +++ b/arch/x86/kernel/cpu/mtrr/state.c @@ -0,0 +1,79 @@ +#include <linux/mm.h> +#include <linux/init.h> +#include <asm/io.h> +#include <asm/mtrr.h> +#include <asm/msr.h> +#include <asm/processor-cyrix.h> +#include "mtrr.h" + + +/* Put the processor into a state where MTRRs can be safely set */ +void set_mtrr_prepare_save(struct set_mtrr_context *ctxt) +{ + unsigned int cr0; + + /* Disable interrupts locally */ + local_irq_save(ctxt->flags); + + if (use_intel() || is_cpu(CYRIX)) { + + /* Save value of CR4 and clear Page Global Enable (bit 7) */ + if ( cpu_has_pge ) { + ctxt->cr4val = read_cr4(); + write_cr4(ctxt->cr4val & ~X86_CR4_PGE); + } + + /* Disable and flush caches. Note that wbinvd flushes the TLBs as + a side-effect */ + cr0 = read_cr0() | 0x40000000; + wbinvd(); + write_cr0(cr0); + wbinvd(); + + if (use_intel()) + /* Save MTRR state */ + rdmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); + else + /* Cyrix ARRs - everything else were excluded at the top */ + ctxt->ccr3 = getCx86(CX86_CCR3); + } +} + +void set_mtrr_cache_disable(struct set_mtrr_context *ctxt) +{ + if (use_intel()) + /* Disable MTRRs, and set the default type to uncached */ + mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo & 0xf300UL, + ctxt->deftype_hi); + else if (is_cpu(CYRIX)) + /* Cyrix ARRs - everything else were excluded at the top */ + setCx86(CX86_CCR3, (ctxt->ccr3 & 0x0f) | 0x10); +} + +/* Restore the processor after a set_mtrr_prepare */ +void set_mtrr_done(struct set_mtrr_context *ctxt) +{ + if (use_intel() || is_cpu(CYRIX)) { + + /* Flush caches and TLBs */ + wbinvd(); + + /* Restore MTRRdefType */ + if (use_intel()) + /* Intel (P6) standard MTRRs */ + mtrr_wrmsr(MTRRdefType_MSR, ctxt->deftype_lo, ctxt->deftype_hi); + else + /* Cyrix ARRs - everything else was excluded at the top */ + setCx86(CX86_CCR3, ctxt->ccr3); + + /* Enable caches */ + write_cr0(read_cr0() & 0xbfffffff); + + /* Restore value of CR4 */ + if ( cpu_has_pge ) + write_cr4(ctxt->cr4val); + } + /* Re-enable interrupts locally (if enabled previously) */ + local_irq_restore(ctxt->flags); +} + diff --git a/arch/i386/kernel/cpu/nexgen.c b/arch/x86/kernel/cpu/nexgen.c index 961fbe1a748..961fbe1a748 100644 --- a/arch/i386/kernel/cpu/nexgen.c +++ b/arch/x86/kernel/cpu/nexgen.c diff --git a/arch/i386/kernel/cpu/perfctr-watchdog.c b/arch/x86/kernel/cpu/perfctr-watchdog.c index 93fecd4b03d..93fecd4b03d 100644 --- a/arch/i386/kernel/cpu/perfctr-watchdog.c +++ b/arch/x86/kernel/cpu/perfctr-watchdog.c diff --git a/arch/i386/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 1e31b6caffb..1e31b6caffb 100644 --- a/arch/i386/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c diff --git a/arch/i386/kernel/cpu/transmeta.c b/arch/x86/kernel/cpu/transmeta.c index 200fb3f9ebf..200fb3f9ebf 100644 --- a/arch/i386/kernel/cpu/transmeta.c +++ b/arch/x86/kernel/cpu/transmeta.c diff --git a/arch/i386/kernel/cpu/umc.c b/arch/x86/kernel/cpu/umc.c index a7a4e75bdcd..a7a4e75bdcd 100644 --- a/arch/i386/kernel/cpu/umc.c +++ b/arch/x86/kernel/cpu/umc.c diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86/kernel/cpufreq/Kconfig index a3fd51926cb..a3fd51926cb 100644 --- a/arch/x86_64/kernel/cpufreq/Kconfig +++ b/arch/x86/kernel/cpufreq/Kconfig diff --git a/arch/i386/kernel/cpuid.c b/arch/x86/kernel/cpuid.c index 5c2faa10e9f..5c2faa10e9f 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/x86/kernel/cpuid.c diff --git a/arch/i386/kernel/crash.c b/arch/x86/kernel/crash_32.c index 53589d1b1a0..53589d1b1a0 100644 --- a/arch/i386/kernel/crash.c +++ b/arch/x86/kernel/crash_32.c diff --git a/arch/x86_64/kernel/crash.c b/arch/x86/kernel/crash_64.c index 13432a1ae90..13432a1ae90 100644 --- a/arch/x86_64/kernel/crash.c +++ b/arch/x86/kernel/crash_64.c diff --git a/arch/i386/kernel/crash_dump.c b/arch/x86/kernel/crash_dump_32.c index 3f532df488b..3f532df488b 100644 --- a/arch/i386/kernel/crash_dump.c +++ b/arch/x86/kernel/crash_dump_32.c diff --git a/arch/x86_64/kernel/crash_dump.c b/arch/x86/kernel/crash_dump_64.c index 942deac4d43..942deac4d43 100644 --- a/arch/x86_64/kernel/crash_dump.c +++ b/arch/x86/kernel/crash_dump_64.c diff --git a/arch/i386/kernel/doublefault.c b/arch/x86/kernel/doublefault_32.c index 40978af630e..40978af630e 100644 --- a/arch/i386/kernel/doublefault.c +++ b/arch/x86/kernel/doublefault_32.c diff --git a/arch/i386/kernel/e820.c b/arch/x86/kernel/e820_32.c index 3c86b979a40..3c86b979a40 100644 --- a/arch/i386/kernel/e820.c +++ b/arch/x86/kernel/e820_32.c diff --git a/arch/x86_64/kernel/e820.c b/arch/x86/kernel/e820_64.c index 0f4d5e209e9..0f4d5e209e9 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86/kernel/e820_64.c diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86/kernel/early-quirks_64.c index 13aa4fd728f..13aa4fd728f 100644 --- a/arch/x86_64/kernel/early-quirks.c +++ b/arch/x86/kernel/early-quirks_64.c diff --git a/arch/x86_64/kernel/early_printk.c b/arch/x86/kernel/early_printk.c index fd9aff3f389..fd9aff3f389 100644 --- a/arch/x86_64/kernel/early_printk.c +++ b/arch/x86/kernel/early_printk.c diff --git a/arch/i386/kernel/efi.c b/arch/x86/kernel/efi_32.c index 2452c6fbe99..2452c6fbe99 100644 --- a/arch/i386/kernel/efi.c +++ b/arch/x86/kernel/efi_32.c diff --git a/arch/i386/kernel/efi_stub.S b/arch/x86/kernel/efi_stub_32.S index ef00bb77d7e..ef00bb77d7e 100644 --- a/arch/i386/kernel/efi_stub.S +++ b/arch/x86/kernel/efi_stub_32.S diff --git a/arch/x86/kernel/entry_32.S b/arch/x86/kernel/entry_32.S new file mode 100644 index 00000000000..290b7bc82da --- /dev/null +++ b/arch/x86/kernel/entry_32.S @@ -0,0 +1,1112 @@ +/* + * linux/arch/i386/entry.S + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* + * entry.S contains the system-call and fault low-level handling routines. + * This also contains the timer-interrupt handler, as well as all interrupts + * and faults that can result in a task-switch. + * + * NOTE: This code handles signal-recognition, which happens every time + * after a timer-interrupt and after each system call. + * + * I changed all the .align's to 4 (16 byte alignment), as that's faster + * on a 486. + * + * Stack layout in 'syscall_exit': + * ptrace needs to have all regs on the stack. + * if the order here is changed, it needs to be + * updated in fork.c:copy_process, signal.c:do_signal, + * ptrace.c and ptrace.h + * + * 0(%esp) - %ebx + * 4(%esp) - %ecx + * 8(%esp) - %edx + * C(%esp) - %esi + * 10(%esp) - %edi + * 14(%esp) - %ebp + * 18(%esp) - %eax + * 1C(%esp) - %ds + * 20(%esp) - %es + * 24(%esp) - %fs + * 28(%esp) - orig_eax + * 2C(%esp) - %eip + * 30(%esp) - %cs + * 34(%esp) - %eflags + * 38(%esp) - %oldesp + * 3C(%esp) - %oldss + * + * "current" is in register %ebx during any slow entries. + */ + +#include <linux/linkage.h> +#include <asm/thread_info.h> +#include <asm/irqflags.h> +#include <asm/errno.h> +#include <asm/segment.h> +#include <asm/smp.h> +#include <asm/page.h> +#include <asm/desc.h> +#include <asm/percpu.h> +#include <asm/dwarf2.h> +#include "irq_vectors.h" + +/* + * We use macros for low-level operations which need to be overridden + * for paravirtualization. The following will never clobber any registers: + * INTERRUPT_RETURN (aka. "iret") + * GET_CR0_INTO_EAX (aka. "movl %cr0, %eax") + * ENABLE_INTERRUPTS_SYSEXIT (aka "sti; sysexit"). + * + * For DISABLE_INTERRUPTS/ENABLE_INTERRUPTS (aka "cli"/"sti"), you must + * specify what registers can be overwritten (CLBR_NONE, CLBR_EAX/EDX/ECX/ANY). + * Allowing a register to be clobbered can shrink the paravirt replacement + * enough to patch inline, increasing performance. + */ + +#define nr_syscalls ((syscall_table_size)/4) + +CF_MASK = 0x00000001 +TF_MASK = 0x00000100 +IF_MASK = 0x00000200 +DF_MASK = 0x00000400 +NT_MASK = 0x00004000 +VM_MASK = 0x00020000 + +#ifdef CONFIG_PREEMPT +#define preempt_stop(clobbers) DISABLE_INTERRUPTS(clobbers); TRACE_IRQS_OFF +#else +#define preempt_stop(clobbers) +#define resume_kernel restore_nocheck +#endif + +.macro TRACE_IRQS_IRET +#ifdef CONFIG_TRACE_IRQFLAGS + testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off? + jz 1f + TRACE_IRQS_ON +1: +#endif +.endm + +#ifdef CONFIG_VM86 +#define resume_userspace_sig check_userspace +#else +#define resume_userspace_sig resume_userspace +#endif + +#define SAVE_ALL \ + cld; \ + pushl %fs; \ + CFI_ADJUST_CFA_OFFSET 4;\ + /*CFI_REL_OFFSET fs, 0;*/\ + pushl %es; \ + CFI_ADJUST_CFA_OFFSET 4;\ + /*CFI_REL_OFFSET es, 0;*/\ + pushl %ds; \ + CFI_ADJUST_CFA_OFFSET 4;\ + /*CFI_REL_OFFSET ds, 0;*/\ + pushl %eax; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET eax, 0;\ + pushl %ebp; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET ebp, 0;\ + pushl %edi; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET edi, 0;\ + pushl %esi; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET esi, 0;\ + pushl %edx; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET edx, 0;\ + pushl %ecx; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET ecx, 0;\ + pushl %ebx; \ + CFI_ADJUST_CFA_OFFSET 4;\ + CFI_REL_OFFSET ebx, 0;\ + movl $(__USER_DS), %edx; \ + movl %edx, %ds; \ + movl %edx, %es; \ + movl $(__KERNEL_PERCPU), %edx; \ + movl %edx, %fs + +#define RESTORE_INT_REGS \ + popl %ebx; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE ebx;\ + popl %ecx; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE ecx;\ + popl %edx; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE edx;\ + popl %esi; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE esi;\ + popl %edi; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE edi;\ + popl %ebp; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE ebp;\ + popl %eax; \ + CFI_ADJUST_CFA_OFFSET -4;\ + CFI_RESTORE eax + +#define RESTORE_REGS \ + RESTORE_INT_REGS; \ +1: popl %ds; \ + CFI_ADJUST_CFA_OFFSET -4;\ + /*CFI_RESTORE ds;*/\ +2: popl %es; \ + CFI_ADJUST_CFA_OFFSET -4;\ + /*CFI_RESTORE es;*/\ +3: popl %fs; \ + CFI_ADJUST_CFA_OFFSET -4;\ + /*CFI_RESTORE fs;*/\ +.pushsection .fixup,"ax"; \ +4: movl $0,(%esp); \ + jmp 1b; \ +5: movl $0,(%esp); \ + jmp 2b; \ +6: movl $0,(%esp); \ + jmp 3b; \ +.section __ex_table,"a";\ + .align 4; \ + .long 1b,4b; \ + .long 2b,5b; \ + .long 3b,6b; \ +.popsection + +#define RING0_INT_FRAME \ + CFI_STARTPROC simple;\ + CFI_SIGNAL_FRAME;\ + CFI_DEF_CFA esp, 3*4;\ + /*CFI_OFFSET cs, -2*4;*/\ + CFI_OFFSET eip, -3*4 + +#define RING0_EC_FRAME \ + CFI_STARTPROC simple;\ + CFI_SIGNAL_FRAME;\ + CFI_DEF_CFA esp, 4*4;\ + /*CFI_OFFSET cs, -2*4;*/\ + CFI_OFFSET eip, -3*4 + +#define RING0_PTREGS_FRAME \ + CFI_STARTPROC simple;\ + CFI_SIGNAL_FRAME;\ + CFI_DEF_CFA esp, PT_OLDESP-PT_EBX;\ + /*CFI_OFFSET cs, PT_CS-PT_OLDESP;*/\ + CFI_OFFSET eip, PT_EIP-PT_OLDESP;\ + /*CFI_OFFSET es, PT_ES-PT_OLDESP;*/\ + /*CFI_OFFSET ds, PT_DS-PT_OLDESP;*/\ + CFI_OFFSET eax, PT_EAX-PT_OLDESP;\ + CFI_OFFSET ebp, PT_EBP-PT_OLDESP;\ + CFI_OFFSET edi, PT_EDI-PT_OLDESP;\ + CFI_OFFSET esi, PT_ESI-PT_OLDESP;\ + CFI_OFFSET edx, PT_EDX-PT_OLDESP;\ + CFI_OFFSET ecx, PT_ECX-PT_OLDESP;\ + CFI_OFFSET ebx, PT_EBX-PT_OLDESP + +ENTRY(ret_from_fork) + CFI_STARTPROC + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + call schedule_tail + GET_THREAD_INFO(%ebp) + popl %eax + CFI_ADJUST_CFA_OFFSET -4 + pushl $0x0202 # Reset kernel eflags + CFI_ADJUST_CFA_OFFSET 4 + popfl + CFI_ADJUST_CFA_OFFSET -4 + jmp syscall_exit + CFI_ENDPROC +END(ret_from_fork) + +/* + * Return to user mode is not as complex as all this looks, + * but we want the default path for a system call return to + * go as quickly as possible which is why some of this is + * less clear than it otherwise should be. + */ + + # userspace resumption stub bypassing syscall exit tracing + ALIGN + RING0_PTREGS_FRAME +ret_from_exception: + preempt_stop(CLBR_ANY) +ret_from_intr: + GET_THREAD_INFO(%ebp) +check_userspace: + movl PT_EFLAGS(%esp), %eax # mix EFLAGS and CS + movb PT_CS(%esp), %al + andl $(VM_MASK | SEGMENT_RPL_MASK), %eax + cmpl $USER_RPL, %eax + jb resume_kernel # not returning to v8086 or userspace + +ENTRY(resume_userspace) + DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt + # setting need_resched or sigpending + # between sampling and the iret + movl TI_flags(%ebp), %ecx + andl $_TIF_WORK_MASK, %ecx # is there any work to be done on + # int/exception return? + jne work_pending + jmp restore_all +END(ret_from_exception) + +#ifdef CONFIG_PREEMPT +ENTRY(resume_kernel) + DISABLE_INTERRUPTS(CLBR_ANY) + cmpl $0,TI_preempt_count(%ebp) # non-zero preempt_count ? + jnz restore_nocheck +need_resched: + movl TI_flags(%ebp), %ecx # need_resched set ? + testb $_TIF_NEED_RESCHED, %cl + jz restore_all + testl $IF_MASK,PT_EFLAGS(%esp) # interrupts off (exception path) ? + jz restore_all + call preempt_schedule_irq + jmp need_resched +END(resume_kernel) +#endif + CFI_ENDPROC + +/* SYSENTER_RETURN points to after the "sysenter" instruction in + the vsyscall page. See vsyscall-sysentry.S, which defines the symbol. */ + + # sysenter call handler stub +ENTRY(sysenter_entry) + CFI_STARTPROC simple + CFI_SIGNAL_FRAME + CFI_DEF_CFA esp, 0 + CFI_REGISTER esp, ebp + movl TSS_sysenter_esp0(%esp),%esp +sysenter_past_esp: + /* + * No need to follow this irqs on/off section: the syscall + * disabled irqs and here we enable it straight after entry: + */ + ENABLE_INTERRUPTS(CLBR_NONE) + pushl $(__USER_DS) + CFI_ADJUST_CFA_OFFSET 4 + /*CFI_REL_OFFSET ss, 0*/ + pushl %ebp + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET esp, 0 + pushfl + CFI_ADJUST_CFA_OFFSET 4 + pushl $(__USER_CS) + CFI_ADJUST_CFA_OFFSET 4 + /*CFI_REL_OFFSET cs, 0*/ + /* + * Push current_thread_info()->sysenter_return to the stack. + * A tiny bit of offset fixup is necessary - 4*4 means the 4 words + * pushed above; +8 corresponds to copy_thread's esp0 setting. + */ + pushl (TI_sysenter_return-THREAD_SIZE+8+4*4)(%esp) + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET eip, 0 + +/* + * Load the potential sixth argument from user stack. + * Careful about security. + */ + cmpl $__PAGE_OFFSET-3,%ebp + jae syscall_fault +1: movl (%ebp),%ebp +.section __ex_table,"a" + .align 4 + .long 1b,syscall_fault +.previous + + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + GET_THREAD_INFO(%ebp) + + /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ + testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) + jnz syscall_trace_entry + cmpl $(nr_syscalls), %eax + jae syscall_badsys + call *sys_call_table(,%eax,4) + movl %eax,PT_EAX(%esp) + DISABLE_INTERRUPTS(CLBR_ANY) + TRACE_IRQS_OFF + movl TI_flags(%ebp), %ecx + testw $_TIF_ALLWORK_MASK, %cx + jne syscall_exit_work +/* if something modifies registers it must also disable sysexit */ + movl PT_EIP(%esp), %edx + movl PT_OLDESP(%esp), %ecx + xorl %ebp,%ebp + TRACE_IRQS_ON +1: mov PT_FS(%esp), %fs + ENABLE_INTERRUPTS_SYSEXIT + CFI_ENDPROC +.pushsection .fixup,"ax" +2: movl $0,PT_FS(%esp) + jmp 1b +.section __ex_table,"a" + .align 4 + .long 1b,2b +.popsection +ENDPROC(sysenter_entry) + + # system call handler stub +ENTRY(system_call) + RING0_INT_FRAME # can't unwind into user space anyway + pushl %eax # save orig_eax + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + GET_THREAD_INFO(%ebp) + # system call tracing in operation / emulation + /* Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb */ + testw $(_TIF_SYSCALL_EMU|_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT),TI_flags(%ebp) + jnz syscall_trace_entry + cmpl $(nr_syscalls), %eax + jae syscall_badsys +syscall_call: + call *sys_call_table(,%eax,4) + movl %eax,PT_EAX(%esp) # store the return value +syscall_exit: + DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt + # setting need_resched or sigpending + # between sampling and the iret + TRACE_IRQS_OFF + testl $TF_MASK,PT_EFLAGS(%esp) # If tracing set singlestep flag on exit + jz no_singlestep + orl $_TIF_SINGLESTEP,TI_flags(%ebp) +no_singlestep: + movl TI_flags(%ebp), %ecx + testw $_TIF_ALLWORK_MASK, %cx # current->work + jne syscall_exit_work + +restore_all: + movl PT_EFLAGS(%esp), %eax # mix EFLAGS, SS and CS + # Warning: PT_OLDSS(%esp) contains the wrong/random values if we + # are returning to the kernel. + # See comments in process.c:copy_thread() for details. + movb PT_OLDSS(%esp), %ah + movb PT_CS(%esp), %al + andl $(VM_MASK | (SEGMENT_TI_MASK << 8) | SEGMENT_RPL_MASK), %eax + cmpl $((SEGMENT_LDT << 8) | USER_RPL), %eax + CFI_REMEMBER_STATE + je ldt_ss # returning to user-space with LDT SS +restore_nocheck: + TRACE_IRQS_IRET +restore_nocheck_notrace: + RESTORE_REGS + addl $4, %esp # skip orig_eax/error_code + CFI_ADJUST_CFA_OFFSET -4 +1: INTERRUPT_RETURN +.section .fixup,"ax" +iret_exc: + pushl $0 # no error code + pushl $do_iret_error + jmp error_code +.previous +.section __ex_table,"a" + .align 4 + .long 1b,iret_exc +.previous + + CFI_RESTORE_STATE +ldt_ss: + larl PT_OLDSS(%esp), %eax + jnz restore_nocheck + testl $0x00400000, %eax # returning to 32bit stack? + jnz restore_nocheck # allright, normal return + +#ifdef CONFIG_PARAVIRT + /* + * The kernel can't run on a non-flat stack if paravirt mode + * is active. Rather than try to fixup the high bits of + * ESP, bypass this code entirely. This may break DOSemu + * and/or Wine support in a paravirt VM, although the option + * is still available to implement the setting of the high + * 16-bits in the INTERRUPT_RETURN paravirt-op. + */ + cmpl $0, paravirt_ops+PARAVIRT_enabled + jne restore_nocheck +#endif + + /* If returning to userspace with 16bit stack, + * try to fix the higher word of ESP, as the CPU + * won't restore it. + * This is an "official" bug of all the x86-compatible + * CPUs, which we can try to work around to make + * dosemu and wine happy. */ + movl PT_OLDESP(%esp), %eax + movl %esp, %edx + call patch_espfix_desc + pushl $__ESPFIX_SS + CFI_ADJUST_CFA_OFFSET 4 + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + DISABLE_INTERRUPTS(CLBR_EAX) + TRACE_IRQS_OFF + lss (%esp), %esp + CFI_ADJUST_CFA_OFFSET -8 + jmp restore_nocheck + CFI_ENDPROC +ENDPROC(system_call) + + # perform work that needs to be done immediately before resumption + ALIGN + RING0_PTREGS_FRAME # can't unwind into user space anyway +work_pending: + testb $_TIF_NEED_RESCHED, %cl + jz work_notifysig +work_resched: + call schedule + DISABLE_INTERRUPTS(CLBR_ANY) # make sure we don't miss an interrupt + # setting need_resched or sigpending + # between sampling and the iret + TRACE_IRQS_OFF + movl TI_flags(%ebp), %ecx + andl $_TIF_WORK_MASK, %ecx # is there any work to be done other + # than syscall tracing? + jz restore_all + testb $_TIF_NEED_RESCHED, %cl + jnz work_resched + +work_notifysig: # deal with pending signals and + # notify-resume requests +#ifdef CONFIG_VM86 + testl $VM_MASK, PT_EFLAGS(%esp) + movl %esp, %eax + jne work_notifysig_v86 # returning to kernel-space or + # vm86-space + xorl %edx, %edx + call do_notify_resume + jmp resume_userspace_sig + + ALIGN +work_notifysig_v86: + pushl %ecx # save ti_flags for do_notify_resume + CFI_ADJUST_CFA_OFFSET 4 + call save_v86_state # %eax contains pt_regs pointer + popl %ecx + CFI_ADJUST_CFA_OFFSET -4 + movl %eax, %esp +#else + movl %esp, %eax +#endif + xorl %edx, %edx + call do_notify_resume + jmp resume_userspace_sig +END(work_pending) + + # perform syscall exit tracing + ALIGN +syscall_trace_entry: + movl $-ENOSYS,PT_EAX(%esp) + movl %esp, %eax + xorl %edx,%edx + call do_syscall_trace + cmpl $0, %eax + jne resume_userspace # ret != 0 -> running under PTRACE_SYSEMU, + # so must skip actual syscall + movl PT_ORIG_EAX(%esp), %eax + cmpl $(nr_syscalls), %eax + jnae syscall_call + jmp syscall_exit +END(syscall_trace_entry) + + # perform syscall exit tracing + ALIGN +syscall_exit_work: + testb $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SINGLESTEP), %cl + jz work_pending + TRACE_IRQS_ON + ENABLE_INTERRUPTS(CLBR_ANY) # could let do_syscall_trace() call + # schedule() instead + movl %esp, %eax + movl $1, %edx + call do_syscall_trace + jmp resume_userspace +END(syscall_exit_work) + CFI_ENDPROC + + RING0_INT_FRAME # can't unwind into user space anyway +syscall_fault: + pushl %eax # save orig_eax + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + GET_THREAD_INFO(%ebp) + movl $-EFAULT,PT_EAX(%esp) + jmp resume_userspace +END(syscall_fault) + +syscall_badsys: + movl $-ENOSYS,PT_EAX(%esp) + jmp resume_userspace +END(syscall_badsys) + CFI_ENDPROC + +#define FIXUP_ESPFIX_STACK \ + /* since we are on a wrong stack, we cant make it a C code :( */ \ + PER_CPU(gdt_page, %ebx); \ + GET_DESC_BASE(GDT_ENTRY_ESPFIX_SS, %ebx, %eax, %ax, %al, %ah); \ + addl %esp, %eax; \ + pushl $__KERNEL_DS; \ + CFI_ADJUST_CFA_OFFSET 4; \ + pushl %eax; \ + CFI_ADJUST_CFA_OFFSET 4; \ + lss (%esp), %esp; \ + CFI_ADJUST_CFA_OFFSET -8; +#define UNWIND_ESPFIX_STACK \ + movl %ss, %eax; \ + /* see if on espfix stack */ \ + cmpw $__ESPFIX_SS, %ax; \ + jne 27f; \ + movl $__KERNEL_DS, %eax; \ + movl %eax, %ds; \ + movl %eax, %es; \ + /* switch to normal stack */ \ + FIXUP_ESPFIX_STACK; \ +27:; + +/* + * Build the entry stubs and pointer table with + * some assembler magic. + */ +.data +ENTRY(interrupt) +.text + +ENTRY(irq_entries_start) + RING0_INT_FRAME +vector=0 +.rept NR_IRQS + ALIGN + .if vector + CFI_ADJUST_CFA_OFFSET -4 + .endif +1: pushl $~(vector) + CFI_ADJUST_CFA_OFFSET 4 + jmp common_interrupt + .previous + .long 1b + .text +vector=vector+1 +.endr +END(irq_entries_start) + +.previous +END(interrupt) +.previous + +/* + * the CPU automatically disables interrupts when executing an IRQ vector, + * so IRQ-flags tracing has to follow that: + */ + ALIGN +common_interrupt: + SAVE_ALL + TRACE_IRQS_OFF + movl %esp,%eax + call do_IRQ + jmp ret_from_intr +ENDPROC(common_interrupt) + CFI_ENDPROC + +#define BUILD_INTERRUPT(name, nr) \ +ENTRY(name) \ + RING0_INT_FRAME; \ + pushl $~(nr); \ + CFI_ADJUST_CFA_OFFSET 4; \ + SAVE_ALL; \ + TRACE_IRQS_OFF \ + movl %esp,%eax; \ + call smp_##name; \ + jmp ret_from_intr; \ + CFI_ENDPROC; \ +ENDPROC(name) + +/* The include is where all of the SMP etc. interrupts come from */ +#include "entry_arch.h" + +KPROBE_ENTRY(page_fault) + RING0_EC_FRAME + pushl $do_page_fault + CFI_ADJUST_CFA_OFFSET 4 + ALIGN +error_code: + /* the function address is in %fs's slot on the stack */ + pushl %es + CFI_ADJUST_CFA_OFFSET 4 + /*CFI_REL_OFFSET es, 0*/ + pushl %ds + CFI_ADJUST_CFA_OFFSET 4 + /*CFI_REL_OFFSET ds, 0*/ + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET eax, 0 + pushl %ebp + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET ebp, 0 + pushl %edi + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET edi, 0 + pushl %esi + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET esi, 0 + pushl %edx + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET edx, 0 + pushl %ecx + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET ecx, 0 + pushl %ebx + CFI_ADJUST_CFA_OFFSET 4 + CFI_REL_OFFSET ebx, 0 + cld + pushl %fs + CFI_ADJUST_CFA_OFFSET 4 + /*CFI_REL_OFFSET fs, 0*/ + movl $(__KERNEL_PERCPU), %ecx + movl %ecx, %fs + UNWIND_ESPFIX_STACK + popl %ecx + CFI_ADJUST_CFA_OFFSET -4 + /*CFI_REGISTER es, ecx*/ + movl PT_FS(%esp), %edi # get the function address + movl PT_ORIG_EAX(%esp), %edx # get the error code + movl $-1, PT_ORIG_EAX(%esp) # no syscall to restart + mov %ecx, PT_FS(%esp) + /*CFI_REL_OFFSET fs, ES*/ + movl $(__USER_DS), %ecx + movl %ecx, %ds + movl %ecx, %es + movl %esp,%eax # pt_regs pointer + call *%edi + jmp ret_from_exception + CFI_ENDPROC +KPROBE_END(page_fault) + +ENTRY(coprocessor_error) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_coprocessor_error + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(coprocessor_error) + +ENTRY(simd_coprocessor_error) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_simd_coprocessor_error + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(simd_coprocessor_error) + +ENTRY(device_not_available) + RING0_INT_FRAME + pushl $-1 # mark this as an int + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + GET_CR0_INTO_EAX + testl $0x4, %eax # EM (math emulation bit) + jne device_not_available_emulate + preempt_stop(CLBR_ANY) + call math_state_restore + jmp ret_from_exception +device_not_available_emulate: + pushl $0 # temporary storage for ORIG_EIP + CFI_ADJUST_CFA_OFFSET 4 + call math_emulate + addl $4, %esp + CFI_ADJUST_CFA_OFFSET -4 + jmp ret_from_exception + CFI_ENDPROC +END(device_not_available) + +/* + * Debug traps and NMI can happen at the one SYSENTER instruction + * that sets up the real kernel stack. Check here, since we can't + * allow the wrong stack to be used. + * + * "TSS_sysenter_esp0+12" is because the NMI/debug handler will have + * already pushed 3 words if it hits on the sysenter instruction: + * eflags, cs and eip. + * + * We just load the right stack, and push the three (known) values + * by hand onto the new stack - while updating the return eip past + * the instruction that would have done it for sysenter. + */ +#define FIX_STACK(offset, ok, label) \ + cmpw $__KERNEL_CS,4(%esp); \ + jne ok; \ +label: \ + movl TSS_sysenter_esp0+offset(%esp),%esp; \ + CFI_DEF_CFA esp, 0; \ + CFI_UNDEFINED eip; \ + pushfl; \ + CFI_ADJUST_CFA_OFFSET 4; \ + pushl $__KERNEL_CS; \ + CFI_ADJUST_CFA_OFFSET 4; \ + pushl $sysenter_past_esp; \ + CFI_ADJUST_CFA_OFFSET 4; \ + CFI_REL_OFFSET eip, 0 + +KPROBE_ENTRY(debug) + RING0_INT_FRAME + cmpl $sysenter_entry,(%esp) + jne debug_stack_correct + FIX_STACK(12, debug_stack_correct, debug_esp_fix_insn) +debug_stack_correct: + pushl $-1 # mark this as an int + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + xorl %edx,%edx # error code 0 + movl %esp,%eax # pt_regs pointer + call do_debug + jmp ret_from_exception + CFI_ENDPROC +KPROBE_END(debug) + +/* + * NMI is doubly nasty. It can happen _while_ we're handling + * a debug fault, and the debug fault hasn't yet been able to + * clear up the stack. So we first check whether we got an + * NMI on the sysenter entry path, but after that we need to + * check whether we got an NMI on the debug path where the debug + * fault happened on the sysenter path. + */ +KPROBE_ENTRY(nmi) + RING0_INT_FRAME + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + movl %ss, %eax + cmpw $__ESPFIX_SS, %ax + popl %eax + CFI_ADJUST_CFA_OFFSET -4 + je nmi_espfix_stack + cmpl $sysenter_entry,(%esp) + je nmi_stack_fixup + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + movl %esp,%eax + /* Do not access memory above the end of our stack page, + * it might not exist. + */ + andl $(THREAD_SIZE-1),%eax + cmpl $(THREAD_SIZE-20),%eax + popl %eax + CFI_ADJUST_CFA_OFFSET -4 + jae nmi_stack_correct + cmpl $sysenter_entry,12(%esp) + je nmi_debug_stack_check +nmi_stack_correct: + /* We have a RING0_INT_FRAME here */ + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + xorl %edx,%edx # zero error code + movl %esp,%eax # pt_regs pointer + call do_nmi + jmp restore_nocheck_notrace + CFI_ENDPROC + +nmi_stack_fixup: + RING0_INT_FRAME + FIX_STACK(12,nmi_stack_correct, 1) + jmp nmi_stack_correct + +nmi_debug_stack_check: + /* We have a RING0_INT_FRAME here */ + cmpw $__KERNEL_CS,16(%esp) + jne nmi_stack_correct + cmpl $debug,(%esp) + jb nmi_stack_correct + cmpl $debug_esp_fix_insn,(%esp) + ja nmi_stack_correct + FIX_STACK(24,nmi_stack_correct, 1) + jmp nmi_stack_correct + +nmi_espfix_stack: + /* We have a RING0_INT_FRAME here. + * + * create the pointer to lss back + */ + pushl %ss + CFI_ADJUST_CFA_OFFSET 4 + pushl %esp + CFI_ADJUST_CFA_OFFSET 4 + addw $4, (%esp) + /* copy the iret frame of 12 bytes */ + .rept 3 + pushl 16(%esp) + CFI_ADJUST_CFA_OFFSET 4 + .endr + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + FIXUP_ESPFIX_STACK # %eax == %esp + xorl %edx,%edx # zero error code + call do_nmi + RESTORE_REGS + lss 12+4(%esp), %esp # back to espfix stack + CFI_ADJUST_CFA_OFFSET -24 +1: INTERRUPT_RETURN + CFI_ENDPROC +.section __ex_table,"a" + .align 4 + .long 1b,iret_exc +.previous +KPROBE_END(nmi) + +#ifdef CONFIG_PARAVIRT +ENTRY(native_iret) +1: iret +.section __ex_table,"a" + .align 4 + .long 1b,iret_exc +.previous +END(native_iret) + +ENTRY(native_irq_enable_sysexit) + sti + sysexit +END(native_irq_enable_sysexit) +#endif + +KPROBE_ENTRY(int3) + RING0_INT_FRAME + pushl $-1 # mark this as an int + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + xorl %edx,%edx # zero error code + movl %esp,%eax # pt_regs pointer + call do_int3 + jmp ret_from_exception + CFI_ENDPROC +KPROBE_END(int3) + +ENTRY(overflow) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_overflow + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(overflow) + +ENTRY(bounds) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_bounds + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(bounds) + +ENTRY(invalid_op) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_invalid_op + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(invalid_op) + +ENTRY(coprocessor_segment_overrun) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_coprocessor_segment_overrun + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(coprocessor_segment_overrun) + +ENTRY(invalid_TSS) + RING0_EC_FRAME + pushl $do_invalid_TSS + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(invalid_TSS) + +ENTRY(segment_not_present) + RING0_EC_FRAME + pushl $do_segment_not_present + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(segment_not_present) + +ENTRY(stack_segment) + RING0_EC_FRAME + pushl $do_stack_segment + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(stack_segment) + +KPROBE_ENTRY(general_protection) + RING0_EC_FRAME + pushl $do_general_protection + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +KPROBE_END(general_protection) + +ENTRY(alignment_check) + RING0_EC_FRAME + pushl $do_alignment_check + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(alignment_check) + +ENTRY(divide_error) + RING0_INT_FRAME + pushl $0 # no error code + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_divide_error + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(divide_error) + +#ifdef CONFIG_X86_MCE +ENTRY(machine_check) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl machine_check_vector + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(machine_check) +#endif + +ENTRY(spurious_interrupt_bug) + RING0_INT_FRAME + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + pushl $do_spurious_interrupt_bug + CFI_ADJUST_CFA_OFFSET 4 + jmp error_code + CFI_ENDPROC +END(spurious_interrupt_bug) + +ENTRY(kernel_thread_helper) + pushl $0 # fake return address for unwinder + CFI_STARTPROC + movl %edx,%eax + push %edx + CFI_ADJUST_CFA_OFFSET 4 + call *%ebx + push %eax + CFI_ADJUST_CFA_OFFSET 4 + call do_exit + CFI_ENDPROC +ENDPROC(kernel_thread_helper) + +#ifdef CONFIG_XEN +ENTRY(xen_hypervisor_callback) + CFI_STARTPROC + pushl $0 + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + TRACE_IRQS_OFF + + /* Check to see if we got the event in the critical + region in xen_iret_direct, after we've reenabled + events and checked for pending events. This simulates + iret instruction's behaviour where it delivers a + pending interrupt when enabling interrupts. */ + movl PT_EIP(%esp),%eax + cmpl $xen_iret_start_crit,%eax + jb 1f + cmpl $xen_iret_end_crit,%eax + jae 1f + + call xen_iret_crit_fixup + +1: mov %esp, %eax + call xen_evtchn_do_upcall + jmp ret_from_intr + CFI_ENDPROC +ENDPROC(xen_hypervisor_callback) + +# Hypervisor uses this for application faults while it executes. +# We get here for two reasons: +# 1. Fault while reloading DS, ES, FS or GS +# 2. Fault while executing IRET +# Category 1 we fix up by reattempting the load, and zeroing the segment +# register if the load fails. +# Category 2 we fix up by jumping to do_iret_error. We cannot use the +# normal Linux return path in this case because if we use the IRET hypercall +# to pop the stack frame we end up in an infinite loop of failsafe callbacks. +# We distinguish between categories by maintaining a status value in EAX. +ENTRY(xen_failsafe_callback) + CFI_STARTPROC + pushl %eax + CFI_ADJUST_CFA_OFFSET 4 + movl $1,%eax +1: mov 4(%esp),%ds +2: mov 8(%esp),%es +3: mov 12(%esp),%fs +4: mov 16(%esp),%gs + testl %eax,%eax + popl %eax + CFI_ADJUST_CFA_OFFSET -4 + lea 16(%esp),%esp + CFI_ADJUST_CFA_OFFSET -16 + jz 5f + addl $16,%esp + jmp iret_exc # EAX != 0 => Category 2 (Bad IRET) +5: pushl $0 # EAX == 0 => Category 1 (Bad segment) + CFI_ADJUST_CFA_OFFSET 4 + SAVE_ALL + jmp ret_from_exception + CFI_ENDPROC + +.section .fixup,"ax" +6: xorl %eax,%eax + movl %eax,4(%esp) + jmp 1b +7: xorl %eax,%eax + movl %eax,8(%esp) + jmp 2b +8: xorl %eax,%eax + movl %eax,12(%esp) + jmp 3b +9: xorl %eax,%eax + movl %eax,16(%esp) + jmp 4b +.previous +.section __ex_table,"a" + .align 4 + .long 1b,6b + .long 2b,7b + .long 3b,8b + .long 4b,9b +.previous +ENDPROC(xen_failsafe_callback) + +#endif /* CONFIG_XEN */ + +.section .rodata,"a" +#include "syscall_table_32.S" + +syscall_table_size=(.-sys_call_table) diff --git a/arch/x86_64/kernel/entry.S b/arch/x86/kernel/entry_64.S index 1d232e5f565..1d232e5f565 100644 --- a/arch/x86_64/kernel/entry.S +++ b/arch/x86/kernel/entry_64.S diff --git a/arch/x86_64/kernel/genapic.c b/arch/x86/kernel/genapic_64.c index 47496a40e84..47496a40e84 100644 --- a/arch/x86_64/kernel/genapic.c +++ b/arch/x86/kernel/genapic_64.c diff --git a/arch/x86_64/kernel/genapic_flat.c b/arch/x86/kernel/genapic_flat_64.c index ecb01eefdd2..ecb01eefdd2 100644 --- a/arch/x86_64/kernel/genapic_flat.c +++ b/arch/x86/kernel/genapic_flat_64.c diff --git a/arch/i386/kernel/geode.c b/arch/x86/kernel/geode_32.c index 41e8aec4c61..41e8aec4c61 100644 --- a/arch/i386/kernel/geode.c +++ b/arch/x86/kernel/geode_32.c diff --git a/arch/x86_64/kernel/head64.c b/arch/x86/kernel/head64.c index 6c34bdd22e2..6c34bdd22e2 100644 --- a/arch/x86_64/kernel/head64.c +++ b/arch/x86/kernel/head64.c diff --git a/arch/x86/kernel/head_32.S b/arch/x86/kernel/head_32.S new file mode 100644 index 00000000000..9150ca9b5f8 --- /dev/null +++ b/arch/x86/kernel/head_32.S @@ -0,0 +1,578 @@ +/* + * linux/arch/i386/kernel/head.S -- the 32-bit startup code. + * + * Copyright (C) 1991, 1992 Linus Torvalds + * + * Enhanced CPU detection and feature setting code by Mike Jagdis + * and Martin Mares, November 1997. + */ + +.text +#include <linux/threads.h> +#include <linux/linkage.h> +#include <asm/segment.h> +#include <asm/page.h> +#include <asm/pgtable.h> +#include <asm/desc.h> +#include <asm/cache.h> +#include <asm/thread_info.h> +#include <asm/asm-offsets.h> +#include <asm/setup.h> + +/* + * References to members of the new_cpu_data structure. + */ + +#define X86 new_cpu_data+CPUINFO_x86 +#define X86_VENDOR new_cpu_data+CPUINFO_x86_vendor +#define X86_MODEL new_cpu_data+CPUINFO_x86_model +#define X86_MASK new_cpu_data+CPUINFO_x86_mask +#define X86_HARD_MATH new_cpu_data+CPUINFO_hard_math +#define X86_CPUID new_cpu_data+CPUINFO_cpuid_level +#define X86_CAPABILITY new_cpu_data+CPUINFO_x86_capability +#define X86_VENDOR_ID new_cpu_data+CPUINFO_x86_vendor_id + +/* + * This is how much memory *in addition to the memory covered up to + * and including _end* we need mapped initially. + * We need: + * - one bit for each possible page, but only in low memory, which means + * 2^32/4096/8 = 128K worst case (4G/4G split.) + * - enough space to map all low memory, which means + * (2^32/4096) / 1024 pages (worst case, non PAE) + * (2^32/4096) / 512 + 4 pages (worst case for PAE) + * - a few pages for allocator use before the kernel pagetable has + * been set up + * + * Modulo rounding, each megabyte assigned here requires a kilobyte of + * memory, which is currently unreclaimed. + * + * This should be a multiple of a page. + */ +LOW_PAGES = 1<<(32-PAGE_SHIFT_asm) + +#if PTRS_PER_PMD > 1 +PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PMD) + PTRS_PER_PGD +#else +PAGE_TABLE_SIZE = (LOW_PAGES / PTRS_PER_PGD) +#endif +BOOTBITMAP_SIZE = LOW_PAGES / 8 +ALLOCATOR_SLOP = 4 + +INIT_MAP_BEYOND_END = BOOTBITMAP_SIZE + (PAGE_TABLE_SIZE + ALLOCATOR_SLOP)*PAGE_SIZE_asm + +/* + * 32-bit kernel entrypoint; only used by the boot CPU. On entry, + * %esi points to the real-mode code as a 32-bit pointer. + * CS and DS must be 4 GB flat segments, but we don't depend on + * any particular GDT layout, because we load our own as soon as we + * can. + */ +.section .text.head,"ax",@progbits +ENTRY(startup_32) + +/* + * Set segments to known values. + */ + cld + lgdt boot_gdt_descr - __PAGE_OFFSET + movl $(__BOOT_DS),%eax + movl %eax,%ds + movl %eax,%es + movl %eax,%fs + movl %eax,%gs + +/* + * Clear BSS first so that there are no surprises... + * No need to cld as DF is already clear from cld above... + */ + xorl %eax,%eax + movl $__bss_start - __PAGE_OFFSET,%edi + movl $__bss_stop - __PAGE_OFFSET,%ecx + subl %edi,%ecx + shrl $2,%ecx + rep ; stosl +/* + * Copy bootup parameters out of the way. + * Note: %esi still has the pointer to the real-mode data. + * With the kexec as boot loader, parameter segment might be loaded beyond + * kernel image and might not even be addressable by early boot page tables. + * (kexec on panic case). Hence copy out the parameters before initializing + * page tables. + */ + movl $(boot_params - __PAGE_OFFSET),%edi + movl $(PARAM_SIZE/4),%ecx + cld + rep + movsl + movl boot_params - __PAGE_OFFSET + NEW_CL_POINTER,%esi + andl %esi,%esi + jnz 2f # New command line protocol + cmpw $(OLD_CL_MAGIC),OLD_CL_MAGIC_ADDR + jne 1f + movzwl OLD_CL_OFFSET,%esi + addl $(OLD_CL_BASE_ADDR),%esi +2: + movl $(boot_command_line - __PAGE_OFFSET),%edi + movl $(COMMAND_LINE_SIZE/4),%ecx + rep + movsl +1: + +/* + * Initialize page tables. This creates a PDE and a set of page + * tables, which are located immediately beyond _end. The variable + * init_pg_tables_end is set up to point to the first "safe" location. + * Mappings are created both at virtual address 0 (identity mapping) + * and PAGE_OFFSET for up to _end+sizeof(page tables)+INIT_MAP_BEYOND_END. + * + * Warning: don't use %esi or the stack in this code. However, %esp + * can be used as a GPR if you really need it... + */ +page_pde_offset = (__PAGE_OFFSET >> 20); + + movl $(pg0 - __PAGE_OFFSET), %edi + movl $(swapper_pg_dir - __PAGE_OFFSET), %edx + movl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ +10: + leal 0x007(%edi),%ecx /* Create PDE entry */ + movl %ecx,(%edx) /* Store identity PDE entry */ + movl %ecx,page_pde_offset(%edx) /* Store kernel PDE entry */ + addl $4,%edx + movl $1024, %ecx +11: + stosl + addl $0x1000,%eax + loop 11b + /* End condition: we must map up to and including INIT_MAP_BEYOND_END */ + /* bytes beyond the end of our own page tables; the +0x007 is the attribute bits */ + leal (INIT_MAP_BEYOND_END+0x007)(%edi),%ebp + cmpl %ebp,%eax + jb 10b + movl %edi,(init_pg_tables_end - __PAGE_OFFSET) + + xorl %ebx,%ebx /* This is the boot CPU (BSP) */ + jmp 3f +/* + * Non-boot CPU entry point; entered from trampoline.S + * We can't lgdt here, because lgdt itself uses a data segment, but + * we know the trampoline has already loaded the boot_gdt for us. + * + * If cpu hotplug is not supported then this code can go in init section + * which will be freed later + */ + +#ifndef CONFIG_HOTPLUG_CPU +.section .init.text,"ax",@progbits +#endif + + /* Do an early initialization of the fixmap area */ + movl $(swapper_pg_dir - __PAGE_OFFSET), %edx + movl $(swapper_pg_pmd - __PAGE_OFFSET), %eax + addl $0x007, %eax /* 0x007 = PRESENT+RW+USER */ + movl %eax, 4092(%edx) + +#ifdef CONFIG_SMP +ENTRY(startup_32_smp) + cld + movl $(__BOOT_DS),%eax + movl %eax,%ds + movl %eax,%es + movl %eax,%fs + movl %eax,%gs + +/* + * New page tables may be in 4Mbyte page mode and may + * be using the global pages. + * + * NOTE! If we are on a 486 we may have no cr4 at all! + * So we do not try to touch it unless we really have + * some bits in it to set. This won't work if the BSP + * implements cr4 but this AP does not -- very unlikely + * but be warned! The same applies to the pse feature + * if not equally supported. --macro + * + * NOTE! We have to correct for the fact that we're + * not yet offset PAGE_OFFSET.. + */ +#define cr4_bits mmu_cr4_features-__PAGE_OFFSET + movl cr4_bits,%edx + andl %edx,%edx + jz 6f + movl %cr4,%eax # Turn on paging options (PSE,PAE,..) + orl %edx,%eax + movl %eax,%cr4 + + btl $5, %eax # check if PAE is enabled + jnc 6f + + /* Check if extended functions are implemented */ + movl $0x80000000, %eax + cpuid + cmpl $0x80000000, %eax + jbe 6f + mov $0x80000001, %eax + cpuid + /* Execute Disable bit supported? */ + btl $20, %edx + jnc 6f + + /* Setup EFER (Extended Feature Enable Register) */ + movl $0xc0000080, %ecx + rdmsr + + btsl $11, %eax + /* Make changes effective */ + wrmsr + +6: + /* This is a secondary processor (AP) */ + xorl %ebx,%ebx + incl %ebx + +#endif /* CONFIG_SMP */ +3: + +/* + * Enable paging + */ + movl $swapper_pg_dir-__PAGE_OFFSET,%eax + movl %eax,%cr3 /* set the page table pointer.. */ + movl %cr0,%eax + orl $0x80000000,%eax + movl %eax,%cr0 /* ..and set paging (PG) bit */ + ljmp $__BOOT_CS,$1f /* Clear prefetch and normalize %eip */ +1: + /* Set up the stack pointer */ + lss stack_start,%esp + +/* + * Initialize eflags. Some BIOS's leave bits like NT set. This would + * confuse the debugger if this code is traced. + * XXX - best to initialize before switching to protected mode. + */ + pushl $0 + popfl + +#ifdef CONFIG_SMP + andl %ebx,%ebx + jz 1f /* Initial CPU cleans BSS */ + jmp checkCPUtype +1: +#endif /* CONFIG_SMP */ + +/* + * start system 32-bit setup. We need to re-do some of the things done + * in 16-bit mode for the "real" operations. + */ + call setup_idt + +checkCPUtype: + + movl $-1,X86_CPUID # -1 for no CPUID initially + +/* check if it is 486 or 386. */ +/* + * XXX - this does a lot of unnecessary setup. Alignment checks don't + * apply at our cpl of 0 and the stack ought to be aligned already, and + * we don't need to preserve eflags. + */ + + movb $3,X86 # at least 386 + pushfl # push EFLAGS + popl %eax # get EFLAGS + movl %eax,%ecx # save original EFLAGS + xorl $0x240000,%eax # flip AC and ID bits in EFLAGS + pushl %eax # copy to EFLAGS + popfl # set EFLAGS + pushfl # get new EFLAGS + popl %eax # put it in eax + xorl %ecx,%eax # change in flags + pushl %ecx # restore original EFLAGS + popfl + testl $0x40000,%eax # check if AC bit changed + je is386 + + movb $4,X86 # at least 486 + testl $0x200000,%eax # check if ID bit changed + je is486 + + /* get vendor info */ + xorl %eax,%eax # call CPUID with 0 -> return vendor ID + cpuid + movl %eax,X86_CPUID # save CPUID level + movl %ebx,X86_VENDOR_ID # lo 4 chars + movl %edx,X86_VENDOR_ID+4 # next 4 chars + movl %ecx,X86_VENDOR_ID+8 # last 4 chars + + orl %eax,%eax # do we have processor info as well? + je is486 + + movl $1,%eax # Use the CPUID instruction to get CPU type + cpuid + movb %al,%cl # save reg for future use + andb $0x0f,%ah # mask processor family + movb %ah,X86 + andb $0xf0,%al # mask model + shrb $4,%al + movb %al,X86_MODEL + andb $0x0f,%cl # mask mask revision + movb %cl,X86_MASK + movl %edx,X86_CAPABILITY + +is486: movl $0x50022,%ecx # set AM, WP, NE and MP + jmp 2f + +is386: movl $2,%ecx # set MP +2: movl %cr0,%eax + andl $0x80000011,%eax # Save PG,PE,ET + orl %ecx,%eax + movl %eax,%cr0 + + call check_x87 + lgdt early_gdt_descr + lidt idt_descr + ljmp $(__KERNEL_CS),$1f +1: movl $(__KERNEL_DS),%eax # reload all the segment registers + movl %eax,%ss # after changing gdt. + movl %eax,%fs # gets reset once there's real percpu + + movl $(__USER_DS),%eax # DS/ES contains default USER segment + movl %eax,%ds + movl %eax,%es + + xorl %eax,%eax # Clear GS and LDT + movl %eax,%gs + lldt %ax + + cld # gcc2 wants the direction flag cleared at all times + pushl $0 # fake return address for unwinder +#ifdef CONFIG_SMP + movb ready, %cl + movb $1, ready + cmpb $0,%cl # the first CPU calls start_kernel + je 1f + movl $(__KERNEL_PERCPU), %eax + movl %eax,%fs # set this cpu's percpu + jmp initialize_secondary # all other CPUs call initialize_secondary +1: +#endif /* CONFIG_SMP */ + jmp start_kernel + +/* + * We depend on ET to be correct. This checks for 287/387. + */ +check_x87: + movb $0,X86_HARD_MATH + clts + fninit + fstsw %ax + cmpb $0,%al + je 1f + movl %cr0,%eax /* no coprocessor: have to set bits */ + xorl $4,%eax /* set EM */ + movl %eax,%cr0 + ret + ALIGN +1: movb $1,X86_HARD_MATH + .byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */ + ret + +/* + * setup_idt + * + * sets up a idt with 256 entries pointing to + * ignore_int, interrupt gates. It doesn't actually load + * idt - that can be done only after paging has been enabled + * and the kernel moved to PAGE_OFFSET. Interrupts + * are enabled elsewhere, when we can be relatively + * sure everything is ok. + * + * Warning: %esi is live across this function. + */ +setup_idt: + lea ignore_int,%edx + movl $(__KERNEL_CS << 16),%eax + movw %dx,%ax /* selector = 0x0010 = cs */ + movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ + + lea idt_table,%edi + mov $256,%ecx +rp_sidt: + movl %eax,(%edi) + movl %edx,4(%edi) + addl $8,%edi + dec %ecx + jne rp_sidt + +.macro set_early_handler handler,trapno + lea \handler,%edx + movl $(__KERNEL_CS << 16),%eax + movw %dx,%ax + movw $0x8E00,%dx /* interrupt gate - dpl=0, present */ + lea idt_table,%edi + movl %eax,8*\trapno(%edi) + movl %edx,8*\trapno+4(%edi) +.endm + + set_early_handler handler=early_divide_err,trapno=0 + set_early_handler handler=early_illegal_opcode,trapno=6 + set_early_handler handler=early_protection_fault,trapno=13 + set_early_handler handler=early_page_fault,trapno=14 + + ret + +early_divide_err: + xor %edx,%edx + pushl $0 /* fake errcode */ + jmp early_fault + +early_illegal_opcode: + movl $6,%edx + pushl $0 /* fake errcode */ + jmp early_fault + +early_protection_fault: + movl $13,%edx + jmp early_fault + +early_page_fault: + movl $14,%edx + jmp early_fault + +early_fault: + cld +#ifdef CONFIG_PRINTK + movl $(__KERNEL_DS),%eax + movl %eax,%ds + movl %eax,%es + cmpl $2,early_recursion_flag + je hlt_loop + incl early_recursion_flag + movl %cr2,%eax + pushl %eax + pushl %edx /* trapno */ + pushl $fault_msg +#ifdef CONFIG_EARLY_PRINTK + call early_printk +#else + call printk +#endif +#endif +hlt_loop: + hlt + jmp hlt_loop + +/* This is the default interrupt "handler" :-) */ + ALIGN +ignore_int: + cld +#ifdef CONFIG_PRINTK + pushl %eax + pushl %ecx + pushl %edx + pushl %es + pushl %ds + movl $(__KERNEL_DS),%eax + movl %eax,%ds + movl %eax,%es + cmpl $2,early_recursion_flag + je hlt_loop + incl early_recursion_flag + pushl 16(%esp) + pushl 24(%esp) + pushl 32(%esp) + pushl 40(%esp) + pushl $int_msg +#ifdef CONFIG_EARLY_PRINTK + call early_printk +#else + call printk +#endif + addl $(5*4),%esp + popl %ds + popl %es + popl %edx + popl %ecx + popl %eax +#endif + iret + +.section .text +/* + * Real beginning of normal "text" segment + */ +ENTRY(stext) +ENTRY(_stext) + +/* + * BSS section + */ +.section ".bss.page_aligned","wa" + .align PAGE_SIZE_asm +ENTRY(swapper_pg_dir) + .fill 1024,4,0 +ENTRY(swapper_pg_pmd) + .fill 1024,4,0 +ENTRY(empty_zero_page) + .fill 4096,1,0 + +/* + * This starts the data section. + */ +.data +ENTRY(stack_start) + .long init_thread_union+THREAD_SIZE + .long __BOOT_DS + +ready: .byte 0 + +early_recursion_flag: + .long 0 + +int_msg: + .asciz "Unknown interrupt or fault at EIP %p %p %p\n" + +fault_msg: + .ascii "Int %d: CR2 %p err %p EIP %p CS %p flags %p\n" + .asciz "Stack: %p %p %p %p %p %p %p %p\n" + +#include "../../x86/xen/xen-head.S" + +/* + * The IDT and GDT 'descriptors' are a strange 48-bit object + * only used by the lidt and lgdt instructions. They are not + * like usual segment descriptors - they consist of a 16-bit + * segment size, and 32-bit linear address value: + */ + +.globl boot_gdt_descr +.globl idt_descr + + ALIGN +# early boot GDT descriptor (must use 1:1 address mapping) + .word 0 # 32 bit align gdt_desc.address +boot_gdt_descr: + .word __BOOT_DS+7 + .long boot_gdt - __PAGE_OFFSET + + .word 0 # 32-bit align idt_desc.address +idt_descr: + .word IDT_ENTRIES*8-1 # idt contains 256 entries + .long idt_table + +# boot GDT descriptor (later on used by CPU#0): + .word 0 # 32 bit align gdt_desc.address +ENTRY(early_gdt_descr) + .word GDT_ENTRIES*8-1 + .long per_cpu__gdt_page /* Overwritten for secondary CPUs */ + +/* + * The boot_gdt must mirror the equivalent in setup.S and is + * used only for booting. + */ + .align L1_CACHE_BYTES +ENTRY(boot_gdt) + .fill GDT_ENTRY_BOOT_CS,8,0 + .quad 0x00cf9a000000ffff /* kernel 4GB code at 0x00000000 */ + .quad 0x00cf92000000ffff /* kernel 4GB data at 0x00000000 */ diff --git a/arch/x86_64/kernel/head.S b/arch/x86/kernel/head_64.S index b6167fe3330..b6167fe3330 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86/kernel/head_64.S diff --git a/arch/i386/kernel/hpet.c b/arch/x86/kernel/hpet_32.c index 533d4932bc7..533d4932bc7 100644 --- a/arch/i386/kernel/hpet.c +++ b/arch/x86/kernel/hpet_32.c diff --git a/arch/x86_64/kernel/hpet.c b/arch/x86/kernel/hpet_64.c index e2d1b912e15..e2d1b912e15 100644 --- a/arch/x86_64/kernel/hpet.c +++ b/arch/x86/kernel/hpet_64.c diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/x86/kernel/i386_ksyms_32.c index e3d4b73bfdb..e3d4b73bfdb 100644 --- a/arch/i386/kernel/i386_ksyms.c +++ b/arch/x86/kernel/i386_ksyms_32.c diff --git a/arch/i386/kernel/i387.c b/arch/x86/kernel/i387_32.c index 665847281ed..665847281ed 100644 --- a/arch/i386/kernel/i387.c +++ b/arch/x86/kernel/i387_32.c diff --git a/arch/x86_64/kernel/i387.c b/arch/x86/kernel/i387_64.c index 1d58c13bc6b..1d58c13bc6b 100644 --- a/arch/x86_64/kernel/i387.c +++ b/arch/x86/kernel/i387_64.c diff --git a/arch/i386/kernel/i8237.c b/arch/x86/kernel/i8237.c index 6f508e8d7c5..6f508e8d7c5 100644 --- a/arch/i386/kernel/i8237.c +++ b/arch/x86/kernel/i8237.c diff --git a/arch/i386/kernel/i8253.c b/arch/x86/kernel/i8253_32.c index 6d839f2f1b1..6d839f2f1b1 100644 --- a/arch/i386/kernel/i8253.c +++ b/arch/x86/kernel/i8253_32.c diff --git a/arch/i386/kernel/i8259.c b/arch/x86/kernel/i8259_32.c index 0499cbe9871..0499cbe9871 100644 --- a/arch/i386/kernel/i8259.c +++ b/arch/x86/kernel/i8259_32.c diff --git a/arch/x86_64/kernel/i8259.c b/arch/x86/kernel/i8259_64.c index 948cae64609..948cae64609 100644 --- a/arch/x86_64/kernel/i8259.c +++ b/arch/x86/kernel/i8259_64.c diff --git a/arch/i386/kernel/init_task.c b/arch/x86/kernel/init_task_32.c index d26fc063a76..d26fc063a76 100644 --- a/arch/i386/kernel/init_task.c +++ b/arch/x86/kernel/init_task_32.c diff --git a/arch/x86_64/kernel/init_task.c b/arch/x86/kernel/init_task_64.c index 4ff33d4f855..4ff33d4f855 100644 --- a/arch/x86_64/kernel/init_task.c +++ b/arch/x86/kernel/init_task_64.c diff --git a/arch/i386/kernel/io_apic.c b/arch/x86/kernel/io_apic_32.c index e2f4a1c6854..e2f4a1c6854 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic_32.c diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86/kernel/io_apic_64.c index 966fa106249..966fa106249 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic_64.c diff --git a/arch/i386/kernel/ioport.c b/arch/x86/kernel/ioport_32.c index 3d310a946d7..3d310a946d7 100644 --- a/arch/i386/kernel/ioport.c +++ b/arch/x86/kernel/ioport_32.c diff --git a/arch/x86_64/kernel/ioport.c b/arch/x86/kernel/ioport_64.c index 653efa30b0f..653efa30b0f 100644 --- a/arch/x86_64/kernel/ioport.c +++ b/arch/x86/kernel/ioport_64.c diff --git a/arch/i386/kernel/irq.c b/arch/x86/kernel/irq_32.c index dd2b97fc00b..dd2b97fc00b 100644 --- a/arch/i386/kernel/irq.c +++ b/arch/x86/kernel/irq_32.c diff --git a/arch/x86_64/kernel/irq.c b/arch/x86/kernel/irq_64.c index 39cb3fa83eb..39cb3fa83eb 100644 --- a/arch/x86_64/kernel/irq.c +++ b/arch/x86/kernel/irq_64.c diff --git a/arch/x86_64/kernel/k8.c b/arch/x86/kernel/k8.c index 7377ccb2133..7377ccb2133 100644 --- a/arch/x86_64/kernel/k8.c +++ b/arch/x86/kernel/k8.c diff --git a/arch/i386/kernel/kprobes.c b/arch/x86/kernel/kprobes_32.c index 448a50b1324..448a50b1324 100644 --- a/arch/i386/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes_32.c diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86/kernel/kprobes_64.c index a30e004682e..a30e004682e 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86/kernel/kprobes_64.c diff --git a/arch/i386/kernel/ldt.c b/arch/x86/kernel/ldt_32.c index e0b2d17f4f1..e0b2d17f4f1 100644 --- a/arch/i386/kernel/ldt.c +++ b/arch/x86/kernel/ldt_32.c diff --git a/arch/x86_64/kernel/ldt.c b/arch/x86/kernel/ldt_64.c index bc9ffd5c19c..bc9ffd5c19c 100644 --- a/arch/x86_64/kernel/ldt.c +++ b/arch/x86/kernel/ldt_64.c diff --git a/arch/i386/kernel/machine_kexec.c b/arch/x86/kernel/machine_kexec_32.c index 91966bafb3d..91966bafb3d 100644 --- a/arch/i386/kernel/machine_kexec.c +++ b/arch/x86/kernel/machine_kexec_32.c diff --git a/arch/x86_64/kernel/machine_kexec.c b/arch/x86/kernel/machine_kexec_64.c index c3a55470367..c3a55470367 100644 --- a/arch/x86_64/kernel/machine_kexec.c +++ b/arch/x86/kernel/machine_kexec_64.c diff --git a/arch/i386/kernel/mca.c b/arch/x86/kernel/mca_32.c index b83672b8952..b83672b8952 100644 --- a/arch/i386/kernel/mca.c +++ b/arch/x86/kernel/mca_32.c diff --git a/arch/x86_64/kernel/mce.c b/arch/x86/kernel/mce_64.c index a66d607f5b9..a66d607f5b9 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86/kernel/mce_64.c diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86/kernel/mce_amd_64.c index 2f8a7f18b0f..2f8a7f18b0f 100644 --- a/arch/x86_64/kernel/mce_amd.c +++ b/arch/x86/kernel/mce_amd_64.c diff --git a/arch/x86_64/kernel/mce_intel.c b/arch/x86/kernel/mce_intel_64.c index 6551505d8a2..6551505d8a2 100644 --- a/arch/x86_64/kernel/mce_intel.c +++ b/arch/x86/kernel/mce_intel_64.c diff --git a/arch/i386/kernel/microcode.c b/arch/x86/kernel/microcode.c index 09cf7811035..09cf7811035 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/x86/kernel/microcode.c diff --git a/arch/i386/kernel/module.c b/arch/x86/kernel/module_32.c index 3db0a5442eb..3db0a5442eb 100644 --- a/arch/i386/kernel/module.c +++ b/arch/x86/kernel/module_32.c diff --git a/arch/x86_64/kernel/module.c b/arch/x86/kernel/module_64.c index a888e67f587..a888e67f587 100644 --- a/arch/x86_64/kernel/module.c +++ b/arch/x86/kernel/module_64.c diff --git a/arch/i386/kernel/mpparse.c b/arch/x86/kernel/mpparse_32.c index 13abb4ebfb7..13abb4ebfb7 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse_32.c diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86/kernel/mpparse_64.c index 8bf0ca03ac8..8bf0ca03ac8 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86/kernel/mpparse_64.c diff --git a/arch/i386/kernel/msr.c b/arch/x86/kernel/msr.c index 0c1069b8d63..0c1069b8d63 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/x86/kernel/msr.c diff --git a/arch/i386/kernel/nmi.c b/arch/x86/kernel/nmi_32.c index c7227e2180f..c7227e2180f 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/x86/kernel/nmi_32.c diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86/kernel/nmi_64.c index 0ec6d2ddb93..0ec6d2ddb93 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86/kernel/nmi_64.c diff --git a/arch/i386/kernel/numaq.c b/arch/x86/kernel/numaq_32.c index 9000d82c6dc..9000d82c6dc 100644 --- a/arch/i386/kernel/numaq.c +++ b/arch/x86/kernel/numaq_32.c diff --git a/arch/i386/kernel/paravirt.c b/arch/x86/kernel/paravirt_32.c index 739cfb207dd..739cfb207dd 100644 --- a/arch/i386/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt_32.c diff --git a/arch/x86_64/kernel/pci-calgary.c b/arch/x86/kernel/pci-calgary_64.c index 71da01e73f0..71da01e73f0 100644 --- a/arch/x86_64/kernel/pci-calgary.c +++ b/arch/x86/kernel/pci-calgary_64.c diff --git a/arch/i386/kernel/pci-dma.c b/arch/x86/kernel/pci-dma_32.c index 048f09b6255..048f09b6255 100644 --- a/arch/i386/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma_32.c diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86/kernel/pci-dma_64.c index 29711445c81..29711445c81 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma_64.c diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86/kernel/pci-gart_64.c index 4918c575d58..4918c575d58 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86/kernel/pci-gart_64.c diff --git a/arch/x86_64/kernel/pci-nommu.c b/arch/x86/kernel/pci-nommu_64.c index 2a34c6c025a..2a34c6c025a 100644 --- a/arch/x86_64/kernel/pci-nommu.c +++ b/arch/x86/kernel/pci-nommu_64.c diff --git a/arch/x86_64/kernel/pci-swiotlb.c b/arch/x86/kernel/pci-swiotlb_64.c index b2f405ea7c8..b2f405ea7c8 100644 --- a/arch/x86_64/kernel/pci-swiotlb.c +++ b/arch/x86/kernel/pci-swiotlb_64.c diff --git a/arch/i386/kernel/pcspeaker.c b/arch/x86/kernel/pcspeaker.c index bc1f2d3ea27..bc1f2d3ea27 100644 --- a/arch/i386/kernel/pcspeaker.c +++ b/arch/x86/kernel/pcspeaker.c diff --git a/arch/x86_64/kernel/pmtimer.c b/arch/x86/kernel/pmtimer_64.c index ae8f91214f1..ae8f91214f1 100644 --- a/arch/x86_64/kernel/pmtimer.c +++ b/arch/x86/kernel/pmtimer_64.c diff --git a/arch/i386/kernel/process.c b/arch/x86/kernel/process_32.c index 84664710b78..84664710b78 100644 --- a/arch/i386/kernel/process.c +++ b/arch/x86/kernel/process_32.c diff --git a/arch/x86_64/kernel/process.c b/arch/x86/kernel/process_64.c index 98956555450..98956555450 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86/kernel/process_64.c diff --git a/arch/i386/kernel/ptrace.c b/arch/x86/kernel/ptrace_32.c index 7c1b92522e9..7c1b92522e9 100644 --- a/arch/i386/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace_32.c diff --git a/arch/x86_64/kernel/ptrace.c b/arch/x86/kernel/ptrace_64.c index eea3702427b..eea3702427b 100644 --- a/arch/x86_64/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace_64.c diff --git a/arch/i386/kernel/quirks.c b/arch/x86/kernel/quirks.c index 6722469c263..6722469c263 100644 --- a/arch/i386/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c diff --git a/arch/i386/kernel/reboot.c b/arch/x86/kernel/reboot_32.c index 0d796248866..0d796248866 100644 --- a/arch/i386/kernel/reboot.c +++ b/arch/x86/kernel/reboot_32.c diff --git a/arch/x86_64/kernel/reboot.c b/arch/x86/kernel/reboot_64.c index 368db2b9c5a..368db2b9c5a 100644 --- a/arch/x86_64/kernel/reboot.c +++ b/arch/x86/kernel/reboot_64.c diff --git a/arch/i386/kernel/reboot_fixups.c b/arch/x86/kernel/reboot_fixups_32.c index 03e1cce58f4..03e1cce58f4 100644 --- a/arch/i386/kernel/reboot_fixups.c +++ b/arch/x86/kernel/reboot_fixups_32.c diff --git a/arch/i386/kernel/relocate_kernel.S b/arch/x86/kernel/relocate_kernel_32.S index f151d6fae46..f151d6fae46 100644 --- a/arch/i386/kernel/relocate_kernel.S +++ b/arch/x86/kernel/relocate_kernel_32.S diff --git a/arch/x86_64/kernel/relocate_kernel.S b/arch/x86/kernel/relocate_kernel_64.S index 14e95872c6a..14e95872c6a 100644 --- a/arch/x86_64/kernel/relocate_kernel.S +++ b/arch/x86/kernel/relocate_kernel_64.S diff --git a/arch/i386/kernel/scx200.c b/arch/x86/kernel/scx200_32.c index c7d3df23f58..c7d3df23f58 100644 --- a/arch/i386/kernel/scx200.c +++ b/arch/x86/kernel/scx200_32.c diff --git a/arch/x86_64/kernel/setup64.c b/arch/x86/kernel/setup64.c index 1200aaac403..1200aaac403 100644 --- a/arch/x86_64/kernel/setup64.c +++ b/arch/x86/kernel/setup64.c diff --git a/arch/i386/kernel/setup.c b/arch/x86/kernel/setup_32.c index d474cd639bc..d474cd639bc 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/x86/kernel/setup_32.c diff --git a/arch/x86_64/kernel/setup.c b/arch/x86/kernel/setup_64.c index af838f6b0b7..af838f6b0b7 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86/kernel/setup_64.c diff --git a/arch/i386/kernel/sigframe.h b/arch/x86/kernel/sigframe_32.h index 0b2221711da..0b2221711da 100644 --- a/arch/i386/kernel/sigframe.h +++ b/arch/x86/kernel/sigframe_32.h diff --git a/arch/x86/kernel/signal_32.c b/arch/x86/kernel/signal_32.c new file mode 100644 index 00000000000..c03570f7fe8 --- /dev/null +++ b/arch/x86/kernel/signal_32.c @@ -0,0 +1,667 @@ +/* + * linux/arch/i386/kernel/signal.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + * + * 1997-11-28 Modified for POSIX.1b signals by Richard Henderson + * 2000-06-20 Pentium III FXSR, SSE support by Gareth Hughes + */ + +#include <linux/sched.h> +#include <linux/mm.h> +#include <linux/smp.h> +#include <linux/kernel.h> +#include <linux/signal.h> +#include <linux/errno.h> +#include <linux/wait.h> +#include <linux/unistd.h> +#include <linux/stddef.h> +#include <linux/personality.h> +#include <linux/suspend.h> +#include <linux/ptrace.h> +#include <linux/elf.h> +#include <linux/binfmts.h> +#include <asm/processor.h> +#include <asm/ucontext.h> +#include <asm/uaccess.h> +#include <asm/i387.h> +#include "sigframe_32.h" + +#define DEBUG_SIG 0 + +#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) + +/* + * Atomically swap in the new signal mask, and wait for a signal. + */ +asmlinkage int +sys_sigsuspend(int history0, int history1, old_sigset_t mask) +{ + mask &= _BLOCKABLE; + spin_lock_irq(¤t->sighand->siglock); + current->saved_sigmask = current->blocked; + siginitset(¤t->blocked, mask); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + + current->state = TASK_INTERRUPTIBLE; + schedule(); + set_thread_flag(TIF_RESTORE_SIGMASK); + return -ERESTARTNOHAND; +} + +asmlinkage int +sys_sigaction(int sig, const struct old_sigaction __user *act, + struct old_sigaction __user *oact) +{ + struct k_sigaction new_ka, old_ka; + int ret; + + if (act) { + old_sigset_t mask; + if (!access_ok(VERIFY_READ, act, sizeof(*act)) || + __get_user(new_ka.sa.sa_handler, &act->sa_handler) || + __get_user(new_ka.sa.sa_restorer, &act->sa_restorer)) + return -EFAULT; + __get_user(new_ka.sa.sa_flags, &act->sa_flags); + __get_user(mask, &act->sa_mask); + siginitset(&new_ka.sa.sa_mask, mask); + } + + ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); + + if (!ret && oact) { + if (!access_ok(VERIFY_WRITE, oact, sizeof(*oact)) || + __put_user(old_ka.sa.sa_handler, &oact->sa_handler) || + __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer)) + return -EFAULT; + __put_user(old_ka.sa.sa_flags, &oact->sa_flags); + __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask); + } + + return ret; +} + +asmlinkage int +sys_sigaltstack(unsigned long ebx) +{ + /* This is needed to make gcc realize it doesn't own the "struct pt_regs" */ + struct pt_regs *regs = (struct pt_regs *)&ebx; + const stack_t __user *uss = (const stack_t __user *)ebx; + stack_t __user *uoss = (stack_t __user *)regs->ecx; + + return do_sigaltstack(uss, uoss, regs->esp); +} + + +/* + * Do a signal return; undo the signal stack. + */ + +static int +restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, int *peax) +{ + unsigned int err = 0; + + /* Always make any pending restarted system calls return -EINTR */ + current_thread_info()->restart_block.fn = do_no_restart_syscall; + +#define COPY(x) err |= __get_user(regs->x, &sc->x) + +#define COPY_SEG(seg) \ + { unsigned short tmp; \ + err |= __get_user(tmp, &sc->seg); \ + regs->x##seg = tmp; } + +#define COPY_SEG_STRICT(seg) \ + { unsigned short tmp; \ + err |= __get_user(tmp, &sc->seg); \ + regs->x##seg = tmp|3; } + +#define GET_SEG(seg) \ + { unsigned short tmp; \ + err |= __get_user(tmp, &sc->seg); \ + loadsegment(seg,tmp); } + +#define FIX_EFLAGS (X86_EFLAGS_AC | X86_EFLAGS_RF | \ + X86_EFLAGS_OF | X86_EFLAGS_DF | \ + X86_EFLAGS_TF | X86_EFLAGS_SF | X86_EFLAGS_ZF | \ + X86_EFLAGS_AF | X86_EFLAGS_PF | X86_EFLAGS_CF) + + GET_SEG(gs); + COPY_SEG(fs); + COPY_SEG(es); + COPY_SEG(ds); + COPY(edi); + COPY(esi); + COPY(ebp); + COPY(esp); + COPY(ebx); + COPY(edx); + COPY(ecx); + COPY(eip); + COPY_SEG_STRICT(cs); + COPY_SEG_STRICT(ss); + + { + unsigned int tmpflags; + err |= __get_user(tmpflags, &sc->eflags); + regs->eflags = (regs->eflags & ~FIX_EFLAGS) | (tmpflags & FIX_EFLAGS); + regs->orig_eax = -1; /* disable syscall checks */ + } + + { + struct _fpstate __user * buf; + err |= __get_user(buf, &sc->fpstate); + if (buf) { + if (!access_ok(VERIFY_READ, buf, sizeof(*buf))) + goto badframe; + err |= restore_i387(buf); + } else { + struct task_struct *me = current; + if (used_math()) { + clear_fpu(me); + clear_used_math(); + } + } + } + + err |= __get_user(*peax, &sc->eax); + return err; + +badframe: + return 1; +} + +asmlinkage int sys_sigreturn(unsigned long __unused) +{ + struct pt_regs *regs = (struct pt_regs *) &__unused; + struct sigframe __user *frame = (struct sigframe __user *)(regs->esp - 8); + sigset_t set; + int eax; + + if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) + goto badframe; + if (__get_user(set.sig[0], &frame->sc.oldmask) + || (_NSIG_WORDS > 1 + && __copy_from_user(&set.sig[1], &frame->extramask, + sizeof(frame->extramask)))) + goto badframe; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + + if (restore_sigcontext(regs, &frame->sc, &eax)) + goto badframe; + return eax; + +badframe: + if (show_unhandled_signals && printk_ratelimit()) + printk("%s%s[%d] bad frame in sigreturn frame:%p eip:%lx" + " esp:%lx oeax:%lx\n", + current->pid > 1 ? KERN_INFO : KERN_EMERG, + current->comm, current->pid, frame, regs->eip, + regs->esp, regs->orig_eax); + + force_sig(SIGSEGV, current); + return 0; +} + +asmlinkage int sys_rt_sigreturn(unsigned long __unused) +{ + struct pt_regs *regs = (struct pt_regs *) &__unused; + struct rt_sigframe __user *frame = (struct rt_sigframe __user *)(regs->esp - 4); + sigset_t set; + int eax; + + if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) + goto badframe; + if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set))) + goto badframe; + + sigdelsetmask(&set, ~_BLOCKABLE); + spin_lock_irq(¤t->sighand->siglock); + current->blocked = set; + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + + if (restore_sigcontext(regs, &frame->uc.uc_mcontext, &eax)) + goto badframe; + + if (do_sigaltstack(&frame->uc.uc_stack, NULL, regs->esp) == -EFAULT) + goto badframe; + + return eax; + +badframe: + force_sig(SIGSEGV, current); + return 0; +} + +/* + * Set up a signal frame. + */ + +static int +setup_sigcontext(struct sigcontext __user *sc, struct _fpstate __user *fpstate, + struct pt_regs *regs, unsigned long mask) +{ + int tmp, err = 0; + + err |= __put_user(regs->xfs, (unsigned int __user *)&sc->fs); + savesegment(gs, tmp); + err |= __put_user(tmp, (unsigned int __user *)&sc->gs); + + err |= __put_user(regs->xes, (unsigned int __user *)&sc->es); + err |= __put_user(regs->xds, (unsigned int __user *)&sc->ds); + err |= __put_user(regs->edi, &sc->edi); + err |= __put_user(regs->esi, &sc->esi); + err |= __put_user(regs->ebp, &sc->ebp); + err |= __put_user(regs->esp, &sc->esp); + err |= __put_user(regs->ebx, &sc->ebx); + err |= __put_user(regs->edx, &sc->edx); + err |= __put_user(regs->ecx, &sc->ecx); + err |= __put_user(regs->eax, &sc->eax); + err |= __put_user(current->thread.trap_no, &sc->trapno); + err |= __put_user(current->thread.error_code, &sc->err); + err |= __put_user(regs->eip, &sc->eip); + err |= __put_user(regs->xcs, (unsigned int __user *)&sc->cs); + err |= __put_user(regs->eflags, &sc->eflags); + err |= __put_user(regs->esp, &sc->esp_at_signal); + err |= __put_user(regs->xss, (unsigned int __user *)&sc->ss); + + tmp = save_i387(fpstate); + if (tmp < 0) + err = 1; + else + err |= __put_user(tmp ? fpstate : NULL, &sc->fpstate); + + /* non-iBCS2 extensions.. */ + err |= __put_user(mask, &sc->oldmask); + err |= __put_user(current->thread.cr2, &sc->cr2); + + return err; +} + +/* + * Determine which stack to use.. + */ +static inline void __user * +get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size) +{ + unsigned long esp; + + /* Default to using normal stack */ + esp = regs->esp; + + /* This is the X/Open sanctioned signal stack switching. */ + if (ka->sa.sa_flags & SA_ONSTACK) { + if (sas_ss_flags(esp) == 0) + esp = current->sas_ss_sp + current->sas_ss_size; + } + + /* This is the legacy signal stack switching. */ + else if ((regs->xss & 0xffff) != __USER_DS && + !(ka->sa.sa_flags & SA_RESTORER) && + ka->sa.sa_restorer) { + esp = (unsigned long) ka->sa.sa_restorer; + } + + esp -= frame_size; + /* Align the stack pointer according to the i386 ABI, + * i.e. so that on function entry ((sp + 4) & 15) == 0. */ + esp = ((esp + 4) & -16ul) - 4; + return (void __user *) esp; +} + +/* These symbols are defined with the addresses in the vsyscall page. + See vsyscall-sigreturn.S. */ +extern void __user __kernel_sigreturn; +extern void __user __kernel_rt_sigreturn; + +static int setup_frame(int sig, struct k_sigaction *ka, + sigset_t *set, struct pt_regs * regs) +{ + void __user *restorer; + struct sigframe __user *frame; + int err = 0; + int usig; + + frame = get_sigframe(ka, regs, sizeof(*frame)); + + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) + goto give_sigsegv; + + usig = current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig; + + err = __put_user(usig, &frame->sig); + if (err) + goto give_sigsegv; + + err = setup_sigcontext(&frame->sc, &frame->fpstate, regs, set->sig[0]); + if (err) + goto give_sigsegv; + + if (_NSIG_WORDS > 1) { + err = __copy_to_user(&frame->extramask, &set->sig[1], + sizeof(frame->extramask)); + if (err) + goto give_sigsegv; + } + + if (current->binfmt->hasvdso) + restorer = (void *)VDSO_SYM(&__kernel_sigreturn); + else + restorer = (void *)&frame->retcode; + if (ka->sa.sa_flags & SA_RESTORER) + restorer = ka->sa.sa_restorer; + + /* Set up to return from userspace. */ + err |= __put_user(restorer, &frame->pretcode); + + /* + * This is popl %eax ; movl $,%eax ; int $0x80 + * + * WE DO NOT USE IT ANY MORE! It's only left here for historical + * reasons and because gdb uses it as a signature to notice + * signal handler stack frames. + */ + err |= __put_user(0xb858, (short __user *)(frame->retcode+0)); + err |= __put_user(__NR_sigreturn, (int __user *)(frame->retcode+2)); + err |= __put_user(0x80cd, (short __user *)(frame->retcode+6)); + + if (err) + goto give_sigsegv; + + /* Set up registers for signal handler */ + regs->esp = (unsigned long) frame; + regs->eip = (unsigned long) ka->sa.sa_handler; + regs->eax = (unsigned long) sig; + regs->edx = (unsigned long) 0; + regs->ecx = (unsigned long) 0; + + set_fs(USER_DS); + regs->xds = __USER_DS; + regs->xes = __USER_DS; + regs->xss = __USER_DS; + regs->xcs = __USER_CS; + + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + +#if DEBUG_SIG + printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", + current->comm, current->pid, frame, regs->eip, frame->pretcode); +#endif + + return 0; + +give_sigsegv: + force_sigsegv(sig, current); + return -EFAULT; +} + +static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, + sigset_t *set, struct pt_regs * regs) +{ + void __user *restorer; + struct rt_sigframe __user *frame; + int err = 0; + int usig; + + frame = get_sigframe(ka, regs, sizeof(*frame)); + + if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) + goto give_sigsegv; + + usig = current_thread_info()->exec_domain + && current_thread_info()->exec_domain->signal_invmap + && sig < 32 + ? current_thread_info()->exec_domain->signal_invmap[sig] + : sig; + + err |= __put_user(usig, &frame->sig); + err |= __put_user(&frame->info, &frame->pinfo); + err |= __put_user(&frame->uc, &frame->puc); + err |= copy_siginfo_to_user(&frame->info, info); + if (err) + goto give_sigsegv; + + /* Create the ucontext. */ + err |= __put_user(0, &frame->uc.uc_flags); + err |= __put_user(0, &frame->uc.uc_link); + err |= __put_user(current->sas_ss_sp, &frame->uc.uc_stack.ss_sp); + err |= __put_user(sas_ss_flags(regs->esp), + &frame->uc.uc_stack.ss_flags); + err |= __put_user(current->sas_ss_size, &frame->uc.uc_stack.ss_size); + err |= setup_sigcontext(&frame->uc.uc_mcontext, &frame->fpstate, + regs, set->sig[0]); + err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set)); + if (err) + goto give_sigsegv; + + /* Set up to return from userspace. */ + restorer = (void *)VDSO_SYM(&__kernel_rt_sigreturn); + if (ka->sa.sa_flags & SA_RESTORER) + restorer = ka->sa.sa_restorer; + err |= __put_user(restorer, &frame->pretcode); + + /* + * This is movl $,%eax ; int $0x80 + * + * WE DO NOT USE IT ANY MORE! It's only left here for historical + * reasons and because gdb uses it as a signature to notice + * signal handler stack frames. + */ + err |= __put_user(0xb8, (char __user *)(frame->retcode+0)); + err |= __put_user(__NR_rt_sigreturn, (int __user *)(frame->retcode+1)); + err |= __put_user(0x80cd, (short __user *)(frame->retcode+5)); + + if (err) + goto give_sigsegv; + + /* Set up registers for signal handler */ + regs->esp = (unsigned long) frame; + regs->eip = (unsigned long) ka->sa.sa_handler; + regs->eax = (unsigned long) usig; + regs->edx = (unsigned long) &frame->info; + regs->ecx = (unsigned long) &frame->uc; + + set_fs(USER_DS); + regs->xds = __USER_DS; + regs->xes = __USER_DS; + regs->xss = __USER_DS; + regs->xcs = __USER_CS; + + /* + * Clear TF when entering the signal handler, but + * notify any tracer that was single-stepping it. + * The tracer may want to single-step inside the + * handler too. + */ + regs->eflags &= ~TF_MASK; + if (test_thread_flag(TIF_SINGLESTEP)) + ptrace_notify(SIGTRAP); + +#if DEBUG_SIG + printk("SIG deliver (%s:%d): sp=%p pc=%p ra=%p\n", + current->comm, current->pid, frame, regs->eip, frame->pretcode); +#endif + + return 0; + +give_sigsegv: + force_sigsegv(sig, current); + return -EFAULT; +} + +/* + * OK, we're invoking a handler + */ + +static int +handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, + sigset_t *oldset, struct pt_regs * regs) +{ + int ret; + + /* Are we from a system call? */ + if (regs->orig_eax >= 0) { + /* If so, check system call restarting.. */ + switch (regs->eax) { + case -ERESTART_RESTARTBLOCK: + case -ERESTARTNOHAND: + regs->eax = -EINTR; + break; + + case -ERESTARTSYS: + if (!(ka->sa.sa_flags & SA_RESTART)) { + regs->eax = -EINTR; + break; + } + /* fallthrough */ + case -ERESTARTNOINTR: + regs->eax = regs->orig_eax; + regs->eip -= 2; + } + } + + /* + * If TF is set due to a debugger (PT_DTRACE), clear the TF flag so + * that register information in the sigcontext is correct. + */ + if (unlikely(regs->eflags & TF_MASK) + && likely(current->ptrace & PT_DTRACE)) { + current->ptrace &= ~PT_DTRACE; + regs->eflags &= ~TF_MASK; + } + + /* Set up the stack frame */ + if (ka->sa.sa_flags & SA_SIGINFO) + ret = setup_rt_frame(sig, ka, info, oldset, regs); + else + ret = setup_frame(sig, ka, oldset, regs); + + if (ret == 0) { + spin_lock_irq(¤t->sighand->siglock); + sigorsets(¤t->blocked,¤t->blocked,&ka->sa.sa_mask); + if (!(ka->sa.sa_flags & SA_NODEFER)) + sigaddset(¤t->blocked,sig); + recalc_sigpending(); + spin_unlock_irq(¤t->sighand->siglock); + } + + return ret; +} + +/* + * Note that 'init' is a special process: it doesn't get signals it doesn't + * want to handle. Thus you cannot kill init even with a SIGKILL even by + * mistake. + */ +static void fastcall do_signal(struct pt_regs *regs) +{ + siginfo_t info; + int signr; + struct k_sigaction ka; + sigset_t *oldset; + + /* + * We want the common case to go fast, which + * is why we may in certain cases get here from + * kernel mode. Just return without doing anything + * if so. vm86 regs switched out by assembly code + * before reaching here, so testing against kernel + * CS suffices. + */ + if (!user_mode(regs)) + return; + + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + oldset = ¤t->saved_sigmask; + else + oldset = ¤t->blocked; + + signr = get_signal_to_deliver(&info, &ka, regs, NULL); + if (signr > 0) { + /* Reenable any watchpoints before delivering the + * signal to user space. The processor register will + * have been cleared if the watchpoint triggered + * inside the kernel. + */ + if (unlikely(current->thread.debugreg[7])) + set_debugreg(current->thread.debugreg[7], 7); + + /* Whee! Actually deliver the signal. */ + if (handle_signal(signr, &info, &ka, oldset, regs) == 0) { + /* a signal was successfully delivered; the saved + * sigmask will have been stored in the signal frame, + * and will be restored by sigreturn, so we can simply + * clear the TIF_RESTORE_SIGMASK flag */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) + clear_thread_flag(TIF_RESTORE_SIGMASK); + } + + return; + } + + /* Did we come from a system call? */ + if (regs->orig_eax >= 0) { + /* Restart the system call - no handlers present */ + switch (regs->eax) { + case -ERESTARTNOHAND: + case -ERESTARTSYS: + case -ERESTARTNOINTR: + regs->eax = regs->orig_eax; + regs->eip -= 2; + break; + + case -ERESTART_RESTARTBLOCK: + regs->eax = __NR_restart_syscall; + regs->eip -= 2; + break; + } + } + + /* if there's no signal to deliver, we just put the saved sigmask + * back */ + if (test_thread_flag(TIF_RESTORE_SIGMASK)) { + clear_thread_flag(TIF_RESTORE_SIGMASK); + sigprocmask(SIG_SETMASK, ¤t->saved_sigmask, NULL); + } +} + +/* + * notification of userspace execution resumption + * - triggered by the TIF_WORK_MASK flags + */ +__attribute__((regparm(3))) +void do_notify_resume(struct pt_regs *regs, void *_unused, + __u32 thread_info_flags) +{ + /* Pending single-step? */ + if (thread_info_flags & _TIF_SINGLESTEP) { + regs->eflags |= TF_MASK; + clear_thread_flag(TIF_SINGLESTEP); + } + + /* deal with pending signal delivery */ + if (thread_info_flags & (_TIF_SIGPENDING | _TIF_RESTORE_SIGMASK)) + do_signal(regs); + + clear_thread_flag(TIF_IRET); +} diff --git a/arch/x86_64/kernel/signal.c b/arch/x86/kernel/signal_64.c index 739175b01e0..739175b01e0 100644 --- a/arch/x86_64/kernel/signal.c +++ b/arch/x86/kernel/signal_64.c diff --git a/arch/i386/kernel/smp.c b/arch/x86/kernel/smp_32.c index 2d35d850202..2d35d850202 100644 --- a/arch/i386/kernel/smp.c +++ b/arch/x86/kernel/smp_32.c diff --git a/arch/x86_64/kernel/smp.c b/arch/x86/kernel/smp_64.c index df4a82812ad..df4a82812ad 100644 --- a/arch/x86_64/kernel/smp.c +++ b/arch/x86/kernel/smp_64.c diff --git a/arch/i386/kernel/smpboot.c b/arch/x86/kernel/smpboot_32.c index e4f61d1c624..e4f61d1c624 100644 --- a/arch/i386/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot_32.c diff --git a/arch/x86_64/kernel/smpboot.c b/arch/x86/kernel/smpboot_64.c index 32f50783edc..32f50783edc 100644 --- a/arch/x86_64/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot_64.c diff --git a/arch/i386/kernel/smpcommon.c b/arch/x86/kernel/smpcommon_32.c index bbfe85a0f69..bbfe85a0f69 100644 --- a/arch/i386/kernel/smpcommon.c +++ b/arch/x86/kernel/smpcommon_32.c diff --git a/arch/i386/kernel/srat.c b/arch/x86/kernel/srat_32.c index 2a8713ec0f9..2a8713ec0f9 100644 --- a/arch/i386/kernel/srat.c +++ b/arch/x86/kernel/srat_32.c diff --git a/arch/x86_64/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c index cb910911358..cb910911358 100644 --- a/arch/x86_64/kernel/stacktrace.c +++ b/arch/x86/kernel/stacktrace.c diff --git a/arch/i386/kernel/summit.c b/arch/x86/kernel/summit_32.c index d0e01a3acf3..d0e01a3acf3 100644 --- a/arch/i386/kernel/summit.c +++ b/arch/x86/kernel/summit_32.c diff --git a/arch/x86_64/kernel/suspend.c b/arch/x86/kernel/suspend_64.c index 573c0a6e0ac..573c0a6e0ac 100644 --- a/arch/x86_64/kernel/suspend.c +++ b/arch/x86/kernel/suspend_64.c diff --git a/arch/x86_64/kernel/suspend_asm.S b/arch/x86/kernel/suspend_asm_64.S index 16d183f67bc..16d183f67bc 100644 --- a/arch/x86_64/kernel/suspend_asm.S +++ b/arch/x86/kernel/suspend_asm_64.S diff --git a/arch/i386/kernel/sys_i386.c b/arch/x86/kernel/sys_i386_32.c index 42147304de8..42147304de8 100644 --- a/arch/i386/kernel/sys_i386.c +++ b/arch/x86/kernel/sys_i386_32.c diff --git a/arch/x86_64/kernel/sys_x86_64.c b/arch/x86/kernel/sys_x86_64.c index 4770b7a2052..4770b7a2052 100644 --- a/arch/x86_64/kernel/sys_x86_64.c +++ b/arch/x86/kernel/sys_x86_64.c diff --git a/arch/x86/kernel/syscall_64.c b/arch/x86/kernel/syscall_64.c new file mode 100644 index 00000000000..9d498c2f8ee --- /dev/null +++ b/arch/x86/kernel/syscall_64.c @@ -0,0 +1,26 @@ +/* System call table for x86-64. */ + +#include <linux/linkage.h> +#include <linux/sys.h> +#include <linux/cache.h> +#include <asm/asm-offsets.h> + +#define __NO_STUBS + +#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; +#undef _ASM_X86_64_UNISTD_H_ +#include <asm/unistd_64.h> + +#undef __SYSCALL +#define __SYSCALL(nr, sym) [ nr ] = sym, +#undef _ASM_X86_64_UNISTD_H_ + +typedef void (*sys_call_ptr_t)(void); + +extern void sys_ni_syscall(void); + +const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { + /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ + [0 ... __NR_syscall_max] = &sys_ni_syscall, +#include <asm/unistd_64.h> +}; diff --git a/arch/i386/kernel/syscall_table.S b/arch/x86/kernel/syscall_table_32.S index 8344c70adf6..8344c70adf6 100644 --- a/arch/i386/kernel/syscall_table.S +++ b/arch/x86/kernel/syscall_table_32.S diff --git a/arch/i386/kernel/sysenter.c b/arch/x86/kernel/sysenter_32.c index 4eb2e408764..4eb2e408764 100644 --- a/arch/i386/kernel/sysenter.c +++ b/arch/x86/kernel/sysenter_32.c diff --git a/arch/x86_64/kernel/tce.c b/arch/x86/kernel/tce_64.c index e3f2569b2c4..e3f2569b2c4 100644 --- a/arch/x86_64/kernel/tce.c +++ b/arch/x86/kernel/tce_64.c diff --git a/arch/i386/kernel/time.c b/arch/x86/kernel/time_32.c index 19a6c678d02..19a6c678d02 100644 --- a/arch/i386/kernel/time.c +++ b/arch/x86/kernel/time_32.c diff --git a/arch/x86_64/kernel/time.c b/arch/x86/kernel/time_64.c index 6d48a4e826d..6d48a4e826d 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86/kernel/time_64.c diff --git a/arch/i386/kernel/topology.c b/arch/x86/kernel/topology.c index 45782356a61..45782356a61 100644 --- a/arch/i386/kernel/topology.c +++ b/arch/x86/kernel/topology.c diff --git a/arch/i386/kernel/trampoline.S b/arch/x86/kernel/trampoline_32.S index f62815f8d06..f62815f8d06 100644 --- a/arch/i386/kernel/trampoline.S +++ b/arch/x86/kernel/trampoline_32.S diff --git a/arch/x86/kernel/trampoline_64.S b/arch/x86/kernel/trampoline_64.S new file mode 100644 index 00000000000..607983b0d27 --- /dev/null +++ b/arch/x86/kernel/trampoline_64.S @@ -0,0 +1,166 @@ +/* + * + * Trampoline.S Derived from Setup.S by Linus Torvalds + * + * 4 Jan 1997 Michael Chastain: changed to gnu as. + * 15 Sept 2005 Eric Biederman: 64bit PIC support + * + * Entry: CS:IP point to the start of our code, we are + * in real mode with no stack, but the rest of the + * trampoline page to make our stack and everything else + * is a mystery. + * + * In fact we don't actually need a stack so we don't + * set one up. + * + * On entry to trampoline_data, the processor is in real mode + * with 16-bit addressing and 16-bit data. CS has some value + * and IP is zero. Thus, data addresses need to be absolute + * (no relocation) and are taken with regard to r_base. + * + * With the addition of trampoline_level4_pgt this code can + * now enter a 64bit kernel that lives at arbitrary 64bit + * physical addresses. + * + * If you work on this file, check the object module with objdump + * --full-contents --reloc to make sure there are no relocation + * entries. + */ + +#include <linux/linkage.h> +#include <asm/pgtable.h> +#include <asm/page.h> +#include <asm/msr.h> +#include <asm/segment.h> + +.data + +.code16 + +ENTRY(trampoline_data) +r_base = . + cli # We should be safe anyway + wbinvd + mov %cs, %ax # Code and data in the same place + mov %ax, %ds + mov %ax, %es + mov %ax, %ss + + + movl $0xA5A5A5A5, trampoline_data - r_base + # write marker for master knows we're running + + # Setup stack + movw $(trampoline_stack_end - r_base), %sp + + call verify_cpu # Verify the cpu supports long mode + testl %eax, %eax # Check for return code + jnz no_longmode + + mov %cs, %ax + movzx %ax, %esi # Find the 32bit trampoline location + shll $4, %esi + + # Fixup the vectors + addl %esi, startup_32_vector - r_base + addl %esi, startup_64_vector - r_base + addl %esi, tgdt + 2 - r_base # Fixup the gdt pointer + + /* + * GDT tables in non default location kernel can be beyond 16MB and + * lgdt will not be able to load the address as in real mode default + * operand size is 16bit. Use lgdtl instead to force operand size + * to 32 bit. + */ + + lidtl tidt - r_base # load idt with 0, 0 + lgdtl tgdt - r_base # load gdt with whatever is appropriate + + xor %ax, %ax + inc %ax # protected mode (PE) bit + lmsw %ax # into protected mode + + # flush prefetch and jump to startup_32 + ljmpl *(startup_32_vector - r_base) + + .code32 + .balign 4 +startup_32: + movl $__KERNEL_DS, %eax # Initialize the %ds segment register + movl %eax, %ds + + xorl %eax, %eax + btsl $5, %eax # Enable PAE mode + movl %eax, %cr4 + + # Setup trampoline 4 level pagetables + leal (trampoline_level4_pgt - r_base)(%esi), %eax + movl %eax, %cr3 + + movl $MSR_EFER, %ecx + movl $(1 << _EFER_LME), %eax # Enable Long Mode + xorl %edx, %edx + wrmsr + + xorl %eax, %eax + btsl $31, %eax # Enable paging and in turn activate Long Mode + btsl $0, %eax # Enable protected mode + movl %eax, %cr0 + + /* + * At this point we're in long mode but in 32bit compatibility mode + * with EFER.LME = 1, CS.L = 0, CS.D = 1 (and in turn + * EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we use + * the new gdt/idt that has __KERNEL_CS with CS.L = 1. + */ + ljmp *(startup_64_vector - r_base)(%esi) + + .code64 + .balign 4 +startup_64: + # Now jump into the kernel using virtual addresses + movq $secondary_startup_64, %rax + jmp *%rax + + .code16 +no_longmode: + hlt + jmp no_longmode +#include "verify_cpu_64.S" + + # Careful these need to be in the same 64K segment as the above; +tidt: + .word 0 # idt limit = 0 + .word 0, 0 # idt base = 0L + + # Duplicate the global descriptor table + # so the kernel can live anywhere + .balign 4 +tgdt: + .short tgdt_end - tgdt # gdt limit + .long tgdt - r_base + .short 0 + .quad 0x00cf9b000000ffff # __KERNEL32_CS + .quad 0x00af9b000000ffff # __KERNEL_CS + .quad 0x00cf93000000ffff # __KERNEL_DS +tgdt_end: + + .balign 4 +startup_32_vector: + .long startup_32 - r_base + .word __KERNEL32_CS, 0 + + .balign 4 +startup_64_vector: + .long startup_64 - r_base + .word __KERNEL_CS, 0 + +trampoline_stack: + .org 0x1000 +trampoline_stack_end: +ENTRY(trampoline_level4_pgt) + .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE + .fill 510,8,0 + .quad level3_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE + +ENTRY(trampoline_end) diff --git a/arch/i386/kernel/traps.c b/arch/x86/kernel/traps_32.c index 47b0bef335b..47b0bef335b 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/x86/kernel/traps_32.c diff --git a/arch/x86_64/kernel/traps.c b/arch/x86/kernel/traps_64.c index 03888420775..03888420775 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86/kernel/traps_64.c diff --git a/arch/i386/kernel/tsc.c b/arch/x86/kernel/tsc_32.c index a39280b4dd3..a39280b4dd3 100644 --- a/arch/i386/kernel/tsc.c +++ b/arch/x86/kernel/tsc_32.c diff --git a/arch/x86_64/kernel/tsc.c b/arch/x86/kernel/tsc_64.c index 2a59bde663f..2a59bde663f 100644 --- a/arch/x86_64/kernel/tsc.c +++ b/arch/x86/kernel/tsc_64.c diff --git a/arch/x86_64/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 355f5f506c8..355f5f506c8 100644 --- a/arch/x86_64/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c diff --git a/arch/x86_64/kernel/verify_cpu.S b/arch/x86/kernel/verify_cpu_64.S index 45b6f8a975a..45b6f8a975a 100644 --- a/arch/x86_64/kernel/verify_cpu.S +++ b/arch/x86/kernel/verify_cpu_64.S diff --git a/arch/i386/kernel/vm86.c b/arch/x86/kernel/vm86_32.c index f2dcd1d27c0..f2dcd1d27c0 100644 --- a/arch/i386/kernel/vm86.c +++ b/arch/x86/kernel/vm86_32.c diff --git a/arch/i386/kernel/vmi.c b/arch/x86/kernel/vmi_32.c index 18673e0f193..18673e0f193 100644 --- a/arch/i386/kernel/vmi.c +++ b/arch/x86/kernel/vmi_32.c diff --git a/arch/i386/kernel/vmiclock.c b/arch/x86/kernel/vmiclock_32.c index b1b5ab08b26..b1b5ab08b26 100644 --- a/arch/i386/kernel/vmiclock.c +++ b/arch/x86/kernel/vmiclock_32.c diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S new file mode 100644 index 00000000000..849ee611f01 --- /dev/null +++ b/arch/x86/kernel/vmlinux.lds.S @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "vmlinux_32.lds.S" +#else +# include "vmlinux_64.lds.S" +#endif diff --git a/arch/i386/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux_32.lds.S index 7d72cce0052..7d72cce0052 100644 --- a/arch/i386/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux_32.lds.S diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux_64.lds.S index ba8ea97abd2..ba8ea97abd2 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux_64.lds.S diff --git a/arch/x86_64/kernel/vsmp.c b/arch/x86/kernel/vsmp_64.c index 414caf0c5f9..414caf0c5f9 100644 --- a/arch/x86_64/kernel/vsmp.c +++ b/arch/x86/kernel/vsmp_64.c diff --git a/arch/x86/kernel/vsyscall-int80_32.S b/arch/x86/kernel/vsyscall-int80_32.S new file mode 100644 index 00000000000..103cab6aa7c --- /dev/null +++ b/arch/x86/kernel/vsyscall-int80_32.S @@ -0,0 +1,53 @@ +/* + * Code for the vsyscall page. This version uses the old int $0x80 method. + * + * NOTE: + * 1) __kernel_vsyscall _must_ be first in this page. + * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S + * for details. + */ + + .text + .globl __kernel_vsyscall + .type __kernel_vsyscall,@function +__kernel_vsyscall: +.LSTART_vsyscall: + int $0x80 + ret +.LEND_vsyscall: + .size __kernel_vsyscall,.-.LSTART_vsyscall + .previous + + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI: + .long .LENDCIEDLSI-.LSTARTCIEDLSI +.LSTARTCIEDLSI: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zR" /* NUL-terminated augmentation string */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 + .align 4 +.LENDCIEDLSI: + .long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */ +.LSTARTFDEDLSI: + .long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */ + .long .LSTART_vsyscall-. /* PC-relative start address */ + .long .LEND_vsyscall-.LSTART_vsyscall + .uleb128 0 + .align 4 +.LENDFDEDLSI: + .previous + +/* + * Get the common code for the sigreturn entry points. + */ +#include "vsyscall-sigreturn_32.S" diff --git a/arch/x86/kernel/vsyscall-note_32.S b/arch/x86/kernel/vsyscall-note_32.S new file mode 100644 index 00000000000..fcf376a37f7 --- /dev/null +++ b/arch/x86/kernel/vsyscall-note_32.S @@ -0,0 +1,45 @@ +/* + * This supplies .note.* sections to go into the PT_NOTE inside the vDSO text. + * Here we can supply some information useful to userland. + */ + +#include <linux/version.h> +#include <linux/elfnote.h> + +/* Ideally this would use UTS_NAME, but using a quoted string here + doesn't work. Remember to change this when changing the + kernel's name. */ +ELFNOTE_START(Linux, 0, "a") + .long LINUX_VERSION_CODE +ELFNOTE_END + +#ifdef CONFIG_XEN +/* + * Add a special note telling glibc's dynamic linker a fake hardware + * flavor that it will use to choose the search path for libraries in the + * same way it uses real hardware capabilities like "mmx". + * We supply "nosegneg" as the fake capability, to indicate that we + * do not like negative offsets in instructions using segment overrides, + * since we implement those inefficiently. This makes it possible to + * install libraries optimized to avoid those access patterns in someplace + * like /lib/i686/tls/nosegneg. Note that an /etc/ld.so.conf.d/file + * corresponding to the bits here is needed to make ldconfig work right. + * It should contain: + * hwcap 1 nosegneg + * to match the mapping of bit to name that we give here. + * + * At runtime, the fake hardware feature will be considered to be present + * if its bit is set in the mask word. So, we start with the mask 0, and + * at boot time we set VDSO_NOTE_NONEGSEG_BIT if running under Xen. + */ + +#include "../../x86/xen/vdso.h" /* Defines VDSO_NOTE_NONEGSEG_BIT. */ + + .globl VDSO_NOTE_MASK +ELFNOTE_START(GNU, 2, "a") + .long 1 /* ncaps */ +VDSO_NOTE_MASK: + .long 0 /* mask */ + .byte VDSO_NOTE_NONEGSEG_BIT; .asciz "nosegneg" /* bit, name */ +ELFNOTE_END +#endif diff --git a/arch/i386/kernel/vsyscall-sigreturn.S b/arch/x86/kernel/vsyscall-sigreturn_32.S index a92262f4165..a92262f4165 100644 --- a/arch/i386/kernel/vsyscall-sigreturn.S +++ b/arch/x86/kernel/vsyscall-sigreturn_32.S diff --git a/arch/x86/kernel/vsyscall-sysenter_32.S b/arch/x86/kernel/vsyscall-sysenter_32.S new file mode 100644 index 00000000000..ed879bf4299 --- /dev/null +++ b/arch/x86/kernel/vsyscall-sysenter_32.S @@ -0,0 +1,122 @@ +/* + * Code for the vsyscall page. This version uses the sysenter instruction. + * + * NOTE: + * 1) __kernel_vsyscall _must_ be first in this page. + * 2) there are alignment constraints on this stub, see vsyscall-sigreturn.S + * for details. + */ + +/* + * The caller puts arg2 in %ecx, which gets pushed. The kernel will use + * %ecx itself for arg2. The pushing is because the sysexit instruction + * (found in entry.S) requires that we clobber %ecx with the desired %esp. + * User code might expect that %ecx is unclobbered though, as it would be + * for returning via the iret instruction, so we must push and pop. + * + * The caller puts arg3 in %edx, which the sysexit instruction requires + * for %eip. Thus, exactly as for arg2, we must push and pop. + * + * Arg6 is different. The caller puts arg6 in %ebp. Since the sysenter + * instruction clobbers %esp, the user's %esp won't even survive entry + * into the kernel. We store %esp in %ebp. Code in entry.S must fetch + * arg6 from the stack. + * + * You can not use this vsyscall for the clone() syscall because the + * three dwords on the parent stack do not get copied to the child. + */ + .text + .globl __kernel_vsyscall + .type __kernel_vsyscall,@function +__kernel_vsyscall: +.LSTART_vsyscall: + push %ecx +.Lpush_ecx: + push %edx +.Lpush_edx: + push %ebp +.Lenter_kernel: + movl %esp,%ebp + sysenter + + /* 7: align return point with nop's to make disassembly easier */ + .space 7,0x90 + + /* 14: System call restart point is here! (SYSENTER_RETURN-2) */ + jmp .Lenter_kernel + /* 16: System call normal return point is here! */ + .globl SYSENTER_RETURN /* Symbol used by sysenter.c */ +SYSENTER_RETURN: + pop %ebp +.Lpop_ebp: + pop %edx +.Lpop_edx: + pop %ecx +.Lpop_ecx: + ret +.LEND_vsyscall: + .size __kernel_vsyscall,.-.LSTART_vsyscall + .previous + + .section .eh_frame,"a",@progbits +.LSTARTFRAMEDLSI: + .long .LENDCIEDLSI-.LSTARTCIEDLSI +.LSTARTCIEDLSI: + .long 0 /* CIE ID */ + .byte 1 /* Version number */ + .string "zR" /* NUL-terminated augmentation string */ + .uleb128 1 /* Code alignment factor */ + .sleb128 -4 /* Data alignment factor */ + .byte 8 /* Return address register column */ + .uleb128 1 /* Augmentation value length */ + .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ + .byte 0x0c /* DW_CFA_def_cfa */ + .uleb128 4 + .uleb128 4 + .byte 0x88 /* DW_CFA_offset, column 0x8 */ + .uleb128 1 + .align 4 +.LENDCIEDLSI: + .long .LENDFDEDLSI-.LSTARTFDEDLSI /* Length FDE */ +.LSTARTFDEDLSI: + .long .LSTARTFDEDLSI-.LSTARTFRAMEDLSI /* CIE pointer */ + .long .LSTART_vsyscall-. /* PC-relative start address */ + .long .LEND_vsyscall-.LSTART_vsyscall + .uleb128 0 + /* What follows are the instructions for the table generation. + We have to record all changes of the stack pointer. */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lpush_ecx-.LSTART_vsyscall + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x08 /* RA at offset 8 now */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lpush_edx-.Lpush_ecx + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x0c /* RA at offset 12 now */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lenter_kernel-.Lpush_edx + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x10 /* RA at offset 16 now */ + .byte 0x85, 0x04 /* DW_CFA_offset %ebp -16 */ + /* Finally the epilogue. */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lpop_ebp-.Lenter_kernel + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x0c /* RA at offset 12 now */ + .byte 0xc5 /* DW_CFA_restore %ebp */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lpop_edx-.Lpop_ebp + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x08 /* RA at offset 8 now */ + .byte 0x04 /* DW_CFA_advance_loc4 */ + .long .Lpop_ecx-.Lpop_edx + .byte 0x0e /* DW_CFA_def_cfa_offset */ + .byte 0x04 /* RA at offset 4 now */ + .align 4 +.LENDFDEDLSI: + .previous + +/* + * Get the common code for the sigreturn entry points. + */ +#include "vsyscall-sigreturn_32.S" diff --git a/arch/x86/kernel/vsyscall_32.S b/arch/x86/kernel/vsyscall_32.S new file mode 100644 index 00000000000..a5ab3dc4fd2 --- /dev/null +++ b/arch/x86/kernel/vsyscall_32.S @@ -0,0 +1,15 @@ +#include <linux/init.h> + +__INITDATA + + .globl vsyscall_int80_start, vsyscall_int80_end +vsyscall_int80_start: + .incbin "arch/x86/kernel/vsyscall-int80_32.so" +vsyscall_int80_end: + + .globl vsyscall_sysenter_start, vsyscall_sysenter_end +vsyscall_sysenter_start: + .incbin "arch/x86/kernel/vsyscall-sysenter_32.so" +vsyscall_sysenter_end: + +__FINIT diff --git a/arch/i386/kernel/vsyscall.lds.S b/arch/x86/kernel/vsyscall_32.lds.S index 4a8b0ed9b8f..4a8b0ed9b8f 100644 --- a/arch/i386/kernel/vsyscall.lds.S +++ b/arch/x86/kernel/vsyscall_32.lds.S diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86/kernel/vsyscall_64.c index 06c34949bfd..06c34949bfd 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86/kernel/vsyscall_64.c diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86/kernel/x8664_ksyms_64.c index 77c25b30763..77c25b30763 100644 --- a/arch/x86_64/kernel/x8664_ksyms.c +++ b/arch/x86/kernel/x8664_ksyms_64.c diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile new file mode 100644 index 00000000000..329da276c6f --- /dev/null +++ b/arch/x86/lib/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/lib/Makefile_32 +else +include ${srctree}/arch/x86/lib/Makefile_64 +endif diff --git a/arch/x86/lib/Makefile_32 b/arch/x86/lib/Makefile_32 new file mode 100644 index 00000000000..98d1f1e2e2e --- /dev/null +++ b/arch/x86/lib/Makefile_32 @@ -0,0 +1,11 @@ +# +# Makefile for i386-specific library files.. +# + + +lib-y = checksum_32.o delay_32.o usercopy_32.o getuser_32.o putuser_32.o memcpy_32.o strstr_32.o \ + bitops_32.o semaphore_32.o string_32.o + +lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o + +obj-$(CONFIG_SMP) += msr-on-cpu.o diff --git a/arch/x86/lib/Makefile_64 b/arch/x86/lib/Makefile_64 new file mode 100644 index 00000000000..bbabad3c933 --- /dev/null +++ b/arch/x86/lib/Makefile_64 @@ -0,0 +1,13 @@ +# +# Makefile for x86_64-specific library files. +# + +CFLAGS_csum-partial_64.o := -funroll-loops + +obj-y := io_64.o iomap_copy_64.o +obj-$(CONFIG_SMP) += msr-on-cpu.o + +lib-y := csum-partial_64.o csum-copy_64.o csum-wrappers_64.o delay_64.o \ + usercopy_64.o getuser_64.o putuser_64.o \ + thunk_64.o clear_page_64.o copy_page_64.o bitstr_64.o bitops_64.o +lib-y += memcpy_64.o memmove_64.o memset_64.o copy_user_64.o rwlock_64.o copy_user_nocache_64.o diff --git a/arch/i386/lib/bitops.c b/arch/x86/lib/bitops_32.c index afd0045595d..afd0045595d 100644 --- a/arch/i386/lib/bitops.c +++ b/arch/x86/lib/bitops_32.c diff --git a/arch/x86_64/lib/bitops.c b/arch/x86/lib/bitops_64.c index 95b6d9639fb..95b6d9639fb 100644 --- a/arch/x86_64/lib/bitops.c +++ b/arch/x86/lib/bitops_64.c diff --git a/arch/x86_64/lib/bitstr.c b/arch/x86/lib/bitstr_64.c index 24676609a6a..24676609a6a 100644 --- a/arch/x86_64/lib/bitstr.c +++ b/arch/x86/lib/bitstr_64.c diff --git a/arch/i386/lib/checksum.S b/arch/x86/lib/checksum_32.S index adbccd0bbb7..adbccd0bbb7 100644 --- a/arch/i386/lib/checksum.S +++ b/arch/x86/lib/checksum_32.S diff --git a/arch/x86_64/lib/clear_page.S b/arch/x86/lib/clear_page_64.S index 9a10a78bb4a..9a10a78bb4a 100644 --- a/arch/x86_64/lib/clear_page.S +++ b/arch/x86/lib/clear_page_64.S diff --git a/arch/x86_64/lib/copy_page.S b/arch/x86/lib/copy_page_64.S index 727a5d46d2f..727a5d46d2f 100644 --- a/arch/x86_64/lib/copy_page.S +++ b/arch/x86/lib/copy_page_64.S diff --git a/arch/x86_64/lib/copy_user.S b/arch/x86/lib/copy_user_64.S index 70bebd31040..70bebd31040 100644 --- a/arch/x86_64/lib/copy_user.S +++ b/arch/x86/lib/copy_user_64.S diff --git a/arch/x86_64/lib/copy_user_nocache.S b/arch/x86/lib/copy_user_nocache_64.S index 4620efb12f1..4620efb12f1 100644 --- a/arch/x86_64/lib/copy_user_nocache.S +++ b/arch/x86/lib/copy_user_nocache_64.S diff --git a/arch/x86_64/lib/csum-copy.S b/arch/x86/lib/csum-copy_64.S index f0dba36578e..f0dba36578e 100644 --- a/arch/x86_64/lib/csum-copy.S +++ b/arch/x86/lib/csum-copy_64.S diff --git a/arch/x86_64/lib/csum-partial.c b/arch/x86/lib/csum-partial_64.c index bc503f50690..bc503f50690 100644 --- a/arch/x86_64/lib/csum-partial.c +++ b/arch/x86/lib/csum-partial_64.c diff --git a/arch/x86_64/lib/csum-wrappers.c b/arch/x86/lib/csum-wrappers_64.c index fd42a4a095f..fd42a4a095f 100644 --- a/arch/x86_64/lib/csum-wrappers.c +++ b/arch/x86/lib/csum-wrappers_64.c diff --git a/arch/i386/lib/delay.c b/arch/x86/lib/delay_32.c index f6edb11364d..f6edb11364d 100644 --- a/arch/i386/lib/delay.c +++ b/arch/x86/lib/delay_32.c diff --git a/arch/x86_64/lib/delay.c b/arch/x86/lib/delay_64.c index 2dbebd30834..2dbebd30834 100644 --- a/arch/x86_64/lib/delay.c +++ b/arch/x86/lib/delay_64.c diff --git a/arch/i386/lib/getuser.S b/arch/x86/lib/getuser_32.S index 6d84b53f12a..6d84b53f12a 100644 --- a/arch/i386/lib/getuser.S +++ b/arch/x86/lib/getuser_32.S diff --git a/arch/x86_64/lib/getuser.S b/arch/x86/lib/getuser_64.S index 5448876261f..5448876261f 100644 --- a/arch/x86_64/lib/getuser.S +++ b/arch/x86/lib/getuser_64.S diff --git a/arch/x86_64/lib/io.c b/arch/x86/lib/io_64.c index 87b4a4e1803..87b4a4e1803 100644 --- a/arch/x86_64/lib/io.c +++ b/arch/x86/lib/io_64.c diff --git a/arch/x86_64/lib/iomap_copy.S b/arch/x86/lib/iomap_copy_64.S index 05a95e713da..05a95e713da 100644 --- a/arch/x86_64/lib/iomap_copy.S +++ b/arch/x86/lib/iomap_copy_64.S diff --git a/arch/i386/lib/memcpy.c b/arch/x86/lib/memcpy_32.c index 8ac51b82a63..8ac51b82a63 100644 --- a/arch/i386/lib/memcpy.c +++ b/arch/x86/lib/memcpy_32.c diff --git a/arch/x86_64/lib/memcpy.S b/arch/x86/lib/memcpy_64.S index c22981fa2f3..c22981fa2f3 100644 --- a/arch/x86_64/lib/memcpy.S +++ b/arch/x86/lib/memcpy_64.S diff --git a/arch/x86_64/lib/memmove.c b/arch/x86/lib/memmove_64.c index 751ebae8ec4..751ebae8ec4 100644 --- a/arch/x86_64/lib/memmove.c +++ b/arch/x86/lib/memmove_64.c diff --git a/arch/x86_64/lib/memset.S b/arch/x86/lib/memset_64.S index 2c5948116bd..2c5948116bd 100644 --- a/arch/x86_64/lib/memset.S +++ b/arch/x86/lib/memset_64.S diff --git a/arch/i386/lib/mmx.c b/arch/x86/lib/mmx_32.c index 28084d2e8dd..28084d2e8dd 100644 --- a/arch/i386/lib/mmx.c +++ b/arch/x86/lib/mmx_32.c diff --git a/arch/i386/lib/msr-on-cpu.c b/arch/x86/lib/msr-on-cpu.c index 7767962f25d..7767962f25d 100644 --- a/arch/i386/lib/msr-on-cpu.c +++ b/arch/x86/lib/msr-on-cpu.c diff --git a/arch/i386/lib/putuser.S b/arch/x86/lib/putuser_32.S index f58fba109d1..f58fba109d1 100644 --- a/arch/i386/lib/putuser.S +++ b/arch/x86/lib/putuser_32.S diff --git a/arch/x86_64/lib/putuser.S b/arch/x86/lib/putuser_64.S index 4989f5a8fa9..4989f5a8fa9 100644 --- a/arch/x86_64/lib/putuser.S +++ b/arch/x86/lib/putuser_64.S diff --git a/arch/x86_64/lib/rwlock.S b/arch/x86/lib/rwlock_64.S index 0cde1f80731..0cde1f80731 100644 --- a/arch/x86_64/lib/rwlock.S +++ b/arch/x86/lib/rwlock_64.S diff --git a/arch/i386/lib/semaphore.S b/arch/x86/lib/semaphore_32.S index c01eb39c0b4..c01eb39c0b4 100644 --- a/arch/i386/lib/semaphore.S +++ b/arch/x86/lib/semaphore_32.S diff --git a/arch/i386/lib/string.c b/arch/x86/lib/string_32.c index 2c773fefa3d..2c773fefa3d 100644 --- a/arch/i386/lib/string.c +++ b/arch/x86/lib/string_32.c diff --git a/arch/i386/lib/strstr.c b/arch/x86/lib/strstr_32.c index a3dafbf59da..a3dafbf59da 100644 --- a/arch/i386/lib/strstr.c +++ b/arch/x86/lib/strstr_32.c diff --git a/arch/x86_64/lib/thunk.S b/arch/x86/lib/thunk_64.S index 55e586d352d..55e586d352d 100644 --- a/arch/x86_64/lib/thunk.S +++ b/arch/x86/lib/thunk_64.S diff --git a/arch/i386/lib/usercopy.c b/arch/x86/lib/usercopy_32.c index 9f38b12b4af..9f38b12b4af 100644 --- a/arch/i386/lib/usercopy.c +++ b/arch/x86/lib/usercopy_32.c diff --git a/arch/x86_64/lib/usercopy.c b/arch/x86/lib/usercopy_64.c index 893d43f838c..893d43f838c 100644 --- a/arch/x86_64/lib/usercopy.c +++ b/arch/x86/lib/usercopy_64.c diff --git a/arch/i386/mach-default/Makefile b/arch/x86/mach-default/Makefile index 012fe34459e..012fe34459e 100644 --- a/arch/i386/mach-default/Makefile +++ b/arch/x86/mach-default/Makefile diff --git a/arch/i386/mach-default/setup.c b/arch/x86/mach-default/setup.c index 7f635c7a238..7f635c7a238 100644 --- a/arch/i386/mach-default/setup.c +++ b/arch/x86/mach-default/setup.c diff --git a/arch/i386/mach-es7000/Makefile b/arch/x86/mach-es7000/Makefile index 69dd4da218d..69dd4da218d 100644 --- a/arch/i386/mach-es7000/Makefile +++ b/arch/x86/mach-es7000/Makefile diff --git a/arch/i386/mach-es7000/es7000.h b/arch/x86/mach-es7000/es7000.h index c8d5aa132fa..c8d5aa132fa 100644 --- a/arch/i386/mach-es7000/es7000.h +++ b/arch/x86/mach-es7000/es7000.h diff --git a/arch/i386/mach-es7000/es7000plat.c b/arch/x86/mach-es7000/es7000plat.c index ab99072d3f9..ab99072d3f9 100644 --- a/arch/i386/mach-es7000/es7000plat.c +++ b/arch/x86/mach-es7000/es7000plat.c diff --git a/arch/x86/mach-generic/Makefile b/arch/x86/mach-generic/Makefile new file mode 100644 index 00000000000..19d6d407737 --- /dev/null +++ b/arch/x86/mach-generic/Makefile @@ -0,0 +1,8 @@ +# +# Makefile for the generic architecture +# + +EXTRA_CFLAGS := -Iarch/x86/kernel + +obj-y := probe.o summit.o bigsmp.o es7000.o default.o +obj-y += ../../x86/mach-es7000/ diff --git a/arch/i386/mach-generic/bigsmp.c b/arch/x86/mach-generic/bigsmp.c index 58a477baec3..58a477baec3 100644 --- a/arch/i386/mach-generic/bigsmp.c +++ b/arch/x86/mach-generic/bigsmp.c diff --git a/arch/i386/mach-generic/default.c b/arch/x86/mach-generic/default.c index 8685208d851..8685208d851 100644 --- a/arch/i386/mach-generic/default.c +++ b/arch/x86/mach-generic/default.c diff --git a/arch/i386/mach-generic/es7000.c b/arch/x86/mach-generic/es7000.c index 4742626f08c..4742626f08c 100644 --- a/arch/i386/mach-generic/es7000.c +++ b/arch/x86/mach-generic/es7000.c diff --git a/arch/i386/mach-generic/probe.c b/arch/x86/mach-generic/probe.c index 74f3da63442..74f3da63442 100644 --- a/arch/i386/mach-generic/probe.c +++ b/arch/x86/mach-generic/probe.c diff --git a/arch/i386/mach-generic/summit.c b/arch/x86/mach-generic/summit.c index 74883ccb8f7..74883ccb8f7 100644 --- a/arch/i386/mach-generic/summit.c +++ b/arch/x86/mach-generic/summit.c diff --git a/arch/i386/mach-visws/Makefile b/arch/x86/mach-visws/Makefile index 835fd96ad76..835fd96ad76 100644 --- a/arch/i386/mach-visws/Makefile +++ b/arch/x86/mach-visws/Makefile diff --git a/arch/i386/mach-visws/mpparse.c b/arch/x86/mach-visws/mpparse.c index f3c74fab8b9..f3c74fab8b9 100644 --- a/arch/i386/mach-visws/mpparse.c +++ b/arch/x86/mach-visws/mpparse.c diff --git a/arch/i386/mach-visws/reboot.c b/arch/x86/mach-visws/reboot.c index 99332abfad4..99332abfad4 100644 --- a/arch/i386/mach-visws/reboot.c +++ b/arch/x86/mach-visws/reboot.c diff --git a/arch/i386/mach-visws/setup.c b/arch/x86/mach-visws/setup.c index 1f81f10e03a..1f81f10e03a 100644 --- a/arch/i386/mach-visws/setup.c +++ b/arch/x86/mach-visws/setup.c diff --git a/arch/i386/mach-visws/traps.c b/arch/x86/mach-visws/traps.c index 843b67acf43..843b67acf43 100644 --- a/arch/i386/mach-visws/traps.c +++ b/arch/x86/mach-visws/traps.c diff --git a/arch/i386/mach-visws/visws_apic.c b/arch/x86/mach-visws/visws_apic.c index 710faf71a65..710faf71a65 100644 --- a/arch/i386/mach-visws/visws_apic.c +++ b/arch/x86/mach-visws/visws_apic.c diff --git a/arch/x86/mach-voyager/Makefile b/arch/x86/mach-voyager/Makefile new file mode 100644 index 00000000000..15c250b371d --- /dev/null +++ b/arch/x86/mach-voyager/Makefile @@ -0,0 +1,8 @@ +# +# Makefile for the linux kernel. +# + +EXTRA_CFLAGS := -Iarch/x86/kernel +obj-y := setup.o voyager_basic.o voyager_thread.o + +obj-$(CONFIG_SMP) += voyager_smp.o voyager_cat.o diff --git a/arch/i386/mach-voyager/setup.c b/arch/x86/mach-voyager/setup.c index 2b55694e640..2b55694e640 100644 --- a/arch/i386/mach-voyager/setup.c +++ b/arch/x86/mach-voyager/setup.c diff --git a/arch/i386/mach-voyager/voyager_basic.c b/arch/x86/mach-voyager/voyager_basic.c index 9b77b39b71a..9b77b39b71a 100644 --- a/arch/i386/mach-voyager/voyager_basic.c +++ b/arch/x86/mach-voyager/voyager_basic.c diff --git a/arch/i386/mach-voyager/voyager_cat.c b/arch/x86/mach-voyager/voyager_cat.c index 26a2d4c54b6..26a2d4c54b6 100644 --- a/arch/i386/mach-voyager/voyager_cat.c +++ b/arch/x86/mach-voyager/voyager_cat.c diff --git a/arch/i386/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index b87f8548e75..b87f8548e75 100644 --- a/arch/i386/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c diff --git a/arch/i386/mach-voyager/voyager_thread.c b/arch/x86/mach-voyager/voyager_thread.c index f9d59533815..f9d59533815 100644 --- a/arch/i386/mach-voyager/voyager_thread.c +++ b/arch/x86/mach-voyager/voyager_thread.c diff --git a/arch/i386/math-emu/Makefile b/arch/x86/math-emu/Makefile index 9c943fa6ce6..9c943fa6ce6 100644 --- a/arch/i386/math-emu/Makefile +++ b/arch/x86/math-emu/Makefile diff --git a/arch/i386/math-emu/README b/arch/x86/math-emu/README index e6235491d6e..e6235491d6e 100644 --- a/arch/i386/math-emu/README +++ b/arch/x86/math-emu/README diff --git a/arch/i386/math-emu/control_w.h b/arch/x86/math-emu/control_w.h index ae2274dbd30..ae2274dbd30 100644 --- a/arch/i386/math-emu/control_w.h +++ b/arch/x86/math-emu/control_w.h diff --git a/arch/i386/math-emu/div_Xsig.S b/arch/x86/math-emu/div_Xsig.S index f77ba3058b3..f77ba3058b3 100644 --- a/arch/i386/math-emu/div_Xsig.S +++ b/arch/x86/math-emu/div_Xsig.S diff --git a/arch/i386/math-emu/div_small.S b/arch/x86/math-emu/div_small.S index 47099628fa4..47099628fa4 100644 --- a/arch/i386/math-emu/div_small.S +++ b/arch/x86/math-emu/div_small.S diff --git a/arch/i386/math-emu/errors.c b/arch/x86/math-emu/errors.c index a1b0d22f697..a1b0d22f697 100644 --- a/arch/i386/math-emu/errors.c +++ b/arch/x86/math-emu/errors.c diff --git a/arch/i386/math-emu/exception.h b/arch/x86/math-emu/exception.h index b463f21a811..b463f21a811 100644 --- a/arch/i386/math-emu/exception.h +++ b/arch/x86/math-emu/exception.h diff --git a/arch/i386/math-emu/fpu_arith.c b/arch/x86/math-emu/fpu_arith.c index 6972dec01af..6972dec01af 100644 --- a/arch/i386/math-emu/fpu_arith.c +++ b/arch/x86/math-emu/fpu_arith.c diff --git a/arch/i386/math-emu/fpu_asm.h b/arch/x86/math-emu/fpu_asm.h index 9ba12416df1..9ba12416df1 100644 --- a/arch/i386/math-emu/fpu_asm.h +++ b/arch/x86/math-emu/fpu_asm.h diff --git a/arch/i386/math-emu/fpu_aux.c b/arch/x86/math-emu/fpu_aux.c index 20886cfb9f7..20886cfb9f7 100644 --- a/arch/i386/math-emu/fpu_aux.c +++ b/arch/x86/math-emu/fpu_aux.c diff --git a/arch/i386/math-emu/fpu_emu.h b/arch/x86/math-emu/fpu_emu.h index 65120f52385..65120f52385 100644 --- a/arch/i386/math-emu/fpu_emu.h +++ b/arch/x86/math-emu/fpu_emu.h diff --git a/arch/i386/math-emu/fpu_entry.c b/arch/x86/math-emu/fpu_entry.c index 1853524c8b5..1853524c8b5 100644 --- a/arch/i386/math-emu/fpu_entry.c +++ b/arch/x86/math-emu/fpu_entry.c diff --git a/arch/i386/math-emu/fpu_etc.c b/arch/x86/math-emu/fpu_etc.c index e3b5d465587..e3b5d465587 100644 --- a/arch/i386/math-emu/fpu_etc.c +++ b/arch/x86/math-emu/fpu_etc.c diff --git a/arch/i386/math-emu/fpu_proto.h b/arch/x86/math-emu/fpu_proto.h index 37a8a7fe7e2..37a8a7fe7e2 100644 --- a/arch/i386/math-emu/fpu_proto.h +++ b/arch/x86/math-emu/fpu_proto.h diff --git a/arch/i386/math-emu/fpu_system.h b/arch/x86/math-emu/fpu_system.h index a3ae28c49dd..a3ae28c49dd 100644 --- a/arch/i386/math-emu/fpu_system.h +++ b/arch/x86/math-emu/fpu_system.h diff --git a/arch/i386/math-emu/fpu_tags.c b/arch/x86/math-emu/fpu_tags.c index cb436fe20e4..cb436fe20e4 100644 --- a/arch/i386/math-emu/fpu_tags.c +++ b/arch/x86/math-emu/fpu_tags.c diff --git a/arch/i386/math-emu/fpu_trig.c b/arch/x86/math-emu/fpu_trig.c index 403cbde1d42..403cbde1d42 100644 --- a/arch/i386/math-emu/fpu_trig.c +++ b/arch/x86/math-emu/fpu_trig.c diff --git a/arch/i386/math-emu/get_address.c b/arch/x86/math-emu/get_address.c index 2e2c51a8bd3..2e2c51a8bd3 100644 --- a/arch/i386/math-emu/get_address.c +++ b/arch/x86/math-emu/get_address.c diff --git a/arch/i386/math-emu/load_store.c b/arch/x86/math-emu/load_store.c index eebd6fb1c8a..eebd6fb1c8a 100644 --- a/arch/i386/math-emu/load_store.c +++ b/arch/x86/math-emu/load_store.c diff --git a/arch/i386/math-emu/mul_Xsig.S b/arch/x86/math-emu/mul_Xsig.S index 717785a53eb..717785a53eb 100644 --- a/arch/i386/math-emu/mul_Xsig.S +++ b/arch/x86/math-emu/mul_Xsig.S diff --git a/arch/i386/math-emu/poly.h b/arch/x86/math-emu/poly.h index 4db79811492..4db79811492 100644 --- a/arch/i386/math-emu/poly.h +++ b/arch/x86/math-emu/poly.h diff --git a/arch/i386/math-emu/poly_2xm1.c b/arch/x86/math-emu/poly_2xm1.c index 9766ad5e974..9766ad5e974 100644 --- a/arch/i386/math-emu/poly_2xm1.c +++ b/arch/x86/math-emu/poly_2xm1.c diff --git a/arch/i386/math-emu/poly_atan.c b/arch/x86/math-emu/poly_atan.c index 82f702952f6..82f702952f6 100644 --- a/arch/i386/math-emu/poly_atan.c +++ b/arch/x86/math-emu/poly_atan.c diff --git a/arch/i386/math-emu/poly_l2.c b/arch/x86/math-emu/poly_l2.c index dd00e1d5b07..dd00e1d5b07 100644 --- a/arch/i386/math-emu/poly_l2.c +++ b/arch/x86/math-emu/poly_l2.c diff --git a/arch/i386/math-emu/poly_sin.c b/arch/x86/math-emu/poly_sin.c index a36313fb06f..a36313fb06f 100644 --- a/arch/i386/math-emu/poly_sin.c +++ b/arch/x86/math-emu/poly_sin.c diff --git a/arch/i386/math-emu/poly_tan.c b/arch/x86/math-emu/poly_tan.c index 8df3e03b6e6..8df3e03b6e6 100644 --- a/arch/i386/math-emu/poly_tan.c +++ b/arch/x86/math-emu/poly_tan.c diff --git a/arch/i386/math-emu/polynom_Xsig.S b/arch/x86/math-emu/polynom_Xsig.S index 17315c89ff3..17315c89ff3 100644 --- a/arch/i386/math-emu/polynom_Xsig.S +++ b/arch/x86/math-emu/polynom_Xsig.S diff --git a/arch/i386/math-emu/reg_add_sub.c b/arch/x86/math-emu/reg_add_sub.c index 7cd3b37ac08..7cd3b37ac08 100644 --- a/arch/i386/math-emu/reg_add_sub.c +++ b/arch/x86/math-emu/reg_add_sub.c diff --git a/arch/i386/math-emu/reg_compare.c b/arch/x86/math-emu/reg_compare.c index f37c5b5a35a..f37c5b5a35a 100644 --- a/arch/i386/math-emu/reg_compare.c +++ b/arch/x86/math-emu/reg_compare.c diff --git a/arch/i386/math-emu/reg_constant.c b/arch/x86/math-emu/reg_constant.c index a8501580196..a8501580196 100644 --- a/arch/i386/math-emu/reg_constant.c +++ b/arch/x86/math-emu/reg_constant.c diff --git a/arch/i386/math-emu/reg_constant.h b/arch/x86/math-emu/reg_constant.h index 1bffaec3a13..1bffaec3a13 100644 --- a/arch/i386/math-emu/reg_constant.h +++ b/arch/x86/math-emu/reg_constant.h diff --git a/arch/i386/math-emu/reg_convert.c b/arch/x86/math-emu/reg_convert.c index 45a25875270..45a25875270 100644 --- a/arch/i386/math-emu/reg_convert.c +++ b/arch/x86/math-emu/reg_convert.c diff --git a/arch/i386/math-emu/reg_divide.c b/arch/x86/math-emu/reg_divide.c index 5cee7ff920d..5cee7ff920d 100644 --- a/arch/i386/math-emu/reg_divide.c +++ b/arch/x86/math-emu/reg_divide.c diff --git a/arch/i386/math-emu/reg_ld_str.c b/arch/x86/math-emu/reg_ld_str.c index e976caef649..e976caef649 100644 --- a/arch/i386/math-emu/reg_ld_str.c +++ b/arch/x86/math-emu/reg_ld_str.c diff --git a/arch/i386/math-emu/reg_mul.c b/arch/x86/math-emu/reg_mul.c index 40f50b61bc6..40f50b61bc6 100644 --- a/arch/i386/math-emu/reg_mul.c +++ b/arch/x86/math-emu/reg_mul.c diff --git a/arch/i386/math-emu/reg_norm.S b/arch/x86/math-emu/reg_norm.S index 8b6352efcee..8b6352efcee 100644 --- a/arch/i386/math-emu/reg_norm.S +++ b/arch/x86/math-emu/reg_norm.S diff --git a/arch/i386/math-emu/reg_round.S b/arch/x86/math-emu/reg_round.S index d1d4e48b4f6..d1d4e48b4f6 100644 --- a/arch/i386/math-emu/reg_round.S +++ b/arch/x86/math-emu/reg_round.S diff --git a/arch/i386/math-emu/reg_u_add.S b/arch/x86/math-emu/reg_u_add.S index 47c4c2434d8..47c4c2434d8 100644 --- a/arch/i386/math-emu/reg_u_add.S +++ b/arch/x86/math-emu/reg_u_add.S diff --git a/arch/i386/math-emu/reg_u_div.S b/arch/x86/math-emu/reg_u_div.S index cc00654b6f9..cc00654b6f9 100644 --- a/arch/i386/math-emu/reg_u_div.S +++ b/arch/x86/math-emu/reg_u_div.S diff --git a/arch/i386/math-emu/reg_u_mul.S b/arch/x86/math-emu/reg_u_mul.S index 973f12af97d..973f12af97d 100644 --- a/arch/i386/math-emu/reg_u_mul.S +++ b/arch/x86/math-emu/reg_u_mul.S diff --git a/arch/i386/math-emu/reg_u_sub.S b/arch/x86/math-emu/reg_u_sub.S index 1b6c24801d2..1b6c24801d2 100644 --- a/arch/i386/math-emu/reg_u_sub.S +++ b/arch/x86/math-emu/reg_u_sub.S diff --git a/arch/i386/math-emu/round_Xsig.S b/arch/x86/math-emu/round_Xsig.S index bbe0e87718e..bbe0e87718e 100644 --- a/arch/i386/math-emu/round_Xsig.S +++ b/arch/x86/math-emu/round_Xsig.S diff --git a/arch/i386/math-emu/shr_Xsig.S b/arch/x86/math-emu/shr_Xsig.S index 31cdd118e91..31cdd118e91 100644 --- a/arch/i386/math-emu/shr_Xsig.S +++ b/arch/x86/math-emu/shr_Xsig.S diff --git a/arch/i386/math-emu/status_w.h b/arch/x86/math-emu/status_w.h index 59e73302aa6..59e73302aa6 100644 --- a/arch/i386/math-emu/status_w.h +++ b/arch/x86/math-emu/status_w.h diff --git a/arch/i386/math-emu/version.h b/arch/x86/math-emu/version.h index a0d73a1d2b6..a0d73a1d2b6 100644 --- a/arch/i386/math-emu/version.h +++ b/arch/x86/math-emu/version.h diff --git a/arch/i386/math-emu/wm_shrx.S b/arch/x86/math-emu/wm_shrx.S index 51842831798..51842831798 100644 --- a/arch/i386/math-emu/wm_shrx.S +++ b/arch/x86/math-emu/wm_shrx.S diff --git a/arch/i386/math-emu/wm_sqrt.S b/arch/x86/math-emu/wm_sqrt.S index d258f59564e..d258f59564e 100644 --- a/arch/i386/math-emu/wm_sqrt.S +++ b/arch/x86/math-emu/wm_sqrt.S diff --git a/arch/x86/mm/Makefile b/arch/x86/mm/Makefile new file mode 100644 index 00000000000..98329109684 --- /dev/null +++ b/arch/x86/mm/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/mm/Makefile_32 +else +include ${srctree}/arch/x86/mm/Makefile_64 +endif diff --git a/arch/x86/mm/Makefile_32 b/arch/x86/mm/Makefile_32 new file mode 100644 index 00000000000..362b4ad082d --- /dev/null +++ b/arch/x86/mm/Makefile_32 @@ -0,0 +1,10 @@ +# +# Makefile for the linux i386-specific parts of the memory manager. +# + +obj-y := init_32.o pgtable_32.o fault_32.o ioremap_32.o extable_32.o pageattr_32.o mmap_32.o + +obj-$(CONFIG_NUMA) += discontig_32.o +obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o +obj-$(CONFIG_HIGHMEM) += highmem_32.o +obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap_32.o diff --git a/arch/x86/mm/Makefile_64 b/arch/x86/mm/Makefile_64 new file mode 100644 index 00000000000..6bcb47945b8 --- /dev/null +++ b/arch/x86/mm/Makefile_64 @@ -0,0 +1,10 @@ +# +# Makefile for the linux x86_64-specific parts of the memory manager. +# + +obj-y := init_64.o fault_64.o ioremap_64.o extable_64.o pageattr_64.o mmap_64.o +obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o +obj-$(CONFIG_NUMA) += numa_64.o +obj-$(CONFIG_K8_NUMA) += k8topology_64.o +obj-$(CONFIG_ACPI_NUMA) += srat_64.o + diff --git a/arch/i386/mm/boot_ioremap.c b/arch/x86/mm/boot_ioremap_32.c index 4de95a17a7d..4de95a17a7d 100644 --- a/arch/i386/mm/boot_ioremap.c +++ b/arch/x86/mm/boot_ioremap_32.c diff --git a/arch/i386/mm/discontig.c b/arch/x86/mm/discontig_32.c index 860e912a3fb..860e912a3fb 100644 --- a/arch/i386/mm/discontig.c +++ b/arch/x86/mm/discontig_32.c diff --git a/arch/i386/mm/extable.c b/arch/x86/mm/extable_32.c index 0ce4f22a263..0ce4f22a263 100644 --- a/arch/i386/mm/extable.c +++ b/arch/x86/mm/extable_32.c diff --git a/arch/x86_64/mm/extable.c b/arch/x86/mm/extable_64.c index 79ac6e7100a..79ac6e7100a 100644 --- a/arch/x86_64/mm/extable.c +++ b/arch/x86/mm/extable_64.c diff --git a/arch/i386/mm/fault.c b/arch/x86/mm/fault_32.c index fcb38e7f354..fcb38e7f354 100644 --- a/arch/i386/mm/fault.c +++ b/arch/x86/mm/fault_32.c diff --git a/arch/x86_64/mm/fault.c b/arch/x86/mm/fault_64.c index 54816adb8e9..54816adb8e9 100644 --- a/arch/x86_64/mm/fault.c +++ b/arch/x86/mm/fault_64.c diff --git a/arch/i386/mm/highmem.c b/arch/x86/mm/highmem_32.c index 1c3bf95f735..1c3bf95f735 100644 --- a/arch/i386/mm/highmem.c +++ b/arch/x86/mm/highmem_32.c diff --git a/arch/i386/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c index 6c06d9c0488..6c06d9c0488 100644 --- a/arch/i386/mm/hugetlbpage.c +++ b/arch/x86/mm/hugetlbpage.c diff --git a/arch/i386/mm/init.c b/arch/x86/mm/init_32.c index 730a5b177b1..730a5b177b1 100644 --- a/arch/i386/mm/init.c +++ b/arch/x86/mm/init_32.c diff --git a/arch/x86_64/mm/init.c b/arch/x86/mm/init_64.c index 458893b376f..458893b376f 100644 --- a/arch/x86_64/mm/init.c +++ b/arch/x86/mm/init_64.c diff --git a/arch/i386/mm/ioremap.c b/arch/x86/mm/ioremap_32.c index 0b278315d73..0b278315d73 100644 --- a/arch/i386/mm/ioremap.c +++ b/arch/x86/mm/ioremap_32.c diff --git a/arch/x86_64/mm/ioremap.c b/arch/x86/mm/ioremap_64.c index 6cac90aa503..6cac90aa503 100644 --- a/arch/x86_64/mm/ioremap.c +++ b/arch/x86/mm/ioremap_64.c diff --git a/arch/x86_64/mm/k8topology.c b/arch/x86/mm/k8topology_64.c index a96006f7ae0..a96006f7ae0 100644 --- a/arch/x86_64/mm/k8topology.c +++ b/arch/x86/mm/k8topology_64.c diff --git a/arch/i386/mm/mmap.c b/arch/x86/mm/mmap_32.c index 552e0847375..552e0847375 100644 --- a/arch/i386/mm/mmap.c +++ b/arch/x86/mm/mmap_32.c diff --git a/arch/x86_64/mm/mmap.c b/arch/x86/mm/mmap_64.c index 80bba0dc000..80bba0dc000 100644 --- a/arch/x86_64/mm/mmap.c +++ b/arch/x86/mm/mmap_64.c diff --git a/arch/x86_64/mm/numa.c b/arch/x86/mm/numa_64.c index 6da23552226..6da23552226 100644 --- a/arch/x86_64/mm/numa.c +++ b/arch/x86/mm/numa_64.c diff --git a/arch/i386/mm/pageattr.c b/arch/x86/mm/pageattr_32.c index 4241a74d16c..4241a74d16c 100644 --- a/arch/i386/mm/pageattr.c +++ b/arch/x86/mm/pageattr_32.c diff --git a/arch/x86_64/mm/pageattr.c b/arch/x86/mm/pageattr_64.c index 10b9809ce82..10b9809ce82 100644 --- a/arch/x86_64/mm/pageattr.c +++ b/arch/x86/mm/pageattr_64.c diff --git a/arch/i386/mm/pgtable.c b/arch/x86/mm/pgtable_32.c index 01437c46baa..01437c46baa 100644 --- a/arch/i386/mm/pgtable.c +++ b/arch/x86/mm/pgtable_32.c diff --git a/arch/x86_64/mm/srat.c b/arch/x86/mm/srat_64.c index acdf03e1914..acdf03e1914 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86/mm/srat_64.c diff --git a/arch/i386/oprofile/Kconfig b/arch/x86/oprofile/Kconfig index d8a84088471..d8a84088471 100644 --- a/arch/i386/oprofile/Kconfig +++ b/arch/x86/oprofile/Kconfig diff --git a/arch/i386/oprofile/Makefile b/arch/x86/oprofile/Makefile index 30f3eb36666..30f3eb36666 100644 --- a/arch/i386/oprofile/Makefile +++ b/arch/x86/oprofile/Makefile diff --git a/arch/i386/oprofile/backtrace.c b/arch/x86/oprofile/backtrace.c index c049ce414f0..c049ce414f0 100644 --- a/arch/i386/oprofile/backtrace.c +++ b/arch/x86/oprofile/backtrace.c diff --git a/arch/i386/oprofile/init.c b/arch/x86/oprofile/init.c index 5341d481d92..5341d481d92 100644 --- a/arch/i386/oprofile/init.c +++ b/arch/x86/oprofile/init.c diff --git a/arch/i386/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 11b7a51566a..11b7a51566a 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c diff --git a/arch/i386/oprofile/nmi_timer_int.c b/arch/x86/oprofile/nmi_timer_int.c index 1418e36ae7a..1418e36ae7a 100644 --- a/arch/i386/oprofile/nmi_timer_int.c +++ b/arch/x86/oprofile/nmi_timer_int.c diff --git a/arch/i386/oprofile/op_counter.h b/arch/x86/oprofile/op_counter.h index 2880b15c467..2880b15c467 100644 --- a/arch/i386/oprofile/op_counter.h +++ b/arch/x86/oprofile/op_counter.h diff --git a/arch/i386/oprofile/op_model_athlon.c b/arch/x86/oprofile/op_model_athlon.c index 3057a19e464..3057a19e464 100644 --- a/arch/i386/oprofile/op_model_athlon.c +++ b/arch/x86/oprofile/op_model_athlon.c diff --git a/arch/i386/oprofile/op_model_p4.c b/arch/x86/oprofile/op_model_p4.c index 47925927b12..47925927b12 100644 --- a/arch/i386/oprofile/op_model_p4.c +++ b/arch/x86/oprofile/op_model_p4.c diff --git a/arch/i386/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index c554f52cb80..c554f52cb80 100644 --- a/arch/i386/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c diff --git a/arch/i386/oprofile/op_x86_model.h b/arch/x86/oprofile/op_x86_model.h index abb1aa95b97..abb1aa95b97 100644 --- a/arch/i386/oprofile/op_x86_model.h +++ b/arch/x86/oprofile/op_x86_model.h diff --git a/arch/x86/pci/Makefile b/arch/x86/pci/Makefile new file mode 100644 index 00000000000..c5c8e485fc4 --- /dev/null +++ b/arch/x86/pci/Makefile @@ -0,0 +1,5 @@ +ifeq ($(CONFIG_X86_32),y) +include ${srctree}/arch/x86/pci/Makefile_32 +else +include ${srctree}/arch/x86/pci/Makefile_64 +endif diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32 new file mode 100644 index 00000000000..cdd6828b5ab --- /dev/null +++ b/arch/x86/pci/Makefile_32 @@ -0,0 +1,14 @@ +obj-y := i386.o init.o + +obj-$(CONFIG_PCI_BIOS) += pcbios.o +obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_32.o direct.o mmconfig-shared.o +obj-$(CONFIG_PCI_DIRECT) += direct.o + +pci-y := fixup.o +pci-$(CONFIG_ACPI) += acpi.o +pci-y += legacy.o irq.o + +pci-$(CONFIG_X86_VISWS) := visws.o fixup.o +pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o + +obj-y += $(pci-y) common.o early.o diff --git a/arch/x86/pci/Makefile_64 b/arch/x86/pci/Makefile_64 new file mode 100644 index 00000000000..7d8c467bf14 --- /dev/null +++ b/arch/x86/pci/Makefile_64 @@ -0,0 +1,17 @@ +# +# Makefile for X86_64 specific PCI routines +# +# Reuse the i386 PCI subsystem +# +EXTRA_CFLAGS += -Iarch/x86/pci + +obj-y := i386.o +obj-$(CONFIG_PCI_DIRECT)+= direct.o +obj-y += fixup.o init.o +obj-$(CONFIG_ACPI) += acpi.o +obj-y += legacy.o irq.o common.o early.o +# mmconfig has a 64bit special +obj-$(CONFIG_PCI_MMCONFIG) += mmconfig_64.o direct.o mmconfig-shared.o + +obj-$(CONFIG_NUMA) += k8-bus_64.o + diff --git a/arch/i386/pci/acpi.c b/arch/x86/pci/acpi.c index bc8a44bddaa..bc8a44bddaa 100644 --- a/arch/i386/pci/acpi.c +++ b/arch/x86/pci/acpi.c diff --git a/arch/i386/pci/common.c b/arch/x86/pci/common.c index ebc6f3c6634..ebc6f3c6634 100644 --- a/arch/i386/pci/common.c +++ b/arch/x86/pci/common.c diff --git a/arch/i386/pci/direct.c b/arch/x86/pci/direct.c index 431c9a51b15..431c9a51b15 100644 --- a/arch/i386/pci/direct.c +++ b/arch/x86/pci/direct.c diff --git a/arch/i386/pci/early.c b/arch/x86/pci/early.c index 42df4b6606d..42df4b6606d 100644 --- a/arch/i386/pci/early.c +++ b/arch/x86/pci/early.c diff --git a/arch/i386/pci/fixup.c b/arch/x86/pci/fixup.c index c82cbf4c722..c82cbf4c722 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/x86/pci/fixup.c diff --git a/arch/i386/pci/i386.c b/arch/x86/pci/i386.c index bcd2f94b732..bcd2f94b732 100644 --- a/arch/i386/pci/i386.c +++ b/arch/x86/pci/i386.c diff --git a/arch/i386/pci/init.c b/arch/x86/pci/init.c index 3de9f9ba2da..3de9f9ba2da 100644 --- a/arch/i386/pci/init.c +++ b/arch/x86/pci/init.c diff --git a/arch/i386/pci/irq.c b/arch/x86/pci/irq.c index 8434f2323b8..8434f2323b8 100644 --- a/arch/i386/pci/irq.c +++ b/arch/x86/pci/irq.c diff --git a/arch/x86_64/pci/k8-bus.c b/arch/x86/pci/k8-bus_64.c index 9cc813e2970..9cc813e2970 100644 --- a/arch/x86_64/pci/k8-bus.c +++ b/arch/x86/pci/k8-bus_64.c diff --git a/arch/i386/pci/legacy.c b/arch/x86/pci/legacy.c index 5565d7016b7..5565d7016b7 100644 --- a/arch/i386/pci/legacy.c +++ b/arch/x86/pci/legacy.c diff --git a/arch/i386/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 4df637e34f8..4df637e34f8 100644 --- a/arch/i386/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c diff --git a/arch/i386/pci/mmconfig.c b/arch/x86/pci/mmconfig_32.c index 1bf5816d34c..1bf5816d34c 100644 --- a/arch/i386/pci/mmconfig.c +++ b/arch/x86/pci/mmconfig_32.c diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86/pci/mmconfig_64.c index 4095e4d66a1..4095e4d66a1 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86/pci/mmconfig_64.c diff --git a/arch/i386/pci/numa.c b/arch/x86/pci/numa.c index f5f165f69e0..f5f165f69e0 100644 --- a/arch/i386/pci/numa.c +++ b/arch/x86/pci/numa.c diff --git a/arch/i386/pci/pcbios.c b/arch/x86/pci/pcbios.c index 10ac8c316c4..10ac8c316c4 100644 --- a/arch/i386/pci/pcbios.c +++ b/arch/x86/pci/pcbios.c diff --git a/arch/i386/pci/pci.h b/arch/x86/pci/pci.h index 8c66f275756..8c66f275756 100644 --- a/arch/i386/pci/pci.h +++ b/arch/x86/pci/pci.h diff --git a/arch/i386/pci/visws.c b/arch/x86/pci/visws.c index 8ecb1c72259..8ecb1c72259 100644 --- a/arch/i386/pci/visws.c +++ b/arch/x86/pci/visws.c diff --git a/arch/i386/power/Makefile b/arch/x86/power/Makefile index d764ec95006..d764ec95006 100644 --- a/arch/i386/power/Makefile +++ b/arch/x86/power/Makefile diff --git a/arch/i386/power/cpu.c b/arch/x86/power/cpu.c index 998fd3ec0d6..998fd3ec0d6 100644 --- a/arch/i386/power/cpu.c +++ b/arch/x86/power/cpu.c diff --git a/arch/i386/power/suspend.c b/arch/x86/power/suspend.c index a0020b913f3..a0020b913f3 100644 --- a/arch/i386/power/suspend.c +++ b/arch/x86/power/suspend.c diff --git a/arch/i386/power/swsusp.S b/arch/x86/power/swsusp.S index 53662e05b39..53662e05b39 100644 --- a/arch/i386/power/swsusp.S +++ b/arch/x86/power/swsusp.S diff --git a/arch/x86_64/vdso/.gitignore b/arch/x86/vdso/.gitignore index f8b69d84238..f8b69d84238 100644 --- a/arch/x86_64/vdso/.gitignore +++ b/arch/x86/vdso/.gitignore diff --git a/arch/x86_64/vdso/Makefile b/arch/x86/vdso/Makefile index 8d03de029d9..8d03de029d9 100644 --- a/arch/x86_64/vdso/Makefile +++ b/arch/x86/vdso/Makefile diff --git a/arch/x86_64/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c index 5b54cdfb2b0..5b54cdfb2b0 100644 --- a/arch/x86_64/vdso/vclock_gettime.c +++ b/arch/x86/vdso/vclock_gettime.c diff --git a/arch/x86_64/vdso/vdso-note.S b/arch/x86/vdso/vdso-note.S index 79a071e4357..79a071e4357 100644 --- a/arch/x86_64/vdso/vdso-note.S +++ b/arch/x86/vdso/vdso-note.S diff --git a/arch/x86_64/vdso/vdso-start.S b/arch/x86/vdso/vdso-start.S index 2dc2cdb84d6..2dc2cdb84d6 100644 --- a/arch/x86_64/vdso/vdso-start.S +++ b/arch/x86/vdso/vdso-start.S diff --git a/arch/x86/vdso/vdso.S b/arch/x86/vdso/vdso.S new file mode 100644 index 00000000000..4b1620a1529 --- /dev/null +++ b/arch/x86/vdso/vdso.S @@ -0,0 +1,2 @@ + .section ".vdso","a" + .incbin "arch/x86/vdso/vdso.so" diff --git a/arch/x86_64/vdso/vdso.lds.S b/arch/x86/vdso/vdso.lds.S index b9a60e665d0..b9a60e665d0 100644 --- a/arch/x86_64/vdso/vdso.lds.S +++ b/arch/x86/vdso/vdso.lds.S diff --git a/arch/x86_64/vdso/vextern.h b/arch/x86/vdso/vextern.h index 1683ba2ae3e..1683ba2ae3e 100644 --- a/arch/x86_64/vdso/vextern.h +++ b/arch/x86/vdso/vextern.h diff --git a/arch/x86_64/vdso/vgetcpu.c b/arch/x86/vdso/vgetcpu.c index 91f6e85d0fc..91f6e85d0fc 100644 --- a/arch/x86_64/vdso/vgetcpu.c +++ b/arch/x86/vdso/vgetcpu.c diff --git a/arch/x86_64/vdso/vma.c b/arch/x86/vdso/vma.c index ff9333e5fb0..ff9333e5fb0 100644 --- a/arch/x86_64/vdso/vma.c +++ b/arch/x86/vdso/vma.c diff --git a/arch/x86/vdso/voffset.h b/arch/x86/vdso/voffset.h new file mode 100644 index 00000000000..4af67c79085 --- /dev/null +++ b/arch/x86/vdso/voffset.h @@ -0,0 +1 @@ +#define VDSO_TEXT_OFFSET 0x600 diff --git a/arch/x86_64/vdso/vvar.c b/arch/x86/vdso/vvar.c index 6fc22219a47..6fc22219a47 100644 --- a/arch/x86_64/vdso/vvar.c +++ b/arch/x86/vdso/vvar.c diff --git a/arch/i386/video/Makefile b/arch/x86/video/Makefile index 2c447c94adc..2c447c94adc 100644 --- a/arch/i386/video/Makefile +++ b/arch/x86/video/Makefile diff --git a/arch/i386/video/fbdev.c b/arch/x86/video/fbdev.c index 48fb38d7d2c..48fb38d7d2c 100644 --- a/arch/i386/video/fbdev.c +++ b/arch/x86/video/fbdev.c diff --git a/arch/i386/xen/Kconfig b/arch/x86/xen/Kconfig index 9df99e1885a..9df99e1885a 100644 --- a/arch/i386/xen/Kconfig +++ b/arch/x86/xen/Kconfig diff --git a/arch/i386/xen/Makefile b/arch/x86/xen/Makefile index 343df246bd3..343df246bd3 100644 --- a/arch/i386/xen/Makefile +++ b/arch/x86/xen/Makefile diff --git a/arch/i386/xen/enlighten.c b/arch/x86/xen/enlighten.c index f01bfcd4bde..f01bfcd4bde 100644 --- a/arch/i386/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c diff --git a/arch/i386/xen/events.c b/arch/x86/xen/events.c index da1b173547a..da1b173547a 100644 --- a/arch/i386/xen/events.c +++ b/arch/x86/xen/events.c diff --git a/arch/i386/xen/features.c b/arch/x86/xen/features.c index 0707714e40d..0707714e40d 100644 --- a/arch/i386/xen/features.c +++ b/arch/x86/xen/features.c diff --git a/arch/i386/xen/manage.c b/arch/x86/xen/manage.c index aa7af9e6abc..aa7af9e6abc 100644 --- a/arch/i386/xen/manage.c +++ b/arch/x86/xen/manage.c diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c new file mode 100644 index 00000000000..874db0cd1d2 --- /dev/null +++ b/arch/x86/xen/mmu.c @@ -0,0 +1,567 @@ +/* + * Xen mmu operations + * + * This file contains the various mmu fetch and update operations. + * The most important job they must perform is the mapping between the + * domain's pfn and the overall machine mfns. + * + * Xen allows guests to directly update the pagetable, in a controlled + * fashion. In other words, the guest modifies the same pagetable + * that the CPU actually uses, which eliminates the overhead of having + * a separate shadow pagetable. + * + * In order to allow this, it falls on the guest domain to map its + * notion of a "physical" pfn - which is just a domain-local linear + * address - into a real "machine address" which the CPU's MMU can + * use. + * + * A pgd_t/pmd_t/pte_t will typically contain an mfn, and so can be + * inserted directly into the pagetable. When creating a new + * pte/pmd/pgd, it converts the passed pfn into an mfn. Conversely, + * when reading the content back with __(pgd|pmd|pte)_val, it converts + * the mfn back into a pfn. + * + * The other constraint is that all pages which make up a pagetable + * must be mapped read-only in the guest. This prevents uncontrolled + * guest updates to the pagetable. Xen strictly enforces this, and + * will disallow any pagetable update which will end up mapping a + * pagetable page RW, and will disallow using any writable page as a + * pagetable. + * + * Naively, when loading %cr3 with the base of a new pagetable, Xen + * would need to validate the whole pagetable before going on. + * Naturally, this is quite slow. The solution is to "pin" a + * pagetable, which enforces all the constraints on the pagetable even + * when it is not actively in use. This menas that Xen can be assured + * that it is still valid when you do load it into %cr3, and doesn't + * need to revalidate it. + * + * Jeremy Fitzhardinge <jeremy@xensource.com>, XenSource Inc, 2007 + */ +#include <linux/sched.h> +#include <linux/highmem.h> +#include <linux/bug.h> +#include <linux/sched.h> + +#include <asm/pgtable.h> +#include <asm/tlbflush.h> +#include <asm/mmu_context.h> +#include <asm/paravirt.h> + +#include <asm/xen/hypercall.h> +#include <asm/xen/hypervisor.h> + +#include <xen/page.h> +#include <xen/interface/xen.h> + +#include "multicalls.h" +#include "mmu.h" + +xmaddr_t arbitrary_virt_to_machine(unsigned long address) +{ + pte_t *pte = lookup_address(address); + unsigned offset = address & PAGE_MASK; + + BUG_ON(pte == NULL); + + return XMADDR((pte_mfn(*pte) << PAGE_SHIFT) + offset); +} + +void make_lowmem_page_readonly(void *vaddr) +{ + pte_t *pte, ptev; + unsigned long address = (unsigned long)vaddr; + + pte = lookup_address(address); + BUG_ON(pte == NULL); + + ptev = pte_wrprotect(*pte); + + if (HYPERVISOR_update_va_mapping(address, ptev, 0)) + BUG(); +} + +void make_lowmem_page_readwrite(void *vaddr) +{ + pte_t *pte, ptev; + unsigned long address = (unsigned long)vaddr; + + pte = lookup_address(address); + BUG_ON(pte == NULL); + + ptev = pte_mkwrite(*pte); + + if (HYPERVISOR_update_va_mapping(address, ptev, 0)) + BUG(); +} + + +void xen_set_pmd(pmd_t *ptr, pmd_t val) +{ + struct multicall_space mcs; + struct mmu_update *u; + + preempt_disable(); + + mcs = xen_mc_entry(sizeof(*u)); + u = mcs.args; + u->ptr = virt_to_machine(ptr).maddr; + u->val = pmd_val_ma(val); + MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF); + + xen_mc_issue(PARAVIRT_LAZY_MMU); + + preempt_enable(); +} + +/* + * Associate a virtual page frame with a given physical page frame + * and protection flags for that frame. + */ +void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) +{ + pgd_t *pgd; + pud_t *pud; + pmd_t *pmd; + pte_t *pte; + + pgd = swapper_pg_dir + pgd_index(vaddr); + if (pgd_none(*pgd)) { + BUG(); + return; + } + pud = pud_offset(pgd, vaddr); + if (pud_none(*pud)) { + BUG(); + return; + } + pmd = pmd_offset(pud, vaddr); + if (pmd_none(*pmd)) { + BUG(); + return; + } + pte = pte_offset_kernel(pmd, vaddr); + /* <mfn,flags> stored as-is, to permit clearing entries */ + xen_set_pte(pte, mfn_pte(mfn, flags)); + + /* + * It's enough to flush this one mapping. + * (PGE mappings get flushed as well) + */ + __flush_tlb_one(vaddr); +} + +void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, + pte_t *ptep, pte_t pteval) +{ + if (mm == current->mm || mm == &init_mm) { + if (xen_get_lazy_mode() == PARAVIRT_LAZY_MMU) { + struct multicall_space mcs; + mcs = xen_mc_entry(0); + + MULTI_update_va_mapping(mcs.mc, addr, pteval, 0); + xen_mc_issue(PARAVIRT_LAZY_MMU); + return; + } else + if (HYPERVISOR_update_va_mapping(addr, pteval, 0) == 0) + return; + } + xen_set_pte(ptep, pteval); +} + +#ifdef CONFIG_X86_PAE +void xen_set_pud(pud_t *ptr, pud_t val) +{ + struct multicall_space mcs; + struct mmu_update *u; + + preempt_disable(); + + mcs = xen_mc_entry(sizeof(*u)); + u = mcs.args; + u->ptr = virt_to_machine(ptr).maddr; + u->val = pud_val_ma(val); + MULTI_mmu_update(mcs.mc, u, 1, NULL, DOMID_SELF); + + xen_mc_issue(PARAVIRT_LAZY_MMU); + + preempt_enable(); +} + +void xen_set_pte(pte_t *ptep, pte_t pte) +{ + ptep->pte_high = pte.pte_high; + smp_wmb(); + ptep->pte_low = pte.pte_low; +} + +void xen_set_pte_atomic(pte_t *ptep, pte_t pte) +{ + set_64bit((u64 *)ptep, pte_val_ma(pte)); +} + +void xen_pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) +{ + ptep->pte_low = 0; + smp_wmb(); /* make sure low gets written first */ + ptep->pte_high = 0; +} + +void xen_pmd_clear(pmd_t *pmdp) +{ + xen_set_pmd(pmdp, __pmd(0)); +} + +unsigned long long xen_pte_val(pte_t pte) +{ + unsigned long long ret = 0; + + if (pte.pte_low) { + ret = ((unsigned long long)pte.pte_high << 32) | pte.pte_low; + ret = machine_to_phys(XMADDR(ret)).paddr | 1; + } + + return ret; +} + +unsigned long long xen_pmd_val(pmd_t pmd) +{ + unsigned long long ret = pmd.pmd; + if (ret) + ret = machine_to_phys(XMADDR(ret)).paddr | 1; + return ret; +} + +unsigned long long xen_pgd_val(pgd_t pgd) +{ + unsigned long long ret = pgd.pgd; + if (ret) + ret = machine_to_phys(XMADDR(ret)).paddr | 1; + return ret; +} + +pte_t xen_make_pte(unsigned long long pte) +{ + if (pte & 1) + pte = phys_to_machine(XPADDR(pte)).maddr; + + return (pte_t){ pte, pte >> 32 }; +} + +pmd_t xen_make_pmd(unsigned long long pmd) +{ + if (pmd & 1) + pmd = phys_to_machine(XPADDR(pmd)).maddr; + + return (pmd_t){ pmd }; +} + +pgd_t xen_make_pgd(unsigned long long pgd) +{ + if (pgd & _PAGE_PRESENT) + pgd = phys_to_machine(XPADDR(pgd)).maddr; + + return (pgd_t){ pgd }; +} +#else /* !PAE */ +void xen_set_pte(pte_t *ptep, pte_t pte) +{ + *ptep = pte; +} + +unsigned long xen_pte_val(pte_t pte) +{ + unsigned long ret = pte.pte_low; + + if (ret & _PAGE_PRESENT) + ret = machine_to_phys(XMADDR(ret)).paddr; + + return ret; +} + +unsigned long xen_pgd_val(pgd_t pgd) +{ + unsigned long ret = pgd.pgd; + if (ret) + ret = machine_to_phys(XMADDR(ret)).paddr | 1; + return ret; +} + +pte_t xen_make_pte(unsigned long pte) +{ + if (pte & _PAGE_PRESENT) + pte = phys_to_machine(XPADDR(pte)).maddr; + + return (pte_t){ pte }; +} + +pgd_t xen_make_pgd(unsigned long pgd) +{ + if (pgd & _PAGE_PRESENT) + pgd = phys_to_machine(XPADDR(pgd)).maddr; + + return (pgd_t){ pgd }; +} +#endif /* CONFIG_X86_PAE */ + + + +/* + (Yet another) pagetable walker. This one is intended for pinning a + pagetable. This means that it walks a pagetable and calls the + callback function on each page it finds making up the page table, + at every level. It walks the entire pagetable, but it only bothers + pinning pte pages which are below pte_limit. In the normal case + this will be TASK_SIZE, but at boot we need to pin up to + FIXADDR_TOP. But the important bit is that we don't pin beyond + there, because then we start getting into Xen's ptes. +*/ +static int pgd_walk(pgd_t *pgd_base, int (*func)(struct page *, unsigned), + unsigned long limit) +{ + pgd_t *pgd = pgd_base; + int flush = 0; + unsigned long addr = 0; + unsigned long pgd_next; + + BUG_ON(limit > FIXADDR_TOP); + + if (xen_feature(XENFEAT_auto_translated_physmap)) + return 0; + + for (; addr != FIXADDR_TOP; pgd++, addr = pgd_next) { + pud_t *pud; + unsigned long pud_limit, pud_next; + + pgd_next = pud_limit = pgd_addr_end(addr, FIXADDR_TOP); + + if (!pgd_val(*pgd)) + continue; + + pud = pud_offset(pgd, 0); + + if (PTRS_PER_PUD > 1) /* not folded */ + flush |= (*func)(virt_to_page(pud), 0); + + for (; addr != pud_limit; pud++, addr = pud_next) { + pmd_t *pmd; + unsigned long pmd_limit; + + pud_next = pud_addr_end(addr, pud_limit); + + if (pud_next < limit) + pmd_limit = pud_next; + else + pmd_limit = limit; + + if (pud_none(*pud)) + continue; + + pmd = pmd_offset(pud, 0); + + if (PTRS_PER_PMD > 1) /* not folded */ + flush |= (*func)(virt_to_page(pmd), 0); + + for (; addr != pmd_limit; pmd++) { + addr += (PAGE_SIZE * PTRS_PER_PTE); + if ((pmd_limit-1) < (addr-1)) { + addr = pmd_limit; + break; + } + + if (pmd_none(*pmd)) + continue; + + flush |= (*func)(pmd_page(*pmd), 0); + } + } + } + + flush |= (*func)(virt_to_page(pgd_base), UVMF_TLB_FLUSH); + + return flush; +} + +static int pin_page(struct page *page, unsigned flags) +{ + unsigned pgfl = test_and_set_bit(PG_pinned, &page->flags); + int flush; + + if (pgfl) + flush = 0; /* already pinned */ + else if (PageHighMem(page)) + /* kmaps need flushing if we found an unpinned + highpage */ + flush = 1; + else { + void *pt = lowmem_page_address(page); + unsigned long pfn = page_to_pfn(page); + struct multicall_space mcs = __xen_mc_entry(0); + + flush = 0; + + MULTI_update_va_mapping(mcs.mc, (unsigned long)pt, + pfn_pte(pfn, PAGE_KERNEL_RO), + flags); + } + + return flush; +} + +/* This is called just after a mm has been created, but it has not + been used yet. We need to make sure that its pagetable is all + read-only, and can be pinned. */ +void xen_pgd_pin(pgd_t *pgd) +{ + struct multicall_space mcs; + struct mmuext_op *op; + + xen_mc_batch(); + + if (pgd_walk(pgd, pin_page, TASK_SIZE)) { + /* re-enable interrupts for kmap_flush_unused */ + xen_mc_issue(0); + kmap_flush_unused(); + xen_mc_batch(); + } + + mcs = __xen_mc_entry(sizeof(*op)); + op = mcs.args; + +#ifdef CONFIG_X86_PAE + op->cmd = MMUEXT_PIN_L3_TABLE; +#else + op->cmd = MMUEXT_PIN_L2_TABLE; +#endif + op->arg1.mfn = pfn_to_mfn(PFN_DOWN(__pa(pgd))); + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); + + xen_mc_issue(0); +} + +/* The init_mm pagetable is really pinned as soon as its created, but + that's before we have page structures to store the bits. So do all + the book-keeping now. */ +static __init int mark_pinned(struct page *page, unsigned flags) +{ + SetPagePinned(page); + return 0; +} + +void __init xen_mark_init_mm_pinned(void) +{ + pgd_walk(init_mm.pgd, mark_pinned, FIXADDR_TOP); +} + +static int unpin_page(struct page *page, unsigned flags) +{ + unsigned pgfl = test_and_clear_bit(PG_pinned, &page->flags); + + if (pgfl && !PageHighMem(page)) { + void *pt = lowmem_page_address(page); + unsigned long pfn = page_to_pfn(page); + struct multicall_space mcs = __xen_mc_entry(0); + + MULTI_update_va_mapping(mcs.mc, (unsigned long)pt, + pfn_pte(pfn, PAGE_KERNEL), + flags); + } + + return 0; /* never need to flush on unpin */ +} + +/* Release a pagetables pages back as normal RW */ +static void xen_pgd_unpin(pgd_t *pgd) +{ + struct mmuext_op *op; + struct multicall_space mcs; + + xen_mc_batch(); + + mcs = __xen_mc_entry(sizeof(*op)); + + op = mcs.args; + op->cmd = MMUEXT_UNPIN_TABLE; + op->arg1.mfn = pfn_to_mfn(PFN_DOWN(__pa(pgd))); + + MULTI_mmuext_op(mcs.mc, op, 1, NULL, DOMID_SELF); + + pgd_walk(pgd, unpin_page, TASK_SIZE); + + xen_mc_issue(0); +} + +void xen_activate_mm(struct mm_struct *prev, struct mm_struct *next) +{ + spin_lock(&next->page_table_lock); + xen_pgd_pin(next->pgd); + spin_unlock(&next->page_table_lock); +} + +void xen_dup_mmap(struct mm_struct *oldmm, struct mm_struct *mm) +{ + spin_lock(&mm->page_table_lock); + xen_pgd_pin(mm->pgd); + spin_unlock(&mm->page_table_lock); +} + + +#ifdef CONFIG_SMP +/* Another cpu may still have their %cr3 pointing at the pagetable, so + we need to repoint it somewhere else before we can unpin it. */ +static void drop_other_mm_ref(void *info) +{ + struct mm_struct *mm = info; + + if (__get_cpu_var(cpu_tlbstate).active_mm == mm) + leave_mm(smp_processor_id()); +} + +static void drop_mm_ref(struct mm_struct *mm) +{ + if (current->active_mm == mm) { + if (current->mm == mm) + load_cr3(swapper_pg_dir); + else + leave_mm(smp_processor_id()); + } + + if (!cpus_empty(mm->cpu_vm_mask)) + xen_smp_call_function_mask(mm->cpu_vm_mask, drop_other_mm_ref, + mm, 1); +} +#else +static void drop_mm_ref(struct mm_struct *mm) +{ + if (current->active_mm == mm) + load_cr3(swapper_pg_dir); +} +#endif + +/* + * While a process runs, Xen pins its pagetables, which means that the + * hypervisor forces it to be read-only, and it controls all updates + * to it. This means that all pagetable updates have to go via the + * hypervisor, which is moderately expensive. + * + * Since we're pulling the pagetable down, we switch to use init_mm, + * unpin old process pagetable and mark it all read-write, which + * allows further operations on it to be simple memory accesses. + * + * The only subtle point is that another CPU may be still using the + * pagetable because of lazy tlb flushing. This means we need need to + * switch all CPUs off this pagetable before we can unpin it. + */ +void xen_exit_mmap(struct mm_struct *mm) +{ + get_cpu(); /* make sure we don't move around */ + drop_mm_ref(mm); + put_cpu(); + + spin_lock(&mm->page_table_lock); + + /* pgd may not be pinned in the error exit path of execve */ + if (PagePinned(virt_to_page(mm->pgd))) + xen_pgd_unpin(mm->pgd); + spin_unlock(&mm->page_table_lock); +} diff --git a/arch/i386/xen/mmu.h b/arch/x86/xen/mmu.h index c9ff27f3ac3..c9ff27f3ac3 100644 --- a/arch/i386/xen/mmu.h +++ b/arch/x86/xen/mmu.h diff --git a/arch/i386/xen/multicalls.c b/arch/x86/xen/multicalls.c index c837e8e463d..c837e8e463d 100644 --- a/arch/i386/xen/multicalls.c +++ b/arch/x86/xen/multicalls.c diff --git a/arch/i386/xen/multicalls.h b/arch/x86/xen/multicalls.h index e6f7530b156..e6f7530b156 100644 --- a/arch/i386/xen/multicalls.h +++ b/arch/x86/xen/multicalls.h diff --git a/arch/i386/xen/setup.c b/arch/x86/xen/setup.c index f84e7722664..f84e7722664 100644 --- a/arch/i386/xen/setup.c +++ b/arch/x86/xen/setup.c diff --git a/arch/i386/xen/smp.c b/arch/x86/xen/smp.c index 557b8e24706..557b8e24706 100644 --- a/arch/i386/xen/smp.c +++ b/arch/x86/xen/smp.c diff --git a/arch/i386/xen/time.c b/arch/x86/xen/time.c index dfd6db69ead..dfd6db69ead 100644 --- a/arch/i386/xen/time.c +++ b/arch/x86/xen/time.c diff --git a/arch/i386/xen/vdso.h b/arch/x86/xen/vdso.h index 861fedfe523..861fedfe523 100644 --- a/arch/i386/xen/vdso.h +++ b/arch/x86/xen/vdso.h diff --git a/arch/i386/xen/xen-asm.S b/arch/x86/xen/xen-asm.S index 1a43b60c0c6..1a43b60c0c6 100644 --- a/arch/i386/xen/xen-asm.S +++ b/arch/x86/xen/xen-asm.S diff --git a/arch/i386/xen/xen-head.S b/arch/x86/xen/xen-head.S index f8d6937db2e..f8d6937db2e 100644 --- a/arch/i386/xen/xen-head.S +++ b/arch/x86/xen/xen-head.S diff --git a/arch/i386/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index b9aaea45f07..b9aaea45f07 100644 --- a/arch/i386/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index b4d9089a6a0..b1b98e614f7 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -704,7 +704,7 @@ source kernel/power/Kconfig source "drivers/acpi/Kconfig" -source "arch/x86_64/kernel/cpufreq/Kconfig" +source "arch/x86/kernel/cpufreq/Kconfig" endmenu @@ -778,7 +778,7 @@ source fs/Kconfig menu "Instrumentation Support" depends on EXPERIMENTAL -source "arch/x86_64/oprofile/Kconfig" +source "arch/x86/oprofile/Kconfig" config KPROBES bool "Kprobes" diff --git a/arch/x86_64/Makefile b/arch/x86_64/Makefile index b024e4a8689..8bffb94c71b 100644 --- a/arch/x86_64/Makefile +++ b/arch/x86_64/Makefile @@ -21,6 +21,9 @@ # # $Id: Makefile,v 1.31 2002/03/22 15:56:07 ak Exp $ +# Fill in SRCARCH +SRCARCH := x86 + LDFLAGS := -m elf_x86_64 OBJCOPYFLAGS := -O binary -R .note -R .comment -S LDFLAGS_vmlinux := @@ -71,18 +74,18 @@ CFLAGS += $(cflags-y) CFLAGS_KERNEL += $(cflags-kernel-y) AFLAGS += -m64 -head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kernel/init_task.o +head-y := arch/x86/kernel/head_64.o arch/x86/kernel/head64.o arch/x86/kernel/init_task_64.o -libs-y += arch/x86_64/lib/ -core-y += arch/x86_64/kernel/ \ - arch/x86_64/mm/ \ - arch/x86_64/crypto/ \ - arch/x86_64/vdso/ -core-$(CONFIG_IA32_EMULATION) += arch/x86_64/ia32/ -drivers-$(CONFIG_PCI) += arch/x86_64/pci/ -drivers-$(CONFIG_OPROFILE) += arch/x86_64/oprofile/ +libs-y += arch/x86/lib/ +core-y += arch/x86/kernel/ \ + arch/x86/mm/ \ + arch/x86/crypto/ \ + arch/x86/vdso/ +core-$(CONFIG_IA32_EMULATION) += arch/x86/ia32/ +drivers-$(CONFIG_PCI) += arch/x86/pci/ +drivers-$(CONFIG_OPROFILE) += arch/x86/oprofile/ -boot := arch/x86_64/boot +boot := arch/x86/boot PHONY += bzImage bzlilo install archmrproper \ fdimage fdimage144 fdimage288 isoimage archclean @@ -90,10 +93,12 @@ PHONY += bzImage bzlilo install archmrproper \ #Default target when executing "make" all: bzImage -BOOTIMAGE := arch/x86_64/boot/bzImage +BOOTIMAGE := arch/x86/boot/bzImage KBUILD_IMAGE := $(BOOTIMAGE) bzImage: vmlinux + $(Q)mkdir -p $(objtree)/arch/x86_64/boot + $(Q)ln -fsn $(objtree)/arch/x86/boot/bzImage $(objtree)/arch/x86_64/boot/bzImage $(Q)$(MAKE) $(build)=$(boot) $(BOOTIMAGE) bzlilo: vmlinux @@ -109,6 +114,7 @@ install: $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@ archclean: + $(Q)rm -rf $(objtree)/arch/x86_64/boot $(Q)$(MAKE) $(clean)=$(boot) define archhelp diff --git a/arch/x86_64/boot/.gitignore b/arch/x86_64/boot/.gitignore deleted file mode 100644 index 18465143cfa..00000000000 --- a/arch/x86_64/boot/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -bootsect -bzImage -setup -setup.bin -setup.elf diff --git a/arch/x86_64/boot/Makefile b/arch/x86_64/boot/Makefile deleted file mode 100644 index 67096389de1..00000000000 --- a/arch/x86_64/boot/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -# -# arch/x86_64/boot/Makefile -# -# The actual boot code is shared with i386 including the Makefile. -# So tell kbuild that we fetch the code from i386 and include the -# Makefile from i386 too. - -src := arch/i386/boot -include $(src)/Makefile diff --git a/arch/x86_64/boot/compressed/Makefile b/arch/x86_64/boot/compressed/Makefile deleted file mode 100644 index 877c0bdbbc6..00000000000 --- a/arch/x86_64/boot/compressed/Makefile +++ /dev/null @@ -1,30 +0,0 @@ -# -# linux/arch/x86_64/boot/compressed/Makefile -# -# create a compressed vmlinux image from the original vmlinux -# - -targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o - -CFLAGS := -m64 -D__KERNEL__ $(LINUXINCLUDE) -O2 \ - -fno-strict-aliasing -fPIC -mcmodel=small \ - $(call cc-option, -ffreestanding) \ - $(call cc-option, -fno-stack-protector) -AFLAGS := $(CFLAGS) -D__ASSEMBLY__ -LDFLAGS := -m elf_x86_64 - -LDFLAGS_vmlinux := -T -$(obj)/vmlinux: $(src)/vmlinux.lds $(obj)/head.o $(obj)/misc.o $(obj)/piggy.o FORCE - $(call if_changed,ld) - @: - -$(obj)/vmlinux.bin: vmlinux FORCE - $(call if_changed,objcopy) - -$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE - $(call if_changed,gzip) - -LDFLAGS_piggy.o := -r --format binary --oformat elf64-x86-64 -T - -$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE - $(call if_changed,ld) diff --git a/arch/x86_64/boot/compressed/head.S b/arch/x86_64/boot/compressed/head.S deleted file mode 100644 index 9fd8030cc54..00000000000 --- a/arch/x86_64/boot/compressed/head.S +++ /dev/null @@ -1,311 +0,0 @@ -/* - * linux/boot/head.S - * - * Copyright (C) 1991, 1992, 1993 Linus Torvalds - */ - -/* - * head.S contains the 32-bit startup code. - * - * NOTE!!! Startup happens at absolute address 0x00001000, which is also where - * the page directory will exist. The startup code will be overwritten by - * the page directory. [According to comments etc elsewhere on a compressed - * kernel it will end up at 0x1000 + 1Mb I hope so as I assume this. - AC] - * - * Page 0 is deliberately kept safe, since System Management Mode code in - * laptops may need to access the BIOS data stored there. This is also - * useful for future device drivers that either access the BIOS via VM86 - * mode. - */ - -/* - * High loaded stuff by Hans Lermen & Werner Almesberger, Feb. 1996 - */ -.code32 -.text - -#include <linux/linkage.h> -#include <asm/segment.h> -#include <asm/pgtable.h> -#include <asm/page.h> -#include <asm/msr.h> - -.section ".text.head" - .code32 - .globl startup_32 - -startup_32: - cld - cli - movl $(__KERNEL_DS), %eax - movl %eax, %ds - movl %eax, %es - movl %eax, %ss - -/* Calculate the delta between where we were compiled to run - * at and where we were actually loaded at. This can only be done - * with a short local call on x86. Nothing else will tell us what - * address we are running at. The reserved chunk of the real-mode - * data at 0x1e4 (defined as a scratch field) are used as the stack - * for this calculation. Only 4 bytes are needed. - */ - leal (0x1e4+4)(%esi), %esp - call 1f -1: popl %ebp - subl $1b, %ebp - -/* setup a stack and make sure cpu supports long mode. */ - movl $user_stack_end, %eax - addl %ebp, %eax - movl %eax, %esp - - call verify_cpu - testl %eax, %eax - jnz no_longmode - -/* Compute the delta between where we were compiled to run at - * and where the code will actually run at. - */ -/* %ebp contains the address we are loaded at by the boot loader and %ebx - * contains the address where we should move the kernel image temporarily - * for safe in-place decompression. - */ - -#ifdef CONFIG_RELOCATABLE - movl %ebp, %ebx - addl $(LARGE_PAGE_SIZE -1), %ebx - andl $LARGE_PAGE_MASK, %ebx -#else - movl $CONFIG_PHYSICAL_START, %ebx -#endif - - /* Replace the compressed data size with the uncompressed size */ - subl input_len(%ebp), %ebx - movl output_len(%ebp), %eax - addl %eax, %ebx - /* Add 8 bytes for every 32K input block */ - shrl $12, %eax - addl %eax, %ebx - /* Add 32K + 18 bytes of extra slack and align on a 4K boundary */ - addl $(32768 + 18 + 4095), %ebx - andl $~4095, %ebx - -/* - * Prepare for entering 64 bit mode - */ - - /* Load new GDT with the 64bit segments using 32bit descriptor */ - leal gdt(%ebp), %eax - movl %eax, gdt+2(%ebp) - lgdt gdt(%ebp) - - /* Enable PAE mode */ - xorl %eax, %eax - orl $(1 << 5), %eax - movl %eax, %cr4 - - /* - * Build early 4G boot pagetable - */ - /* Initialize Page tables to 0*/ - leal pgtable(%ebx), %edi - xorl %eax, %eax - movl $((4096*6)/4), %ecx - rep stosl - - /* Build Level 4 */ - leal pgtable + 0(%ebx), %edi - leal 0x1007 (%edi), %eax - movl %eax, 0(%edi) - - /* Build Level 3 */ - leal pgtable + 0x1000(%ebx), %edi - leal 0x1007(%edi), %eax - movl $4, %ecx -1: movl %eax, 0x00(%edi) - addl $0x00001000, %eax - addl $8, %edi - decl %ecx - jnz 1b - - /* Build Level 2 */ - leal pgtable + 0x2000(%ebx), %edi - movl $0x00000183, %eax - movl $2048, %ecx -1: movl %eax, 0(%edi) - addl $0x00200000, %eax - addl $8, %edi - decl %ecx - jnz 1b - - /* Enable the boot page tables */ - leal pgtable(%ebx), %eax - movl %eax, %cr3 - - /* Enable Long mode in EFER (Extended Feature Enable Register) */ - movl $MSR_EFER, %ecx - rdmsr - btsl $_EFER_LME, %eax - wrmsr - - /* Setup for the jump to 64bit mode - * - * When the jump is performend we will be in long mode but - * in 32bit compatibility mode with EFER.LME = 1, CS.L = 0, CS.D = 1 - * (and in turn EFER.LMA = 1). To jump into 64bit mode we use - * the new gdt/idt that has __KERNEL_CS with CS.L = 1. - * We place all of the values on our mini stack so lret can - * used to perform that far jump. - */ - pushl $__KERNEL_CS - leal startup_64(%ebp), %eax - pushl %eax - - /* Enter paged protected Mode, activating Long Mode */ - movl $0x80000001, %eax /* Enable Paging and Protected mode */ - movl %eax, %cr0 - - /* Jump from 32bit compatibility mode into 64bit mode. */ - lret - -no_longmode: - /* This isn't an x86-64 CPU so hang */ -1: - hlt - jmp 1b - -#include "../../kernel/verify_cpu.S" - - /* Be careful here startup_64 needs to be at a predictable - * address so I can export it in an ELF header. Bootloaders - * should look at the ELF header to find this address, as - * it may change in the future. - */ - .code64 - .org 0x200 -ENTRY(startup_64) - /* We come here either from startup_32 or directly from a - * 64bit bootloader. If we come here from a bootloader we depend on - * an identity mapped page table being provied that maps our - * entire text+data+bss and hopefully all of memory. - */ - - /* Setup data segments. */ - xorl %eax, %eax - movl %eax, %ds - movl %eax, %es - movl %eax, %ss - movl %eax, %fs - movl %eax, %gs - lldt %ax - movl $0x20, %eax - ltr %ax - - /* Compute the decompressed kernel start address. It is where - * we were loaded at aligned to a 2M boundary. %rbp contains the - * decompressed kernel start address. - * - * If it is a relocatable kernel then decompress and run the kernel - * from load address aligned to 2MB addr, otherwise decompress and - * run the kernel from CONFIG_PHYSICAL_START - */ - - /* Start with the delta to where the kernel will run at. */ -#ifdef CONFIG_RELOCATABLE - leaq startup_32(%rip) /* - $startup_32 */, %rbp - addq $(LARGE_PAGE_SIZE - 1), %rbp - andq $LARGE_PAGE_MASK, %rbp - movq %rbp, %rbx -#else - movq $CONFIG_PHYSICAL_START, %rbp - movq %rbp, %rbx -#endif - - /* Replace the compressed data size with the uncompressed size */ - movl input_len(%rip), %eax - subq %rax, %rbx - movl output_len(%rip), %eax - addq %rax, %rbx - /* Add 8 bytes for every 32K input block */ - shrq $12, %rax - addq %rax, %rbx - /* Add 32K + 18 bytes of extra slack and align on a 4K boundary */ - addq $(32768 + 18 + 4095), %rbx - andq $~4095, %rbx - -/* Copy the compressed kernel to the end of our buffer - * where decompression in place becomes safe. - */ - leaq _end(%rip), %r8 - leaq _end(%rbx), %r9 - movq $_end /* - $startup_32 */, %rcx -1: subq $8, %r8 - subq $8, %r9 - movq 0(%r8), %rax - movq %rax, 0(%r9) - subq $8, %rcx - jnz 1b - -/* - * Jump to the relocated address. - */ - leaq relocated(%rbx), %rax - jmp *%rax - -.section ".text" -relocated: - -/* - * Clear BSS - */ - xorq %rax, %rax - leaq _edata(%rbx), %rdi - leaq _end(%rbx), %rcx - subq %rdi, %rcx - cld - rep - stosb - - /* Setup the stack */ - leaq user_stack_end(%rip), %rsp - - /* zero EFLAGS after setting rsp */ - pushq $0 - popfq - -/* - * Do the decompression, and jump to the new kernel.. - */ - pushq %rsi # Save the real mode argument - movq %rsi, %rdi # real mode address - leaq _heap(%rip), %rsi # _heap - leaq input_data(%rip), %rdx # input_data - movl input_len(%rip), %eax - movq %rax, %rcx # input_len - movq %rbp, %r8 # output - call decompress_kernel - popq %rsi - - -/* - * Jump to the decompressed kernel. - */ - jmp *%rbp - - .data -gdt: - .word gdt_end - gdt - .long gdt - .word 0 - .quad 0x0000000000000000 /* NULL descriptor */ - .quad 0x00af9a000000ffff /* __KERNEL_CS */ - .quad 0x00cf92000000ffff /* __KERNEL_DS */ - .quad 0x0080890000000000 /* TS descriptor */ - .quad 0x0000000000000000 /* TS continued */ -gdt_end: - .bss -/* Stack for uncompression */ - .balign 4 -user_stack: - .fill 4096,4,0 -user_stack_end: diff --git a/arch/x86_64/boot/tools/.gitignore b/arch/x86_64/boot/tools/.gitignore deleted file mode 100644 index 378eac25d31..00000000000 --- a/arch/x86_64/boot/tools/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build diff --git a/arch/x86_64/crypto/Makefile b/arch/x86_64/crypto/Makefile deleted file mode 100644 index 15b538a8b7f..00000000000 --- a/arch/x86_64/crypto/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# -# x86_64/crypto/Makefile -# -# Arch-specific CryptoAPI modules. -# - -obj-$(CONFIG_CRYPTO_AES_X86_64) += aes-x86_64.o -obj-$(CONFIG_CRYPTO_TWOFISH_X86_64) += twofish-x86_64.o - -aes-x86_64-y := aes-x86_64-asm.o aes.o -twofish-x86_64-y := twofish-x86_64-asm.o twofish.o - diff --git a/arch/x86_64/ia32/audit.c b/arch/x86_64/ia32/audit.c deleted file mode 100644 index 8850fe40ea3..00000000000 --- a/arch/x86_64/ia32/audit.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <asm-i386/unistd.h> - -unsigned ia32_dir_class[] = { -#include <asm-generic/audit_dir_write.h> -~0U -}; - -unsigned ia32_chattr_class[] = { -#include <asm-generic/audit_change_attr.h> -~0U -}; - -unsigned ia32_write_class[] = { -#include <asm-generic/audit_write.h> -~0U -}; - -unsigned ia32_read_class[] = { -#include <asm-generic/audit_read.h> -~0U -}; - -unsigned ia32_signal_class[] = { -#include <asm-generic/audit_signal.h> -~0U -}; - -int ia32_classify_syscall(unsigned syscall) -{ - switch(syscall) { - case __NR_open: - return 2; - case __NR_openat: - return 3; - case __NR_socketcall: - return 4; - case __NR_execve: - return 5; - default: - return 1; - } -} diff --git a/arch/x86_64/ia32/ipc32.c b/arch/x86_64/ia32/ipc32.c deleted file mode 100644 index 369151dc321..00000000000 --- a/arch/x86_64/ia32/ipc32.c +++ /dev/null @@ -1,57 +0,0 @@ -#include <linux/kernel.h> -#include <linux/spinlock.h> -#include <linux/list.h> -#include <linux/syscalls.h> -#include <linux/time.h> -#include <linux/sem.h> -#include <linux/msg.h> -#include <linux/shm.h> -#include <linux/ipc.h> -#include <linux/compat.h> - -#include <asm-i386/ipc.h> - -asmlinkage long -sys32_ipc(u32 call, int first, int second, int third, - compat_uptr_t ptr, u32 fifth) -{ - int version; - - version = call >> 16; /* hack for backward compatibility */ - call &= 0xffff; - - switch (call) { - case SEMOP: - /* struct sembuf is the same on 32 and 64bit :)) */ - return sys_semtimedop(first, compat_ptr(ptr), second, NULL); - case SEMTIMEDOP: - return compat_sys_semtimedop(first, compat_ptr(ptr), second, - compat_ptr(fifth)); - case SEMGET: - return sys_semget(first, second, third); - case SEMCTL: - return compat_sys_semctl(first, second, third, compat_ptr(ptr)); - - case MSGSND: - return compat_sys_msgsnd(first, second, third, compat_ptr(ptr)); - case MSGRCV: - return compat_sys_msgrcv(first, second, fifth, third, - version, compat_ptr(ptr)); - case MSGGET: - return sys_msgget((key_t) first, second); - case MSGCTL: - return compat_sys_msgctl(first, second, compat_ptr(ptr)); - - case SHMAT: - return compat_sys_shmat(first, second, third, version, - compat_ptr(ptr)); - break; - case SHMDT: - return sys_shmdt(compat_ptr(ptr)); - case SHMGET: - return sys_shmget(first, (unsigned)second, third); - case SHMCTL: - return compat_sys_shmctl(first, second, compat_ptr(ptr)); - } - return -ENOSYS; -} diff --git a/arch/x86_64/ia32/syscall32_syscall.S b/arch/x86_64/ia32/syscall32_syscall.S deleted file mode 100644 index 8f8271bdf13..00000000000 --- a/arch/x86_64/ia32/syscall32_syscall.S +++ /dev/null @@ -1,17 +0,0 @@ -/* 32bit VDSOs mapped into user space. */ - - .section ".init.data","aw" - - .globl syscall32_syscall - .globl syscall32_syscall_end - -syscall32_syscall: - .incbin "arch/x86_64/ia32/vsyscall-syscall.so" -syscall32_syscall_end: - - .globl syscall32_sysenter - .globl syscall32_sysenter_end - -syscall32_sysenter: - .incbin "arch/x86_64/ia32/vsyscall-sysenter.so" -syscall32_sysenter_end: diff --git a/arch/x86_64/ia32/vsyscall-sigreturn.S b/arch/x86_64/ia32/vsyscall-sigreturn.S deleted file mode 100644 index 1384367cdbe..00000000000 --- a/arch/x86_64/ia32/vsyscall-sigreturn.S +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Common code for the sigreturn entry points on the vsyscall page. - * This code uses SYSCALL_ENTER_KERNEL (either syscall or int $0x80) - * to enter the kernel. - * This file is #include'd by vsyscall-*.S to define them after the - * vsyscall entry point. The addresses we get for these entry points - * by doing ".balign 32" must match in both versions of the page. - */ - - .code32 - .section .text.sigreturn,"ax" - .balign 32 - .globl __kernel_sigreturn - .type __kernel_sigreturn,@function -__kernel_sigreturn: -.LSTART_sigreturn: - popl %eax - movl $__NR_ia32_sigreturn, %eax - SYSCALL_ENTER_KERNEL -.LEND_sigreturn: - .size __kernel_sigreturn,.-.LSTART_sigreturn - - .section .text.rtsigreturn,"ax" - .balign 32 - .globl __kernel_rt_sigreturn - .type __kernel_rt_sigreturn,@function -__kernel_rt_sigreturn: -.LSTART_rt_sigreturn: - movl $__NR_ia32_rt_sigreturn, %eax - SYSCALL_ENTER_KERNEL -.LEND_rt_sigreturn: - .size __kernel_rt_sigreturn,.-.LSTART_rt_sigreturn - - .section .eh_frame,"a",@progbits -.LSTARTFRAMES: - .long .LENDCIES-.LSTARTCIES -.LSTARTCIES: - .long 0 /* CIE ID */ - .byte 1 /* Version number */ - .string "zRS" /* NUL-terminated augmentation string */ - .uleb128 1 /* Code alignment factor */ - .sleb128 -4 /* Data alignment factor */ - .byte 8 /* Return address register column */ - .uleb128 1 /* Augmentation value length */ - .byte 0x1b /* DW_EH_PE_pcrel|DW_EH_PE_sdata4. */ - .byte 0x0c /* DW_CFA_def_cfa */ - .uleb128 4 - .uleb128 4 - .byte 0x88 /* DW_CFA_offset, column 0x8 */ - .uleb128 1 - .align 4 -.LENDCIES: - - .long .LENDFDE2-.LSTARTFDE2 /* Length FDE */ -.LSTARTFDE2: - .long .LSTARTFDE2-.LSTARTFRAMES /* CIE pointer */ - /* HACK: The dwarf2 unwind routines will subtract 1 from the - return address to get an address in the middle of the - presumed call instruction. Since we didn't get here via - a call, we need to include the nop before the real start - to make up for it. */ - .long .LSTART_sigreturn-1-. /* PC-relative start address */ - .long .LEND_sigreturn-.LSTART_sigreturn+1 - .uleb128 0 /* Augmentation length */ - /* What follows are the instructions for the table generation. - We record the locations of each register saved. This is - complicated by the fact that the "CFA" is always assumed to - be the value of the stack pointer in the caller. This means - that we must define the CFA of this body of code to be the - saved value of the stack pointer in the sigcontext. Which - also means that there is no fixed relation to the other - saved registers, which means that we must use DW_CFA_expression - to compute their addresses. It also means that when we - adjust the stack with the popl, we have to do it all over again. */ - -#define do_cfa_expr(offset) \ - .byte 0x0f; /* DW_CFA_def_cfa_expression */ \ - .uleb128 1f-0f; /* length */ \ -0: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ - .byte 0x06; /* DW_OP_deref */ \ -1: - -#define do_expr(regno, offset) \ - .byte 0x10; /* DW_CFA_expression */ \ - .uleb128 regno; /* regno */ \ - .uleb128 1f-0f; /* length */ \ -0: .byte 0x74; /* DW_OP_breg4 */ \ - .sleb128 offset; /* offset */ \ -1: - - do_cfa_expr(IA32_SIGCONTEXT_esp+4) - do_expr(0, IA32_SIGCONTEXT_eax+4) - do_expr(1, IA32_SIGCONTEXT_ecx+4) - do_expr(2, IA32_SIGCONTEXT_edx+4) - do_expr(3, IA32_SIGCONTEXT_ebx+4) - do_expr(5, IA32_SIGCONTEXT_ebp+4) - do_expr(6, IA32_SIGCONTEXT_esi+4) - do_expr(7, IA32_SIGCONTEXT_edi+4) - do_expr(8, IA32_SIGCONTEXT_eip+4) - - .byte 0x42 /* DW_CFA_advance_loc 2 -- nop; popl eax. */ - - do_cfa_expr(IA32_SIGCONTEXT_esp) - do_expr(0, IA32_SIGCONTEXT_eax) - do_expr(1, IA32_SIGCONTEXT_ecx) - do_expr(2, IA32_SIGCONTEXT_edx) - do_expr(3, IA32_SIGCONTEXT_ebx) - do_expr(5, IA32_SIGCONTEXT_ebp) - do_expr(6, IA32_SIGCONTEXT_esi) - do_expr(7, IA32_SIGCONTEXT_edi) - do_expr(8, IA32_SIGCONTEXT_eip) - - .align 4 -.LENDFDE2: - - .long .LENDFDE3-.LSTARTFDE3 /* Length FDE */ -.LSTARTFDE3: - .long .LSTARTFDE3-.LSTARTFRAMES /* CIE pointer */ - /* HACK: See above wrt unwind library assumptions. */ - .long .LSTART_rt_sigreturn-1-. /* PC-relative start address */ - .long .LEND_rt_sigreturn-.LSTART_rt_sigreturn+1 - .uleb128 0 /* Augmentation */ - /* What follows are the instructions for the table generation. - We record the locations of each register saved. This is - slightly less complicated than the above, since we don't - modify the stack pointer in the process. */ - - do_cfa_expr(IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esp) - do_expr(0, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eax) - do_expr(1, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ecx) - do_expr(2, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edx) - do_expr(3, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebx) - do_expr(5, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_ebp) - do_expr(6, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_esi) - do_expr(7, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_edi) - do_expr(8, IA32_RT_SIGFRAME_sigcontext-4 + IA32_SIGCONTEXT_eip) - - .align 4 -.LENDFDE3: - -#include "../../i386/kernel/vsyscall-note.S" - diff --git a/arch/x86_64/kernel/Makefile b/arch/x86_64/kernel/Makefile deleted file mode 100644 index ff5d8c9b96d..00000000000 --- a/arch/x86_64/kernel/Makefile +++ /dev/null @@ -1,63 +0,0 @@ -# -# Makefile for the linux kernel. -# - -extra-y := head.o head64.o init_task.o vmlinux.lds -EXTRA_AFLAGS := -traditional -obj-y := process.o signal.o entry.o traps.o irq.o \ - ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \ - x8664_ksyms.o i387.o syscall.o vsyscall.o \ - setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \ - pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o bugs.o \ - perfctr-watchdog.o - -obj-$(CONFIG_STACKTRACE) += stacktrace.o -obj-$(CONFIG_X86_MCE) += mce.o therm_throt.o -obj-$(CONFIG_X86_MCE_INTEL) += mce_intel.o -obj-$(CONFIG_X86_MCE_AMD) += mce_amd.o -obj-$(CONFIG_MTRR) += ../../i386/kernel/cpu/mtrr/ -obj-$(CONFIG_ACPI) += acpi/ -obj-$(CONFIG_X86_MSR) += msr.o -obj-$(CONFIG_MICROCODE) += microcode.o -obj-$(CONFIG_X86_CPUID) += cpuid.o -obj-$(CONFIG_SMP) += smp.o smpboot.o trampoline.o tsc_sync.o -obj-y += apic.o nmi.o -obj-y += io_apic.o mpparse.o genapic.o genapic_flat.o -obj-$(CONFIG_KEXEC) += machine_kexec.o relocate_kernel.o crash.o -obj-$(CONFIG_CRASH_DUMP) += crash_dump.o -obj-$(CONFIG_PM) += suspend.o -obj-$(CONFIG_HIBERNATION) += suspend_asm.o -obj-$(CONFIG_CPU_FREQ) += cpufreq/ -obj-$(CONFIG_EARLY_PRINTK) += early_printk.o -obj-$(CONFIG_IOMMU) += pci-gart.o aperture.o -obj-$(CONFIG_CALGARY_IOMMU) += pci-calgary.o tce.o -obj-$(CONFIG_SWIOTLB) += pci-swiotlb.o -obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o -obj-$(CONFIG_X86_VSMP) += vsmp.o -obj-$(CONFIG_K8_NB) += k8.o -obj-$(CONFIG_AUDIT) += audit.o - -obj-$(CONFIG_MODULES) += module.o -obj-$(CONFIG_PCI) += early-quirks.o - -obj-y += topology.o -obj-y += intel_cacheinfo.o -obj-y += addon_cpuid_features.o -obj-y += pcspeaker.o - -CFLAGS_vsyscall.o := $(PROFILING) -g0 - -therm_throt-y += ../../i386/kernel/cpu/mcheck/therm_throt.o -bootflag-y += ../../i386/kernel/bootflag.o -cpuid-$(subst m,y,$(CONFIG_X86_CPUID)) += ../../i386/kernel/cpuid.o -topology-y += ../../i386/kernel/topology.o -microcode-$(subst m,y,$(CONFIG_MICROCODE)) += ../../i386/kernel/microcode.o -intel_cacheinfo-y += ../../i386/kernel/cpu/intel_cacheinfo.o -addon_cpuid_features-y += ../../i386/kernel/cpu/addon_cpuid_features.o -quirks-y += ../../i386/kernel/quirks.o -i8237-y += ../../i386/kernel/i8237.o -msr-$(subst m,y,$(CONFIG_X86_MSR)) += ../../i386/kernel/msr.o -alternative-y += ../../i386/kernel/alternative.o -pcspeaker-y += ../../i386/kernel/pcspeaker.o -perfctr-watchdog-y += ../../i386/kernel/cpu/perfctr-watchdog.o diff --git a/arch/x86_64/kernel/acpi/Makefile b/arch/x86_64/kernel/acpi/Makefile deleted file mode 100644 index 080b9963f1b..00000000000 --- a/arch/x86_64/kernel/acpi/Makefile +++ /dev/null @@ -1,9 +0,0 @@ -obj-y := boot.o -boot-y := ../../../i386/kernel/acpi/boot.o -obj-$(CONFIG_ACPI_SLEEP) += sleep.o wakeup.o - -ifneq ($(CONFIG_ACPI_PROCESSOR),) -obj-y += processor.o -processor-y := ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o -endif - diff --git a/arch/x86_64/kernel/acpi/wakeup.S b/arch/x86_64/kernel/acpi/wakeup.S deleted file mode 100644 index a06f2bcabef..00000000000 --- a/arch/x86_64/kernel/acpi/wakeup.S +++ /dev/null @@ -1,456 +0,0 @@ -.text -#include <linux/linkage.h> -#include <asm/segment.h> -#include <asm/pgtable.h> -#include <asm/page.h> -#include <asm/msr.h> - -# Copyright 2003 Pavel Machek <pavel@suse.cz>, distribute under GPLv2 -# -# wakeup_code runs in real mode, and at unknown address (determined at run-time). -# Therefore it must only use relative jumps/calls. -# -# Do we need to deal with A20? It is okay: ACPI specs says A20 must be enabled -# -# If physical address of wakeup_code is 0x12345, BIOS should call us with -# cs = 0x1234, eip = 0x05 -# - -#define BEEP \ - inb $97, %al; \ - outb %al, $0x80; \ - movb $3, %al; \ - outb %al, $97; \ - outb %al, $0x80; \ - movb $-74, %al; \ - outb %al, $67; \ - outb %al, $0x80; \ - movb $-119, %al; \ - outb %al, $66; \ - outb %al, $0x80; \ - movb $15, %al; \ - outb %al, $66; - - -ALIGN - .align 16 -ENTRY(wakeup_start) -wakeup_code: - wakeup_code_start = . - .code16 - -# Running in *copy* of this code, somewhere in low 1MB. - - movb $0xa1, %al ; outb %al, $0x80 - cli - cld - # setup data segment - movw %cs, %ax - movw %ax, %ds # Make ds:0 point to wakeup_start - movw %ax, %ss - - # Data segment must be set up before we can see whether to beep. - testl $4, realmode_flags - wakeup_code - jz 1f - BEEP -1: - - # Private stack is needed for ASUS board - mov $(wakeup_stack - wakeup_code), %sp - - pushl $0 # Kill any dangerous flags - popfl - - movl real_magic - wakeup_code, %eax - cmpl $0x12345678, %eax - jne bogus_real_magic - - call verify_cpu # Verify the cpu supports long - # mode - testl %eax, %eax - jnz no_longmode - - testl $1, realmode_flags - wakeup_code - jz 1f - lcall $0xc000,$3 - movw %cs, %ax - movw %ax, %ds # Bios might have played with that - movw %ax, %ss -1: - - testl $2, realmode_flags - wakeup_code - jz 1f - mov video_mode - wakeup_code, %ax - call mode_set -1: - - movw $0xb800, %ax - movw %ax,%fs - movw $0x0e00 + 'L', %fs:(0x10) - - movb $0xa2, %al ; outb %al, $0x80 - - mov %ds, %ax # Find 32bit wakeup_code addr - movzx %ax, %esi # (Convert %ds:gdt to a liner ptr) - shll $4, %esi - # Fix up the vectors - addl %esi, wakeup_32_vector - wakeup_code - addl %esi, wakeup_long64_vector - wakeup_code - addl %esi, gdt_48a + 2 - wakeup_code # Fixup the gdt pointer - - lidtl %ds:idt_48a - wakeup_code - lgdtl %ds:gdt_48a - wakeup_code # load gdt with whatever is - # appropriate - - movl $1, %eax # protected mode (PE) bit - lmsw %ax # This is it! - jmp 1f -1: - - ljmpl *(wakeup_32_vector - wakeup_code) - - .balign 4 -wakeup_32_vector: - .long wakeup_32 - wakeup_code - .word __KERNEL32_CS, 0 - - .code32 -wakeup_32: -# Running in this code, but at low address; paging is not yet turned on. - movb $0xa5, %al ; outb %al, $0x80 - - movl $__KERNEL_DS, %eax - movl %eax, %ds - - movw $0x0e00 + 'i', %ds:(0xb8012) - movb $0xa8, %al ; outb %al, $0x80; - - /* - * Prepare for entering 64bits mode - */ - - /* Enable PAE */ - xorl %eax, %eax - btsl $5, %eax - movl %eax, %cr4 - - /* Setup early boot stage 4 level pagetables */ - leal (wakeup_level4_pgt - wakeup_code)(%esi), %eax - movl %eax, %cr3 - - /* Check if nx is implemented */ - movl $0x80000001, %eax - cpuid - movl %edx,%edi - - /* Enable Long Mode */ - xorl %eax, %eax - btsl $_EFER_LME, %eax - - /* No Execute supported? */ - btl $20,%edi - jnc 1f - btsl $_EFER_NX, %eax - - /* Make changes effective */ -1: movl $MSR_EFER, %ecx - xorl %edx, %edx - wrmsr - - xorl %eax, %eax - btsl $31, %eax /* Enable paging and in turn activate Long Mode */ - btsl $0, %eax /* Enable protected mode */ - - /* Make changes effective */ - movl %eax, %cr0 - - /* At this point: - CR4.PAE must be 1 - CS.L must be 0 - CR3 must point to PML4 - Next instruction must be a branch - This must be on identity-mapped page - */ - /* - * At this point we're in long mode but in 32bit compatibility mode - * with EFER.LME = 1, CS.L = 0, CS.D = 1 (and in turn - * EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we load - * the new gdt/idt that has __KERNEL_CS with CS.L = 1. - */ - - /* Finally jump in 64bit mode */ - ljmp *(wakeup_long64_vector - wakeup_code)(%esi) - - .balign 4 -wakeup_long64_vector: - .long wakeup_long64 - wakeup_code - .word __KERNEL_CS, 0 - -.code64 - - /* Hooray, we are in Long 64-bit mode (but still running in - * low memory) - */ -wakeup_long64: - /* - * We must switch to a new descriptor in kernel space for the GDT - * because soon the kernel won't have access anymore to the userspace - * addresses where we're currently running on. We have to do that here - * because in 32bit we couldn't load a 64bit linear address. - */ - lgdt cpu_gdt_descr - - movw $0x0e00 + 'n', %ds:(0xb8014) - movb $0xa9, %al ; outb %al, $0x80 - - movq saved_magic, %rax - movq $0x123456789abcdef0, %rdx - cmpq %rdx, %rax - jne bogus_64_magic - - movw $0x0e00 + 'u', %ds:(0xb8016) - - nop - nop - movw $__KERNEL_DS, %ax - movw %ax, %ss - movw %ax, %ds - movw %ax, %es - movw %ax, %fs - movw %ax, %gs - movq saved_rsp, %rsp - - movw $0x0e00 + 'x', %ds:(0xb8018) - movq saved_rbx, %rbx - movq saved_rdi, %rdi - movq saved_rsi, %rsi - movq saved_rbp, %rbp - - movw $0x0e00 + '!', %ds:(0xb801a) - movq saved_rip, %rax - jmp *%rax - -.code32 - - .align 64 -gdta: - /* Its good to keep gdt in sync with one in trampoline.S */ - .word 0, 0, 0, 0 # dummy - /* ??? Why I need the accessed bit set in order for this to work? */ - .quad 0x00cf9b000000ffff # __KERNEL32_CS - .quad 0x00af9b000000ffff # __KERNEL_CS - .quad 0x00cf93000000ffff # __KERNEL_DS - -idt_48a: - .word 0 # idt limit = 0 - .word 0, 0 # idt base = 0L - -gdt_48a: - .word 0x800 # gdt limit=2048, - # 256 GDT entries - .long gdta - wakeup_code # gdt base (relocated in later) - -real_magic: .quad 0 -video_mode: .quad 0 -realmode_flags: .quad 0 - -.code16 -bogus_real_magic: - movb $0xba,%al ; outb %al,$0x80 - jmp bogus_real_magic - -.code64 -bogus_64_magic: - movb $0xb3,%al ; outb %al,$0x80 - jmp bogus_64_magic - -.code16 -no_longmode: - movb $0xbc,%al ; outb %al,$0x80 - jmp no_longmode - -#include "../verify_cpu.S" - -/* This code uses an extended set of video mode numbers. These include: - * Aliases for standard modes - * NORMAL_VGA (-1) - * EXTENDED_VGA (-2) - * ASK_VGA (-3) - * Video modes numbered by menu position -- NOT RECOMMENDED because of lack - * of compatibility when extending the table. These are between 0x00 and 0xff. - */ -#define VIDEO_FIRST_MENU 0x0000 - -/* Standard BIOS video modes (BIOS number + 0x0100) */ -#define VIDEO_FIRST_BIOS 0x0100 - -/* VESA BIOS video modes (VESA number + 0x0200) */ -#define VIDEO_FIRST_VESA 0x0200 - -/* Video7 special modes (BIOS number + 0x0900) */ -#define VIDEO_FIRST_V7 0x0900 - -# Setting of user mode (AX=mode ID) => CF=success - -# For now, we only handle VESA modes (0x0200..0x03ff). To handle other -# modes, we should probably compile in the video code from the boot -# directory. -.code16 -mode_set: - movw %ax, %bx - subb $VIDEO_FIRST_VESA>>8, %bh - cmpb $2, %bh - jb check_vesa - -setbad: - clc - ret - -check_vesa: - orw $0x4000, %bx # Use linear frame buffer - movw $0x4f02, %ax # VESA BIOS mode set call - int $0x10 - cmpw $0x004f, %ax # AL=4f if implemented - jnz setbad # AH=0 if OK - - stc - ret - -wakeup_stack_begin: # Stack grows down - -.org 0xff0 -wakeup_stack: # Just below end of page - -.org 0x1000 -ENTRY(wakeup_level4_pgt) - .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE - .fill 510,8,0 - /* (2^48-(2*1024*1024*1024))/(2^39) = 511 */ - .quad level3_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE - -ENTRY(wakeup_end) - -## -# acpi_copy_wakeup_routine -# -# Copy the above routine to low memory. -# -# Parameters: -# %rdi: place to copy wakeup routine to -# -# Returned address is location of code in low memory (past data and stack) -# - .code64 -ENTRY(acpi_copy_wakeup_routine) - pushq %rax - pushq %rdx - - movl saved_video_mode, %edx - movl %edx, video_mode - wakeup_start (,%rdi) - movl acpi_realmode_flags, %edx - movl %edx, realmode_flags - wakeup_start (,%rdi) - movq $0x12345678, real_magic - wakeup_start (,%rdi) - movq $0x123456789abcdef0, %rdx - movq %rdx, saved_magic - - movq saved_magic, %rax - movq $0x123456789abcdef0, %rdx - cmpq %rdx, %rax - jne bogus_64_magic - - # restore the regs we used - popq %rdx - popq %rax -ENTRY(do_suspend_lowlevel_s4bios) - ret - - .align 2 - .p2align 4,,15 -.globl do_suspend_lowlevel - .type do_suspend_lowlevel,@function -do_suspend_lowlevel: -.LFB5: - subq $8, %rsp - xorl %eax, %eax - call save_processor_state - - movq %rsp, saved_context_esp(%rip) - movq %rax, saved_context_eax(%rip) - movq %rbx, saved_context_ebx(%rip) - movq %rcx, saved_context_ecx(%rip) - movq %rdx, saved_context_edx(%rip) - movq %rbp, saved_context_ebp(%rip) - movq %rsi, saved_context_esi(%rip) - movq %rdi, saved_context_edi(%rip) - movq %r8, saved_context_r08(%rip) - movq %r9, saved_context_r09(%rip) - movq %r10, saved_context_r10(%rip) - movq %r11, saved_context_r11(%rip) - movq %r12, saved_context_r12(%rip) - movq %r13, saved_context_r13(%rip) - movq %r14, saved_context_r14(%rip) - movq %r15, saved_context_r15(%rip) - pushfq ; popq saved_context_eflags(%rip) - - movq $.L97, saved_rip(%rip) - - movq %rsp,saved_rsp - movq %rbp,saved_rbp - movq %rbx,saved_rbx - movq %rdi,saved_rdi - movq %rsi,saved_rsi - - addq $8, %rsp - movl $3, %edi - xorl %eax, %eax - jmp acpi_enter_sleep_state -.L97: - .p2align 4,,7 -.L99: - .align 4 - movl $24, %eax - movw %ax, %ds - movq saved_context+58(%rip), %rax - movq %rax, %cr4 - movq saved_context+50(%rip), %rax - movq %rax, %cr3 - movq saved_context+42(%rip), %rax - movq %rax, %cr2 - movq saved_context+34(%rip), %rax - movq %rax, %cr0 - pushq saved_context_eflags(%rip) ; popfq - movq saved_context_esp(%rip), %rsp - movq saved_context_ebp(%rip), %rbp - movq saved_context_eax(%rip), %rax - movq saved_context_ebx(%rip), %rbx - movq saved_context_ecx(%rip), %rcx - movq saved_context_edx(%rip), %rdx - movq saved_context_esi(%rip), %rsi - movq saved_context_edi(%rip), %rdi - movq saved_context_r08(%rip), %r8 - movq saved_context_r09(%rip), %r9 - movq saved_context_r10(%rip), %r10 - movq saved_context_r11(%rip), %r11 - movq saved_context_r12(%rip), %r12 - movq saved_context_r13(%rip), %r13 - movq saved_context_r14(%rip), %r14 - movq saved_context_r15(%rip), %r15 - - xorl %eax, %eax - addq $8, %rsp - jmp restore_processor_state -.LFE5: -.Lfe5: - .size do_suspend_lowlevel,.Lfe5-do_suspend_lowlevel - -.data -ALIGN -ENTRY(saved_rbp) .quad 0 -ENTRY(saved_rsi) .quad 0 -ENTRY(saved_rdi) .quad 0 -ENTRY(saved_rbx) .quad 0 - -ENTRY(saved_rip) .quad 0 -ENTRY(saved_rsp) .quad 0 - -ENTRY(saved_magic) .quad 0 diff --git a/arch/x86_64/kernel/cpufreq/Makefile b/arch/x86_64/kernel/cpufreq/Makefile deleted file mode 100644 index 753ce1dd418..00000000000 --- a/arch/x86_64/kernel/cpufreq/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# -# Reuse the i386 cpufreq drivers -# - -SRCDIR := ../../../i386/kernel/cpu/cpufreq - -obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o -obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o -obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o -obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o -obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o - -powernow-k8-objs := ${SRCDIR}/powernow-k8.o -speedstep-centrino-objs := ${SRCDIR}/speedstep-centrino.o -acpi-cpufreq-objs := ${SRCDIR}/acpi-cpufreq.o -p4-clockmod-objs := ${SRCDIR}/p4-clockmod.o -speedstep-lib-objs := ${SRCDIR}/speedstep-lib.o diff --git a/arch/x86_64/kernel/syscall.c b/arch/x86_64/kernel/syscall.c deleted file mode 100644 index 63d592c276c..00000000000 --- a/arch/x86_64/kernel/syscall.c +++ /dev/null @@ -1,26 +0,0 @@ -/* System call table for x86-64. */ - -#include <linux/linkage.h> -#include <linux/sys.h> -#include <linux/cache.h> -#include <asm/asm-offsets.h> - -#define __NO_STUBS - -#define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; -#undef _ASM_X86_64_UNISTD_H_ -#include <asm-x86_64/unistd.h> - -#undef __SYSCALL -#define __SYSCALL(nr, sym) [ nr ] = sym, -#undef _ASM_X86_64_UNISTD_H_ - -typedef void (*sys_call_ptr_t)(void); - -extern void sys_ni_syscall(void); - -const sys_call_ptr_t sys_call_table[__NR_syscall_max+1] = { - /* Smells like a like a compiler bug -- it doesn't work when the & below is removed. */ - [0 ... __NR_syscall_max] = &sys_ni_syscall, -#include <asm-x86_64/unistd.h> -}; diff --git a/arch/x86_64/kernel/trampoline.S b/arch/x86_64/kernel/trampoline.S deleted file mode 100644 index e7e2764c461..00000000000 --- a/arch/x86_64/kernel/trampoline.S +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * Trampoline.S Derived from Setup.S by Linus Torvalds - * - * 4 Jan 1997 Michael Chastain: changed to gnu as. - * 15 Sept 2005 Eric Biederman: 64bit PIC support - * - * Entry: CS:IP point to the start of our code, we are - * in real mode with no stack, but the rest of the - * trampoline page to make our stack and everything else - * is a mystery. - * - * In fact we don't actually need a stack so we don't - * set one up. - * - * On entry to trampoline_data, the processor is in real mode - * with 16-bit addressing and 16-bit data. CS has some value - * and IP is zero. Thus, data addresses need to be absolute - * (no relocation) and are taken with regard to r_base. - * - * With the addition of trampoline_level4_pgt this code can - * now enter a 64bit kernel that lives at arbitrary 64bit - * physical addresses. - * - * If you work on this file, check the object module with objdump - * --full-contents --reloc to make sure there are no relocation - * entries. - */ - -#include <linux/linkage.h> -#include <asm/pgtable.h> -#include <asm/page.h> -#include <asm/msr.h> -#include <asm/segment.h> - -.data - -.code16 - -ENTRY(trampoline_data) -r_base = . - cli # We should be safe anyway - wbinvd - mov %cs, %ax # Code and data in the same place - mov %ax, %ds - mov %ax, %es - mov %ax, %ss - - - movl $0xA5A5A5A5, trampoline_data - r_base - # write marker for master knows we're running - - # Setup stack - movw $(trampoline_stack_end - r_base), %sp - - call verify_cpu # Verify the cpu supports long mode - testl %eax, %eax # Check for return code - jnz no_longmode - - mov %cs, %ax - movzx %ax, %esi # Find the 32bit trampoline location - shll $4, %esi - - # Fixup the vectors - addl %esi, startup_32_vector - r_base - addl %esi, startup_64_vector - r_base - addl %esi, tgdt + 2 - r_base # Fixup the gdt pointer - - /* - * GDT tables in non default location kernel can be beyond 16MB and - * lgdt will not be able to load the address as in real mode default - * operand size is 16bit. Use lgdtl instead to force operand size - * to 32 bit. - */ - - lidtl tidt - r_base # load idt with 0, 0 - lgdtl tgdt - r_base # load gdt with whatever is appropriate - - xor %ax, %ax - inc %ax # protected mode (PE) bit - lmsw %ax # into protected mode - - # flush prefetch and jump to startup_32 - ljmpl *(startup_32_vector - r_base) - - .code32 - .balign 4 -startup_32: - movl $__KERNEL_DS, %eax # Initialize the %ds segment register - movl %eax, %ds - - xorl %eax, %eax - btsl $5, %eax # Enable PAE mode - movl %eax, %cr4 - - # Setup trampoline 4 level pagetables - leal (trampoline_level4_pgt - r_base)(%esi), %eax - movl %eax, %cr3 - - movl $MSR_EFER, %ecx - movl $(1 << _EFER_LME), %eax # Enable Long Mode - xorl %edx, %edx - wrmsr - - xorl %eax, %eax - btsl $31, %eax # Enable paging and in turn activate Long Mode - btsl $0, %eax # Enable protected mode - movl %eax, %cr0 - - /* - * At this point we're in long mode but in 32bit compatibility mode - * with EFER.LME = 1, CS.L = 0, CS.D = 1 (and in turn - * EFER.LMA = 1). Now we want to jump in 64bit mode, to do that we use - * the new gdt/idt that has __KERNEL_CS with CS.L = 1. - */ - ljmp *(startup_64_vector - r_base)(%esi) - - .code64 - .balign 4 -startup_64: - # Now jump into the kernel using virtual addresses - movq $secondary_startup_64, %rax - jmp *%rax - - .code16 -no_longmode: - hlt - jmp no_longmode -#include "verify_cpu.S" - - # Careful these need to be in the same 64K segment as the above; -tidt: - .word 0 # idt limit = 0 - .word 0, 0 # idt base = 0L - - # Duplicate the global descriptor table - # so the kernel can live anywhere - .balign 4 -tgdt: - .short tgdt_end - tgdt # gdt limit - .long tgdt - r_base - .short 0 - .quad 0x00cf9b000000ffff # __KERNEL32_CS - .quad 0x00af9b000000ffff # __KERNEL_CS - .quad 0x00cf93000000ffff # __KERNEL_DS -tgdt_end: - - .balign 4 -startup_32_vector: - .long startup_32 - r_base - .word __KERNEL32_CS, 0 - - .balign 4 -startup_64_vector: - .long startup_64 - r_base - .word __KERNEL_CS, 0 - -trampoline_stack: - .org 0x1000 -trampoline_stack_end: -ENTRY(trampoline_level4_pgt) - .quad level3_ident_pgt - __START_KERNEL_map + _KERNPG_TABLE - .fill 510,8,0 - .quad level3_kernel_pgt - __START_KERNEL_map + _KERNPG_TABLE - -ENTRY(trampoline_end) diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile deleted file mode 100644 index c9432717839..00000000000 --- a/arch/x86_64/lib/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# -# Makefile for x86_64-specific library files. -# - -CFLAGS_csum-partial.o := -funroll-loops - -obj-y := io.o iomap_copy.o -obj-$(CONFIG_SMP) += msr-on-cpu.o - -lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ - usercopy.o getuser.o putuser.o \ - thunk.o clear_page.o copy_page.o bitstr.o bitops.o -lib-y += memcpy.o memmove.o memset.o copy_user.o rwlock.o copy_user_nocache.o diff --git a/arch/x86_64/lib/msr-on-cpu.c b/arch/x86_64/lib/msr-on-cpu.c deleted file mode 100644 index 47e0ec47c37..00000000000 --- a/arch/x86_64/lib/msr-on-cpu.c +++ /dev/null @@ -1 +0,0 @@ -#include "../../i386/lib/msr-on-cpu.c" diff --git a/arch/x86_64/mm/Makefile b/arch/x86_64/mm/Makefile deleted file mode 100644 index d25ac86fe27..00000000000 --- a/arch/x86_64/mm/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -# -# Makefile for the linux x86_64-specific parts of the memory manager. -# - -obj-y := init.o fault.o ioremap.o extable.o pageattr.o mmap.o -obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o -obj-$(CONFIG_NUMA) += numa.o -obj-$(CONFIG_K8_NUMA) += k8topology.o -obj-$(CONFIG_ACPI_NUMA) += srat.o - -hugetlbpage-y = ../../i386/mm/hugetlbpage.o diff --git a/arch/x86_64/oprofile/Kconfig b/arch/x86_64/oprofile/Kconfig deleted file mode 100644 index d8a84088471..00000000000 --- a/arch/x86_64/oprofile/Kconfig +++ /dev/null @@ -1,17 +0,0 @@ -config PROFILING - bool "Profiling support (EXPERIMENTAL)" - help - Say Y here to enable the extended profiling support mechanisms used - by profilers such as OProfile. - - -config OPROFILE - tristate "OProfile system profiling (EXPERIMENTAL)" - depends on PROFILING - help - OProfile is a profiling system capable of profiling the - whole system, include the kernel, kernel modules, libraries, - and applications. - - If unsure, say N. - diff --git a/arch/x86_64/oprofile/Makefile b/arch/x86_64/oprofile/Makefile deleted file mode 100644 index 6be32683e1b..00000000000 --- a/arch/x86_64/oprofile/Makefile +++ /dev/null @@ -1,19 +0,0 @@ -# -# oprofile for x86-64. -# Just reuse the one from i386. -# - -obj-$(CONFIG_OPROFILE) += oprofile.o - -DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ - oprof.o cpu_buffer.o buffer_sync.o \ - event_buffer.o oprofile_files.o \ - oprofilefs.o oprofile_stats.o \ - timer_int.o ) - -OPROFILE-y := init.o backtrace.o -OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o op_model_p4.o \ - op_model_ppro.o -OPROFILE-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o - -oprofile-y = $(DRIVER_OBJS) $(addprefix ../../i386/oprofile/, $(OPROFILE-y)) diff --git a/arch/x86_64/pci/Makefile b/arch/x86_64/pci/Makefile deleted file mode 100644 index c9eddc8859c..00000000000 --- a/arch/x86_64/pci/Makefile +++ /dev/null @@ -1,27 +0,0 @@ -# -# Makefile for X86_64 specific PCI routines -# -# Reuse the i386 PCI subsystem -# -EXTRA_CFLAGS += -Iarch/i386/pci - -obj-y := i386.o -obj-$(CONFIG_PCI_DIRECT)+= direct.o -obj-y += fixup.o init.o -obj-$(CONFIG_ACPI) += acpi.o -obj-y += legacy.o irq.o common.o early.o -# mmconfig has a 64bit special -obj-$(CONFIG_PCI_MMCONFIG) += mmconfig.o direct.o mmconfig-shared.o - -obj-$(CONFIG_NUMA) += k8-bus.o - -direct-y += ../../i386/pci/direct.o -acpi-y += ../../i386/pci/acpi.o -legacy-y += ../../i386/pci/legacy.o -irq-y += ../../i386/pci/irq.o -common-y += ../../i386/pci/common.o -fixup-y += ../../i386/pci/fixup.o -i386-y += ../../i386/pci/i386.o -init-y += ../../i386/pci/init.o -early-y += ../../i386/pci/early.o -mmconfig-shared-y += ../../i386/pci/mmconfig-shared.o diff --git a/arch/x86_64/vdso/vdso.S b/arch/x86_64/vdso/vdso.S deleted file mode 100644 index 92e80c1972a..00000000000 --- a/arch/x86_64/vdso/vdso.S +++ /dev/null @@ -1,2 +0,0 @@ - .section ".vdso","a" - .incbin "arch/x86_64/vdso/vdso.so" diff --git a/arch/x86_64/vdso/voffset.h b/arch/x86_64/vdso/voffset.h deleted file mode 100644 index 5304204911f..00000000000 --- a/arch/x86_64/vdso/voffset.h +++ /dev/null @@ -1 +0,0 @@ -#define VDSO_TEXT_OFFSET 0x500 diff --git a/crypto/async_tx/async_tx.c b/crypto/async_tx/async_tx.c index 035007145e7..bc18cbb8ea7 100644 --- a/crypto/async_tx/async_tx.c +++ b/crypto/async_tx/async_tx.c @@ -80,6 +80,7 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) { enum dma_status status; struct dma_async_tx_descriptor *iter; + struct dma_async_tx_descriptor *parent; if (!tx) return DMA_SUCCESS; @@ -87,8 +88,15 @@ dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx) /* poll through the dependency chain, return when tx is complete */ do { iter = tx; - while (iter->cookie == -EBUSY) - iter = iter->parent; + + /* find the root of the unsubmitted dependency chain */ + while (iter->cookie == -EBUSY) { + parent = iter->parent; + if (parent && parent->cookie == -EBUSY) + iter = iter->parent; + else + break; + } status = dma_sync_wait(iter->chan, iter->cookie); } while (status == DMA_IN_PROGRESS || (iter != tx)); diff --git a/drivers/acpi/sleep/Makefile b/drivers/acpi/sleep/Makefile index ba9bd403d44..f1fb888c2d2 100644 --- a/drivers/acpi/sleep/Makefile +++ b/drivers/acpi/sleep/Makefile @@ -1,5 +1,5 @@ obj-y := wakeup.o -obj-$(CONFIG_ACPI_SLEEP) += main.o +obj-y += main.o obj-$(CONFIG_ACPI_SLEEP) += proc.o EXTRA_CFLAGS += $(ACPI_CFLAGS) diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c index 85633c585aa..2cbb9aabd00 100644 --- a/drivers/acpi/sleep/main.c +++ b/drivers/acpi/sleep/main.c @@ -24,7 +24,30 @@ u8 sleep_states[ACPI_S_STATE_COUNT]; +#ifdef CONFIG_PM_SLEEP static u32 acpi_target_sleep_state = ACPI_STATE_S0; +#endif + +int acpi_sleep_prepare(u32 acpi_state) +{ +#ifdef CONFIG_ACPI_SLEEP + /* do we have a wakeup address for S2 and S3? */ + if (acpi_state == ACPI_STATE_S3) { + if (!acpi_wakeup_address) { + return -EFAULT; + } + acpi_set_firmware_waking_vector((acpi_physical_address) + virt_to_phys((void *) + acpi_wakeup_address)); + + } + ACPI_FLUSH_CPU_CACHE(); + acpi_enable_wakeup_device_prep(acpi_state); +#endif + acpi_gpe_sleep_prepare(acpi_state); + acpi_enter_sleep_state_prep(acpi_state); + return 0; +} #ifdef CONFIG_SUSPEND static struct pm_ops acpi_pm_ops; @@ -60,27 +83,6 @@ static int acpi_pm_set_target(suspend_state_t pm_state) return error; } -int acpi_sleep_prepare(u32 acpi_state) -{ -#ifdef CONFIG_ACPI_SLEEP - /* do we have a wakeup address for S2 and S3? */ - if (acpi_state == ACPI_STATE_S3) { - if (!acpi_wakeup_address) { - return -EFAULT; - } - acpi_set_firmware_waking_vector((acpi_physical_address) - virt_to_phys((void *) - acpi_wakeup_address)); - - } - ACPI_FLUSH_CPU_CACHE(); - acpi_enable_wakeup_device_prep(acpi_state); -#endif - acpi_gpe_sleep_prepare(acpi_state); - acpi_enter_sleep_state_prep(acpi_state); - return 0; -} - /** * acpi_pm_prepare - Do preliminary suspend work. * @pm_state: ignored @@ -299,6 +301,7 @@ int acpi_suspend(u32 acpi_state) return -EINVAL; } +#ifdef CONFIG_PM_SLEEP /** * acpi_pm_device_sleep_state - return preferred power state of ACPI device * in the system sleep state given by %acpi_target_sleep_state @@ -373,6 +376,7 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p) *d_min_p = d_min; return d_max; } +#endif static void acpi_power_off_prepare(void) { diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 3b8bf1812dc..6996eb5b750 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -921,6 +921,13 @@ static int piix_broken_suspend(void) { static struct dmi_system_id sysids[] = { { + .ident = "TECRA M3", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), + DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M3"), + }, + }, + { .ident = "TECRA M5", .matches = { DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 4ca7fd6118d..5dea3584c6c 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c @@ -189,6 +189,9 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) data->cs0 = devm_ioremap(&pdev->dev, cs0->start, 0x1000); data->cs1 = devm_ioremap(&pdev->dev, cs1->start, 0x1000); + if (!data->cs0 || !data->cs1) + return -ENOMEM; + irq = platform_get_irq(pdev, 0); if (irq) set_irq_type(irq, IRQT_RISING); diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c index ae206f35f74..b45506f1ef7 100644 --- a/drivers/ata/pata_marvell.c +++ b/drivers/ata/pata_marvell.c @@ -44,10 +44,10 @@ static int marvell_pre_reset(struct ata_port *ap, unsigned long deadline) return -ENOMEM; printk("BAR5:"); for(i = 0; i <= 0x0F; i++) - printk("%02X:%02X ", i, readb(barp + i)); + printk("%02X:%02X ", i, ioread8(barp + i)); printk("\n"); - devices = readl(barp + 0x0C); + devices = ioread32(barp + 0x0C); pci_iounmap(pdev, barp); if ((pdev->device == 0x6145) && (ap->port_no == 0) && diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 2bd7645f1a8..cce2834b2b6 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c @@ -375,8 +375,9 @@ static void sis_66_set_dmamode (struct ata_port *ap, struct ata_device *adev) int drive_pci = sis_old_port_base(adev); u16 timing; + /* MWDMA 0-2 and UDMA 0-5 */ const u16 mwdma_bits[] = { 0x008, 0x302, 0x301 }; - const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000}; + const u16 udma_bits[] = { 0xF000, 0xD000, 0xB000, 0xA000, 0x9000, 0x8000 }; pci_read_config_word(pdev, drive_pci, &timing); diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 11bf6c7ac12..cb7dec97fee 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c @@ -313,7 +313,10 @@ enum { #define IS_GEN_IIE(hpriv) ((hpriv)->hp_flags & MV_HP_GEN_IIE) enum { - MV_DMA_BOUNDARY = 0xffffffffU, + /* DMA boundary 0xffff is required by the s/g splitting + * we need on /length/ in mv_fill-sg(). + */ + MV_DMA_BOUNDARY = 0xffffU, /* mask of register bits containing lower 32 bits * of EDMA request queue DMA address @@ -448,7 +451,7 @@ static struct scsi_host_template mv5_sht = { .queuecommand = ata_scsi_queuecmd, .can_queue = ATA_DEF_QUEUE, .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = MV_MAX_SG_CT, + .sg_tablesize = MV_MAX_SG_CT / 2, .cmd_per_lun = ATA_SHT_CMD_PER_LUN, .emulated = ATA_SHT_EMULATED, .use_clustering = 1, @@ -466,7 +469,7 @@ static struct scsi_host_template mv6_sht = { .queuecommand = ata_scsi_queuecmd, .can_queue = ATA_DEF_QUEUE, .this_id = ATA_SHT_THIS_ID, - .sg_tablesize = MV_MAX_SG_CT, + .sg_tablesize = MV_MAX_SG_CT / 2, .cmd_per_lun = ATA_SHT_CMD_PER_LUN, .emulated = ATA_SHT_EMULATED, .use_clustering = 1, @@ -1139,15 +1142,27 @@ static unsigned int mv_fill_sg(struct ata_queued_cmd *qc) dma_addr_t addr = sg_dma_address(sg); u32 sg_len = sg_dma_len(sg); - mv_sg->addr = cpu_to_le32(addr & 0xffffffff); - mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16); - mv_sg->flags_size = cpu_to_le32(sg_len & 0xffff); + while (sg_len) { + u32 offset = addr & 0xffff; + u32 len = sg_len; + + if ((offset + sg_len > 0x10000)) + len = 0x10000 - offset; + + mv_sg->addr = cpu_to_le32(addr & 0xffffffff); + mv_sg->addr_hi = cpu_to_le32((addr >> 16) >> 16); + mv_sg->flags_size = cpu_to_le32(len); - if (ata_sg_is_last(sg, qc)) - mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL); + sg_len -= len; + addr += len; + + if (!sg_len && ata_sg_is_last(sg, qc)) + mv_sg->flags_size |= cpu_to_le32(EPRD_FLAG_END_OF_TBL); + + mv_sg++; + n_sg++; + } - mv_sg++; - n_sg++; } return n_sg; diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index ef83e6b1e31..233e8869339 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c @@ -888,6 +888,16 @@ static inline void sil24_host_intr(struct ata_port *ap) u32 slot_stat, qc_active; int rc; + /* If PCIX_IRQ_WOC, there's an inherent race window between + * clearing IRQ pending status and reading PORT_SLOT_STAT + * which may cause spurious interrupts afterwards. This is + * unavoidable and much better than losing interrupts which + * happens if IRQ pending is cleared after reading + * PORT_SLOT_STAT. + */ + if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) + writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT); + slot_stat = readl(port + PORT_SLOT_STAT); if (unlikely(slot_stat & HOST_SSTAT_ATTN)) { @@ -895,9 +905,6 @@ static inline void sil24_host_intr(struct ata_port *ap) return; } - if (ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) - writel(PORT_IRQ_COMPLETE, port + PORT_IRQ_STAT); - qc_active = slot_stat & ~HOST_SSTAT_ATTN; rc = ata_qc_complete_multiple(ap, qc_active, sil24_finish_qc); if (rc > 0) @@ -910,7 +917,8 @@ static inline void sil24_host_intr(struct ata_port *ap) return; } - if (ata_ratelimit()) + /* spurious interrupts are expected if PCIX_IRQ_WOC */ + if (!(ap->flags & SIL24_FLAG_PCIX_IRQ_WOC) && ata_ratelimit()) ata_port_printk(ap, KERN_INFO, "spurious interrupt " "(slot_stat 0x%x active_tag %d sactive 0x%x)\n", slot_stat, ap->active_tag, ap->sactive); diff --git a/drivers/base/core.c b/drivers/base/core.c index 6de33d7a29b..ec86d6fc236 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -284,6 +284,7 @@ static ssize_t show_uevent(struct device *dev, struct device_attribute *attr, /* let the kset specific function add its keys */ pos = data; + memset(envp, 0, sizeof(envp)); retval = kset->uevent_ops->uevent(kset, &dev->kobj, envp, ARRAY_SIZE(envp), pos, PAGE_SIZE); @@ -585,9 +586,13 @@ void device_initialize(struct device *dev) static struct kobject * get_device_parent(struct device *dev, struct device *parent) { - /* Set the parent to the class, not the parent device */ - /* this keeps sysfs from having a symlink to make old udevs happy */ - if (dev->class) + /* + * Set the parent to the class, not the parent device + * for topmost devices in class hierarchy. + * This keeps sysfs from having a symlink to make old + * udevs happy + */ + if (dev->class && (!parent || parent->class != dev->class)) return &dev->class->subsys.kobj; else if (parent) return &parent->kobj; diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 67ee3d4b287..79245714f0a 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -1032,6 +1032,10 @@ int cdrom_open(struct cdrom_device_info *cdi, struct inode *ip, struct file *fp) check_disk_change(ip->i_bdev); return 0; err_release: + if (CDROM_CAN(CDC_LOCK) && cdi->options & CDO_LOCK) { + cdi->ops->lock_door(cdi, 0); + cdinfo(CD_OPEN, "door unlocked.\n"); + } cdi->ops->release(cdi); err: cdi->use_count--; diff --git a/drivers/char/Makefile b/drivers/char/Makefile index d68ddbe70f7..c78ff26647e 100644 --- a/drivers/char/Makefile +++ b/drivers/char/Makefile @@ -129,7 +129,7 @@ $(obj)/defkeymap.o: $(obj)/defkeymap.c ifdef GENERATE_KEYMAP -$(obj)/defkeymap.c $(obj)/%.c: $(src)/%.map +$(obj)/defkeymap.c: $(obj)/%.c: $(src)/%.map loadkeys --mktable $< > $@.tmp sed -e 's/^static *//' $@.tmp > $@ rm $@.tmp diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index a5d0e95a227..141ca176c39 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c @@ -506,11 +506,6 @@ static void intel_i830_init_gtt_entries(void) break; } } else { - /* G33's GTT stolen memory is separate from gfx data - * stolen memory. - */ - if (IS_G33) - size = 0; switch (gmch_ctrl & I855_GMCH_GMS_MASK) { case I855_GMCH_GMS_STOLEN_1M: gtt_entries = MB(1) - KB(size); diff --git a/drivers/char/drm/i915_drv.h b/drivers/char/drm/i915_drv.h index 737088bd078..28b98733beb 100644 --- a/drivers/char/drm/i915_drv.h +++ b/drivers/char/drm/i915_drv.h @@ -210,6 +210,12 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); #define I915REG_INT_MASK_R 0x020a8 #define I915REG_INT_ENABLE_R 0x020a0 +#define I915REG_PIPEASTAT 0x70024 +#define I915REG_PIPEBSTAT 0x71024 + +#define I915_VBLANK_INTERRUPT_ENABLE (1UL<<17) +#define I915_VBLANK_CLEAR (1UL<<1) + #define SRX_INDEX 0x3c4 #define SRX_DATA 0x3c5 #define SR01 1 diff --git a/drivers/char/drm/i915_irq.c b/drivers/char/drm/i915_irq.c index 4b4b2ce8986..bb8e9e9c820 100644 --- a/drivers/char/drm/i915_irq.c +++ b/drivers/char/drm/i915_irq.c @@ -214,6 +214,10 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) struct drm_device *dev = (struct drm_device *) arg; drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; u16 temp; + u32 pipea_stats, pipeb_stats; + + pipea_stats = I915_READ(I915REG_PIPEASTAT); + pipeb_stats = I915_READ(I915REG_PIPEBSTAT); temp = I915_READ16(I915REG_INT_IDENTITY_R); @@ -225,6 +229,8 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) return IRQ_NONE; I915_WRITE16(I915REG_INT_IDENTITY_R, temp); + (void) I915_READ16(I915REG_INT_IDENTITY_R); + DRM_READMEMORYBARRIER(); dev_priv->sarea_priv->last_dispatch = READ_BREADCRUMB(dev_priv); @@ -252,6 +258,12 @@ irqreturn_t i915_driver_irq_handler(DRM_IRQ_ARGS) if (dev_priv->swaps_pending > 0) drm_locked_tasklet(dev, i915_vblank_tasklet); + I915_WRITE(I915REG_PIPEASTAT, + pipea_stats|I915_VBLANK_INTERRUPT_ENABLE| + I915_VBLANK_CLEAR); + I915_WRITE(I915REG_PIPEBSTAT, + pipeb_stats|I915_VBLANK_INTERRUPT_ENABLE| + I915_VBLANK_CLEAR); } return IRQ_HANDLED; diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index 7ecffc9c738..4c16778e3f8 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c @@ -62,6 +62,8 @@ static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ; +/* This clocksource driver currently only works on ia64 */ +#ifdef CONFIG_IA64 static void __iomem *hpet_mctr; static cycle_t read_hpet(void) @@ -79,6 +81,7 @@ static struct clocksource clocksource_hpet = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; static struct clocksource *hpet_clocksource; +#endif /* A lock for concurrent access by app and isr hpet activity. */ static DEFINE_SPINLOCK(hpet_lock); @@ -943,14 +946,14 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) printk(KERN_DEBUG "%s: 0x%lx is busy\n", __FUNCTION__, hdp->hd_phys_address); iounmap(hdp->hd_address); - return -EBUSY; + return AE_ALREADY_EXISTS; } } else if (res->type == ACPI_RESOURCE_TYPE_FIXED_MEMORY32) { struct acpi_resource_fixed_memory32 *fixmem32; fixmem32 = &res->data.fixed_memory32; if (!fixmem32) - return -EINVAL; + return AE_NO_MEMORY; hdp->hd_phys_address = fixmem32->address; hdp->hd_address = ioremap(fixmem32->address, @@ -960,7 +963,7 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) printk(KERN_DEBUG "%s: 0x%lx is busy\n", __FUNCTION__, hdp->hd_phys_address); iounmap(hdp->hd_address); - return -EBUSY; + return AE_ALREADY_EXISTS; } } else if (res->type == ACPI_RESOURCE_TYPE_EXTENDED_IRQ) { struct acpi_resource_extended_irq *irqp; diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c index 049a46cc9f8..04ac155d3a0 100644 --- a/drivers/char/mspec.c +++ b/drivers/char/mspec.c @@ -155,23 +155,22 @@ mspec_open(struct vm_area_struct *vma) * mspec_close * * Called when unmapping a device mapping. Frees all mspec pages - * belonging to the vma. + * belonging to all the vma's sharing this vma_data structure. */ static void mspec_close(struct vm_area_struct *vma) { struct vma_data *vdata; - int index, last_index, result; + int index, last_index; unsigned long my_page; vdata = vma->vm_private_data; - BUG_ON(vma->vm_start < vdata->vm_start || vma->vm_end > vdata->vm_end); + if (!atomic_dec_and_test(&vdata->refcnt)) + return; - spin_lock(&vdata->lock); - index = (vma->vm_start - vdata->vm_start) >> PAGE_SHIFT; - last_index = (vma->vm_end - vdata->vm_start) >> PAGE_SHIFT; - for (; index < last_index; index++) { + last_index = (vdata->vm_end - vdata->vm_start) >> PAGE_SHIFT; + for (index = 0; index < last_index; index++) { if (vdata->maddr[index] == 0) continue; /* @@ -180,20 +179,12 @@ mspec_close(struct vm_area_struct *vma) */ my_page = vdata->maddr[index]; vdata->maddr[index] = 0; - spin_unlock(&vdata->lock); - result = mspec_zero_block(my_page, PAGE_SIZE); - if (!result) + if (!mspec_zero_block(my_page, PAGE_SIZE)) uncached_free_page(my_page); else printk(KERN_WARNING "mspec_close(): " - "failed to zero page %i\n", - result); - spin_lock(&vdata->lock); + "failed to zero page %ld\n", my_page); } - spin_unlock(&vdata->lock); - - if (!atomic_dec_and_test(&vdata->refcnt)) - return; if (vdata->flags & VMD_VMALLOCED) vfree(vdata); @@ -201,7 +192,6 @@ mspec_close(struct vm_area_struct *vma) kfree(vdata); } - /* * mspec_nopfn * diff --git a/drivers/char/random.c b/drivers/char/random.c index 397c714cf2b..af274e5a25e 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c @@ -1550,11 +1550,13 @@ __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, * As close as possible to RFC 793, which * suggests using a 250 kHz clock. * Further reading shows this assumes 2 Mb/s networks. - * For 10 Gb/s Ethernet, a 1 GHz clock is appropriate. - * That's funny, Linux has one built in! Use it! - * (Networks are faster now - should this be increased?) + * For 10 Mb/s Ethernet, a 1 MHz clock is appropriate. + * For 10 Gb/s Ethernet, a 1 GHz clock should be ok, but + * we also need to limit the resolution so that the u32 seq + * overlaps less than one time per MSL (2 minutes). + * Choosing a clock of 64 ns period is OK. (period of 274 s) */ - seq += ktime_get_real().tv64; + seq += ktime_get_real().tv64 >> 6; #if 0 printk("init_seq(%lx, %lx, %d, %d) = %d\n", saddr, daddr, sport, dport, seq); diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index c6f6f420973..7a61a2a9aaf 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c @@ -770,6 +770,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* * Switching-from response */ + acquire_console_sem(); if (vc->vt_newvt >= 0) { if (arg == 0) /* @@ -784,7 +785,6 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * complete the switch. */ int newvt; - acquire_console_sem(); newvt = vc->vt_newvt; vc->vt_newvt = -1; i = vc_allocate(newvt); @@ -798,7 +798,6 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, * other console switches.. */ complete_change_console(vc_cons[newvt].d); - release_console_sem(); } } @@ -810,9 +809,12 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, /* * If it's just an ACK, ignore it */ - if (arg != VT_ACKACQ) + if (arg != VT_ACKACQ) { + release_console_sem(); return -EINVAL; + } } + release_console_sem(); return 0; @@ -1030,7 +1032,7 @@ static DECLARE_WAIT_QUEUE_HEAD(vt_activate_queue); /* * Sleeps until a vt is activated, or the task is interrupted. Returns - * 0 if activation, -EINTR if interrupted. + * 0 if activation, -EINTR if interrupted by a signal handler. */ int vt_waitactive(int vt) { @@ -1055,7 +1057,7 @@ int vt_waitactive(int vt) break; } release_console_sem(); - retval = -EINTR; + retval = -ERESTARTNOHAND; if (signal_pending(current)) break; schedule(); @@ -1208,15 +1210,18 @@ void change_console(struct vc_data *new_vc) /* * Send the signal as privileged - kill_pid() will * tell us if the process has gone or something else - * is awry + * is awry. + * + * We need to set vt_newvt *before* sending the signal or we + * have a race. */ + vc->vt_newvt = new_vc->vc_num; if (kill_pid(vc->vt_pid, vc->vt_mode.relsig, 1) == 0) { /* * It worked. Mark the vt to switch to and * return. The process needs to send us a * VT_RELDISP ioctl to complete the switch. */ - vc->vt_newvt = new_vc->vc_num; return; } diff --git a/drivers/firewire/Kconfig b/drivers/firewire/Kconfig index d011a76f8e7..fe9e768cfbc 100644 --- a/drivers/firewire/Kconfig +++ b/drivers/firewire/Kconfig @@ -11,7 +11,8 @@ config FIREWIRE This is the "Juju" FireWire stack, a new alternative implementation designed for robustness and simplicity. You can build either this stack, or the classic stack (the ieee1394 driver, ohci1394 etc.) - or both. + or both. Please read http://wiki.linux1394.org/JujuMigration before + you enable the new stack. To compile this driver as a module, say M here: the module will be called firewire-core. It functionally replaces ieee1394, raw1394, diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index f19eb6daeef..2fb047b898a 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c @@ -1546,6 +1546,7 @@ static struct pci_device_id pmac_ide_pci_match[] = { PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, { PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_IPID2_ATA, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, + {}, }; static struct pci_driver pmac_ide_pci_driver = { diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index ba0428d872a..85c51bdc36f 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c @@ -1211,12 +1211,42 @@ static void set_datagram_seg(struct mlx4_wqe_datagram_seg *dseg, dseg->qkey = cpu_to_be32(wr->wr.ud.remote_qkey); } -static void set_data_seg(struct mlx4_wqe_data_seg *dseg, - struct ib_sge *sg) +static void set_mlx_icrc_seg(void *dseg) +{ + u32 *t = dseg; + struct mlx4_wqe_inline_seg *iseg = dseg; + + t[1] = 0; + + /* + * Need a barrier here before writing the byte_count field to + * make sure that all the data is visible before the + * byte_count field is set. Otherwise, if the segment begins + * a new cacheline, the HCA prefetcher could grab the 64-byte + * chunk and get a valid (!= * 0xffffffff) byte count but + * stale data, and end up sending the wrong data. + */ + wmb(); + + iseg->byte_count = cpu_to_be32((1 << 31) | 4); +} + +static void set_data_seg(struct mlx4_wqe_data_seg *dseg, struct ib_sge *sg) { - dseg->byte_count = cpu_to_be32(sg->length); dseg->lkey = cpu_to_be32(sg->lkey); dseg->addr = cpu_to_be64(sg->addr); + + /* + * Need a barrier here before writing the byte_count field to + * make sure that all the data is visible before the + * byte_count field is set. Otherwise, if the segment begins + * a new cacheline, the HCA prefetcher could grab the 64-byte + * chunk and get a valid (!= * 0xffffffff) byte count but + * stale data, and end up sending the wrong data. + */ + wmb(); + + dseg->byte_count = cpu_to_be32(sg->length); } int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, @@ -1225,6 +1255,7 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, struct mlx4_ib_qp *qp = to_mqp(ibqp); void *wqe; struct mlx4_wqe_ctrl_seg *ctrl; + struct mlx4_wqe_data_seg *dseg; unsigned long flags; int nreq; int err = 0; @@ -1324,22 +1355,27 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, break; } - for (i = 0; i < wr->num_sge; ++i) { - set_data_seg(wqe, wr->sg_list + i); + /* + * Write data segments in reverse order, so as to + * overwrite cacheline stamp last within each + * cacheline. This avoids issues with WQE + * prefetching. + */ - wqe += sizeof (struct mlx4_wqe_data_seg); - size += sizeof (struct mlx4_wqe_data_seg) / 16; - } + dseg = wqe; + dseg += wr->num_sge - 1; + size += wr->num_sge * (sizeof (struct mlx4_wqe_data_seg) / 16); /* Add one more inline data segment for ICRC for MLX sends */ - if (qp->ibqp.qp_type == IB_QPT_SMI || qp->ibqp.qp_type == IB_QPT_GSI) { - ((struct mlx4_wqe_inline_seg *) wqe)->byte_count = - cpu_to_be32((1 << 31) | 4); - ((u32 *) wqe)[1] = 0; - wqe += sizeof (struct mlx4_wqe_data_seg); + if (unlikely(qp->ibqp.qp_type == IB_QPT_SMI || + qp->ibqp.qp_type == IB_QPT_GSI)) { + set_mlx_icrc_seg(dseg + 1); size += sizeof (struct mlx4_wqe_data_seg) / 16; } + for (i = wr->num_sge - 1; i >= 0; --i, --dseg) + set_data_seg(dseg, wr->sg_list + i); + ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? MLX4_WQE_CTRL_FENCE : 0) | size; diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig index e2abe18e575..7c662ee594a 100644 --- a/drivers/input/joystick/Kconfig +++ b/drivers/input/joystick/Kconfig @@ -277,7 +277,7 @@ config JOYSTICK_XPAD_FF config JOYSTICK_XPAD_LEDS bool "LED Support for Xbox360 controller 'BigX' LED" - depends on LEDS_CLASS && JOYSTICK_XPAD + depends on JOYSTICK_XPAD && (LEDS_CLASS=y || LEDS_CLASS=JOYSTICK_XPAD) ---help--- This option enables support for the LED which surrounds the Big X on XBox 360 controller. diff --git a/drivers/input/mouse/appletouch.c b/drivers/input/mouse/appletouch.c index 2bea1b2c631..a1804bfdbb8 100644 --- a/drivers/input/mouse/appletouch.c +++ b/drivers/input/mouse/appletouch.c @@ -328,6 +328,7 @@ static void atp_complete(struct urb* urb) { int x, y, x_z, y_z, x_f, y_f; int retval, i, j; + int key; struct atp *dev = urb->context; switch (urb->status) { @@ -468,6 +469,7 @@ static void atp_complete(struct urb* urb) ATP_XFACT, &x_z, &x_f); y = atp_calculate_abs(dev->xy_acc + ATP_XSENSORS, ATP_YSENSORS, ATP_YFACT, &y_z, &y_f); + key = dev->data[dev->datalen - 1] & 1; if (x && y) { if (dev->x_old != -1) { @@ -505,7 +507,7 @@ static void atp_complete(struct urb* urb) the first touch unless reinitialised. Do so if it's been idle for a while in order to avoid waking the kernel up several hundred times a second */ - if (atp_is_geyser_3(dev)) { + if (!key && atp_is_geyser_3(dev)) { dev->idlecount++; if (dev->idlecount == 10) { dev->valid = 0; @@ -514,7 +516,7 @@ static void atp_complete(struct urb* urb) } } - input_report_key(dev->input, BTN_LEFT, dev->data[dev->datalen - 1] & 1); + input_report_key(dev->input, BTN_LEFT, key); input_sync(dev->input); exit: diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index ec5f4046412..4910bca5264 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -1135,7 +1135,7 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t * off) if (count > dev->drv[drvidx]->stavail) count = dev->drv[drvidx]->stavail; len = dev->drv[drvidx]->interface->readstat(buf, count, - drvidx, isdn_minor2chan(minor)); + drvidx, isdn_minor2chan(minor - ISDN_MINOR_CTRL)); if (len < 0) { retval = len; goto out; @@ -1207,7 +1207,8 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t * off */ if (dev->drv[drvidx]->interface->writecmd) retval = dev->drv[drvidx]->interface-> - writecmd(buf, count, drvidx, isdn_minor2chan(minor)); + writecmd(buf, count, drvidx, + isdn_minor2chan(minor - ISDN_MINOR_CTRL)); else retval = count; goto out; diff --git a/drivers/lguest/lguest_asm.S b/drivers/lguest/lguest_asm.S index f182c6a3620..1ddcd5cd20f 100644 --- a/drivers/lguest/lguest_asm.S +++ b/drivers/lguest/lguest_asm.S @@ -22,8 +22,9 @@ jmp lguest_init /*G:055 We create a macro which puts the assembler code between lgstart_ and - * lgend_ markers. These templates end up in the .init.text section, so they - * are discarded after boot. */ + * lgend_ markers. These templates are put in the .text section: they can't be + * discarded after boot as we may need to patch modules, too. */ +.text #define LGUEST_PATCH(name, insns...) \ lgstart_##name: insns; lgend_##name:; \ .globl lgstart_##name; .globl lgend_##name @@ -34,7 +35,6 @@ LGUEST_PATCH(popf, movl %eax, lguest_data+LGUEST_DATA_irq_enabled) LGUEST_PATCH(pushf, movl lguest_data+LGUEST_DATA_irq_enabled, %eax) /*:*/ -.text /* These demark the EIP range where host should never deliver interrupts. */ .global lguest_noirq_start .global lguest_noirq_end diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 4d63773ee73..f96dea975fa 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -514,7 +514,7 @@ static void ops_complete_biofill(void *stripe_head_ref) struct stripe_head *sh = stripe_head_ref; struct bio *return_bi = NULL; raid5_conf_t *conf = sh->raid_conf; - int i, more_to_read = 0; + int i; pr_debug("%s: stripe %llu\n", __FUNCTION__, (unsigned long long)sh->sector); @@ -522,16 +522,14 @@ static void ops_complete_biofill(void *stripe_head_ref) /* clear completed biofills */ for (i = sh->disks; i--; ) { struct r5dev *dev = &sh->dev[i]; - /* check if this stripe has new incoming reads */ - if (dev->toread) - more_to_read++; /* acknowledge completion of a biofill operation */ - /* and check if we need to reply to a read request - */ - if (test_bit(R5_Wantfill, &dev->flags) && !dev->toread) { + /* and check if we need to reply to a read request, + * new R5_Wantfill requests are held off until + * !test_bit(STRIPE_OP_BIOFILL, &sh->ops.pending) + */ + if (test_and_clear_bit(R5_Wantfill, &dev->flags)) { struct bio *rbi, *rbi2; - clear_bit(R5_Wantfill, &dev->flags); /* The access to dev->read is outside of the * spin_lock_irq(&conf->device_lock), but is protected @@ -558,8 +556,7 @@ static void ops_complete_biofill(void *stripe_head_ref) return_io(return_bi); - if (more_to_read) - set_bit(STRIPE_HANDLE, &sh->state); + set_bit(STRIPE_HANDLE, &sh->state); release_stripe(sh); } diff --git a/drivers/media/video/ivtv/ivtv-fileops.c b/drivers/media/video/ivtv/ivtv-fileops.c index 0285c4a830e..66ea3cbc369 100644 --- a/drivers/media/video/ivtv/ivtv-fileops.c +++ b/drivers/media/video/ivtv/ivtv-fileops.c @@ -754,9 +754,11 @@ static void ivtv_stop_decoding(struct ivtv_open_id *id, int flags, u64 pts) ivtv_yuv_close(itv); } if (s->type == IVTV_DEC_STREAM_TYPE_YUV && itv->output_mode == OUT_YUV) - itv->output_mode = OUT_NONE; + itv->output_mode = OUT_NONE; + else if (s->type == IVTV_DEC_STREAM_TYPE_YUV && itv->output_mode == OUT_UDMA_YUV) + itv->output_mode = OUT_NONE; else if (s->type == IVTV_DEC_STREAM_TYPE_MPG && itv->output_mode == OUT_MPG) - itv->output_mode = OUT_NONE; + itv->output_mode = OUT_NONE; itv->speed = 0; clear_bit(IVTV_F_I_DEC_PAUSED, &itv->i_flags); diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index e3371f97224..0cb006f2943 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -1387,7 +1387,6 @@ static const struct file_operations usbvision_fops = { .ioctl = video_ioctl2, .llseek = no_llseek, /* .poll = video_poll, */ - .mmap = usbvision_v4l2_mmap, .compat_ioctl = v4l_compat_ioctl32, }; static struct video_device usbvision_video_template = { @@ -1413,7 +1412,7 @@ static struct video_device usbvision_video_template = { .vidioc_s_input = vidioc_s_input, .vidioc_queryctrl = vidioc_queryctrl, .vidioc_g_audio = vidioc_g_audio, - .vidioc_g_audio = vidioc_s_audio, + .vidioc_s_audio = vidioc_s_audio, .vidioc_g_ctrl = vidioc_g_ctrl, .vidioc_s_ctrl = vidioc_s_ctrl, .vidioc_streamon = vidioc_streamon, @@ -1459,7 +1458,7 @@ static struct video_device usbvision_radio_template= .vidioc_s_input = vidioc_s_input, .vidioc_queryctrl = vidioc_queryctrl, .vidioc_g_audio = vidioc_g_audio, - .vidioc_g_audio = vidioc_s_audio, + .vidioc_s_audio = vidioc_s_audio, .vidioc_g_ctrl = vidioc_g_ctrl, .vidioc_s_ctrl = vidioc_s_ctrl, .vidioc_g_tuner = vidioc_g_tuner, diff --git a/drivers/net/e1000/e1000_ethtool.c b/drivers/net/e1000/e1000_ethtool.c index 4c3785c9d4b..9ecc3adcf6c 100644 --- a/drivers/net/e1000/e1000_ethtool.c +++ b/drivers/net/e1000/e1000_ethtool.c @@ -1726,6 +1726,7 @@ static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wol case E1000_DEV_ID_82571EB_QUAD_COPPER: case E1000_DEV_ID_82571EB_QUAD_FIBER: case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: + case E1000_DEV_ID_82571PT_QUAD_COPPER: case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3: /* quad port adapters only support WoL on port A */ if (!adapter->quad_port_a) { diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index ba120f7fb0b..8604adbe351 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c @@ -387,6 +387,7 @@ e1000_set_mac_type(struct e1000_hw *hw) case E1000_DEV_ID_82571EB_SERDES_DUAL: case E1000_DEV_ID_82571EB_SERDES_QUAD: case E1000_DEV_ID_82571EB_QUAD_COPPER: + case E1000_DEV_ID_82571PT_QUAD_COPPER: case E1000_DEV_ID_82571EB_QUAD_FIBER: case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: hw->mac_type = e1000_82571; diff --git a/drivers/net/e1000/e1000_hw.h b/drivers/net/e1000/e1000_hw.h index fe8714655c9..07f0ea73676 100644 --- a/drivers/net/e1000/e1000_hw.h +++ b/drivers/net/e1000/e1000_hw.h @@ -475,6 +475,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw); #define E1000_DEV_ID_82571EB_FIBER 0x105F #define E1000_DEV_ID_82571EB_SERDES 0x1060 #define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4 +#define E1000_DEV_ID_82571PT_QUAD_COPPER 0x10D5 #define E1000_DEV_ID_82571EB_QUAD_FIBER 0x10A5 #define E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE 0x10BC #define E1000_DEV_ID_82571EB_SERDES_DUAL 0x10D9 diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 4a225950fb4..e7c8951f47f 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -108,6 +108,7 @@ static struct pci_device_id e1000_pci_tbl[] = { INTEL_E1000_ETHERNET_DEVICE(0x10BC), INTEL_E1000_ETHERNET_DEVICE(0x10C4), INTEL_E1000_ETHERNET_DEVICE(0x10C5), + INTEL_E1000_ETHERNET_DEVICE(0x10D5), INTEL_E1000_ETHERNET_DEVICE(0x10D9), INTEL_E1000_ETHERNET_DEVICE(0x10DA), /* required last entry */ @@ -1101,6 +1102,7 @@ e1000_probe(struct pci_dev *pdev, case E1000_DEV_ID_82571EB_QUAD_COPPER: case E1000_DEV_ID_82571EB_QUAD_FIBER: case E1000_DEV_ID_82571EB_QUAD_COPPER_LOWPROFILE: + case E1000_DEV_ID_82571PT_QUAD_COPPER: /* if quad port adapter, disable WoL on all but port A */ if (global_quad_port_a != 0) adapter->eeprom_wol = 0; diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 6a117e9968c..315335671f0 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c @@ -534,7 +534,7 @@ static irqreturn_t mv643xx_eth_int_handler(int irq, void *dev_id) } /* PHY status changed */ - if (eth_int_cause_ext & ETH_INT_CAUSE_PHY) { + if (eth_int_cause_ext & (ETH_INT_CAUSE_PHY | ETH_INT_CAUSE_STATE)) { struct ethtool_cmd cmd; if (mii_link_ok(&mp->mii)) { @@ -1357,7 +1357,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) #endif dev->watchdog_timeo = 2 * HZ; - dev->tx_queue_len = mp->tx_ring_size; dev->base_addr = 0; dev->change_mtu = mv643xx_eth_change_mtu; dev->do_ioctl = mv643xx_eth_do_ioctl; @@ -2768,8 +2767,6 @@ static const struct ethtool_ops mv643xx_ethtool_ops = { .get_stats_count = mv643xx_get_stats_count, .get_ethtool_stats = mv643xx_get_ethtool_stats, .get_strings = mv643xx_get_strings, - .get_stats_count = mv643xx_get_stats_count, - .get_ethtool_stats = mv643xx_get_ethtool_stats, .nway_reset = mv643xx_eth_nway_restart, }; diff --git a/drivers/net/mv643xx_eth.h b/drivers/net/mv643xx_eth.h index 82f8c0cbfb6..565b96696ac 100644 --- a/drivers/net/mv643xx_eth.h +++ b/drivers/net/mv643xx_eth.h @@ -64,7 +64,9 @@ #define ETH_INT_CAUSE_TX_ERROR (ETH_TX_QUEUES_ENABLED << 8) #define ETH_INT_CAUSE_TX (ETH_INT_CAUSE_TX_DONE | ETH_INT_CAUSE_TX_ERROR) #define ETH_INT_CAUSE_PHY 0x00010000 -#define ETH_INT_UNMASK_ALL_EXT (ETH_INT_CAUSE_TX | ETH_INT_CAUSE_PHY) +#define ETH_INT_CAUSE_STATE 0x00100000 +#define ETH_INT_UNMASK_ALL_EXT (ETH_INT_CAUSE_TX | ETH_INT_CAUSE_PHY | \ + ETH_INT_CAUSE_STATE) #define ETH_INT_MASK_ALL 0x00000000 #define ETH_INT_MASK_ALL_EXT 0x00000000 diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index c06cae3f0b5..503f2685fb7 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c @@ -116,7 +116,7 @@ struct el3_private { spinlock_t lock; }; -static const char *if_names[] = { "auto", "10base2", "10baseT", "AUI" }; +static const char *if_names[] = { "auto", "10baseT", "10base2", "AUI" }; /*====================================================================*/ diff --git a/drivers/net/ppp_mppe.c b/drivers/net/ppp_mppe.c index f79cf87a2bf..c0b6d19d145 100644 --- a/drivers/net/ppp_mppe.c +++ b/drivers/net/ppp_mppe.c @@ -136,7 +136,7 @@ struct ppp_mppe_state { * Key Derivation, from RFC 3078, RFC 3079. * Equivalent to Get_Key() for MS-CHAP as described in RFC 3079. */ -static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *InterimKey) +static void get_new_key_from_sha(struct ppp_mppe_state * state) { struct hash_desc desc; struct scatterlist sg[4]; @@ -153,8 +153,6 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *I desc.flags = 0; crypto_hash_digest(&desc, sg, nbytes, state->sha1_digest); - - memcpy(InterimKey, state->sha1_digest, state->keylen); } /* @@ -163,21 +161,21 @@ static void get_new_key_from_sha(struct ppp_mppe_state * state, unsigned char *I */ static void mppe_rekey(struct ppp_mppe_state * state, int initial_key) { - unsigned char InterimKey[MPPE_MAX_KEY_LEN]; struct scatterlist sg_in[1], sg_out[1]; struct blkcipher_desc desc = { .tfm = state->arc4 }; - get_new_key_from_sha(state, InterimKey); + get_new_key_from_sha(state); if (!initial_key) { - crypto_blkcipher_setkey(state->arc4, InterimKey, state->keylen); - setup_sg(sg_in, InterimKey, state->keylen); + crypto_blkcipher_setkey(state->arc4, state->sha1_digest, + state->keylen); + setup_sg(sg_in, state->sha1_digest, state->keylen); setup_sg(sg_out, state->session_key, state->keylen); if (crypto_blkcipher_encrypt(&desc, sg_out, sg_in, state->keylen) != 0) { printk(KERN_WARNING "mppe_rekey: cipher_encrypt failed\n"); } } else { - memcpy(state->session_key, InterimKey, state->keylen); + memcpy(state->session_key, state->sha1_digest, state->keylen); } if (state->keylen == 8) { /* See RFC 3078 */ diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c index 69da95b5ad0..ea151315050 100755 --- a/drivers/net/qla3xxx.c +++ b/drivers/net/qla3xxx.c @@ -2248,6 +2248,13 @@ static int ql_tx_rx_clean(struct ql3_adapter *qdev, qdev->rsp_consumer_index) && (work_done < work_to_do)) { net_rsp = qdev->rsp_current; + rmb(); + /* + * Fix 4032 chipe undocumented "feature" where bit-8 is set if the + * inbound completion is for a VLAN. + */ + if (qdev->device_id == QL3032_DEVICE_ID) + net_rsp->opcode &= 0x7f; switch (net_rsp->opcode) { case OPCODE_OB_MAC_IOCB_FN0: diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index b85ab4a8f2a..c76dd29c8e9 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c @@ -1228,7 +1228,10 @@ static void rtl8169_hw_phy_config(struct net_device *dev) return; } - /* phy config for RTL8169s mac_version C chip */ + if ((tp->mac_version != RTL_GIGA_MAC_VER_02) && + (tp->mac_version != RTL_GIGA_MAC_VER_03)) + return; + mdio_write(ioaddr, 31, 0x0001); //w 31 2 0 1 mdio_write(ioaddr, 21, 0x1000); //w 21 15 0 1000 mdio_write(ioaddr, 24, 0x65c7); //w 24 15 0 65c7 @@ -1915,7 +1918,11 @@ static void rtl_hw_start_8169(struct net_device *dev) rtl_set_rx_max_size(ioaddr); - rtl_set_rx_tx_config_registers(tp); + if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || + (tp->mac_version == RTL_GIGA_MAC_VER_02) || + (tp->mac_version == RTL_GIGA_MAC_VER_03) || + (tp->mac_version == RTL_GIGA_MAC_VER_04)) + rtl_set_rx_tx_config_registers(tp); tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; @@ -1938,6 +1945,14 @@ static void rtl_hw_start_8169(struct net_device *dev) rtl_set_rx_tx_desc_registers(tp, ioaddr); + if ((tp->mac_version != RTL_GIGA_MAC_VER_01) && + (tp->mac_version != RTL_GIGA_MAC_VER_02) && + (tp->mac_version != RTL_GIGA_MAC_VER_03) && + (tp->mac_version != RTL_GIGA_MAC_VER_04)) { + RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); + rtl_set_rx_tx_config_registers(tp); + } + RTL_W8(Cfg9346, Cfg9346_Lock); /* Initially a 10 us delay. Turned it into a PCI commit. - FR */ @@ -1952,8 +1967,6 @@ static void rtl_hw_start_8169(struct net_device *dev) /* Enable all known interrupts by setting the interrupt mask. */ RTL_W16(IntrMask, tp->intr_event); - - RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb); } static void rtl_hw_start_8168(struct net_device *dev) @@ -2567,6 +2580,15 @@ static void rtl8169_tx_interrupt(struct net_device *dev, (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { netif_wake_queue(dev); } + /* + * 8168 hack: TxPoll requests are lost when the Tx packets are + * too close. Let's kick an extra TxPoll request when a burst + * of start_xmit activity is detected (if it is not detected, + * it is slow enough). -- FR + */ + smp_rmb(); + if (tp->cur_tx != dirty_tx) + RTL_W8(TxPoll, NPQ); } } diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index eaffe551d1d..ea117fc3d5e 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -338,6 +338,16 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) if (!(hw->flags & SKY2_HW_GIGABIT)) { /* enable automatic crossover */ ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO) >> 1; + + if (hw->chip_id == CHIP_ID_YUKON_FE_P && + hw->chip_rev == CHIP_REV_YU_FE2_A0) { + u16 spec; + + /* Enable Class A driver for FE+ A0 */ + spec = gm_phy_read(hw, port, PHY_MARV_FE_SPEC_2); + spec |= PHY_M_FESC_SEL_CL_A; + gm_phy_write(hw, port, PHY_MARV_FE_SPEC_2, spec); + } } else { /* disable energy detect */ ctrl &= ~PHY_M_PC_EN_DET_MSK; @@ -816,7 +826,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_CLR); sky2_write16(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_OPER_ON); - if (!(hw->flags & SKY2_HW_RAMBUFFER)) { + /* On chips without ram buffer, pause is controled by MAC level */ + if (sky2_read8(hw, B2_E_0) == 0) { sky2_write8(hw, SK_REG(port, RX_GMF_LP_THR), 768/8); sky2_write8(hw, SK_REG(port, RX_GMF_UP_THR), 1024/8); @@ -899,6 +910,20 @@ static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2) return le; } +static void tx_init(struct sky2_port *sky2) +{ + struct sky2_tx_le *le; + + sky2->tx_prod = sky2->tx_cons = 0; + sky2->tx_tcpsum = 0; + sky2->tx_last_mss = 0; + + le = get_tx_le(sky2); + le->addr = 0; + le->opcode = OP_ADDR64 | HW_OWNER; + sky2->tx_addr64 = 0; +} + static inline struct tx_ring_info *tx_le_re(struct sky2_port *sky2, struct sky2_tx_le *le) { @@ -1271,7 +1296,7 @@ static int sky2_up(struct net_device *dev) struct sky2_port *sky2 = netdev_priv(dev); struct sky2_hw *hw = sky2->hw; unsigned port = sky2->port; - u32 imask; + u32 imask, ramsize; int cap, err = -ENOMEM; struct net_device *otherdev = hw->dev[sky2->port^1]; @@ -1309,7 +1334,8 @@ static int sky2_up(struct net_device *dev) GFP_KERNEL); if (!sky2->tx_ring) goto err_out; - sky2->tx_prod = sky2->tx_cons = 0; + + tx_init(sky2); sky2->rx_le = pci_alloc_consistent(hw->pdev, RX_LE_BYTES, &sky2->rx_le_map); @@ -1326,13 +1352,12 @@ static int sky2_up(struct net_device *dev) sky2_mac_init(hw, port); - if (hw->flags & SKY2_HW_RAMBUFFER) { - /* Register is number of 4K blocks on internal RAM buffer. */ - u32 ramsize = sky2_read8(hw, B2_E_0) * 4; + /* Register is number of 4K blocks on internal RAM buffer. */ + ramsize = sky2_read8(hw, B2_E_0) * 4; + if (ramsize > 0) { u32 rxspace; - printk(KERN_DEBUG PFX "%s: ram buffer %dK\n", dev->name, ramsize); - + pr_debug(PFX "%s: ram buffer %dK\n", dev->name, ramsize); if (ramsize < 16) rxspace = ramsize / 2; else @@ -1995,7 +2020,7 @@ static int sky2_change_mtu(struct net_device *dev, int new_mtu) synchronize_irq(hw->pdev->irq); - if (!(hw->flags & SKY2_HW_RAMBUFFER)) + if (sky2_read8(hw, B2_E_0) == 0) sky2_set_tx_stfwd(hw, port); ctl = gma_read16(hw, port, GM_GP_CTRL); @@ -2138,6 +2163,15 @@ static struct sk_buff *sky2_receive(struct net_device *dev, sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; prefetch(sky2->rx_ring + sky2->rx_next); + /* This chip has hardware problems that generates bogus status. + * So do only marginal checking and expect higher level protocols + * to handle crap frames. + */ + if (sky2->hw->chip_id == CHIP_ID_YUKON_FE_P && + sky2->hw->chip_rev == CHIP_REV_YU_FE2_A0 && + length != count) + goto okay; + if (status & GMR_FS_ANY_ERR) goto error; @@ -2146,8 +2180,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, /* if length reported by DMA does not match PHY, packet was truncated */ if (length != count) - goto len_mismatch; + goto len_error; +okay: if (length < copybreak) skb = receive_copy(sky2, re, length); else @@ -2157,13 +2192,13 @@ resubmit: return skb; -len_mismatch: +len_error: /* Truncation of overlength packets causes PHY length to not match MAC length */ ++sky2->net_stats.rx_length_errors; if (netif_msg_rx_err(sky2) && net_ratelimit()) - pr_info(PFX "%s: rx length mismatch: length %d status %#x\n", - dev->name, length, status); + pr_info(PFX "%s: rx length error: status %#x length %d\n", + dev->name, status, length); goto resubmit; error: @@ -2526,7 +2561,7 @@ static void sky2_watchdog(unsigned long arg) ++active; /* For chips with Rx FIFO, check if stuck */ - if ((hw->flags & SKY2_HW_RAMBUFFER) && + if ((hw->flags & SKY2_HW_FIFO_HANG_CHECK) && sky2_rx_hung(dev)) { pr_info(PFX "%s: receiver hang detected\n", dev->name); @@ -2684,8 +2719,10 @@ static int __devinit sky2_init(struct sky2_hw *hw) switch(hw->chip_id) { case CHIP_ID_YUKON_XL: hw->flags = SKY2_HW_GIGABIT - | SKY2_HW_NEWER_PHY - | SKY2_HW_RAMBUFFER; + | SKY2_HW_NEWER_PHY; + if (hw->chip_rev < 3) + hw->flags |= SKY2_HW_FIFO_HANG_CHECK; + break; case CHIP_ID_YUKON_EC_U: @@ -2711,11 +2748,10 @@ static int __devinit sky2_init(struct sky2_hw *hw) dev_err(&hw->pdev->dev, "unsupported revision Yukon-EC rev A1\n"); return -EOPNOTSUPP; } - hw->flags = SKY2_HW_GIGABIT | SKY2_HW_RAMBUFFER; + hw->flags = SKY2_HW_GIGABIT | SKY2_HW_FIFO_HANG_CHECK; break; case CHIP_ID_YUKON_FE: - hw->flags = SKY2_HW_RAMBUFFER; break; case CHIP_ID_YUKON_FE_P: @@ -3923,13 +3959,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, sky2->hw = hw; sky2->msg_enable = netif_msg_init(debug, default_msg); - /* This chip has hardware problems that generates - * bogus PHY receive status so by default shut up the message. - */ - if (hw->chip_id == CHIP_ID_YUKON_FE_P && - hw->chip_rev == CHIP_REV_YU_FE2_A0) - sky2->msg_enable &= ~NETIF_MSG_RX_ERR; - /* Auto speed and flow control */ sky2->autoneg = AUTONEG_ENABLE; sky2->flow_mode = FC_BOTH; @@ -3953,8 +3982,12 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, dev->features |= NETIF_F_HIGHDMA; #ifdef SKY2_VLAN_TAG_USED - dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; - dev->vlan_rx_register = sky2_vlan_rx_register; + /* The workaround for FE+ status conflicts with VLAN tag detection. */ + if (!(sky2->hw->chip_id == CHIP_ID_YUKON_FE_P && + sky2->hw->chip_rev == CHIP_REV_YU_FE2_A0)) { + dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; + dev->vlan_rx_register = sky2_vlan_rx_register; + } #endif /* read the mac address */ diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 69cd98400fe..8bc5c54e3ef 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h @@ -2063,7 +2063,7 @@ struct sky2_hw { #define SKY2_HW_FIBRE_PHY 0x00000002 #define SKY2_HW_GIGABIT 0x00000004 #define SKY2_HW_NEWER_PHY 0x00000008 -#define SKY2_HW_RAMBUFFER 0x00000010 /* chip has RAM FIFO */ +#define SKY2_HW_FIFO_HANG_CHECK 0x00000010 #define SKY2_HW_NEW_LE 0x00000020 /* new LSOv2 format */ #define SKY2_HW_AUTO_TX_SUM 0x00000040 /* new IP decode for Tx */ #define SKY2_HW_ADV_POWER_CTL 0x00000080 /* additional PHY power regs */ diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 16c7a0e8785..a2de32fabc1 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c @@ -405,7 +405,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) dev->net->ethtool_ops = &dm9601_ethtool_ops; dev->net->hard_header_len += DM_TX_OVERHEAD; dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; - dev->rx_urb_size = dev->net->mtu + DM_RX_OVERHEAD; + dev->rx_urb_size = dev->net->mtu + ETH_HLEN + DM_RX_OVERHEAD; dev->mii.dev = dev->net; dev->mii.mdio_read = dm9601_mdio_read; diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile index ef35bc6c4a2..4eb6d975288 100644 --- a/drivers/net/wireless/Makefile +++ b/drivers/net/wireless/Makefile @@ -43,7 +43,7 @@ obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o obj-$(CONFIG_USB_ZD1201) += zd1201.o -obj-$(CONFIG_LIBERTAS_USB) += libertas/ +obj-$(CONFIG_LIBERTAS) += libertas/ rtl8187-objs := rtl8187_dev.o rtl8187_rtl8225.o obj-$(CONFIG_RTL8187) += rtl8187.o diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c index d6d9413d7f2..6acfdc49dcc 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c @@ -444,7 +444,7 @@ static int bcm43xx_wx_set_xmitpower(struct net_device *net_dev, u16 maxpower; if ((data->txpower.flags & IW_TXPOW_TYPE) != IW_TXPOW_DBM) { - printk(PFX KERN_ERR "TX power not in dBm.\n"); + printk(KERN_ERR PFX "TX power not in dBm.\n"); return -EOPNOTSUPP; } diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index d590a99930f..2305cc450a4 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c @@ -45,7 +45,7 @@ #include "cpqphp.h" #include "cpqphp_nvram.h" -#include "../../../arch/i386/pci/pci.h" /* horrible hack showing how processor dependent we are... */ +#include "../../../arch/x86/pci/pci.h" /* horrible hack showing how processor dependent we are... */ /* Global variables */ diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c index fc7c74d7259..3f6cd20e95d 100644 --- a/drivers/pci/hotplug/cpqphp_pci.c +++ b/drivers/pci/hotplug/cpqphp_pci.c @@ -37,7 +37,7 @@ #include "../pci.h" #include "cpqphp.h" #include "cpqphp_nvram.h" -#include "../../../arch/i386/pci/pci.h" /* horrible hack showing how processor dependent we are... */ +#include "../../../arch/x86/pci/pci.h" /* horrible hack showing how processor dependent we are... */ u8 cpqhp_nic_irq; diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index 0316eeaaeb2..a90c28d0c69 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c @@ -35,7 +35,7 @@ #include <linux/delay.h> #include <linux/wait.h> #include "../pci.h" -#include "../../../arch/i386/pci/pci.h" /* for struct irq_routing_table */ +#include "../../../arch/x86/pci/pci.h" /* for struct irq_routing_table */ #include "ibmphp.h" #define attn_on(sl) ibmphp_hpc_writeslot (sl, HPC_SLOT_ATTNON) diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 7dcaa09b3c2..50f2dd9e1bb 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c @@ -1444,7 +1444,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID, quirk_netmos); static void __devinit quirk_e100_interrupt(struct pci_dev *dev) { u16 command; - u32 bar; u8 __iomem *csr; u8 cmd_hi; @@ -1476,12 +1475,12 @@ static void __devinit quirk_e100_interrupt(struct pci_dev *dev) * re-enable them when it's ready. */ pci_read_config_word(dev, PCI_COMMAND, &command); - pci_read_config_dword(dev, PCI_BASE_ADDRESS_0, &bar); - if (!(command & PCI_COMMAND_MEMORY) || !bar) + if (!(command & PCI_COMMAND_MEMORY) || !pci_resource_start(dev, 0)) return; - csr = ioremap(bar, 8); + /* Convert from PCI bus to resource space. */ + csr = ioremap(pci_resource_start(dev, 0), 8); if (!csr) { printk(KERN_WARNING "PCI: Can't map %s e100 registers\n", pci_name(dev)); diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index c7c4574729b..de3155b2128 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c @@ -289,6 +289,7 @@ int power_supply_uevent(struct device *dev, char **envp, int num_envp, if (ret) goto out; } + envp[i] = NULL; out: free_page((unsigned long)prop_buf); diff --git a/drivers/scsi/aic94xx/aic94xx_task.c b/drivers/scsi/aic94xx/aic94xx_task.c index d5d8caba356..ab13824df85 100644 --- a/drivers/scsi/aic94xx/aic94xx_task.c +++ b/drivers/scsi/aic94xx/aic94xx_task.c @@ -451,7 +451,7 @@ static int asd_build_smp_ascb(struct asd_ascb *ascb, struct sas_task *task, struct scb *scb; pci_map_sg(asd_ha->pcidev, &task->smp_task.smp_req, 1, - PCI_DMA_FROMDEVICE); + PCI_DMA_TODEVICE); pci_map_sg(asd_ha->pcidev, &task->smp_task.smp_resp, 1, PCI_DMA_FROMDEVICE); @@ -486,7 +486,7 @@ static void asd_unbuild_smp_ascb(struct asd_ascb *a) BUG_ON(!task); pci_unmap_sg(a->ha->pcidev, &task->smp_task.smp_req, 1, - PCI_DMA_FROMDEVICE); + PCI_DMA_TODEVICE); pci_unmap_sg(a->ha->pcidev, &task->smp_task.smp_resp, 1, PCI_DMA_FROMDEVICE); } diff --git a/drivers/scsi/esp_scsi.c b/drivers/scsi/esp_scsi.c index 77b06a983fa..95cf7b6cd62 100644 --- a/drivers/scsi/esp_scsi.c +++ b/drivers/scsi/esp_scsi.c @@ -2314,6 +2314,7 @@ int __devinit scsi_esp_register(struct esp *esp, struct device *dev) esp->host->transportt = esp_transport_template; esp->host->max_lun = ESP_MAX_LUN; esp->host->cmd_per_lun = 2; + esp->host->unique_id = instance; esp_set_clock_params(esp); @@ -2337,7 +2338,7 @@ int __devinit scsi_esp_register(struct esp *esp, struct device *dev) if (err) return err; - esp->host->unique_id = instance++; + instance++; scsi_scan_host(esp->host); diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 3907f6718ed..da56163c30a 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -1753,6 +1753,14 @@ mega_build_sglist(adapter_t *adapter, scb_t *scb, u32 *buf, u32 *len) *len = 0; + if (scsi_sg_count(cmd) == 1 && !adapter->has_64bit_addr) { + sg = scsi_sglist(cmd); + scb->dma_h_bulkdata = sg_dma_address(sg); + *buf = (u32)scb->dma_h_bulkdata; + *len = sg_dma_len(sg); + return 0; + } + scsi_for_each_sg(cmd, sg, sgcnt, idx) { if (adapter->has_64bit_addr) { scb->sgl64[idx].address = sg_dma_address(sg); diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 6f56f875063..4df21c92ff1 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -787,10 +787,12 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) struct scsi_target *starget = sdev->sdev_target; struct Scsi_Host *shost = sdev->host; int len = sdev->inquiry_len; + int min_period = spi_min_period(starget); + int max_width = spi_max_width(starget); /* first set us up for narrow async */ DV_SET(offset, 0); DV_SET(width, 0); - + if (spi_dv_device_compare_inquiry(sdev, buffer, buffer, DV_LOOPS) != SPI_COMPARE_SUCCESS) { starget_printk(KERN_ERR, starget, "Domain Validation Initial Inquiry Failed\n"); @@ -798,9 +800,13 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) return; } + if (!scsi_device_wide(sdev)) { + spi_max_width(starget) = 0; + max_width = 0; + } + /* test width */ - if (i->f->set_width && spi_max_width(starget) && - scsi_device_wide(sdev)) { + if (i->f->set_width && max_width) { i->f->set_width(starget, 1); if (spi_dv_device_compare_inquiry(sdev, buffer, @@ -809,6 +815,11 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) != SPI_COMPARE_SUCCESS) { starget_printk(KERN_ERR, starget, "Wide Transfers Fail\n"); i->f->set_width(starget, 0); + /* Make sure we don't force wide back on by asking + * for a transfer period that requires it */ + max_width = 0; + if (min_period < 10) + min_period = 10; } } @@ -828,7 +839,8 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) /* now set up to the maximum */ DV_SET(offset, spi_max_offset(starget)); - DV_SET(period, spi_min_period(starget)); + DV_SET(period, min_period); + /* try QAS requests; this should be harmless to set if the * target supports it */ if (scsi_device_qas(sdev)) { @@ -837,14 +849,14 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) DV_SET(qas, 0); } - if (scsi_device_ius(sdev) && spi_min_period(starget) < 9) { + if (scsi_device_ius(sdev) && min_period < 9) { /* This u320 (or u640). Set IU transfers */ DV_SET(iu, 1); /* Then set the optional parameters */ DV_SET(rd_strm, 1); DV_SET(wr_flow, 1); DV_SET(rti, 1); - if (spi_min_period(starget) == 8) + if (min_period == 8) DV_SET(pcomp_en, 1); } else { DV_SET(iu, 0); @@ -862,6 +874,10 @@ spi_dv_device_internal(struct scsi_device *sdev, u8 *buffer) } else { DV_SET(dt, 1); } + /* set width last because it will pull all the other + * parameters down to required values */ + DV_SET(width, max_width); + /* Do the read only INQUIRY tests */ spi_dv_retrain(sdev, buffer, buffer + sdev->inquiry_len, spi_dv_device_compare_inquiry); diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.h b/drivers/serial/cpm_uart/cpm_uart_cpm1.h index a99e45e2b6d..2a6477834c3 100644 --- a/drivers/serial/cpm_uart/cpm_uart_cpm1.h +++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.h @@ -37,6 +37,6 @@ static inline void cpm_set_smc_fcr(volatile smc_uart_t * up) up->smc_tfcr = SMC_EB; } -#define DPRAM_BASE ((unsigned char *)&cpmp->cp_dpmem[0]) +#define DPRAM_BASE ((unsigned char *)cpm_dpram_addr(0)) #endif diff --git a/drivers/serial/serial_cs.c b/drivers/serial/serial_cs.c index a0ea4359851..7c8d78fbbbf 100644 --- a/drivers/serial/serial_cs.c +++ b/drivers/serial/serial_cs.c @@ -943,6 +943,7 @@ static struct pcmcia_device_id serial_ids[] = { PCMCIA_MFC_DEVICE_PROD_ID12(1,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4), PCMCIA_MFC_DEVICE_PROD_ID12(2,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4), PCMCIA_MFC_DEVICE_PROD_ID12(3,"Elan","Serial Port: SL432",0x3beb8cf2,0x1cce7ac4), + PCMCIA_DEVICE_MANF_CARD(0x0279, 0x950b), /* too generic */ /* PCMCIA_MFC_DEVICE_MANF_CARD(0, 0x0160, 0x0002), */ /* PCMCIA_MFC_DEVICE_MANF_CARD(1, 0x0160, 0x0002), */ diff --git a/drivers/serial/sunsab.c b/drivers/serial/sunsab.c index e348ba68405..ff610c23314 100644 --- a/drivers/serial/sunsab.c +++ b/drivers/serial/sunsab.c @@ -38,7 +38,7 @@ #include <asm/prom.h> #include <asm/of_device.h> -#if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) +#if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) #define SUPPORT_SYSRQ #endif diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c index 8d7ab74170d..a593f900eff 100644 --- a/drivers/w1/w1.c +++ b/drivers/w1/w1.c @@ -431,6 +431,7 @@ static int w1_uevent(struct device *dev, char **envp, int num_envp, err = add_uevent_var(envp, num_envp, &cur_index, buffer, buffer_size, &cur_len, "W1_SLAVE_ID=%024LX", (unsigned long long)sl->reg_num.id); + envp[cur_index] = NULL; if (err) return err; @@ -1562,6 +1562,7 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, fput(file); return -EAGAIN; } + req->ki_filp = file; if (iocb->aio_flags & IOCB_FLAG_RESFD) { /* * If the IOCB_FLAG_RESFD flag of aio_flags is set, get an @@ -1576,7 +1577,6 @@ int fastcall io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, } } - req->ki_filp = file; ret = put_user(req->ki_key, &user_iocb->aio_key); if (unlikely(ret)) { dprintk("EFAULT: aio_key\n"); diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 861141b4f6d..fcb3405bb14 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c @@ -742,6 +742,7 @@ static int load_flat_file(struct linux_binprm * bprm, * __start to address 4 so that is okay). */ if (rev > OLD_FLAT_VERSION) { + unsigned long persistent = 0; for (i=0; i < relocs; i++) { unsigned long addr, relval; @@ -749,6 +750,8 @@ static int load_flat_file(struct linux_binprm * bprm, relocated (of course, the address has to be relocated first). */ relval = ntohl(reloc[i]); + if (flat_set_persistent (relval, &persistent)) + continue; addr = flat_get_relocate_addr(relval); rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); if (rp == (unsigned long *)RELOC_FAILED) { @@ -757,7 +760,8 @@ static int load_flat_file(struct linux_binprm * bprm, } /* Get the pointer's value. */ - addr = flat_get_addr_from_rp(rp, relval, flags); + addr = flat_get_addr_from_rp(rp, relval, flags, + &persistent); if (addr != 0) { /* * Do the relocation. PIC relocs in the data section are diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 5a5b7116cef..37310b0e810 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c @@ -3190,6 +3190,8 @@ COMPATIBLE_IOCTL(SIOCSIWRETRY) COMPATIBLE_IOCTL(SIOCGIWRETRY) COMPATIBLE_IOCTL(SIOCSIWPOWER) COMPATIBLE_IOCTL(SIOCGIWPOWER) +COMPATIBLE_IOCTL(SIOCSIWAUTH) +COMPATIBLE_IOCTL(SIOCGIWAUTH) /* hiddev */ COMPATIBLE_IOCTL(HIDIOCGVERSION) COMPATIBLE_IOCTL(HIDIOCAPPLICATION) diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c index a21e4bc5444..d120ec39bcb 100644 --- a/fs/lockd/svclock.c +++ b/fs/lockd/svclock.c @@ -171,19 +171,14 @@ found: * GRANTED_RES message by cookie, without having to rely on the client's IP * address. --okir */ -static inline struct nlm_block * -nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_file *file, - struct nlm_lock *lock, struct nlm_cookie *cookie) +static struct nlm_block * +nlmsvc_create_block(struct svc_rqst *rqstp, struct nlm_host *host, + struct nlm_file *file, struct nlm_lock *lock, + struct nlm_cookie *cookie) { struct nlm_block *block; - struct nlm_host *host; struct nlm_rqst *call = NULL; - /* Create host handle for callback */ - host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); - if (host == NULL) - return NULL; - call = nlm_alloc_call(host); if (call == NULL) return NULL; @@ -366,6 +361,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, struct nlm_lock *lock, int wait, struct nlm_cookie *cookie) { struct nlm_block *block = NULL; + struct nlm_host *host; int error; __be32 ret; @@ -377,6 +373,10 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, (long long)lock->fl.fl_end, wait); + /* Create host handle for callback */ + host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); + if (host == NULL) + return nlm_lck_denied_nolocks; /* Lock file against concurrent access */ mutex_lock(&file->f_mutex); @@ -385,7 +385,8 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, */ block = nlmsvc_lookup_block(file, lock); if (block == NULL) { - block = nlmsvc_create_block(rqstp, file, lock, cookie); + block = nlmsvc_create_block(rqstp, nlm_get_host(host), file, + lock, cookie); ret = nlm_lck_denied_nolocks; if (block == NULL) goto out; @@ -449,6 +450,7 @@ nlmsvc_lock(struct svc_rqst *rqstp, struct nlm_file *file, out: mutex_unlock(&file->f_mutex); nlmsvc_release_block(block); + nlm_release_host(host); dprintk("lockd: nlmsvc_lock returned %u\n", ret); return ret; } @@ -477,10 +479,17 @@ nlmsvc_testlock(struct svc_rqst *rqstp, struct nlm_file *file, if (block == NULL) { struct file_lock *conf = kzalloc(sizeof(*conf), GFP_KERNEL); + struct nlm_host *host; if (conf == NULL) return nlm_granted; - block = nlmsvc_create_block(rqstp, file, lock, cookie); + /* Create host handle for callback */ + host = nlmsvc_lookup_host(rqstp, lock->caller, lock->len); + if (host == NULL) { + kfree(conf); + return nlm_lck_denied_nolocks; + } + block = nlmsvc_create_block(rqstp, host, file, lock, cookie); if (block == NULL) { kfree(conf); return nlm_granted; diff --git a/fs/nfs/client.c b/fs/nfs/client.c index a49f9feff77..a204484072f 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -588,16 +588,6 @@ static int nfs_init_server(struct nfs_server *server, const struct nfs_mount_dat server->namelen = data->namlen; /* Create a client RPC handle for the NFSv3 ACL management interface */ nfs_init_server_aclclient(server); - if (clp->cl_nfsversion == 3) { - if (server->namelen == 0 || server->namelen > NFS3_MAXNAMLEN) - server->namelen = NFS3_MAXNAMLEN; - if (!(data->flags & NFS_MOUNT_NORDIRPLUS)) - server->caps |= NFS_CAP_READDIRPLUS; - } else { - if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN) - server->namelen = NFS2_MAXNAMLEN; - } - dprintk("<-- nfs_init_server() = 0 [new %p]\n", clp); return 0; @@ -794,6 +784,16 @@ struct nfs_server *nfs_create_server(const struct nfs_mount_data *data, error = nfs_probe_fsinfo(server, mntfh, &fattr); if (error < 0) goto error; + if (server->nfs_client->rpc_ops->version == 3) { + if (server->namelen == 0 || server->namelen > NFS3_MAXNAMLEN) + server->namelen = NFS3_MAXNAMLEN; + if (!(data->flags & NFS_MOUNT_NORDIRPLUS)) + server->caps |= NFS_CAP_READDIRPLUS; + } else { + if (server->namelen == 0 || server->namelen > NFS2_MAXNAMLEN) + server->namelen = NFS2_MAXNAMLEN; + } + if (!(fattr.valid & NFS_ATTR_FATTR)) { error = server->nfs_client->rpc_ops->getattr(server, mntfh, &fattr); if (error < 0) { @@ -984,6 +984,9 @@ struct nfs_server *nfs4_create_server(const struct nfs4_mount_data *data, if (error < 0) goto error; + if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN) + server->namelen = NFS4_MAXNAMLEN; + BUG_ON(!server->nfs_client); BUG_ON(!server->nfs_client->rpc_ops); BUG_ON(!server->nfs_client->rpc_ops->file_inode_ops); @@ -1056,6 +1059,9 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, if (error < 0) goto error; + if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN) + server->namelen = NFS4_MAXNAMLEN; + dprintk("Referral FSID: %llx:%llx\n", (unsigned long long) server->fsid.major, (unsigned long long) server->fsid.minor); @@ -1115,6 +1121,9 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, if (error < 0) goto out_free_server; + if (server->namelen == 0 || server->namelen > NFS4_MAXNAMLEN) + server->namelen = NFS4_MAXNAMLEN; + dprintk("Cloned FSID: %llx:%llx\n", (unsigned long long) server->fsid.major, (unsigned long long) server->fsid.minor); diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index ea97408e423..e4a04d16b8b 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1162,6 +1162,8 @@ static struct dentry *nfs_readdir_lookup(nfs_readdir_descriptor_t *desc) } if (!desc->plus || !(entry->fattr->valid & NFS_ATTR_FATTR)) return NULL; + if (name.len > NFS_SERVER(dir)->namelen) + return NULL; /* Note: caller is already holding the dir->i_mutex! */ dentry = d_alloc(parent, &name); if (dentry == NULL) diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c index d1cbf0a0fbb..522e5ad4d8a 100644 --- a/fs/nfs/getroot.c +++ b/fs/nfs/getroot.c @@ -175,6 +175,9 @@ next_component: path++; name.len = path - (const char *) name.name; + if (name.len > NFS4_MAXNAMLEN) + return -ENAMETOOLONG; + eat_dot_dir: while (*path == '/') path++; diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index de984d27257..d272847d5a0 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -514,8 +514,10 @@ int ocfs2_reserve_local_alloc_bits(struct ocfs2_super *osb, ac->ac_bh = osb->local_alloc_bh; status = 0; bail: - if (status < 0 && local_alloc_inode) + if (status < 0 && local_alloc_inode) { + mutex_unlock(&local_alloc_inode->i_mutex); iput(local_alloc_inode); + } mlog_exit(status); return status; diff --git a/fs/splice.c b/fs/splice.c index c010a72ca2d..e95a3622886 100644 --- a/fs/splice.c +++ b/fs/splice.c @@ -1224,6 +1224,33 @@ static long do_splice(struct file *in, loff_t __user *off_in, } /* + * Do a copy-from-user while holding the mmap_semaphore for reading, in a + * manner safe from deadlocking with simultaneous mmap() (grabbing mmap_sem + * for writing) and page faulting on the user memory pointed to by src. + * This assumes that we will very rarely hit the partial != 0 path, or this + * will not be a win. + */ +static int copy_from_user_mmap_sem(void *dst, const void __user *src, size_t n) +{ + int partial; + + pagefault_disable(); + partial = __copy_from_user_inatomic(dst, src, n); + pagefault_enable(); + + /* + * Didn't copy everything, drop the mmap_sem and do a faulting copy + */ + if (unlikely(partial)) { + up_read(¤t->mm->mmap_sem); + partial = copy_from_user(dst, src, n); + down_read(¤t->mm->mmap_sem); + } + + return partial; +} + +/* * Map an iov into an array of pages and offset/length tupples. With the * partial_page structure, we can map several non-contiguous ranges into * our ones pages[] map instead of splitting that operation into pieces. @@ -1236,31 +1263,26 @@ static int get_iovec_page_array(const struct iovec __user *iov, { int buffers = 0, error = 0; - /* - * It's ok to take the mmap_sem for reading, even - * across a "get_user()". - */ down_read(¤t->mm->mmap_sem); while (nr_vecs) { unsigned long off, npages; + struct iovec entry; void __user *base; size_t len; int i; - /* - * Get user address base and length for this iovec. - */ - error = get_user(base, &iov->iov_base); - if (unlikely(error)) - break; - error = get_user(len, &iov->iov_len); - if (unlikely(error)) + error = -EFAULT; + if (copy_from_user_mmap_sem(&entry, iov, sizeof(entry))) break; + base = entry.iov_base; + len = entry.iov_len; + /* * Sanity check this iovec. 0 read succeeds. */ + error = 0; if (unlikely(!len)) break; error = -EFAULT; diff --git a/fs/ufs/super.c b/fs/ufs/super.c index 73402c5eeb8..38eb0b7a1f3 100644 --- a/fs/ufs/super.c +++ b/fs/ufs/super.c @@ -894,7 +894,7 @@ magic_found: goto again; } - + sbi->s_flags = flags;/*after that line some functions use s_flags*/ ufs_print_super_stuff(sb, usb1, usb2, usb3); /* @@ -1025,8 +1025,6 @@ magic_found: UFS_MOUNT_UFSTYPE_44BSD) uspi->s_maxsymlinklen = fs32_to_cpu(sb, usb3->fs_un2.fs_44.fs_maxsymlinklen); - - sbi->s_flags = flags; inode = iget(sb, UFS_ROOTINO); if (!inode || is_bad_inode(inode)) diff --git a/fs/xfs/xfs_buf_item.h b/fs/xfs/xfs_buf_item.h index fa25b7dcc6c..d7e13614306 100644 --- a/fs/xfs/xfs_buf_item.h +++ b/fs/xfs/xfs_buf_item.h @@ -52,11 +52,6 @@ typedef struct xfs_buf_log_format_t { #define XFS_BLI_UDQUOT_BUF 0x4 #define XFS_BLI_PDQUOT_BUF 0x8 #define XFS_BLI_GDQUOT_BUF 0x10 -/* - * This flag indicates that the buffer contains newly allocated - * inodes. - */ -#define XFS_BLI_INODE_NEW_BUF 0x20 #define XFS_BLI_CHUNK 128 #define XFS_BLI_SHIFT 7 diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 7174991f4be..8ae6e8e5f3d 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -1874,7 +1874,6 @@ xlog_recover_do_inode_buffer( /*ARGSUSED*/ STATIC void xlog_recover_do_reg_buffer( - xfs_mount_t *mp, xlog_recover_item_t *item, xfs_buf_t *bp, xfs_buf_log_format_t *buf_f) @@ -1885,50 +1884,6 @@ xlog_recover_do_reg_buffer( unsigned int *data_map = NULL; unsigned int map_size = 0; int error; - int stale_buf = 1; - - /* - * Scan through the on-disk inode buffer and attempt to - * determine if it has been written to since it was logged. - * - * - If any of the magic numbers are incorrect then the buffer is stale - * - If any of the modes are non-zero then the buffer is not stale - * - If all of the modes are zero and at least one of the generation - * counts is non-zero then the buffer is stale - * - * If the end result is a stale buffer then the log buffer is replayed - * otherwise it is skipped. - * - * This heuristic is not perfect. It can be improved by scanning the - * entire inode chunk for evidence that any of the inode clusters have - * been updated. To fix this problem completely we will need a major - * architectural change to the logging system. - */ - if (buf_f->blf_flags & XFS_BLI_INODE_NEW_BUF) { - xfs_dinode_t *dip; - int inodes_per_buf; - int mode_count = 0; - int gen_count = 0; - - stale_buf = 0; - inodes_per_buf = XFS_BUF_COUNT(bp) >> mp->m_sb.sb_inodelog; - for (i = 0; i < inodes_per_buf; i++) { - dip = (xfs_dinode_t *)xfs_buf_offset(bp, - i * mp->m_sb.sb_inodesize); - if (be16_to_cpu(dip->di_core.di_magic) != - XFS_DINODE_MAGIC) { - stale_buf = 1; - break; - } - if (dip->di_core.di_mode) - mode_count++; - if (dip->di_core.di_gen) - gen_count++; - } - - if (!mode_count && gen_count) - stale_buf = 1; - } switch (buf_f->blf_type) { case XFS_LI_BUF: @@ -1962,7 +1917,7 @@ xlog_recover_do_reg_buffer( -1, 0, XFS_QMOPT_DOWARN, "dquot_buf_recover"); } - if (!error && stale_buf) + if (!error) memcpy(xfs_buf_offset(bp, (uint)bit << XFS_BLI_SHIFT), /* dest */ item->ri_buf[i].i_addr, /* source */ @@ -2134,7 +2089,7 @@ xlog_recover_do_dquot_buffer( if (log->l_quotaoffs_flag & type) return; - xlog_recover_do_reg_buffer(mp, item, bp, buf_f); + xlog_recover_do_reg_buffer(item, bp, buf_f); } /* @@ -2235,7 +2190,7 @@ xlog_recover_do_buffer_trans( (XFS_BLI_UDQUOT_BUF|XFS_BLI_PDQUOT_BUF|XFS_BLI_GDQUOT_BUF)) { xlog_recover_do_dquot_buffer(mp, log, item, bp, buf_f); } else { - xlog_recover_do_reg_buffer(mp, item, bp, buf_f); + xlog_recover_do_reg_buffer(item, bp, buf_f); } if (error) return XFS_ERROR(error); diff --git a/fs/xfs/xfs_trans_buf.c b/fs/xfs/xfs_trans_buf.c index 95fff6872a2..60b6b898022 100644 --- a/fs/xfs/xfs_trans_buf.c +++ b/fs/xfs/xfs_trans_buf.c @@ -966,7 +966,6 @@ xfs_trans_inode_alloc_buf( ASSERT(atomic_read(&bip->bli_refcount) > 0); bip->bli_flags |= XFS_BLI_INODE_ALLOC_BUF; - bip->bli_format.blf_flags |= XFS_BLI_INODE_NEW_BUF; } diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 202acb9ff4d..f85f77a538a 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h @@ -147,10 +147,6 @@ static inline void unregister_hotplug_dock_device(acpi_handle handle) /*-------------------------------------------------------------------------- Suspend/Resume -------------------------------------------------------------------------- */ -#ifdef CONFIG_ACPI_SLEEP extern int acpi_sleep_init(void); -#else -static inline int acpi_sleep_init(void) { return 0; } -#endif #endif /*__ACPI_DRIVERS_H__*/ diff --git a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h index e043cafa3c4..69b9f8e120e 100644 --- a/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf533/bfin_serial_5xx.h @@ -1,5 +1,6 @@ #include <linux/serial.h> #include <asm/dma.h> +#include <asm/portmux.h> #define NR_PORTS 1 @@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = { } }; +#define DRIVER_NAME "bfin-uart" int nr_ports = NR_PORTS; static void bfin_serial_hw_init(struct bfin_serial_port *uart) { +#ifdef CONFIG_SERIAL_BFIN_UART0 + peripheral_request(P_UART0_TX, DRIVER_NAME); + peripheral_request(P_UART0_RX, DRIVER_NAME); +#endif + #ifdef CONFIG_SERIAL_BFIN_CTSRTS if (uart->cts_pin >= 0) { - gpio_request(uart->cts_pin, NULL); + gpio_request(uart->cts_pin, DRIVER_NAME); gpio_direction_input(uart->cts_pin); } if (uart->rts_pin >= 0) { - gpio_request(uart->rts_pin, NULL); + gpio_request(uart->rts_pin, DRIVER_NAME); gpio_direction_input(uart->rts_pin); } #endif diff --git a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h index 8f5d9c4d8d5..6fb328f5186 100644 --- a/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf537/bfin_serial_5xx.h @@ -1,5 +1,6 @@ #include <linux/serial.h> #include <asm/dma.h> +#include <asm/portmux.h> #define NR_PORTS 2 @@ -122,25 +123,29 @@ struct bfin_serial_res bfin_serial_resource[] = { int nr_ports = ARRAY_SIZE(bfin_serial_resource); +#define DRIVER_NAME "bfin-uart" + static void bfin_serial_hw_init(struct bfin_serial_port *uart) { - unsigned short val; - val = bfin_read16(BFIN_PORT_MUX); - val &= ~(PFDE | PFTE); - bfin_write16(BFIN_PORT_MUX, val); - val = bfin_read16(PORTF_FER); - val |= 0xF; - bfin_write16(PORTF_FER, val); +#ifdef CONFIG_SERIAL_BFIN_UART0 + peripheral_request(P_UART0_TX, DRIVER_NAME); + peripheral_request(P_UART0_RX, DRIVER_NAME); +#endif + +#ifdef CONFIG_SERIAL_BFIN_UART1 + peripheral_request(P_UART1_TX, DRIVER_NAME); + peripheral_request(P_UART1_RX, DRIVER_NAME); +#endif #ifdef CONFIG_SERIAL_BFIN_CTSRTS if (uart->cts_pin >= 0) { - gpio_request(uart->cts_pin, NULL); + gpio_request(uart->cts_pin, DRIVER_NAME); gpio_direction_input(uart->cts_pin); } if (uart->rts_pin >= 0) { - gpio_request(uart->rts_pin, NULL); + gpio_request(uart->rts_pin, DRIVER_NAME); gpio_direction_output(uart->rts_pin); } #endif diff --git a/include/asm-blackfin/mach-bf537/portmux.h b/include/asm-blackfin/mach-bf537/portmux.h index 23e13c5abc4..ae6c53b2845 100644 --- a/include/asm-blackfin/mach-bf537/portmux.h +++ b/include/asm-blackfin/mach-bf537/portmux.h @@ -106,4 +106,37 @@ #define P_SPI0_SSEL2 (P_DEFINED | P_IDENT(PORT_PJ11) | P_FUNCT(1)) #define P_SPI0_SSEL7 (P_DEFINED | P_IDENT(PORT_PJ5) | P_FUNCT(2)) -#endif /* _MACH_PORTMUX_H_ */ +#define P_MII0 {\ + P_MII0_ETxD0, \ + P_MII0_ETxD1, \ + P_MII0_ETxD2, \ + P_MII0_ETxD3, \ + P_MII0_ETxEN, \ + P_MII0_TxCLK, \ + P_MII0_PHYINT, \ + P_MII0_COL, \ + P_MII0_ERxD0, \ + P_MII0_ERxD1, \ + P_MII0_ERxD2, \ + P_MII0_ERxD3, \ + P_MII0_ERxDV, \ + P_MII0_ERxCLK, \ + P_MII0_ERxER, \ + P_MII0_CRS, \ + P_MDC, \ + P_MDIO, 0} + + +#define P_RMII0 {\ + P_MII0_ETxD0, \ + P_MII0_ETxD1, \ + P_MII0_ETxEN, \ + P_MII0_ERxD0, \ + P_MII0_ERxD1, \ + P_MII0_ERxER, \ + P_RMII0_REF_CLK, \ + P_RMII0_MDINT, \ + P_RMII0_CRS_DV, \ + P_MDC, \ + P_MDIO, 0} +#endif /* _MACH_PORTMUX_H_ */ diff --git a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h index e043cafa3c4..69b9f8e120e 100644 --- a/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h +++ b/include/asm-blackfin/mach-bf561/bfin_serial_5xx.h @@ -1,5 +1,6 @@ #include <linux/serial.h> #include <asm/dma.h> +#include <asm/portmux.h> #define NR_PORTS 1 @@ -92,18 +93,24 @@ struct bfin_serial_res bfin_serial_resource[] = { } }; +#define DRIVER_NAME "bfin-uart" int nr_ports = NR_PORTS; static void bfin_serial_hw_init(struct bfin_serial_port *uart) { +#ifdef CONFIG_SERIAL_BFIN_UART0 + peripheral_request(P_UART0_TX, DRIVER_NAME); + peripheral_request(P_UART0_RX, DRIVER_NAME); +#endif + #ifdef CONFIG_SERIAL_BFIN_CTSRTS if (uart->cts_pin >= 0) { - gpio_request(uart->cts_pin, NULL); + gpio_request(uart->cts_pin, DRIVER_NAME); gpio_direction_input(uart->cts_pin); } if (uart->rts_pin >= 0) { - gpio_request(uart->rts_pin, NULL); + gpio_request(uart->rts_pin, DRIVER_NAME); gpio_direction_input(uart->rts_pin); } #endif diff --git a/include/asm-blackfin/portmux.h b/include/asm-blackfin/portmux.h index 9d3681e4211..0d3f650d2d9 100644 --- a/include/asm-blackfin/portmux.h +++ b/include/asm-blackfin/portmux.h @@ -14,6 +14,12 @@ #define P_MAYSHARE 0x2000 #define P_DONTCARE 0x1000 + +int peripheral_request(unsigned short per, const char *label); +void peripheral_free(unsigned short per); +int peripheral_request_list(unsigned short per[], const char *label); +void peripheral_free_list(unsigned short per[]); + #include <asm/gpio.h> #include <asm/mach/portmux.h> @@ -145,6 +151,22 @@ #define P_SPI2_SSEL3 P_UNDEF #endif +#ifndef P_SPI2_SSEL4 +#define P_SPI2_SSEL4 P_UNDEF +#endif + +#ifndef P_SPI2_SSEL5 +#define P_SPI2_SSEL5 P_UNDEF +#endif + +#ifndef P_SPI2_SSEL6 +#define P_SPI2_SSEL6 P_UNDEF +#endif + +#ifndef P_SPI2_SSEL7 +#define P_SPI2_SSEL7 P_UNDEF +#endif + #ifndef P_SPI2_SCK #define P_SPI2_SCK P_UNDEF #endif @@ -513,6 +535,22 @@ #define P_SPI0_SSEL3 P_UNDEF #endif +#ifndef P_SPI0_SSEL4 +#define P_SPI0_SSEL4 P_UNDEF +#endif + +#ifndef P_SPI0_SSEL5 +#define P_SPI0_SSEL5 P_UNDEF +#endif + +#ifndef P_SPI0_SSEL6 +#define P_SPI0_SSEL6 P_UNDEF +#endif + +#ifndef P_SPI0_SSEL7 +#define P_SPI0_SSEL7 P_UNDEF +#endif + #ifndef P_UART0_TX #define P_UART0_TX P_UNDEF #endif @@ -741,6 +779,23 @@ #define P_SPI1_SSEL3 P_UNDEF #endif + +#ifndef P_SPI1_SSEL4 +#define P_SPI1_SSEL4 P_UNDEF +#endif + +#ifndef P_SPI1_SSEL5 +#define P_SPI1_SSEL5 P_UNDEF +#endif + +#ifndef P_SPI1_SSEL6 +#define P_SPI1_SSEL6 P_UNDEF +#endif + +#ifndef P_SPI1_SSEL7 +#define P_SPI1_SSEL7 P_UNDEF +#endif + #ifndef P_SPI1_SCK #define P_SPI1_SCK P_UNDEF #endif diff --git a/include/asm-blackfin/unistd.h b/include/asm-blackfin/unistd.h index 0df9f2d322a..07ffe8b718c 100644 --- a/include/asm-blackfin/unistd.h +++ b/include/asm-blackfin/unistd.h @@ -3,6 +3,7 @@ /* * This file contains the system call numbers. */ +#define __NR_restart_syscall 0 #define __NR_exit 1 #define __NR_fork 2 #define __NR_read 3 @@ -165,13 +166,13 @@ #define __NR_sched_get_priority_min 160 #define __NR_sched_rr_get_interval 161 #define __NR_nanosleep 162 - /* 163 __NR_mremap */ +#define __NR_mremap 163 #define __NR_setresuid 164 #define __NR_getresuid 165 /* 166 __NR_vm86 */ /* 167 __NR_query_module */ /* 168 __NR_poll */ - /* 169 __NR_nfsservctl */ +#define __NR_nfsservctl 169 #define __NR_setresgid 170 #define __NR_getresgid 171 #define __NR_prctl 172 @@ -227,7 +228,7 @@ /* 222 reserved for TUX */ /* 223 reserved for TUX */ #define __NR_gettid 224 - /* 225 __NR_readahead */ +#define __NR_readahead 225 #define __NR_setxattr 226 #define __NR_lsetxattr 227 #define __NR_fsetxattr 228 @@ -287,7 +288,7 @@ #define __NR_mq_timedreceive (__NR_mq_open+3) #define __NR_mq_notify (__NR_mq_open+4) #define __NR_mq_getsetattr (__NR_mq_open+5) - /* 284 __NR_sys_kexec_load */ +#define __NR_kexec_load 284 #define __NR_waitid 285 #define __NR_add_key 286 #define __NR_request_key 287 @@ -352,9 +353,54 @@ #define __NR_shmdt 340 #define __NR_shmget 341 -#define __NR_syscall 342 +#define __NR_splice 342 +#define __NR_sync_file_range 343 +#define __NR_tee 344 +#define __NR_vmsplice 345 + +#define __NR_epoll_pwait 346 +#define __NR_utimensat 347 +#define __NR_signalfd 348 +#define __NR_timerfd 349 +#define __NR_eventfd 350 +#define __NR_pread64 351 +#define __NR_pwrite64 352 +#define __NR_fadvise64 353 +#define __NR_set_robust_list 354 +#define __NR_get_robust_list 355 +#define __NR_fallocate 356 + +#define __NR_syscall 357 #define NR_syscalls __NR_syscall +/* Old optional stuff no one actually uses */ +#define __IGNORE_sysfs +#define __IGNORE_uselib + +/* Implement the newer interfaces */ +#define __IGNORE_mmap +#define __IGNORE_poll +#define __IGNORE_select +#define __IGNORE_utime + +/* Not relevant on no-mmu */ +#define __IGNORE_swapon +#define __IGNORE_swapoff +#define __IGNORE_msync +#define __IGNORE_mlock +#define __IGNORE_munlock +#define __IGNORE_mlockall +#define __IGNORE_munlockall +#define __IGNORE_mincore +#define __IGNORE_madvise +#define __IGNORE_remap_file_pages +#define __IGNORE_mbind +#define __IGNORE_get_mempolicy +#define __IGNORE_set_mempolicy +#define __IGNORE_migrate_pages +#define __IGNORE_move_pages +#define __IGNORE_getcpu + #ifdef __KERNEL__ #define __ARCH_WANT_IPC_PARSE_VERSION #define __ARCH_WANT_STAT64 diff --git a/include/asm-h8300/flat.h b/include/asm-h8300/flat.h index c20eee767d6..2a873508a9a 100644 --- a/include/asm-h8300/flat.h +++ b/include/asm-h8300/flat.h @@ -9,6 +9,7 @@ #define flat_argvp_envp_on_stack() 1 #define flat_old_ram_flag(flags) 1 #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) +#define flat_set_persistent(relval, p) 0 /* * on the H8 a couple of the relocations have an instruction in the @@ -18,7 +19,7 @@ */ #define flat_get_relocate_addr(rel) (rel) -#define flat_get_addr_from_rp(rp, relval, flags) \ +#define flat_get_addr_from_rp(rp, relval, flags, persistent) \ (get_unaligned(rp) & ((flags & FLAT_FLAG_GOTPIC) ? 0xffffffff: 0x00ffffff)) #define flat_put_addr_at_rp(rp, addr, rel) \ put_unaligned (((*(char *)(rp)) << 24) | ((addr) & 0x00ffffff), rp) diff --git a/include/asm-i386/Kbuild b/include/asm-i386/Kbuild deleted file mode 100644 index cbf6e8f1087..00000000000 --- a/include/asm-i386/Kbuild +++ /dev/null @@ -1,12 +0,0 @@ -include include/asm-generic/Kbuild.asm - -header-y += boot.h -header-y += debugreg.h -header-y += ldt.h -header-y += msr-index.h -header-y += ptrace-abi.h -header-y += ucontext.h - -unifdef-y += msr.h -unifdef-y += mtrr.h -unifdef-y += vm86.h diff --git a/include/asm-i386/k8.h b/include/asm-i386/k8.h deleted file mode 100644 index dfd88a6e604..00000000000 --- a/include/asm-i386/k8.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-x86_64/k8.h> diff --git a/include/asm-i386/pci-direct.h b/include/asm-i386/pci-direct.h deleted file mode 100644 index 4f6738b0820..00000000000 --- a/include/asm-i386/pci-direct.h +++ /dev/null @@ -1 +0,0 @@ -#include "asm-x86_64/pci-direct.h" diff --git a/include/asm-i386/stacktrace.h b/include/asm-i386/stacktrace.h deleted file mode 100644 index 7d1f6a5cbfc..00000000000 --- a/include/asm-i386/stacktrace.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-x86_64/stacktrace.h> diff --git a/include/asm-i386/system.h b/include/asm-i386/system.h deleted file mode 100644 index 609756c6167..00000000000 --- a/include/asm-i386/system.h +++ /dev/null @@ -1,318 +0,0 @@ -#ifndef __ASM_SYSTEM_H -#define __ASM_SYSTEM_H - -#include <linux/kernel.h> -#include <asm/segment.h> -#include <asm/cpufeature.h> -#include <asm/cmpxchg.h> - -#ifdef __KERNEL__ - -struct task_struct; /* one of the stranger aspects of C forward declarations.. */ -extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); - -/* - * Saving eflags is important. It switches not only IOPL between tasks, - * it also protects other tasks from NT leaking through sysenter etc. - */ -#define switch_to(prev,next,last) do { \ - unsigned long esi,edi; \ - asm volatile("pushfl\n\t" /* Save flags */ \ - "pushl %%ebp\n\t" \ - "movl %%esp,%0\n\t" /* save ESP */ \ - "movl %5,%%esp\n\t" /* restore ESP */ \ - "movl $1f,%1\n\t" /* save EIP */ \ - "pushl %6\n\t" /* restore EIP */ \ - "jmp __switch_to\n" \ - "1:\t" \ - "popl %%ebp\n\t" \ - "popfl" \ - :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ - "=a" (last),"=S" (esi),"=D" (edi) \ - :"m" (next->thread.esp),"m" (next->thread.eip), \ - "2" (prev), "d" (next)); \ -} while (0) - -#define _set_base(addr,base) do { unsigned long __pr; \ -__asm__ __volatile__ ("movw %%dx,%1\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %%dl,%2\n\t" \ - "movb %%dh,%3" \ - :"=&d" (__pr) \ - :"m" (*((addr)+2)), \ - "m" (*((addr)+4)), \ - "m" (*((addr)+7)), \ - "0" (base) \ - ); } while(0) - -#define _set_limit(addr,limit) do { unsigned long __lr; \ -__asm__ __volatile__ ("movw %%dx,%1\n\t" \ - "rorl $16,%%edx\n\t" \ - "movb %2,%%dh\n\t" \ - "andb $0xf0,%%dh\n\t" \ - "orb %%dh,%%dl\n\t" \ - "movb %%dl,%2" \ - :"=&d" (__lr) \ - :"m" (*(addr)), \ - "m" (*((addr)+6)), \ - "0" (limit) \ - ); } while(0) - -#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) -#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1) ) - -/* - * Load a segment. Fall back on loading the zero - * segment if something goes wrong.. - */ -#define loadsegment(seg,value) \ - asm volatile("\n" \ - "1:\t" \ - "mov %0,%%" #seg "\n" \ - "2:\n" \ - ".section .fixup,\"ax\"\n" \ - "3:\t" \ - "pushl $0\n\t" \ - "popl %%" #seg "\n\t" \ - "jmp 2b\n" \ - ".previous\n" \ - ".section __ex_table,\"a\"\n\t" \ - ".align 4\n\t" \ - ".long 1b,3b\n" \ - ".previous" \ - : :"rm" (value)) - -/* - * Save a segment register away - */ -#define savesegment(seg, value) \ - asm volatile("mov %%" #seg ",%0":"=rm" (value)) - - -static inline void native_clts(void) -{ - asm volatile ("clts"); -} - -static inline unsigned long native_read_cr0(void) -{ - unsigned long val; - asm volatile("movl %%cr0,%0\n\t" :"=r" (val)); - return val; -} - -static inline void native_write_cr0(unsigned long val) -{ - asm volatile("movl %0,%%cr0": :"r" (val)); -} - -static inline unsigned long native_read_cr2(void) -{ - unsigned long val; - asm volatile("movl %%cr2,%0\n\t" :"=r" (val)); - return val; -} - -static inline void native_write_cr2(unsigned long val) -{ - asm volatile("movl %0,%%cr2": :"r" (val)); -} - -static inline unsigned long native_read_cr3(void) -{ - unsigned long val; - asm volatile("movl %%cr3,%0\n\t" :"=r" (val)); - return val; -} - -static inline void native_write_cr3(unsigned long val) -{ - asm volatile("movl %0,%%cr3": :"r" (val)); -} - -static inline unsigned long native_read_cr4(void) -{ - unsigned long val; - asm volatile("movl %%cr4,%0\n\t" :"=r" (val)); - return val; -} - -static inline unsigned long native_read_cr4_safe(void) -{ - unsigned long val; - /* This could fault if %cr4 does not exist */ - asm("1: movl %%cr4, %0 \n" - "2: \n" - ".section __ex_table,\"a\" \n" - ".long 1b,2b \n" - ".previous \n" - : "=r" (val): "0" (0)); - return val; -} - -static inline void native_write_cr4(unsigned long val) -{ - asm volatile("movl %0,%%cr4": :"r" (val)); -} - -static inline void native_wbinvd(void) -{ - asm volatile("wbinvd": : :"memory"); -} - - -#ifdef CONFIG_PARAVIRT -#include <asm/paravirt.h> -#else -#define read_cr0() (native_read_cr0()) -#define write_cr0(x) (native_write_cr0(x)) -#define read_cr2() (native_read_cr2()) -#define write_cr2(x) (native_write_cr2(x)) -#define read_cr3() (native_read_cr3()) -#define write_cr3(x) (native_write_cr3(x)) -#define read_cr4() (native_read_cr4()) -#define read_cr4_safe() (native_read_cr4_safe()) -#define write_cr4(x) (native_write_cr4(x)) -#define wbinvd() (native_wbinvd()) - -/* Clear the 'TS' bit */ -#define clts() (native_clts()) - -#endif/* CONFIG_PARAVIRT */ - -/* Set the 'TS' bit */ -#define stts() write_cr0(8 | read_cr0()) - -#endif /* __KERNEL__ */ - -static inline unsigned long get_limit(unsigned long segment) -{ - unsigned long __limit; - __asm__("lsll %1,%0" - :"=r" (__limit):"r" (segment)); - return __limit+1; -} - -#define nop() __asm__ __volatile__ ("nop") - -/* - * Force strict CPU ordering. - * And yes, this is required on UP too when we're talking - * to devices. - * - * For now, "wmb()" doesn't actually do anything, as all - * Intel CPU's follow what Intel calls a *Processor Order*, - * in which all writes are seen in the program order even - * outside the CPU. - * - * I expect future Intel CPU's to have a weaker ordering, - * but I'd also expect them to finally get their act together - * and add some real memory barriers if so. - * - * Some non intel clones support out of order store. wmb() ceases to be a - * nop for these. - */ - - -/* - * Actually only lfence would be needed for mb() because all stores done - * by the kernel should be already ordered. But keep a full barrier for now. - */ - -#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) -#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2) - -/** - * read_barrier_depends - Flush all pending reads that subsequents reads - * depend on. - * - * No data-dependent reads from memory-like regions are ever reordered - * over this barrier. All reads preceding this primitive are guaranteed - * to access memory (but not necessarily other CPUs' caches) before any - * reads following this primitive that depend on the data return by - * any of the preceding reads. This primitive is much lighter weight than - * rmb() on most CPUs, and is never heavier weight than is - * rmb(). - * - * These ordering constraints are respected by both the local CPU - * and the compiler. - * - * Ordering is not guaranteed by anything other than these primitives, - * not even by data dependencies. See the documentation for - * memory_barrier() for examples and URLs to more information. - * - * For example, the following code would force ordering (the initial - * value of "a" is zero, "b" is one, and "p" is "&a"): - * - * <programlisting> - * CPU 0 CPU 1 - * - * b = 2; - * memory_barrier(); - * p = &b; q = p; - * read_barrier_depends(); - * d = *q; - * </programlisting> - * - * because the read of "*q" depends on the read of "p" and these - * two reads are separated by a read_barrier_depends(). However, - * the following code, with the same initial values for "a" and "b": - * - * <programlisting> - * CPU 0 CPU 1 - * - * a = 2; - * memory_barrier(); - * b = 3; y = b; - * read_barrier_depends(); - * x = a; - * </programlisting> - * - * does not enforce ordering, since there is no data dependency between - * the read of "a" and the read of "b". Therefore, on some CPUs, such - * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() - * in cases like this where there are no data dependencies. - **/ - -#define read_barrier_depends() do { } while(0) - -#ifdef CONFIG_X86_OOSTORE -/* Actually there are no OOO store capable CPUs for now that do SSE, - but make it already an possibility. */ -#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM) -#else -#define wmb() __asm__ __volatile__ ("": : :"memory") -#endif - -#ifdef CONFIG_SMP -#define smp_mb() mb() -#define smp_rmb() rmb() -#define smp_wmb() wmb() -#define smp_read_barrier_depends() read_barrier_depends() -#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) -#else -#define smp_mb() barrier() -#define smp_rmb() barrier() -#define smp_wmb() barrier() -#define smp_read_barrier_depends() do { } while(0) -#define set_mb(var, value) do { var = value; barrier(); } while (0) -#endif - -#include <linux/irqflags.h> - -/* - * disable hlt during certain critical i/o operations - */ -#define HAVE_DISABLE_HLT -void disable_hlt(void); -void enable_hlt(void); - -extern int es7000_plat; -void cpu_idle_wait(void); - -extern unsigned long arch_align_stack(unsigned long sp); -extern void free_init_pages(char *what, unsigned long begin, unsigned long end); - -void default_idle(void); - -#endif diff --git a/include/asm-i386/termios.h b/include/asm-i386/termios.h deleted file mode 100644 index f520b7c16fa..00000000000 --- a/include/asm-i386/termios.h +++ /dev/null @@ -1,91 +0,0 @@ -#ifndef _I386_TERMIOS_H -#define _I386_TERMIOS_H - -#include <asm/termbits.h> -#include <asm/ioctls.h> - -struct winsize { - unsigned short ws_row; - unsigned short ws_col; - unsigned short ws_xpixel; - unsigned short ws_ypixel; -}; - -#define NCC 8 -struct termio { - unsigned short c_iflag; /* input mode flags */ - unsigned short c_oflag; /* output mode flags */ - unsigned short c_cflag; /* control mode flags */ - unsigned short c_lflag; /* local mode flags */ - unsigned char c_line; /* line discipline */ - unsigned char c_cc[NCC]; /* control characters */ -}; - -/* modem lines */ -#define TIOCM_LE 0x001 -#define TIOCM_DTR 0x002 -#define TIOCM_RTS 0x004 -#define TIOCM_ST 0x008 -#define TIOCM_SR 0x010 -#define TIOCM_CTS 0x020 -#define TIOCM_CAR 0x040 -#define TIOCM_RNG 0x080 -#define TIOCM_DSR 0x100 -#define TIOCM_CD TIOCM_CAR -#define TIOCM_RI TIOCM_RNG -#define TIOCM_OUT1 0x2000 -#define TIOCM_OUT2 0x4000 -#define TIOCM_LOOP 0x8000 - -/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ - -#ifdef __KERNEL__ -#include <linux/module.h> - -/* intr=^C quit=^\ erase=del kill=^U - eof=^D vtime=\0 vmin=\1 sxtc=\0 - start=^Q stop=^S susp=^Z eol=\0 - reprint=^R discard=^U werase=^W lnext=^V - eol2=\0 -*/ -#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" - -/* - * Translate a "termio" structure into a "termios". Ugh. - */ -#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ - unsigned short __tmp; \ - get_user(__tmp,&(termio)->x); \ - *(unsigned short *) &(termios)->x = __tmp; \ -} - -#define user_termio_to_kernel_termios(termios, termio) \ -({ \ - SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ - SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ - copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ -}) - -/* - * Translate a "termios" structure into a "termio". Ugh. - */ -#define kernel_termios_to_user_termio(termio, termios) \ -({ \ - put_user((termios)->c_iflag, &(termio)->c_iflag); \ - put_user((termios)->c_oflag, &(termio)->c_oflag); \ - put_user((termios)->c_cflag, &(termio)->c_cflag); \ - put_user((termios)->c_lflag, &(termio)->c_lflag); \ - put_user((termios)->c_line, &(termio)->c_line); \ - copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ -}) - -#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) -#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) -#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) -#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) - -#endif /* __KERNEL__ */ - -#endif /* _I386_TERMIOS_H */ diff --git a/include/asm-m32r/flat.h b/include/asm-m32r/flat.h index 1b285f65cab..d851cf0c4aa 100644 --- a/include/asm-m32r/flat.h +++ b/include/asm-m32r/flat.h @@ -15,9 +15,10 @@ #define flat_stack_align(sp) (*sp += (*sp & 3 ? (4 - (*sp & 3)): 0)) #define flat_argvp_envp_on_stack() 0 #define flat_old_ram_flag(flags) (flags) +#define flat_set_persistent(relval, p) 0 #define flat_reloc_valid(reloc, size) \ (((reloc) - textlen_for_m32r_lo16_data) <= (size)) -#define flat_get_addr_from_rp(rp, relval, flags) \ +#define flat_get_addr_from_rp(rp, relval, flags, persistent) \ m32r_flat_get_addr_from_rp(rp, relval, (text_len) ) #define flat_put_addr_at_rp(rp, addr, relval) \ diff --git a/include/asm-m68knommu/flat.h b/include/asm-m68knommu/flat.h index 2d836edc434..814b5174a8e 100644 --- a/include/asm-m68knommu/flat.h +++ b/include/asm-m68knommu/flat.h @@ -9,8 +9,9 @@ #define flat_argvp_envp_on_stack() 1 #define flat_old_ram_flag(flags) (flags) #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) -#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) +#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp) #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) #define flat_get_relocate_addr(rel) (rel) +#define flat_set_persistent(relval, p) 0 #endif /* __M68KNOMMU_FLAT_H__ */ diff --git a/include/asm-mips/cmpxchg.h b/include/asm-mips/cmpxchg.h new file mode 100644 index 00000000000..c5b4708e003 --- /dev/null +++ b/include/asm-mips/cmpxchg.h @@ -0,0 +1,107 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 2003, 06, 07 by Ralf Baechle (ralf@linux-mips.org) + */ +#ifndef __ASM_CMPXCHG_H +#define __ASM_CMPXCHG_H + +#include <linux/irqflags.h> + +#define __HAVE_ARCH_CMPXCHG 1 + +#define __cmpxchg_asm(ld, st, m, old, new) \ +({ \ + __typeof(*(m)) __ret; \ + \ + if (cpu_has_llsc && R10000_LLSC_WAR) { \ + __asm__ __volatile__( \ + " .set push \n" \ + " .set noat \n" \ + " .set mips3 \n" \ + "1: " ld " %0, %2 # __cmpxchg_asm \n" \ + " bne %0, %z3, 2f \n" \ + " .set mips0 \n" \ + " move $1, %z4 \n" \ + " .set mips3 \n" \ + " " st " $1, %1 \n" \ + " beqzl $1, 1b \n" \ + "2: \n" \ + " .set pop \n" \ + : "=&r" (__ret), "=R" (*m) \ + : "R" (*m), "Jr" (old), "Jr" (new) \ + : "memory"); \ + } else if (cpu_has_llsc) { \ + __asm__ __volatile__( \ + " .set push \n" \ + " .set noat \n" \ + " .set mips3 \n" \ + "1: " ld " %0, %2 # __cmpxchg_asm \n" \ + " bne %0, %z3, 2f \n" \ + " .set mips0 \n" \ + " move $1, %z4 \n" \ + " .set mips3 \n" \ + " " st " $1, %1 \n" \ + " beqz $1, 3f \n" \ + "2: \n" \ + " .subsection 2 \n" \ + "3: b 1b \n" \ + " .previous \n" \ + " .set pop \n" \ + : "=&r" (__ret), "=R" (*m) \ + : "R" (*m), "Jr" (old), "Jr" (new) \ + : "memory"); \ + } else { \ + unsigned long __flags; \ + \ + raw_local_irq_save(__flags); \ + __ret = *m; \ + if (__ret == old) \ + *m = new; \ + raw_local_irq_restore(__flags); \ + } \ + \ + __ret; \ +}) + +/* + * This function doesn't exist, so you'll get a linker error + * if something tries to do an invalid cmpxchg(). + */ +extern void __cmpxchg_called_with_bad_pointer(void); + +#define __cmpxchg(ptr,old,new,barrier) \ +({ \ + __typeof__(ptr) __ptr = (ptr); \ + __typeof__(*(ptr)) __old = (old); \ + __typeof__(*(ptr)) __new = (new); \ + __typeof__(*(ptr)) __res = 0; \ + \ + barrier; \ + \ + switch (sizeof(*(__ptr))) { \ + case 4: \ + __res = __cmpxchg_asm("ll", "sc", __ptr, __old, __new); \ + break; \ + case 8: \ + if (sizeof(long) == 8) { \ + __res = __cmpxchg_asm("lld", "scd", __ptr, \ + __old, __new); \ + break; \ + } \ + default: \ + __cmpxchg_called_with_bad_pointer(); \ + break; \ + } \ + \ + barrier; \ + \ + __res; \ +}) + +#define cmpxchg(ptr, old, new) __cmpxchg(ptr, old, new, smp_llsc_mb()) +#define cmpxchg_local(ptr, old, new) __cmpxchg(ptr, old, new,) + +#endif /* __ASM_CMPXCHG_H */ diff --git a/include/asm-mips/fcntl.h b/include/asm-mips/fcntl.h index 00a50ec1c19..2a52333a062 100644 --- a/include/asm-mips/fcntl.h +++ b/include/asm-mips/fcntl.h @@ -13,6 +13,7 @@ #define O_SYNC 0x0010 #define O_NONBLOCK 0x0080 #define O_CREAT 0x0100 /* not fcntl */ +#define O_TRUNC 0x0200 /* not fcntl */ #define O_EXCL 0x0400 /* not fcntl */ #define O_NOCTTY 0x0800 /* not fcntl */ #define FASYNC 0x1000 /* fcntl, for BSD compatibility */ diff --git a/include/asm-mips/irq.h b/include/asm-mips/irq.h index 97102ebc54b..2cb52cf8bd4 100644 --- a/include/asm-mips/irq.h +++ b/include/asm-mips/irq.h @@ -24,7 +24,30 @@ static inline int irq_canonicalize(int irq) #define irq_canonicalize(irq) (irq) /* Sane hardware, sane code ... */ #endif +#ifdef CONFIG_MIPS_MT_SMTC + +struct irqaction; + +extern unsigned long irq_hwmask[]; +extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, + unsigned long hwmask); + +static inline void smtc_im_ack_irq(unsigned int irq) +{ + if (irq_hwmask[irq] & ST0_IM) + set_c0_status(irq_hwmask[irq] & ST0_IM); +} + +#else + +static inline void smtc_im_ack_irq(unsigned int irq) +{ +} + +#endif /* CONFIG_MIPS_MT_SMTC */ + #ifdef CONFIG_MIPS_MT_SMTC_IM_BACKSTOP + /* * Clear interrupt mask handling "backstop" if irq_hwmask * entry so indicates. This implies that the ack() or end() @@ -38,6 +61,7 @@ do { \ ~(irq_hwmask[irq] & 0x0000ff00)); \ } while (0) #else + #define __DO_IRQ_SMTC_HOOK(irq) do { } while (0) #endif @@ -60,14 +84,6 @@ do { \ extern void arch_init_irq(void); extern void spurious_interrupt(void); -#ifdef CONFIG_MIPS_MT_SMTC -struct irqaction; - -extern unsigned long irq_hwmask[]; -extern int setup_irq_smtc(unsigned int irq, struct irqaction * new, - unsigned long hwmask); -#endif /* CONFIG_MIPS_MT_SMTC */ - extern int allocate_irqno(void); extern void alloc_legacy_irqno(void); extern void free_irqno(unsigned int irq); diff --git a/include/asm-mips/local.h b/include/asm-mips/local.h index ed882c88e0c..f9a5ce5c9af 100644 --- a/include/asm-mips/local.h +++ b/include/asm-mips/local.h @@ -4,6 +4,7 @@ #include <linux/percpu.h> #include <linux/bitops.h> #include <asm/atomic.h> +#include <asm/cmpxchg.h> #include <asm/war.h> typedef struct @@ -114,68 +115,6 @@ static __inline__ long local_sub_return(long i, local_t * l) return result; } -/* - * local_sub_if_positive - conditionally subtract integer from atomic variable - * @i: integer value to subtract - * @l: pointer of type local_t - * - * Atomically test @l and subtract @i if @l is greater or equal than @i. - * The function returns the old value of @l minus @i. - */ -static __inline__ long local_sub_if_positive(long i, local_t * l) -{ - unsigned long result; - - if (cpu_has_llsc && R10000_LLSC_WAR) { - unsigned long temp; - - __asm__ __volatile__( - " .set mips3 \n" - "1:" __LL "%1, %2 # local_sub_if_positive\n" - " dsubu %0, %1, %3 \n" - " bltz %0, 1f \n" - __SC "%0, %2 \n" - " .set noreorder \n" - " beqzl %0, 1b \n" - " dsubu %0, %1, %3 \n" - " .set reorder \n" - "1: \n" - " .set mips0 \n" - : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) - : "Ir" (i), "m" (l->a.counter) - : "memory"); - } else if (cpu_has_llsc) { - unsigned long temp; - - __asm__ __volatile__( - " .set mips3 \n" - "1:" __LL "%1, %2 # local_sub_if_positive\n" - " dsubu %0, %1, %3 \n" - " bltz %0, 1f \n" - __SC "%0, %2 \n" - " .set noreorder \n" - " beqz %0, 1b \n" - " dsubu %0, %1, %3 \n" - " .set reorder \n" - "1: \n" - " .set mips0 \n" - : "=&r" (result), "=&r" (temp), "=m" (l->a.counter) - : "Ir" (i), "m" (l->a.counter) - : "memory"); - } else { - unsigned long flags; - - local_irq_save(flags); - result = l->a.counter; - result -= i; - if (result >= 0) - l->a.counter = result; - local_irq_restore(flags); - } - - return result; -} - #define local_cmpxchg(l, o, n) \ ((long)cmpxchg_local(&((l)->a.counter), (o), (n))) #define local_xchg(l, n) (xchg_local(&((l)->a.counter),(n))) @@ -234,12 +173,6 @@ static __inline__ long local_sub_if_positive(long i, local_t * l) #define local_dec_and_test(l) (local_sub_return(1, (l)) == 0) /* - * local_dec_if_positive - decrement by 1 if old value positive - * @l: pointer of type local_t - */ -#define local_dec_if_positive(l) local_sub_if_positive(1, l) - -/* * local_add_negative - add and test if negative * @l: pointer of type local_t * @i: integer value to add diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h index b92dd8c760d..e3301e54d55 100644 --- a/include/asm-mips/page.h +++ b/include/asm-mips/page.h @@ -142,7 +142,7 @@ typedef struct { unsigned long pgprot; } pgprot_t; /* * __pa()/__va() should be used only during mem init. */ -#if defined(CONFIG_64BIT) && !defined(CONFIG_BUILD_ELF64) +#ifdef CONFIG_64BIT #define __pa(x) \ ({ \ unsigned long __x = (unsigned long)(x); \ diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 357251f4251..480b574e248 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h @@ -17,6 +17,7 @@ #include <asm/addrspace.h> #include <asm/barrier.h> +#include <asm/cmpxchg.h> #include <asm/cpu-features.h> #include <asm/dsp.h> #include <asm/war.h> @@ -194,266 +195,6 @@ static inline unsigned long __xchg(unsigned long x, volatile void * ptr, int siz #define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) -#define __HAVE_ARCH_CMPXCHG 1 - -static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old, - unsigned long new) -{ - __u32 retval; - - if (cpu_has_llsc && R10000_LLSC_WAR) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: ll %0, %2 # __cmpxchg_u32 \n" - " bne %0, %z3, 2f \n" - " .set mips0 \n" - " move $1, %z4 \n" - " .set mips3 \n" - " sc $1, %1 \n" - " beqzl $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else if (cpu_has_llsc) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: ll %0, %2 # __cmpxchg_u32 \n" - " bne %0, %z3, 2f \n" - " .set mips0 \n" - " move $1, %z4 \n" - " .set mips3 \n" - " sc $1, %1 \n" - " beqz $1, 3f \n" - "2: \n" - " .subsection 2 \n" - "3: b 1b \n" - " .previous \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else { - unsigned long flags; - - raw_local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - raw_local_irq_restore(flags); /* implies memory barrier */ - } - - smp_llsc_mb(); - - return retval; -} - -static inline unsigned long __cmpxchg_u32_local(volatile int * m, - unsigned long old, unsigned long new) -{ - __u32 retval; - - if (cpu_has_llsc && R10000_LLSC_WAR) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: ll %0, %2 # __cmpxchg_u32 \n" - " bne %0, %z3, 2f \n" - " .set mips0 \n" - " move $1, %z4 \n" - " .set mips3 \n" - " sc $1, %1 \n" - " beqzl $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else if (cpu_has_llsc) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: ll %0, %2 # __cmpxchg_u32 \n" - " bne %0, %z3, 2f \n" - " .set mips0 \n" - " move $1, %z4 \n" - " .set mips3 \n" - " sc $1, %1 \n" - " beqz $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else { - unsigned long flags; - - local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - local_irq_restore(flags); /* implies memory barrier */ - } - - return retval; -} - -#ifdef CONFIG_64BIT -static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, - unsigned long new) -{ - __u64 retval; - - if (cpu_has_llsc && R10000_LLSC_WAR) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: lld %0, %2 # __cmpxchg_u64 \n" - " bne %0, %z3, 2f \n" - " move $1, %z4 \n" - " scd $1, %1 \n" - " beqzl $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else if (cpu_has_llsc) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: lld %0, %2 # __cmpxchg_u64 \n" - " bne %0, %z3, 2f \n" - " move $1, %z4 \n" - " scd $1, %1 \n" - " beqz $1, 3f \n" - "2: \n" - " .subsection 2 \n" - "3: b 1b \n" - " .previous \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else { - unsigned long flags; - - raw_local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - raw_local_irq_restore(flags); /* implies memory barrier */ - } - - smp_llsc_mb(); - - return retval; -} - -static inline unsigned long __cmpxchg_u64_local(volatile int * m, - unsigned long old, unsigned long new) -{ - __u64 retval; - - if (cpu_has_llsc && R10000_LLSC_WAR) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: lld %0, %2 # __cmpxchg_u64 \n" - " bne %0, %z3, 2f \n" - " move $1, %z4 \n" - " scd $1, %1 \n" - " beqzl $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else if (cpu_has_llsc) { - __asm__ __volatile__( - " .set push \n" - " .set noat \n" - " .set mips3 \n" - "1: lld %0, %2 # __cmpxchg_u64 \n" - " bne %0, %z3, 2f \n" - " move $1, %z4 \n" - " scd $1, %1 \n" - " beqz $1, 1b \n" - "2: \n" - " .set pop \n" - : "=&r" (retval), "=R" (*m) - : "R" (*m), "Jr" (old), "Jr" (new) - : "memory"); - } else { - unsigned long flags; - - local_irq_save(flags); - retval = *m; - if (retval == old) - *m = new; - local_irq_restore(flags); /* implies memory barrier */ - } - - return retval; -} - -#else -extern unsigned long __cmpxchg_u64_unsupported_on_32bit_kernels( - volatile int * m, unsigned long old, unsigned long new); -#define __cmpxchg_u64 __cmpxchg_u64_unsupported_on_32bit_kernels -extern unsigned long __cmpxchg_u64_local_unsupported_on_32bit_kernels( - volatile int * m, unsigned long old, unsigned long new); -#define __cmpxchg_u64_local __cmpxchg_u64_local_unsupported_on_32bit_kernels -#endif - -/* This function doesn't exist, so you'll get a linker error - if something tries to do an invalid cmpxchg(). */ -extern void __cmpxchg_called_with_bad_pointer(void); - -static inline unsigned long __cmpxchg(volatile void * ptr, unsigned long old, - unsigned long new, int size) -{ - switch (size) { - case 4: - return __cmpxchg_u32(ptr, old, new); - case 8: - return __cmpxchg_u64(ptr, old, new); - } - __cmpxchg_called_with_bad_pointer(); - return old; -} - -static inline unsigned long __cmpxchg_local(volatile void * ptr, - unsigned long old, unsigned long new, int size) -{ - switch (size) { - case 4: - return __cmpxchg_u32_local(ptr, old, new); - case 8: - return __cmpxchg_u64_local(ptr, old, new); - } - __cmpxchg_called_with_bad_pointer(); - return old; -} - -#define cmpxchg(ptr,old,new) \ - ((__typeof__(*(ptr)))__cmpxchg((ptr), \ - (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) - -#define cmpxchg_local(ptr,old,new) \ - ((__typeof__(*(ptr)))__cmpxchg_local((ptr), \ - (unsigned long)(old), (unsigned long)(new),sizeof(*(ptr)))) - extern void set_handler (unsigned long offset, void *addr, unsigned long len); extern void set_uncached_handler (unsigned long offset, void *addr, unsigned long len); diff --git a/include/asm-sh/flat.h b/include/asm-sh/flat.h index 0d5cc04ab00..dc4f5950daf 100644 --- a/include/asm-sh/flat.h +++ b/include/asm-sh/flat.h @@ -16,8 +16,9 @@ #define flat_argvp_envp_on_stack() 0 #define flat_old_ram_flag(flags) (flags) #define flat_reloc_valid(reloc, size) ((reloc) <= (size)) -#define flat_get_addr_from_rp(rp, relval, flags) get_unaligned(rp) +#define flat_get_addr_from_rp(rp, relval, flags, p) get_unaligned(rp) #define flat_put_addr_at_rp(rp, val, relval) put_unaligned(val,rp) #define flat_get_relocate_addr(rel) (rel) +#define flat_set_persistent(relval, p) 0 #endif /* __ASM_SH_FLAT_H */ diff --git a/include/asm-sh/mpc1211/mc146818rtc.h b/include/asm-sh/mpc1211/mc146818rtc.h index 0ec78f66cea..e245f2a3cd7 100644 --- a/include/asm-sh/mpc1211/mc146818rtc.h +++ b/include/asm-sh/mpc1211/mc146818rtc.h @@ -1,6 +1,6 @@ /* * MPC1211 uses PC/AT style RTC definitions. */ -#include <asm-i386/mc146818rtc.h> +#include <asm-x86/mc146818rtc_32.h> diff --git a/include/asm-v850/flat.h b/include/asm-v850/flat.h index 3888f59d688..17f0ea56661 100644 --- a/include/asm-v850/flat.h +++ b/include/asm-v850/flat.h @@ -25,6 +25,7 @@ #define flat_stack_align(sp) /* nothing needed */ #define flat_argvp_envp_on_stack() 0 #define flat_old_ram_flag(flags) (flags) +#define flat_set_persistent(relval, p) 0 /* We store the type of relocation in the top 4 bits of the `relval.' */ @@ -46,7 +47,8 @@ flat_get_relocate_addr (unsigned long relval) For the v850, RP should always be half-word aligned. */ static inline unsigned long flat_get_addr_from_rp (unsigned long *rp, unsigned long relval, - unsigned long flags) + unsigned long flags, + unsigned long *persistent) { short *srp = (short *)rp; diff --git a/include/asm-x86/8253pit.h b/include/asm-x86/8253pit.h new file mode 100644 index 00000000000..d3c2b38a661 --- /dev/null +++ b/include/asm-x86/8253pit.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "8253pit_32.h" +#else +# include "8253pit_64.h" +#endif diff --git a/include/asm-i386/8253pit.h b/include/asm-x86/8253pit_32.h index 96c7c3592da..96c7c3592da 100644 --- a/include/asm-i386/8253pit.h +++ b/include/asm-x86/8253pit_32.h diff --git a/include/asm-x86_64/8253pit.h b/include/asm-x86/8253pit_64.h index 285f78488cc..285f78488cc 100644 --- a/include/asm-x86_64/8253pit.h +++ b/include/asm-x86/8253pit_64.h diff --git a/include/asm-x86/Kbuild b/include/asm-x86/Kbuild new file mode 100644 index 00000000000..c5e43cb3987 --- /dev/null +++ b/include/asm-x86/Kbuild @@ -0,0 +1,88 @@ +include include/asm-generic/Kbuild.asm + +header-y += boot.h +header-y += bootsetup.h +header-y += debugreg_32.h +header-y += debugreg_64.h +header-y += debugreg.h +header-y += ldt_32.h +header-y += ldt_64.h +header-y += ldt.h +header-y += msr-index.h +header-y += prctl.h +header-y += ptrace-abi_32.h +header-y += ptrace-abi_64.h +header-y += ptrace-abi.h +header-y += sigcontext32.h +header-y += ucontext_32.h +header-y += ucontext_64.h +header-y += ucontext.h +header-y += vsyscall32.h + +unifdef-y += a.out_32.h +unifdef-y += a.out_64.h +unifdef-y += auxvec_32.h +unifdef-y += auxvec_64.h +unifdef-y += byteorder_32.h +unifdef-y += byteorder_64.h +unifdef-y += elf_32.h +unifdef-y += elf_64.h +unifdef-y += errno_32.h +unifdef-y += errno_64.h +unifdef-y += ioctls_32.h +unifdef-y += ioctls_64.h +unifdef-y += ipcbuf_32.h +unifdef-y += ipcbuf_64.h +unifdef-y += mce.h +unifdef-y += mman_32.h +unifdef-y += mman_64.h +unifdef-y += msgbuf_32.h +unifdef-y += msgbuf_64.h +unifdef-y += msr_32.h +unifdef-y += msr_64.h +unifdef-y += msr.h +unifdef-y += mtrr_32.h +unifdef-y += mtrr_64.h +unifdef-y += mtrr.h +unifdef-y += page_32.h +unifdef-y += page_64.h +unifdef-y += param_32.h +unifdef-y += param_64.h +unifdef-y += posix_types_32.h +unifdef-y += posix_types_64.h +unifdef-y += ptrace_32.h +unifdef-y += ptrace_64.h +unifdef-y += resource_32.h +unifdef-y += resource_64.h +unifdef-y += sembuf_32.h +unifdef-y += sembuf_64.h +unifdef-y += setup_32.h +unifdef-y += setup_64.h +unifdef-y += shmbuf_32.h +unifdef-y += shmbuf_64.h +unifdef-y += shmparam_32.h +unifdef-y += shmparam_64.h +unifdef-y += sigcontext_32.h +unifdef-y += sigcontext_64.h +unifdef-y += siginfo_32.h +unifdef-y += siginfo_64.h +unifdef-y += signal_32.h +unifdef-y += signal_64.h +unifdef-y += sockios_32.h +unifdef-y += sockios_64.h +unifdef-y += stat_32.h +unifdef-y += stat_64.h +unifdef-y += statfs_32.h +unifdef-y += statfs_64.h +unifdef-y += termbits_32.h +unifdef-y += termbits_64.h +unifdef-y += termios_32.h +unifdef-y += termios_64.h +unifdef-y += types_32.h +unifdef-y += types_64.h +unifdef-y += unistd_32.h +unifdef-y += unistd_64.h +unifdef-y += user_32.h +unifdef-y += user_64.h +unifdef-y += vm86.h +unifdef-y += vsyscall.h diff --git a/include/asm-x86/a.out.h b/include/asm-x86/a.out.h new file mode 100644 index 00000000000..5bc9b1d3b22 --- /dev/null +++ b/include/asm-x86/a.out.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "a.out_32.h" +# else +# include "a.out_64.h" +# endif +#else +# ifdef __i386__ +# include "a.out_32.h" +# else +# include "a.out_64.h" +# endif +#endif diff --git a/include/asm-i386/a.out.h b/include/asm-x86/a.out_32.h index 851a60f8258..851a60f8258 100644 --- a/include/asm-i386/a.out.h +++ b/include/asm-x86/a.out_32.h diff --git a/include/asm-x86_64/a.out.h b/include/asm-x86/a.out_64.h index e789300e41a..e789300e41a 100644 --- a/include/asm-x86_64/a.out.h +++ b/include/asm-x86/a.out_64.h diff --git a/include/asm-x86/acpi.h b/include/asm-x86/acpi.h new file mode 100644 index 00000000000..0693689d414 --- /dev/null +++ b/include/asm-x86/acpi.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "acpi_32.h" +#else +# include "acpi_64.h" +#endif diff --git a/include/asm-i386/acpi.h b/include/asm-x86/acpi_32.h index 125179adf04..125179adf04 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-x86/acpi_32.h diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86/acpi_64.h index 98173357dd8..98173357dd8 100644 --- a/include/asm-x86_64/acpi.h +++ b/include/asm-x86/acpi_64.h diff --git a/include/asm-x86/agp.h b/include/asm-x86/agp.h new file mode 100644 index 00000000000..9348f1e4f6f --- /dev/null +++ b/include/asm-x86/agp.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "agp_32.h" +#else +# include "agp_64.h" +#endif diff --git a/include/asm-i386/agp.h b/include/asm-x86/agp_32.h index 6af173dbf12..6af173dbf12 100644 --- a/include/asm-i386/agp.h +++ b/include/asm-x86/agp_32.h diff --git a/include/asm-x86_64/agp.h b/include/asm-x86/agp_64.h index de338666f3f..de338666f3f 100644 --- a/include/asm-x86_64/agp.h +++ b/include/asm-x86/agp_64.h diff --git a/include/asm-x86/alternative-asm.i b/include/asm-x86/alternative-asm.i new file mode 100644 index 00000000000..4f360cd3c88 --- /dev/null +++ b/include/asm-x86/alternative-asm.i @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "alternative-asm_32.i" +#else +# include "alternative-asm_64.i" +#endif diff --git a/include/asm-i386/alternative-asm.i b/include/asm-x86/alternative-asm_32.i index f0510209ccb..f0510209ccb 100644 --- a/include/asm-i386/alternative-asm.i +++ b/include/asm-x86/alternative-asm_32.i diff --git a/include/asm-x86_64/alternative-asm.i b/include/asm-x86/alternative-asm_64.i index 0b3f1a2bb2c..0b3f1a2bb2c 100644 --- a/include/asm-x86_64/alternative-asm.i +++ b/include/asm-x86/alternative-asm_64.i diff --git a/include/asm-x86/alternative.h b/include/asm-x86/alternative.h new file mode 100644 index 00000000000..9eef6a32a13 --- /dev/null +++ b/include/asm-x86/alternative.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "alternative_32.h" +#else +# include "alternative_64.h" +#endif diff --git a/include/asm-i386/alternative.h b/include/asm-x86/alternative_32.h index bda6c810c0f..bda6c810c0f 100644 --- a/include/asm-i386/alternative.h +++ b/include/asm-x86/alternative_32.h diff --git a/include/asm-x86_64/alternative.h b/include/asm-x86/alternative_64.h index ab161e81015..ab161e81015 100644 --- a/include/asm-x86_64/alternative.h +++ b/include/asm-x86/alternative_64.h diff --git a/include/asm-x86/apic.h b/include/asm-x86/apic.h new file mode 100644 index 00000000000..9fbcc0bd2ac --- /dev/null +++ b/include/asm-x86/apic.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "apic_32.h" +#else +# include "apic_64.h" +#endif diff --git a/include/asm-i386/apic.h b/include/asm-x86/apic_32.h index 4091b33dcb1..4091b33dcb1 100644 --- a/include/asm-i386/apic.h +++ b/include/asm-x86/apic_32.h diff --git a/include/asm-x86_64/apic.h b/include/asm-x86/apic_64.h index 85125ef3c41..85125ef3c41 100644 --- a/include/asm-x86_64/apic.h +++ b/include/asm-x86/apic_64.h diff --git a/include/asm-x86/apicdef.h b/include/asm-x86/apicdef.h new file mode 100644 index 00000000000..4542c220bf4 --- /dev/null +++ b/include/asm-x86/apicdef.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "apicdef_32.h" +#else +# include "apicdef_64.h" +#endif diff --git a/include/asm-i386/apicdef.h b/include/asm-x86/apicdef_32.h index 9f6995341fd..9f6995341fd 100644 --- a/include/asm-i386/apicdef.h +++ b/include/asm-x86/apicdef_32.h diff --git a/include/asm-x86_64/apicdef.h b/include/asm-x86/apicdef_64.h index 1dd40067c67..1dd40067c67 100644 --- a/include/asm-x86_64/apicdef.h +++ b/include/asm-x86/apicdef_64.h diff --git a/include/asm-i386/arch_hooks.h b/include/asm-x86/arch_hooks.h index a8c1fca9726..a8c1fca9726 100644 --- a/include/asm-i386/arch_hooks.h +++ b/include/asm-x86/arch_hooks.h diff --git a/include/asm-x86/atomic.h b/include/asm-x86/atomic.h new file mode 100644 index 00000000000..4e1b8873c47 --- /dev/null +++ b/include/asm-x86/atomic.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "atomic_32.h" +#else +# include "atomic_64.h" +#endif diff --git a/include/asm-i386/atomic.h b/include/asm-x86/atomic_32.h index 437aac80171..437aac80171 100644 --- a/include/asm-i386/atomic.h +++ b/include/asm-x86/atomic_32.h diff --git a/include/asm-x86_64/atomic.h b/include/asm-x86/atomic_64.h index f2e64634fa4..f2e64634fa4 100644 --- a/include/asm-x86_64/atomic.h +++ b/include/asm-x86/atomic_64.h diff --git a/include/asm-x86/auxvec.h b/include/asm-x86/auxvec.h new file mode 100644 index 00000000000..7ff866f829c --- /dev/null +++ b/include/asm-x86/auxvec.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "auxvec_32.h" +# else +# include "auxvec_64.h" +# endif +#else +# ifdef __i386__ +# include "auxvec_32.h" +# else +# include "auxvec_64.h" +# endif +#endif diff --git a/include/asm-i386/auxvec.h b/include/asm-x86/auxvec_32.h index 395e13016bf..395e13016bf 100644 --- a/include/asm-i386/auxvec.h +++ b/include/asm-x86/auxvec_32.h diff --git a/include/asm-x86_64/auxvec.h b/include/asm-x86/auxvec_64.h index 1d5ab0d0395..1d5ab0d0395 100644 --- a/include/asm-x86_64/auxvec.h +++ b/include/asm-x86/auxvec_64.h diff --git a/include/asm-x86/bitops.h b/include/asm-x86/bitops.h new file mode 100644 index 00000000000..07e3f6d4fe4 --- /dev/null +++ b/include/asm-x86/bitops.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "bitops_32.h" +#else +# include "bitops_64.h" +#endif diff --git a/include/asm-i386/bitops.h b/include/asm-x86/bitops_32.h index a20fe9822f6..a20fe9822f6 100644 --- a/include/asm-i386/bitops.h +++ b/include/asm-x86/bitops_32.h diff --git a/include/asm-x86_64/bitops.h b/include/asm-x86/bitops_64.h index d4dbbe5f7bd..d4dbbe5f7bd 100644 --- a/include/asm-x86_64/bitops.h +++ b/include/asm-x86/bitops_64.h diff --git a/include/asm-i386/boot.h b/include/asm-x86/boot.h index ed8affbf96c..ed8affbf96c 100644 --- a/include/asm-i386/boot.h +++ b/include/asm-x86/boot.h diff --git a/include/asm-i386/bootparam.h b/include/asm-x86/bootparam.h index b91b01783e4..b91b01783e4 100644 --- a/include/asm-i386/bootparam.h +++ b/include/asm-x86/bootparam.h diff --git a/include/asm-x86_64/bootsetup.h b/include/asm-x86/bootsetup.h index 7b1c3ad155f..7b1c3ad155f 100644 --- a/include/asm-x86_64/bootsetup.h +++ b/include/asm-x86/bootsetup.h diff --git a/include/asm-x86/bug.h b/include/asm-x86/bug.h new file mode 100644 index 00000000000..c655d7f3a5e --- /dev/null +++ b/include/asm-x86/bug.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "bug_32.h" +#else +# include "bug_64.h" +#endif diff --git a/include/asm-i386/bug.h b/include/asm-x86/bug_32.h index b0fd78ca261..b0fd78ca261 100644 --- a/include/asm-i386/bug.h +++ b/include/asm-x86/bug_32.h diff --git a/include/asm-x86_64/bug.h b/include/asm-x86/bug_64.h index 68260641491..68260641491 100644 --- a/include/asm-x86_64/bug.h +++ b/include/asm-x86/bug_64.h diff --git a/include/asm-x86/bugs.h b/include/asm-x86/bugs.h new file mode 100644 index 00000000000..ddf42d36dd5 --- /dev/null +++ b/include/asm-x86/bugs.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "bugs_32.h" +#else +# include "bugs_64.h" +#endif diff --git a/include/asm-i386/bugs.h b/include/asm-x86/bugs_32.h index d28979ff73b..d28979ff73b 100644 --- a/include/asm-i386/bugs.h +++ b/include/asm-x86/bugs_32.h diff --git a/include/asm-x86_64/bugs.h b/include/asm-x86/bugs_64.h index b33dc04d8f4..b33dc04d8f4 100644 --- a/include/asm-x86_64/bugs.h +++ b/include/asm-x86/bugs_64.h diff --git a/include/asm-x86/byteorder.h b/include/asm-x86/byteorder.h new file mode 100644 index 00000000000..eb14b1870ed --- /dev/null +++ b/include/asm-x86/byteorder.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "byteorder_32.h" +# else +# include "byteorder_64.h" +# endif +#else +# ifdef __i386__ +# include "byteorder_32.h" +# else +# include "byteorder_64.h" +# endif +#endif diff --git a/include/asm-i386/byteorder.h b/include/asm-x86/byteorder_32.h index a45470a8b74..a45470a8b74 100644 --- a/include/asm-i386/byteorder.h +++ b/include/asm-x86/byteorder_32.h diff --git a/include/asm-x86_64/byteorder.h b/include/asm-x86/byteorder_64.h index 5e86c868c75..5e86c868c75 100644 --- a/include/asm-x86_64/byteorder.h +++ b/include/asm-x86/byteorder_64.h diff --git a/include/asm-x86/cache.h b/include/asm-x86/cache.h new file mode 100644 index 00000000000..c36d190ac9d --- /dev/null +++ b/include/asm-x86/cache.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "cache_32.h" +#else +# include "cache_64.h" +#endif diff --git a/include/asm-i386/cache.h b/include/asm-x86/cache_32.h index 57c62f41415..57c62f41415 100644 --- a/include/asm-i386/cache.h +++ b/include/asm-x86/cache_32.h diff --git a/include/asm-x86_64/cache.h b/include/asm-x86/cache_64.h index 052df758ae6..052df758ae6 100644 --- a/include/asm-x86_64/cache.h +++ b/include/asm-x86/cache_64.h diff --git a/include/asm-x86/cacheflush.h b/include/asm-x86/cacheflush.h new file mode 100644 index 00000000000..e2df3b55034 --- /dev/null +++ b/include/asm-x86/cacheflush.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "cacheflush_32.h" +#else +# include "cacheflush_64.h" +#endif diff --git a/include/asm-i386/cacheflush.h b/include/asm-x86/cacheflush_32.h index 74e03c8f2e5..74e03c8f2e5 100644 --- a/include/asm-i386/cacheflush.h +++ b/include/asm-x86/cacheflush_32.h diff --git a/include/asm-x86_64/cacheflush.h b/include/asm-x86/cacheflush_64.h index ab1cb5c7dc9..ab1cb5c7dc9 100644 --- a/include/asm-x86_64/cacheflush.h +++ b/include/asm-x86/cacheflush_64.h diff --git a/include/asm-x86_64/calgary.h b/include/asm-x86/calgary.h index 67f60406e2d..67f60406e2d 100644 --- a/include/asm-x86_64/calgary.h +++ b/include/asm-x86/calgary.h diff --git a/include/asm-x86_64/calling.h b/include/asm-x86/calling.h index 6f4f63af96e..6f4f63af96e 100644 --- a/include/asm-x86_64/calling.h +++ b/include/asm-x86/calling.h diff --git a/include/asm-x86/checksum.h b/include/asm-x86/checksum.h new file mode 100644 index 00000000000..848850fd7d6 --- /dev/null +++ b/include/asm-x86/checksum.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "checksum_32.h" +#else +# include "checksum_64.h" +#endif diff --git a/include/asm-i386/checksum.h b/include/asm-x86/checksum_32.h index 75194abbe8e..75194abbe8e 100644 --- a/include/asm-i386/checksum.h +++ b/include/asm-x86/checksum_32.h diff --git a/include/asm-x86_64/checksum.h b/include/asm-x86/checksum_64.h index 419fe88a034..419fe88a034 100644 --- a/include/asm-x86_64/checksum.h +++ b/include/asm-x86/checksum_64.h diff --git a/include/asm-x86/cmpxchg.h b/include/asm-x86/cmpxchg.h new file mode 100644 index 00000000000..a460fa088d4 --- /dev/null +++ b/include/asm-x86/cmpxchg.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "cmpxchg_32.h" +#else +# include "cmpxchg_64.h" +#endif diff --git a/include/asm-i386/cmpxchg.h b/include/asm-x86/cmpxchg_32.h index f86ede28f6d..f86ede28f6d 100644 --- a/include/asm-i386/cmpxchg.h +++ b/include/asm-x86/cmpxchg_32.h diff --git a/include/asm-x86_64/cmpxchg.h b/include/asm-x86/cmpxchg_64.h index 5e182062e6e..5e182062e6e 100644 --- a/include/asm-x86_64/cmpxchg.h +++ b/include/asm-x86/cmpxchg_64.h diff --git a/include/asm-x86_64/compat.h b/include/asm-x86/compat.h index 53cb96b68a6..53cb96b68a6 100644 --- a/include/asm-x86_64/compat.h +++ b/include/asm-x86/compat.h diff --git a/include/asm-i386/cpu.h b/include/asm-x86/cpu.h index 9d914e1e4aa..9d914e1e4aa 100644 --- a/include/asm-i386/cpu.h +++ b/include/asm-x86/cpu.h diff --git a/include/asm-x86/cpufeature.h b/include/asm-x86/cpufeature.h new file mode 100644 index 00000000000..b7160a4598d --- /dev/null +++ b/include/asm-x86/cpufeature.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "cpufeature_32.h" +#else +# include "cpufeature_64.h" +#endif diff --git a/include/asm-i386/cpufeature.h b/include/asm-x86/cpufeature_32.h index 7b3aa28ebc6..7b3aa28ebc6 100644 --- a/include/asm-i386/cpufeature.h +++ b/include/asm-x86/cpufeature_32.h diff --git a/include/asm-x86/cpufeature_64.h b/include/asm-x86/cpufeature_64.h new file mode 100644 index 00000000000..2983501e8b3 --- /dev/null +++ b/include/asm-x86/cpufeature_64.h @@ -0,0 +1,30 @@ +/* + * cpufeature_32.h + * + * Defines x86 CPU feature bits + */ + +#ifndef __ASM_X8664_CPUFEATURE_H +#define __ASM_X8664_CPUFEATURE_H + +#include <asm/cpufeature_32.h> + +#undef cpu_has_vme +#define cpu_has_vme 0 + +#undef cpu_has_pae +#define cpu_has_pae ___BUG___ + +#undef cpu_has_mp +#define cpu_has_mp 1 /* XXX */ + +#undef cpu_has_k6_mtrr +#define cpu_has_k6_mtrr 0 + +#undef cpu_has_cyrix_arr +#define cpu_has_cyrix_arr 0 + +#undef cpu_has_centaur_mcr +#define cpu_has_centaur_mcr 0 + +#endif /* __ASM_X8664_CPUFEATURE_H */ diff --git a/include/asm-x86/cputime.h b/include/asm-x86/cputime.h new file mode 100644 index 00000000000..87c37cf6b70 --- /dev/null +++ b/include/asm-x86/cputime.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "cputime_32.h" +#else +# include "cputime_64.h" +#endif diff --git a/include/asm-i386/cputime.h b/include/asm-x86/cputime_32.h index 398ed7cd171..398ed7cd171 100644 --- a/include/asm-i386/cputime.h +++ b/include/asm-x86/cputime_32.h diff --git a/include/asm-x86_64/cputime.h b/include/asm-x86/cputime_64.h index a07012dc5a3..a07012dc5a3 100644 --- a/include/asm-x86_64/cputime.h +++ b/include/asm-x86/cputime_64.h diff --git a/include/asm-x86/current.h b/include/asm-x86/current.h new file mode 100644 index 00000000000..d2526d3f734 --- /dev/null +++ b/include/asm-x86/current.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "current_32.h" +#else +# include "current_64.h" +#endif diff --git a/include/asm-i386/current.h b/include/asm-x86/current_32.h index d3524853991..d3524853991 100644 --- a/include/asm-i386/current.h +++ b/include/asm-x86/current_32.h diff --git a/include/asm-x86_64/current.h b/include/asm-x86/current_64.h index bc8adecee66..bc8adecee66 100644 --- a/include/asm-x86_64/current.h +++ b/include/asm-x86/current_64.h diff --git a/include/asm-x86/debugreg.h b/include/asm-x86/debugreg.h new file mode 100644 index 00000000000..b6ce7e4fa00 --- /dev/null +++ b/include/asm-x86/debugreg.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "debugreg_32.h" +# else +# include "debugreg_64.h" +# endif +#else +# ifdef __i386__ +# include "debugreg_32.h" +# else +# include "debugreg_64.h" +# endif +#endif diff --git a/include/asm-i386/debugreg.h b/include/asm-x86/debugreg_32.h index f0b2b06ae0f..f0b2b06ae0f 100644 --- a/include/asm-i386/debugreg.h +++ b/include/asm-x86/debugreg_32.h diff --git a/include/asm-x86_64/debugreg.h b/include/asm-x86/debugreg_64.h index bd1aab1d8c4..bd1aab1d8c4 100644 --- a/include/asm-x86_64/debugreg.h +++ b/include/asm-x86/debugreg_64.h diff --git a/include/asm-x86/delay.h b/include/asm-x86/delay.h new file mode 100644 index 00000000000..10f2c71d622 --- /dev/null +++ b/include/asm-x86/delay.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "delay_32.h" +#else +# include "delay_64.h" +#endif diff --git a/include/asm-i386/delay.h b/include/asm-x86/delay_32.h index 9ae5e3782ed..9ae5e3782ed 100644 --- a/include/asm-i386/delay.h +++ b/include/asm-x86/delay_32.h diff --git a/include/asm-x86_64/delay.h b/include/asm-x86/delay_64.h index c2669f1f552..c2669f1f552 100644 --- a/include/asm-x86_64/delay.h +++ b/include/asm-x86/delay_64.h diff --git a/include/asm-x86/desc.h b/include/asm-x86/desc.h new file mode 100644 index 00000000000..6065c509226 --- /dev/null +++ b/include/asm-x86/desc.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "desc_32.h" +#else +# include "desc_64.h" +#endif diff --git a/include/asm-i386/desc.h b/include/asm-x86/desc_32.h index c547403f341..c547403f341 100644 --- a/include/asm-i386/desc.h +++ b/include/asm-x86/desc_32.h diff --git a/include/asm-x86_64/desc.h b/include/asm-x86/desc_64.h index ac991b5ca0f..ac991b5ca0f 100644 --- a/include/asm-x86_64/desc.h +++ b/include/asm-x86/desc_64.h diff --git a/include/asm-x86_64/desc_defs.h b/include/asm-x86/desc_defs.h index 08900407009..08900407009 100644 --- a/include/asm-x86_64/desc_defs.h +++ b/include/asm-x86/desc_defs.h diff --git a/include/asm-x86/device.h b/include/asm-x86/device.h new file mode 100644 index 00000000000..e2bcf7c7dce --- /dev/null +++ b/include/asm-x86/device.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "device_32.h" +#else +# include "device_64.h" +#endif diff --git a/include/asm-i386/device.h b/include/asm-x86/device_32.h index 849604c70e6..849604c70e6 100644 --- a/include/asm-i386/device.h +++ b/include/asm-x86/device_32.h diff --git a/include/asm-x86_64/device.h b/include/asm-x86/device_64.h index 3afa03f33a3..3afa03f33a3 100644 --- a/include/asm-x86_64/device.h +++ b/include/asm-x86/device_64.h diff --git a/include/asm-x86/div64.h b/include/asm-x86/div64.h new file mode 100644 index 00000000000..8ac7da6ca28 --- /dev/null +++ b/include/asm-x86/div64.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "div64_32.h" +#else +# include "div64_64.h" +#endif diff --git a/include/asm-i386/div64.h b/include/asm-x86/div64_32.h index 438e980068b..438e980068b 100644 --- a/include/asm-i386/div64.h +++ b/include/asm-x86/div64_32.h diff --git a/include/asm-x86_64/div64.h b/include/asm-x86/div64_64.h index 6cd978cefb2..6cd978cefb2 100644 --- a/include/asm-x86_64/div64.h +++ b/include/asm-x86/div64_64.h diff --git a/include/asm-x86/dma-mapping.h b/include/asm-x86/dma-mapping.h new file mode 100644 index 00000000000..58f790f4df5 --- /dev/null +++ b/include/asm-x86/dma-mapping.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "dma-mapping_32.h" +#else +# include "dma-mapping_64.h" +#endif diff --git a/include/asm-i386/dma-mapping.h b/include/asm-x86/dma-mapping_32.h index f1d72d177f6..f1d72d177f6 100644 --- a/include/asm-i386/dma-mapping.h +++ b/include/asm-x86/dma-mapping_32.h diff --git a/include/asm-x86_64/dma-mapping.h b/include/asm-x86/dma-mapping_64.h index 6897e2a436e..6897e2a436e 100644 --- a/include/asm-x86_64/dma-mapping.h +++ b/include/asm-x86/dma-mapping_64.h diff --git a/include/asm-x86/dma.h b/include/asm-x86/dma.h new file mode 100644 index 00000000000..9f936c61a4e --- /dev/null +++ b/include/asm-x86/dma.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "dma_32.h" +#else +# include "dma_64.h" +#endif diff --git a/include/asm-i386/dma.h b/include/asm-x86/dma_32.h index d23aac8e1a5..d23aac8e1a5 100644 --- a/include/asm-i386/dma.h +++ b/include/asm-x86/dma_32.h diff --git a/include/asm-x86_64/dma.h b/include/asm-x86/dma_64.h index a37c16f0628..a37c16f0628 100644 --- a/include/asm-x86_64/dma.h +++ b/include/asm-x86/dma_64.h diff --git a/include/asm-x86/dmi.h b/include/asm-x86/dmi.h new file mode 100644 index 00000000000..c9e4e8ebc27 --- /dev/null +++ b/include/asm-x86/dmi.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "dmi_32.h" +#else +# include "dmi_64.h" +#endif diff --git a/include/asm-i386/dmi.h b/include/asm-x86/dmi_32.h index 38d4eeb7fc7..38d4eeb7fc7 100644 --- a/include/asm-i386/dmi.h +++ b/include/asm-x86/dmi_32.h diff --git a/include/asm-x86_64/dmi.h b/include/asm-x86/dmi_64.h index d02e32e3c3f..d02e32e3c3f 100644 --- a/include/asm-x86_64/dmi.h +++ b/include/asm-x86/dmi_64.h diff --git a/include/asm-x86/dwarf2.h b/include/asm-x86/dwarf2.h new file mode 100644 index 00000000000..b3cbb0ccae1 --- /dev/null +++ b/include/asm-x86/dwarf2.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "dwarf2_32.h" +#else +# include "dwarf2_64.h" +#endif diff --git a/include/asm-i386/dwarf2.h b/include/asm-x86/dwarf2_32.h index 6d66398a307..6d66398a307 100644 --- a/include/asm-i386/dwarf2.h +++ b/include/asm-x86/dwarf2_32.h diff --git a/include/asm-x86_64/dwarf2.h b/include/asm-x86/dwarf2_64.h index eedc08526b0..eedc08526b0 100644 --- a/include/asm-x86_64/dwarf2.h +++ b/include/asm-x86/dwarf2_64.h diff --git a/include/asm-x86/e820.h b/include/asm-x86/e820.h new file mode 100644 index 00000000000..5d4d2183e5d --- /dev/null +++ b/include/asm-x86/e820.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "e820_32.h" +#else +# include "e820_64.h" +#endif diff --git a/include/asm-i386/e820.h b/include/asm-x86/e820_32.h index cf67dbb1db7..cf67dbb1db7 100644 --- a/include/asm-i386/e820.h +++ b/include/asm-x86/e820_32.h diff --git a/include/asm-x86_64/e820.h b/include/asm-x86/e820_64.h index 3486e701bd8..3486e701bd8 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86/e820_64.h diff --git a/include/asm-x86/edac.h b/include/asm-x86/edac.h new file mode 100644 index 00000000000..f8b888e140b --- /dev/null +++ b/include/asm-x86/edac.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "edac_32.h" +#else +# include "edac_64.h" +#endif diff --git a/include/asm-i386/edac.h b/include/asm-x86/edac_32.h index 3e7dd0ab68c..3e7dd0ab68c 100644 --- a/include/asm-i386/edac.h +++ b/include/asm-x86/edac_32.h diff --git a/include/asm-x86_64/edac.h b/include/asm-x86/edac_64.h index cad1cd42b4e..cad1cd42b4e 100644 --- a/include/asm-x86_64/edac.h +++ b/include/asm-x86/edac_64.h diff --git a/include/asm-x86/elf.h b/include/asm-x86/elf.h new file mode 100644 index 00000000000..ed6bb6e546b --- /dev/null +++ b/include/asm-x86/elf.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "elf_32.h" +# else +# include "elf_64.h" +# endif +#else +# ifdef __i386__ +# include "elf_32.h" +# else +# include "elf_64.h" +# endif +#endif diff --git a/include/asm-i386/elf.h b/include/asm-x86/elf_32.h index b32df3a332d..b32df3a332d 100644 --- a/include/asm-i386/elf.h +++ b/include/asm-x86/elf_32.h diff --git a/include/asm-x86_64/elf.h b/include/asm-x86/elf_64.h index b4fbe47f6cc..b4fbe47f6cc 100644 --- a/include/asm-x86_64/elf.h +++ b/include/asm-x86/elf_64.h diff --git a/include/asm-i386/emergency-restart.h b/include/asm-x86/emergency-restart.h index 680c3956334..680c3956334 100644 --- a/include/asm-i386/emergency-restart.h +++ b/include/asm-x86/emergency-restart.h diff --git a/include/asm-x86/errno.h b/include/asm-x86/errno.h new file mode 100644 index 00000000000..9d511be8e57 --- /dev/null +++ b/include/asm-x86/errno.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "errno_32.h" +# else +# include "errno_64.h" +# endif +#else +# ifdef __i386__ +# include "errno_32.h" +# else +# include "errno_64.h" +# endif +#endif diff --git a/include/asm-i386/errno.h b/include/asm-x86/errno_32.h index 969b3437472..969b3437472 100644 --- a/include/asm-i386/errno.h +++ b/include/asm-x86/errno_32.h diff --git a/include/asm-x86_64/errno.h b/include/asm-x86/errno_64.h index 311182129e3..311182129e3 100644 --- a/include/asm-x86_64/errno.h +++ b/include/asm-x86/errno_64.h diff --git a/include/asm-x86/fb.h b/include/asm-x86/fb.h new file mode 100644 index 00000000000..238c7ca4587 --- /dev/null +++ b/include/asm-x86/fb.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "fb_32.h" +#else +# include "fb_64.h" +#endif diff --git a/include/asm-i386/fb.h b/include/asm-x86/fb_32.h index d1c6297d4a6..d1c6297d4a6 100644 --- a/include/asm-i386/fb.h +++ b/include/asm-x86/fb_32.h diff --git a/include/asm-x86_64/fb.h b/include/asm-x86/fb_64.h index 60548e651d1..60548e651d1 100644 --- a/include/asm-x86_64/fb.h +++ b/include/asm-x86/fb_64.h diff --git a/include/asm-i386/fcntl.h b/include/asm-x86/fcntl.h index 46ab12db573..46ab12db573 100644 --- a/include/asm-i386/fcntl.h +++ b/include/asm-x86/fcntl.h diff --git a/include/asm-x86/fixmap.h b/include/asm-x86/fixmap.h new file mode 100644 index 00000000000..382eb271a89 --- /dev/null +++ b/include/asm-x86/fixmap.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "fixmap_32.h" +#else +# include "fixmap_64.h" +#endif diff --git a/include/asm-i386/fixmap.h b/include/asm-x86/fixmap_32.h index 249e753ac80..249e753ac80 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-x86/fixmap_32.h diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86/fixmap_64.h index cdfbe4a6ae6..cdfbe4a6ae6 100644 --- a/include/asm-x86_64/fixmap.h +++ b/include/asm-x86/fixmap_64.h diff --git a/include/asm-x86/floppy.h b/include/asm-x86/floppy.h new file mode 100644 index 00000000000..aecbb6dca21 --- /dev/null +++ b/include/asm-x86/floppy.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "floppy_32.h" +#else +# include "floppy_64.h" +#endif diff --git a/include/asm-i386/floppy.h b/include/asm-x86/floppy_32.h index 44ef2f55a8e..44ef2f55a8e 100644 --- a/include/asm-i386/floppy.h +++ b/include/asm-x86/floppy_32.h diff --git a/include/asm-x86_64/floppy.h b/include/asm-x86/floppy_64.h index 6ea13c3806f..6ea13c3806f 100644 --- a/include/asm-x86_64/floppy.h +++ b/include/asm-x86/floppy_64.h diff --git a/include/asm-x86_64/fpu32.h b/include/asm-x86/fpu32.h index 4153db5c0c3..4153db5c0c3 100644 --- a/include/asm-x86_64/fpu32.h +++ b/include/asm-x86/fpu32.h diff --git a/include/asm-i386/frame.i b/include/asm-x86/frame.i index 03620251ae1..03620251ae1 100644 --- a/include/asm-i386/frame.i +++ b/include/asm-x86/frame.i diff --git a/include/asm-x86/futex.h b/include/asm-x86/futex.h new file mode 100644 index 00000000000..1f4610e0c61 --- /dev/null +++ b/include/asm-x86/futex.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "futex_32.h" +#else +# include "futex_64.h" +#endif diff --git a/include/asm-i386/futex.h b/include/asm-x86/futex_32.h index 438ef0ec710..438ef0ec710 100644 --- a/include/asm-i386/futex.h +++ b/include/asm-x86/futex_32.h diff --git a/include/asm-x86_64/futex.h b/include/asm-x86/futex_64.h index 5cdfb08013c..5cdfb08013c 100644 --- a/include/asm-x86_64/futex.h +++ b/include/asm-x86/futex_64.h diff --git a/include/asm-x86/genapic.h b/include/asm-x86/genapic.h new file mode 100644 index 00000000000..d48bee663a6 --- /dev/null +++ b/include/asm-x86/genapic.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "genapic_32.h" +#else +# include "genapic_64.h" +#endif diff --git a/include/asm-i386/genapic.h b/include/asm-x86/genapic_32.h index 33e3ffe1766..33e3ffe1766 100644 --- a/include/asm-i386/genapic.h +++ b/include/asm-x86/genapic_32.h diff --git a/include/asm-x86_64/genapic.h b/include/asm-x86/genapic_64.h index d7e516ccbaa..d7e516ccbaa 100644 --- a/include/asm-x86_64/genapic.h +++ b/include/asm-x86/genapic_64.h diff --git a/include/asm-i386/geode.h b/include/asm-x86/geode.h index 6da4bbbea3d..6da4bbbea3d 100644 --- a/include/asm-i386/geode.h +++ b/include/asm-x86/geode.h diff --git a/include/asm-x86/hardirq.h b/include/asm-x86/hardirq.h new file mode 100644 index 00000000000..314434d664e --- /dev/null +++ b/include/asm-x86/hardirq.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "hardirq_32.h" +#else +# include "hardirq_64.h" +#endif diff --git a/include/asm-i386/hardirq.h b/include/asm-x86/hardirq_32.h index 0e358dc405f..0e358dc405f 100644 --- a/include/asm-i386/hardirq.h +++ b/include/asm-x86/hardirq_32.h diff --git a/include/asm-x86_64/hardirq.h b/include/asm-x86/hardirq_64.h index 95d5e090ed8..95d5e090ed8 100644 --- a/include/asm-x86_64/hardirq.h +++ b/include/asm-x86/hardirq_64.h diff --git a/include/asm-i386/highmem.h b/include/asm-x86/highmem.h index 13cdcd66fff..13cdcd66fff 100644 --- a/include/asm-i386/highmem.h +++ b/include/asm-x86/highmem.h diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h new file mode 100644 index 00000000000..9eff4860125 --- /dev/null +++ b/include/asm-x86/hpet.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "hpet_32.h" +#else +# include "hpet_64.h" +#endif diff --git a/include/asm-i386/hpet.h b/include/asm-x86/hpet_32.h index c82dc7ed96b..c82dc7ed96b 100644 --- a/include/asm-i386/hpet.h +++ b/include/asm-x86/hpet_32.h diff --git a/include/asm-x86/hpet_64.h b/include/asm-x86/hpet_64.h new file mode 100644 index 00000000000..fd4decac93a --- /dev/null +++ b/include/asm-x86/hpet_64.h @@ -0,0 +1,18 @@ +#ifndef _ASM_X8664_HPET_H +#define _ASM_X8664_HPET_H 1 + +#include <asm/hpet_32.h> + +#define HPET_TICK_RATE (HZ * 100000UL) + +extern int hpet_rtc_timer_init(void); +extern int hpet_arch_init(void); +extern int hpet_timer_stop_set_go(unsigned long tick); +extern int hpet_reenable(void); +extern unsigned int hpet_calibrate_tsc(void); + +extern int hpet_use_timer; +extern unsigned long hpet_period; +extern unsigned long hpet_tick; + +#endif diff --git a/include/asm-x86/hw_irq.h b/include/asm-x86/hw_irq.h new file mode 100644 index 00000000000..bf025399d93 --- /dev/null +++ b/include/asm-x86/hw_irq.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "hw_irq_32.h" +#else +# include "hw_irq_64.h" +#endif diff --git a/include/asm-i386/hw_irq.h b/include/asm-x86/hw_irq_32.h index 0bedbdf5e90..0bedbdf5e90 100644 --- a/include/asm-i386/hw_irq.h +++ b/include/asm-x86/hw_irq_32.h diff --git a/include/asm-x86_64/hw_irq.h b/include/asm-x86/hw_irq_64.h index 09dfc18a6dd..09dfc18a6dd 100644 --- a/include/asm-x86_64/hw_irq.h +++ b/include/asm-x86/hw_irq_64.h diff --git a/include/asm-i386/hypertransport.h b/include/asm-x86/hypertransport.h index c16c6ff4bdd..c16c6ff4bdd 100644 --- a/include/asm-i386/hypertransport.h +++ b/include/asm-x86/hypertransport.h diff --git a/include/asm-x86/i387.h b/include/asm-x86/i387.h new file mode 100644 index 00000000000..a8bbed34966 --- /dev/null +++ b/include/asm-x86/i387.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "i387_32.h" +#else +# include "i387_64.h" +#endif diff --git a/include/asm-i386/i387.h b/include/asm-x86/i387_32.h index cdd1e248e3b..cdd1e248e3b 100644 --- a/include/asm-i386/i387.h +++ b/include/asm-x86/i387_32.h diff --git a/include/asm-x86_64/i387.h b/include/asm-x86/i387_64.h index 0217b74cc9f..0217b74cc9f 100644 --- a/include/asm-x86_64/i387.h +++ b/include/asm-x86/i387_64.h diff --git a/include/asm-x86/i8253.h b/include/asm-x86/i8253.h new file mode 100644 index 00000000000..b2a4f995a33 --- /dev/null +++ b/include/asm-x86/i8253.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "i8253_32.h" +#else +# include "i8253_64.h" +#endif diff --git a/include/asm-i386/i8253.h b/include/asm-x86/i8253_32.h index 7577d058d86..7577d058d86 100644 --- a/include/asm-i386/i8253.h +++ b/include/asm-x86/i8253_32.h diff --git a/include/asm-x86_64/i8253.h b/include/asm-x86/i8253_64.h index 015d8df0769..015d8df0769 100644 --- a/include/asm-x86_64/i8253.h +++ b/include/asm-x86/i8253_64.h diff --git a/include/asm-i386/i8259.h b/include/asm-x86/i8259.h index 29d8f9a6b3f..29d8f9a6b3f 100644 --- a/include/asm-i386/i8259.h +++ b/include/asm-x86/i8259.h diff --git a/include/asm-x86_64/ia32.h b/include/asm-x86/ia32.h index 0190b7c4e31..0190b7c4e31 100644 --- a/include/asm-x86_64/ia32.h +++ b/include/asm-x86/ia32.h diff --git a/include/asm-x86_64/ia32_unistd.h b/include/asm-x86/ia32_unistd.h index 5b52ce50733..5b52ce50733 100644 --- a/include/asm-x86_64/ia32_unistd.h +++ b/include/asm-x86/ia32_unistd.h diff --git a/include/asm-i386/ide.h b/include/asm-x86/ide.h index e7817a3d657..e7817a3d657 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-x86/ide.h diff --git a/include/asm-x86_64/idle.h b/include/asm-x86/idle.h index 6bd47dcf206..6bd47dcf206 100644 --- a/include/asm-x86_64/idle.h +++ b/include/asm-x86/idle.h diff --git a/include/asm-x86/intel_arch_perfmon.h b/include/asm-x86/intel_arch_perfmon.h new file mode 100644 index 00000000000..4f6d4e6bf57 --- /dev/null +++ b/include/asm-x86/intel_arch_perfmon.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "intel_arch_perfmon_32.h" +#else +# include "intel_arch_perfmon_64.h" +#endif diff --git a/include/asm-i386/intel_arch_perfmon.h b/include/asm-x86/intel_arch_perfmon_32.h index b52cd60a075..b52cd60a075 100644 --- a/include/asm-i386/intel_arch_perfmon.h +++ b/include/asm-x86/intel_arch_perfmon_32.h diff --git a/include/asm-x86_64/intel_arch_perfmon.h b/include/asm-x86/intel_arch_perfmon_64.h index 8633331420e..8633331420e 100644 --- a/include/asm-x86_64/intel_arch_perfmon.h +++ b/include/asm-x86/intel_arch_perfmon_64.h diff --git a/include/asm-x86/io.h b/include/asm-x86/io.h new file mode 100644 index 00000000000..5a58b176dd6 --- /dev/null +++ b/include/asm-x86/io.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "io_32.h" +#else +# include "io_64.h" +#endif diff --git a/include/asm-i386/io.h b/include/asm-x86/io_32.h index e8e0bd64112..e8e0bd64112 100644 --- a/include/asm-i386/io.h +++ b/include/asm-x86/io_32.h diff --git a/include/asm-x86_64/io.h b/include/asm-x86/io_64.h index 7475095c506..7475095c506 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86/io_64.h diff --git a/include/asm-x86/io_apic.h b/include/asm-x86/io_apic.h new file mode 100644 index 00000000000..88494966bee --- /dev/null +++ b/include/asm-x86/io_apic.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "io_apic_32.h" +#else +# include "io_apic_64.h" +#endif diff --git a/include/asm-i386/io_apic.h b/include/asm-x86/io_apic_32.h index dbe734ddf2a..dbe734ddf2a 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-x86/io_apic_32.h diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86/io_apic_64.h index d9f2e54324d..d9f2e54324d 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86/io_apic_64.h diff --git a/include/asm-i386/ioctl.h b/include/asm-x86/ioctl.h index b279fe06dfe..b279fe06dfe 100644 --- a/include/asm-i386/ioctl.h +++ b/include/asm-x86/ioctl.h diff --git a/include/asm-x86/ioctls.h b/include/asm-x86/ioctls.h new file mode 100644 index 00000000000..1e0fd48f18b --- /dev/null +++ b/include/asm-x86/ioctls.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ioctls_32.h" +# else +# include "ioctls_64.h" +# endif +#else +# ifdef __i386__ +# include "ioctls_32.h" +# else +# include "ioctls_64.h" +# endif +#endif diff --git a/include/asm-i386/ioctls.h b/include/asm-x86/ioctls_32.h index ef5878762dc..ef5878762dc 100644 --- a/include/asm-i386/ioctls.h +++ b/include/asm-x86/ioctls_32.h diff --git a/include/asm-x86_64/ioctls.h b/include/asm-x86/ioctls_64.h index 3fc0b15a0d7..3fc0b15a0d7 100644 --- a/include/asm-x86_64/ioctls.h +++ b/include/asm-x86/ioctls_64.h diff --git a/include/asm-x86_64/iommu.h b/include/asm-x86/iommu.h index 5af471f228e..5af471f228e 100644 --- a/include/asm-x86_64/iommu.h +++ b/include/asm-x86/iommu.h diff --git a/include/asm-i386/ipc.h b/include/asm-x86/ipc.h index a46e3d9c2a3..a46e3d9c2a3 100644 --- a/include/asm-i386/ipc.h +++ b/include/asm-x86/ipc.h diff --git a/include/asm-x86/ipcbuf.h b/include/asm-x86/ipcbuf.h new file mode 100644 index 00000000000..eb2e448c6e2 --- /dev/null +++ b/include/asm-x86/ipcbuf.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ipcbuf_32.h" +# else +# include "ipcbuf_64.h" +# endif +#else +# ifdef __i386__ +# include "ipcbuf_32.h" +# else +# include "ipcbuf_64.h" +# endif +#endif diff --git a/include/asm-i386/ipcbuf.h b/include/asm-x86/ipcbuf_32.h index 0dcad4f84c2..0dcad4f84c2 100644 --- a/include/asm-i386/ipcbuf.h +++ b/include/asm-x86/ipcbuf_32.h diff --git a/include/asm-x86_64/ipcbuf.h b/include/asm-x86/ipcbuf_64.h index 470cf85e3ba..470cf85e3ba 100644 --- a/include/asm-x86_64/ipcbuf.h +++ b/include/asm-x86/ipcbuf_64.h diff --git a/include/asm-x86_64/ipi.h b/include/asm-x86/ipi.h index a7c75ea408a..a7c75ea408a 100644 --- a/include/asm-x86_64/ipi.h +++ b/include/asm-x86/ipi.h diff --git a/include/asm-x86/irq.h b/include/asm-x86/irq.h new file mode 100644 index 00000000000..7ba905465a5 --- /dev/null +++ b/include/asm-x86/irq.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "irq_32.h" +#else +# include "irq_64.h" +#endif diff --git a/include/asm-i386/irq.h b/include/asm-x86/irq_32.h index 36f310632c4..36f310632c4 100644 --- a/include/asm-i386/irq.h +++ b/include/asm-x86/irq_32.h diff --git a/include/asm-x86_64/irq.h b/include/asm-x86/irq_64.h index 5006c6e7565..5006c6e7565 100644 --- a/include/asm-x86_64/irq.h +++ b/include/asm-x86/irq_64.h diff --git a/include/asm-x86/irq_regs.h b/include/asm-x86/irq_regs.h new file mode 100644 index 00000000000..89c898ab298 --- /dev/null +++ b/include/asm-x86/irq_regs.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "irq_regs_32.h" +#else +# include "irq_regs_64.h" +#endif diff --git a/include/asm-i386/irq_regs.h b/include/asm-x86/irq_regs_32.h index 3368b20c0b4..3368b20c0b4 100644 --- a/include/asm-i386/irq_regs.h +++ b/include/asm-x86/irq_regs_32.h diff --git a/include/asm-x86_64/irq_regs.h b/include/asm-x86/irq_regs_64.h index 3dd9c0b7027..3dd9c0b7027 100644 --- a/include/asm-x86_64/irq_regs.h +++ b/include/asm-x86/irq_regs_64.h diff --git a/include/asm-x86/irqflags.h b/include/asm-x86/irqflags.h new file mode 100644 index 00000000000..1b695ff5268 --- /dev/null +++ b/include/asm-x86/irqflags.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "irqflags_32.h" +#else +# include "irqflags_64.h" +#endif diff --git a/include/asm-i386/irqflags.h b/include/asm-x86/irqflags_32.h index eff8585cb74..eff8585cb74 100644 --- a/include/asm-i386/irqflags.h +++ b/include/asm-x86/irqflags_32.h diff --git a/include/asm-x86_64/irqflags.h b/include/asm-x86/irqflags_64.h index 86e70fe2365..86e70fe2365 100644 --- a/include/asm-x86_64/irqflags.h +++ b/include/asm-x86/irqflags_64.h diff --git a/include/asm-i386/ist.h b/include/asm-x86/ist.h index ef2003ebc6f..ef2003ebc6f 100644 --- a/include/asm-i386/ist.h +++ b/include/asm-x86/ist.h diff --git a/include/asm-x86_64/k8.h b/include/asm-x86/k8.h index 699dd6961ed..699dd6961ed 100644 --- a/include/asm-x86_64/k8.h +++ b/include/asm-x86/k8.h diff --git a/include/asm-x86/kdebug.h b/include/asm-x86/kdebug.h new file mode 100644 index 00000000000..38479106c25 --- /dev/null +++ b/include/asm-x86/kdebug.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "kdebug_32.h" +#else +# include "kdebug_64.h" +#endif diff --git a/include/asm-i386/kdebug.h b/include/asm-x86/kdebug_32.h index a185b5f73e7..a185b5f73e7 100644 --- a/include/asm-i386/kdebug.h +++ b/include/asm-x86/kdebug_32.h diff --git a/include/asm-x86_64/kdebug.h b/include/asm-x86/kdebug_64.h index d7e2bcf49e4..d7e2bcf49e4 100644 --- a/include/asm-x86_64/kdebug.h +++ b/include/asm-x86/kdebug_64.h diff --git a/include/asm-x86/kexec.h b/include/asm-x86/kexec.h new file mode 100644 index 00000000000..718ddbfb951 --- /dev/null +++ b/include/asm-x86/kexec.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "kexec_32.h" +#else +# include "kexec_64.h" +#endif diff --git a/include/asm-i386/kexec.h b/include/asm-x86/kexec_32.h index 4b9dc9e6b70..4b9dc9e6b70 100644 --- a/include/asm-i386/kexec.h +++ b/include/asm-x86/kexec_32.h diff --git a/include/asm-x86_64/kexec.h b/include/asm-x86/kexec_64.h index 738e581b67f..738e581b67f 100644 --- a/include/asm-x86_64/kexec.h +++ b/include/asm-x86/kexec_64.h diff --git a/include/asm-x86/kmap_types.h b/include/asm-x86/kmap_types.h new file mode 100644 index 00000000000..e4ec724b298 --- /dev/null +++ b/include/asm-x86/kmap_types.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "kmap_types_32.h" +#else +# include "kmap_types_64.h" +#endif diff --git a/include/asm-i386/kmap_types.h b/include/asm-x86/kmap_types_32.h index 806aae3c533..806aae3c533 100644 --- a/include/asm-i386/kmap_types.h +++ b/include/asm-x86/kmap_types_32.h diff --git a/include/asm-x86_64/kmap_types.h b/include/asm-x86/kmap_types_64.h index 7486338c6ce..7486338c6ce 100644 --- a/include/asm-x86_64/kmap_types.h +++ b/include/asm-x86/kmap_types_64.h diff --git a/include/asm-x86/kprobes.h b/include/asm-x86/kprobes.h new file mode 100644 index 00000000000..b7bbd25ba2a --- /dev/null +++ b/include/asm-x86/kprobes.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "kprobes_32.h" +#else +# include "kprobes_64.h" +#endif diff --git a/include/asm-i386/kprobes.h b/include/asm-x86/kprobes_32.h index 06f7303c30c..06f7303c30c 100644 --- a/include/asm-i386/kprobes.h +++ b/include/asm-x86/kprobes_32.h diff --git a/include/asm-x86_64/kprobes.h b/include/asm-x86/kprobes_64.h index 7db825403e0..7db825403e0 100644 --- a/include/asm-x86_64/kprobes.h +++ b/include/asm-x86/kprobes_64.h diff --git a/include/asm-x86/ldt.h b/include/asm-x86/ldt.h new file mode 100644 index 00000000000..3d9cc20d2ba --- /dev/null +++ b/include/asm-x86/ldt.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ldt_32.h" +# else +# include "ldt_64.h" +# endif +#else +# ifdef __i386__ +# include "ldt_32.h" +# else +# include "ldt_64.h" +# endif +#endif diff --git a/include/asm-i386/ldt.h b/include/asm-x86/ldt_32.h index e9d3de1dee6..e9d3de1dee6 100644 --- a/include/asm-i386/ldt.h +++ b/include/asm-x86/ldt_32.h diff --git a/include/asm-x86_64/ldt.h b/include/asm-x86/ldt_64.h index 9ef647b890d..9ef647b890d 100644 --- a/include/asm-x86_64/ldt.h +++ b/include/asm-x86/ldt_64.h diff --git a/include/asm-x86/linkage.h b/include/asm-x86/linkage.h new file mode 100644 index 00000000000..94b257fa870 --- /dev/null +++ b/include/asm-x86/linkage.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "linkage_32.h" +#else +# include "linkage_64.h" +#endif diff --git a/include/asm-i386/linkage.h b/include/asm-x86/linkage_32.h index f4a6ebac024..f4a6ebac024 100644 --- a/include/asm-i386/linkage.h +++ b/include/asm-x86/linkage_32.h diff --git a/include/asm-x86_64/linkage.h b/include/asm-x86/linkage_64.h index b5f39d0189c..b5f39d0189c 100644 --- a/include/asm-x86_64/linkage.h +++ b/include/asm-x86/linkage_64.h diff --git a/include/asm-x86/local.h b/include/asm-x86/local.h new file mode 100644 index 00000000000..c7a1b1c66c9 --- /dev/null +++ b/include/asm-x86/local.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "local_32.h" +#else +# include "local_64.h" +#endif diff --git a/include/asm-i386/local.h b/include/asm-x86/local_32.h index 6e85975b9ed..6e85975b9ed 100644 --- a/include/asm-i386/local.h +++ b/include/asm-x86/local_32.h diff --git a/include/asm-x86_64/local.h b/include/asm-x86/local_64.h index e87492bb069..e87492bb069 100644 --- a/include/asm-x86_64/local.h +++ b/include/asm-x86/local_64.h diff --git a/include/asm-i386/mach-bigsmp/mach_apic.h b/include/asm-x86/mach-bigsmp/mach_apic.h index ebd319f838a..ebd319f838a 100644 --- a/include/asm-i386/mach-bigsmp/mach_apic.h +++ b/include/asm-x86/mach-bigsmp/mach_apic.h diff --git a/include/asm-i386/mach-bigsmp/mach_apicdef.h b/include/asm-x86/mach-bigsmp/mach_apicdef.h index a58ab5a75c8..a58ab5a75c8 100644 --- a/include/asm-i386/mach-bigsmp/mach_apicdef.h +++ b/include/asm-x86/mach-bigsmp/mach_apicdef.h diff --git a/include/asm-i386/mach-bigsmp/mach_ipi.h b/include/asm-x86/mach-bigsmp/mach_ipi.h index 9404c535b7e..9404c535b7e 100644 --- a/include/asm-i386/mach-bigsmp/mach_ipi.h +++ b/include/asm-x86/mach-bigsmp/mach_ipi.h diff --git a/include/asm-i386/mach-bigsmp/mach_mpspec.h b/include/asm-x86/mach-bigsmp/mach_mpspec.h index 6b5dadcf1d0..6b5dadcf1d0 100644 --- a/include/asm-i386/mach-bigsmp/mach_mpspec.h +++ b/include/asm-x86/mach-bigsmp/mach_mpspec.h diff --git a/include/asm-i386/mach-default/apm.h b/include/asm-x86/mach-default/apm.h index 1f730b8bd1f..1f730b8bd1f 100644 --- a/include/asm-i386/mach-default/apm.h +++ b/include/asm-x86/mach-default/apm.h diff --git a/include/asm-i386/mach-default/bios_ebda.h b/include/asm-x86/mach-default/bios_ebda.h index 9cbd9a668af..9cbd9a668af 100644 --- a/include/asm-i386/mach-default/bios_ebda.h +++ b/include/asm-x86/mach-default/bios_ebda.h diff --git a/include/asm-i386/mach-default/do_timer.h b/include/asm-x86/mach-default/do_timer.h index 23ecda0b28a..23ecda0b28a 100644 --- a/include/asm-i386/mach-default/do_timer.h +++ b/include/asm-x86/mach-default/do_timer.h diff --git a/include/asm-i386/mach-default/entry_arch.h b/include/asm-x86/mach-default/entry_arch.h index bc861469bdb..bc861469bdb 100644 --- a/include/asm-i386/mach-default/entry_arch.h +++ b/include/asm-x86/mach-default/entry_arch.h diff --git a/include/asm-i386/mach-default/io_ports.h b/include/asm-x86/mach-default/io_ports.h index 48540ba9716..48540ba9716 100644 --- a/include/asm-i386/mach-default/io_ports.h +++ b/include/asm-x86/mach-default/io_ports.h diff --git a/include/asm-i386/mach-default/irq_vectors.h b/include/asm-x86/mach-default/irq_vectors.h index 881c63ca61a..881c63ca61a 100644 --- a/include/asm-i386/mach-default/irq_vectors.h +++ b/include/asm-x86/mach-default/irq_vectors.h diff --git a/include/asm-i386/mach-default/irq_vectors_limits.h b/include/asm-x86/mach-default/irq_vectors_limits.h index a90c7a60109..a90c7a60109 100644 --- a/include/asm-i386/mach-default/irq_vectors_limits.h +++ b/include/asm-x86/mach-default/irq_vectors_limits.h diff --git a/include/asm-i386/mach-default/mach_apic.h b/include/asm-x86/mach-default/mach_apic.h index 6db1c3babe9..6db1c3babe9 100644 --- a/include/asm-i386/mach-default/mach_apic.h +++ b/include/asm-x86/mach-default/mach_apic.h diff --git a/include/asm-i386/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h index 7bcb350c3ee..7bcb350c3ee 100644 --- a/include/asm-i386/mach-default/mach_apicdef.h +++ b/include/asm-x86/mach-default/mach_apicdef.h diff --git a/include/asm-i386/mach-default/mach_ipi.h b/include/asm-x86/mach-default/mach_ipi.h index 0dba244c86d..0dba244c86d 100644 --- a/include/asm-i386/mach-default/mach_ipi.h +++ b/include/asm-x86/mach-default/mach_ipi.h diff --git a/include/asm-i386/mach-default/mach_mpparse.h b/include/asm-x86/mach-default/mach_mpparse.h index 1d383248258..1d383248258 100644 --- a/include/asm-i386/mach-default/mach_mpparse.h +++ b/include/asm-x86/mach-default/mach_mpparse.h diff --git a/include/asm-i386/mach-default/mach_mpspec.h b/include/asm-x86/mach-default/mach_mpspec.h index 51c9a977593..51c9a977593 100644 --- a/include/asm-i386/mach-default/mach_mpspec.h +++ b/include/asm-x86/mach-default/mach_mpspec.h diff --git a/include/asm-i386/mach-default/mach_reboot.h b/include/asm-x86/mach-default/mach_reboot.h index e23fd9fbebb..e23fd9fbebb 100644 --- a/include/asm-i386/mach-default/mach_reboot.h +++ b/include/asm-x86/mach-default/mach_reboot.h diff --git a/include/asm-i386/mach-default/mach_time.h b/include/asm-x86/mach-default/mach_time.h index 31eb5de6f3d..31eb5de6f3d 100644 --- a/include/asm-i386/mach-default/mach_time.h +++ b/include/asm-x86/mach-default/mach_time.h diff --git a/include/asm-i386/mach-default/mach_timer.h b/include/asm-x86/mach-default/mach_timer.h index 807992fd417..807992fd417 100644 --- a/include/asm-i386/mach-default/mach_timer.h +++ b/include/asm-x86/mach-default/mach_timer.h diff --git a/include/asm-i386/mach-default/mach_traps.h b/include/asm-x86/mach-default/mach_traps.h index 625438b8a6e..625438b8a6e 100644 --- a/include/asm-i386/mach-default/mach_traps.h +++ b/include/asm-x86/mach-default/mach_traps.h diff --git a/include/asm-i386/mach-default/mach_wakecpu.h b/include/asm-x86/mach-default/mach_wakecpu.h index 3ebb17893aa..3ebb17893aa 100644 --- a/include/asm-i386/mach-default/mach_wakecpu.h +++ b/include/asm-x86/mach-default/mach_wakecpu.h diff --git a/include/asm-i386/mach-default/pci-functions.h b/include/asm-x86/mach-default/pci-functions.h index ed0bab42735..ed0bab42735 100644 --- a/include/asm-i386/mach-default/pci-functions.h +++ b/include/asm-x86/mach-default/pci-functions.h diff --git a/include/asm-i386/mach-default/setup_arch.h b/include/asm-x86/mach-default/setup_arch.h index 605e3ccb991..605e3ccb991 100644 --- a/include/asm-i386/mach-default/setup_arch.h +++ b/include/asm-x86/mach-default/setup_arch.h diff --git a/include/asm-i386/mach-default/smpboot_hooks.h b/include/asm-x86/mach-default/smpboot_hooks.h index 7f45f631105..7f45f631105 100644 --- a/include/asm-i386/mach-default/smpboot_hooks.h +++ b/include/asm-x86/mach-default/smpboot_hooks.h diff --git a/include/asm-i386/mach-es7000/mach_apic.h b/include/asm-x86/mach-es7000/mach_apic.h index caec64be516..caec64be516 100644 --- a/include/asm-i386/mach-es7000/mach_apic.h +++ b/include/asm-x86/mach-es7000/mach_apic.h diff --git a/include/asm-i386/mach-es7000/mach_apicdef.h b/include/asm-x86/mach-es7000/mach_apicdef.h index a58ab5a75c8..a58ab5a75c8 100644 --- a/include/asm-i386/mach-es7000/mach_apicdef.h +++ b/include/asm-x86/mach-es7000/mach_apicdef.h diff --git a/include/asm-i386/mach-es7000/mach_ipi.h b/include/asm-x86/mach-es7000/mach_ipi.h index 5e61bd220b0..5e61bd220b0 100644 --- a/include/asm-i386/mach-es7000/mach_ipi.h +++ b/include/asm-x86/mach-es7000/mach_ipi.h diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-x86/mach-es7000/mach_mpparse.h index 8aa10547b4b..8aa10547b4b 100644 --- a/include/asm-i386/mach-es7000/mach_mpparse.h +++ b/include/asm-x86/mach-es7000/mach_mpparse.h diff --git a/include/asm-i386/mach-es7000/mach_mpspec.h b/include/asm-x86/mach-es7000/mach_mpspec.h index b1f5039d450..b1f5039d450 100644 --- a/include/asm-i386/mach-es7000/mach_mpspec.h +++ b/include/asm-x86/mach-es7000/mach_mpspec.h diff --git a/include/asm-i386/mach-es7000/mach_wakecpu.h b/include/asm-x86/mach-es7000/mach_wakecpu.h index 84ff5831450..84ff5831450 100644 --- a/include/asm-i386/mach-es7000/mach_wakecpu.h +++ b/include/asm-x86/mach-es7000/mach_wakecpu.h diff --git a/include/asm-i386/mach-generic/irq_vectors_limits.h b/include/asm-x86/mach-generic/irq_vectors_limits.h index 890ce3f5e09..890ce3f5e09 100644 --- a/include/asm-i386/mach-generic/irq_vectors_limits.h +++ b/include/asm-x86/mach-generic/irq_vectors_limits.h diff --git a/include/asm-i386/mach-generic/mach_apic.h b/include/asm-x86/mach-generic/mach_apic.h index a236e702152..a236e702152 100644 --- a/include/asm-i386/mach-generic/mach_apic.h +++ b/include/asm-x86/mach-generic/mach_apic.h diff --git a/include/asm-i386/mach-generic/mach_apicdef.h b/include/asm-x86/mach-generic/mach_apicdef.h index 28ed98972ca..28ed98972ca 100644 --- a/include/asm-i386/mach-generic/mach_apicdef.h +++ b/include/asm-x86/mach-generic/mach_apicdef.h diff --git a/include/asm-i386/mach-generic/mach_ipi.h b/include/asm-x86/mach-generic/mach_ipi.h index 441b0fe3ed1..441b0fe3ed1 100644 --- a/include/asm-i386/mach-generic/mach_ipi.h +++ b/include/asm-x86/mach-generic/mach_ipi.h diff --git a/include/asm-i386/mach-generic/mach_mpparse.h b/include/asm-x86/mach-generic/mach_mpparse.h index dbd9fce54f4..dbd9fce54f4 100644 --- a/include/asm-i386/mach-generic/mach_mpparse.h +++ b/include/asm-x86/mach-generic/mach_mpparse.h diff --git a/include/asm-i386/mach-generic/mach_mpspec.h b/include/asm-x86/mach-generic/mach_mpspec.h index 9ef0b941bb2..9ef0b941bb2 100644 --- a/include/asm-i386/mach-generic/mach_mpspec.h +++ b/include/asm-x86/mach-generic/mach_mpspec.h diff --git a/include/asm-i386/mach-numaq/mach_apic.h b/include/asm-x86/mach-numaq/mach_apic.h index 5e5e7dd2692..5e5e7dd2692 100644 --- a/include/asm-i386/mach-numaq/mach_apic.h +++ b/include/asm-x86/mach-numaq/mach_apic.h diff --git a/include/asm-i386/mach-numaq/mach_apicdef.h b/include/asm-x86/mach-numaq/mach_apicdef.h index bf439d0690f..bf439d0690f 100644 --- a/include/asm-i386/mach-numaq/mach_apicdef.h +++ b/include/asm-x86/mach-numaq/mach_apicdef.h diff --git a/include/asm-i386/mach-numaq/mach_ipi.h b/include/asm-x86/mach-numaq/mach_ipi.h index c6044488e9e..c6044488e9e 100644 --- a/include/asm-i386/mach-numaq/mach_ipi.h +++ b/include/asm-x86/mach-numaq/mach_ipi.h diff --git a/include/asm-i386/mach-numaq/mach_mpparse.h b/include/asm-x86/mach-numaq/mach_mpparse.h index 51bbac8fc0c..51bbac8fc0c 100644 --- a/include/asm-i386/mach-numaq/mach_mpparse.h +++ b/include/asm-x86/mach-numaq/mach_mpparse.h diff --git a/include/asm-i386/mach-numaq/mach_mpspec.h b/include/asm-x86/mach-numaq/mach_mpspec.h index dffb09856f8..dffb09856f8 100644 --- a/include/asm-i386/mach-numaq/mach_mpspec.h +++ b/include/asm-x86/mach-numaq/mach_mpspec.h diff --git a/include/asm-i386/mach-numaq/mach_wakecpu.h b/include/asm-x86/mach-numaq/mach_wakecpu.h index 00530041a99..00530041a99 100644 --- a/include/asm-i386/mach-numaq/mach_wakecpu.h +++ b/include/asm-x86/mach-numaq/mach_wakecpu.h diff --git a/include/asm-i386/mach-summit/irq_vectors_limits.h b/include/asm-x86/mach-summit/irq_vectors_limits.h index 890ce3f5e09..890ce3f5e09 100644 --- a/include/asm-i386/mach-summit/irq_vectors_limits.h +++ b/include/asm-x86/mach-summit/irq_vectors_limits.h diff --git a/include/asm-i386/mach-summit/mach_apic.h b/include/asm-x86/mach-summit/mach_apic.h index 732f776aab8..732f776aab8 100644 --- a/include/asm-i386/mach-summit/mach_apic.h +++ b/include/asm-x86/mach-summit/mach_apic.h diff --git a/include/asm-i386/mach-summit/mach_apicdef.h b/include/asm-x86/mach-summit/mach_apicdef.h index a58ab5a75c8..a58ab5a75c8 100644 --- a/include/asm-i386/mach-summit/mach_apicdef.h +++ b/include/asm-x86/mach-summit/mach_apicdef.h diff --git a/include/asm-i386/mach-summit/mach_ipi.h b/include/asm-x86/mach-summit/mach_ipi.h index 9404c535b7e..9404c535b7e 100644 --- a/include/asm-i386/mach-summit/mach_ipi.h +++ b/include/asm-x86/mach-summit/mach_ipi.h diff --git a/include/asm-i386/mach-summit/mach_mpparse.h b/include/asm-x86/mach-summit/mach_mpparse.h index c2520539d93..c2520539d93 100644 --- a/include/asm-i386/mach-summit/mach_mpparse.h +++ b/include/asm-x86/mach-summit/mach_mpparse.h diff --git a/include/asm-i386/mach-summit/mach_mpspec.h b/include/asm-x86/mach-summit/mach_mpspec.h index bd765523511..bd765523511 100644 --- a/include/asm-i386/mach-summit/mach_mpspec.h +++ b/include/asm-x86/mach-summit/mach_mpspec.h diff --git a/include/asm-i386/mach-visws/cobalt.h b/include/asm-x86/mach-visws/cobalt.h index 33c36225a04..33c36225a04 100644 --- a/include/asm-i386/mach-visws/cobalt.h +++ b/include/asm-x86/mach-visws/cobalt.h diff --git a/include/asm-i386/mach-visws/entry_arch.h b/include/asm-x86/mach-visws/entry_arch.h index b183fa6d83d..b183fa6d83d 100644 --- a/include/asm-i386/mach-visws/entry_arch.h +++ b/include/asm-x86/mach-visws/entry_arch.h diff --git a/include/asm-i386/mach-visws/irq_vectors.h b/include/asm-x86/mach-visws/irq_vectors.h index cb572d8db50..cb572d8db50 100644 --- a/include/asm-i386/mach-visws/irq_vectors.h +++ b/include/asm-x86/mach-visws/irq_vectors.h diff --git a/include/asm-i386/mach-visws/lithium.h b/include/asm-x86/mach-visws/lithium.h index d443e68d006..d443e68d006 100644 --- a/include/asm-i386/mach-visws/lithium.h +++ b/include/asm-x86/mach-visws/lithium.h diff --git a/include/asm-i386/mach-visws/mach_apic.h b/include/asm-x86/mach-visws/mach_apic.h index efac6f0d139..efac6f0d139 100644 --- a/include/asm-i386/mach-visws/mach_apic.h +++ b/include/asm-x86/mach-visws/mach_apic.h diff --git a/include/asm-i386/mach-visws/mach_apicdef.h b/include/asm-x86/mach-visws/mach_apicdef.h index 826cfa97d77..826cfa97d77 100644 --- a/include/asm-i386/mach-visws/mach_apicdef.h +++ b/include/asm-x86/mach-visws/mach_apicdef.h diff --git a/include/asm-i386/mach-visws/piix4.h b/include/asm-x86/mach-visws/piix4.h index 83ea4f46e41..83ea4f46e41 100644 --- a/include/asm-i386/mach-visws/piix4.h +++ b/include/asm-x86/mach-visws/piix4.h diff --git a/include/asm-i386/mach-visws/setup_arch.h b/include/asm-x86/mach-visws/setup_arch.h index 33f700ef683..33f700ef683 100644 --- a/include/asm-i386/mach-visws/setup_arch.h +++ b/include/asm-x86/mach-visws/setup_arch.h diff --git a/include/asm-i386/mach-visws/smpboot_hooks.h b/include/asm-x86/mach-visws/smpboot_hooks.h index d926471fa35..d926471fa35 100644 --- a/include/asm-i386/mach-visws/smpboot_hooks.h +++ b/include/asm-x86/mach-visws/smpboot_hooks.h diff --git a/include/asm-i386/mach-voyager/do_timer.h b/include/asm-x86/mach-voyager/do_timer.h index bc2b5892630..bc2b5892630 100644 --- a/include/asm-i386/mach-voyager/do_timer.h +++ b/include/asm-x86/mach-voyager/do_timer.h diff --git a/include/asm-i386/mach-voyager/entry_arch.h b/include/asm-x86/mach-voyager/entry_arch.h index 4a1e1e8c10b..4a1e1e8c10b 100644 --- a/include/asm-i386/mach-voyager/entry_arch.h +++ b/include/asm-x86/mach-voyager/entry_arch.h diff --git a/include/asm-i386/mach-voyager/irq_vectors.h b/include/asm-x86/mach-voyager/irq_vectors.h index 165421f5821..165421f5821 100644 --- a/include/asm-i386/mach-voyager/irq_vectors.h +++ b/include/asm-x86/mach-voyager/irq_vectors.h diff --git a/include/asm-i386/mach-voyager/setup_arch.h b/include/asm-x86/mach-voyager/setup_arch.h index 84d01ad3345..84d01ad3345 100644 --- a/include/asm-i386/mach-voyager/setup_arch.h +++ b/include/asm-x86/mach-voyager/setup_arch.h diff --git a/include/asm-x86_64/mach_apic.h b/include/asm-x86/mach_apic.h index 7b7115a0c1c..7b7115a0c1c 100644 --- a/include/asm-x86_64/mach_apic.h +++ b/include/asm-x86/mach_apic.h diff --git a/include/asm-i386/math_emu.h b/include/asm-x86/math_emu.h index a4b0aa3320e..a4b0aa3320e 100644 --- a/include/asm-i386/math_emu.h +++ b/include/asm-x86/math_emu.h diff --git a/include/asm-x86/mc146818rtc.h b/include/asm-x86/mc146818rtc.h new file mode 100644 index 00000000000..5c2bb66caf1 --- /dev/null +++ b/include/asm-x86/mc146818rtc.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mc146818rtc_32.h" +#else +# include "mc146818rtc_64.h" +#endif diff --git a/include/asm-i386/mc146818rtc.h b/include/asm-x86/mc146818rtc_32.h index 1613b42eaf5..1613b42eaf5 100644 --- a/include/asm-i386/mc146818rtc.h +++ b/include/asm-x86/mc146818rtc_32.h diff --git a/include/asm-x86_64/mc146818rtc.h b/include/asm-x86/mc146818rtc_64.h index d6e3009430c..d6e3009430c 100644 --- a/include/asm-x86_64/mc146818rtc.h +++ b/include/asm-x86/mc146818rtc_64.h diff --git a/include/asm-i386/mca.h b/include/asm-x86/mca.h index 09adf2eac4d..09adf2eac4d 100644 --- a/include/asm-i386/mca.h +++ b/include/asm-x86/mca.h diff --git a/include/asm-i386/mca_dma.h b/include/asm-x86/mca_dma.h index fbb1f3b7127..fbb1f3b7127 100644 --- a/include/asm-i386/mca_dma.h +++ b/include/asm-x86/mca_dma.h diff --git a/include/asm-x86/mce.h b/include/asm-x86/mce.h new file mode 100644 index 00000000000..cc8ca389912 --- /dev/null +++ b/include/asm-x86/mce.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mce_32.h" +#else +# include "mce_64.h" +#endif diff --git a/include/asm-i386/mce.h b/include/asm-x86/mce_32.h index d56d89742e8..d56d89742e8 100644 --- a/include/asm-i386/mce.h +++ b/include/asm-x86/mce_32.h diff --git a/include/asm-x86_64/mce.h b/include/asm-x86/mce_64.h index 7bc030a1996..7bc030a1996 100644 --- a/include/asm-x86_64/mce.h +++ b/include/asm-x86/mce_64.h diff --git a/include/asm-x86/mman.h b/include/asm-x86/mman.h new file mode 100644 index 00000000000..322db07e82c --- /dev/null +++ b/include/asm-x86/mman.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "mman_32.h" +# else +# include "mman_64.h" +# endif +#else +# ifdef __i386__ +# include "mman_32.h" +# else +# include "mman_64.h" +# endif +#endif diff --git a/include/asm-i386/mman.h b/include/asm-x86/mman_32.h index 8fd9d7ab7fa..8fd9d7ab7fa 100644 --- a/include/asm-i386/mman.h +++ b/include/asm-x86/mman_32.h diff --git a/include/asm-x86_64/mman.h b/include/asm-x86/mman_64.h index dd5cb0534d3..dd5cb0534d3 100644 --- a/include/asm-x86_64/mman.h +++ b/include/asm-x86/mman_64.h diff --git a/include/asm-x86_64/mmsegment.h b/include/asm-x86/mmsegment.h index d3f80c99633..d3f80c99633 100644 --- a/include/asm-x86_64/mmsegment.h +++ b/include/asm-x86/mmsegment.h diff --git a/include/asm-x86/mmu.h b/include/asm-x86/mmu.h new file mode 100644 index 00000000000..9c628cd70e2 --- /dev/null +++ b/include/asm-x86/mmu.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mmu_32.h" +#else +# include "mmu_64.h" +#endif diff --git a/include/asm-i386/mmu.h b/include/asm-x86/mmu_32.h index 8358dd3df7a..8358dd3df7a 100644 --- a/include/asm-i386/mmu.h +++ b/include/asm-x86/mmu_32.h diff --git a/include/asm-x86_64/mmu.h b/include/asm-x86/mmu_64.h index d2cd4a9d984..d2cd4a9d984 100644 --- a/include/asm-x86_64/mmu.h +++ b/include/asm-x86/mmu_64.h diff --git a/include/asm-x86/mmu_context.h b/include/asm-x86/mmu_context.h new file mode 100644 index 00000000000..6598450da6c --- /dev/null +++ b/include/asm-x86/mmu_context.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mmu_context_32.h" +#else +# include "mmu_context_64.h" +#endif diff --git a/include/asm-i386/mmu_context.h b/include/asm-x86/mmu_context_32.h index 7eb0b0b1fb3..7eb0b0b1fb3 100644 --- a/include/asm-i386/mmu_context.h +++ b/include/asm-x86/mmu_context_32.h diff --git a/include/asm-x86_64/mmu_context.h b/include/asm-x86/mmu_context_64.h index 0cce83a7837..0cce83a7837 100644 --- a/include/asm-x86_64/mmu_context.h +++ b/include/asm-x86/mmu_context_64.h diff --git a/include/asm-i386/mmx.h b/include/asm-x86/mmx.h index 46b71da9986..46b71da9986 100644 --- a/include/asm-i386/mmx.h +++ b/include/asm-x86/mmx.h diff --git a/include/asm-x86/mmzone.h b/include/asm-x86/mmzone.h new file mode 100644 index 00000000000..64217ea16a3 --- /dev/null +++ b/include/asm-x86/mmzone.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mmzone_32.h" +#else +# include "mmzone_64.h" +#endif diff --git a/include/asm-i386/mmzone.h b/include/asm-x86/mmzone_32.h index 118e9812778..118e9812778 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-x86/mmzone_32.h diff --git a/include/asm-x86_64/mmzone.h b/include/asm-x86/mmzone_64.h index 19a89377b12..19a89377b12 100644 --- a/include/asm-x86_64/mmzone.h +++ b/include/asm-x86/mmzone_64.h diff --git a/include/asm-x86/module.h b/include/asm-x86/module.h new file mode 100644 index 00000000000..2b2f18d8a53 --- /dev/null +++ b/include/asm-x86/module.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "module_32.h" +#else +# include "module_64.h" +#endif diff --git a/include/asm-i386/module.h b/include/asm-x86/module_32.h index 7e5fda6c397..7e5fda6c397 100644 --- a/include/asm-i386/module.h +++ b/include/asm-x86/module_32.h diff --git a/include/asm-x86_64/module.h b/include/asm-x86/module_64.h index 67f8f69fa7b..67f8f69fa7b 100644 --- a/include/asm-x86_64/module.h +++ b/include/asm-x86/module_64.h diff --git a/include/asm-x86/mpspec.h b/include/asm-x86/mpspec.h new file mode 100644 index 00000000000..8f268e8fd2e --- /dev/null +++ b/include/asm-x86/mpspec.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mpspec_32.h" +#else +# include "mpspec_64.h" +#endif diff --git a/include/asm-i386/mpspec.h b/include/asm-x86/mpspec_32.h index f21349399d1..f21349399d1 100644 --- a/include/asm-i386/mpspec.h +++ b/include/asm-x86/mpspec_32.h diff --git a/include/asm-x86_64/mpspec.h b/include/asm-x86/mpspec_64.h index 017fddb61dc..017fddb61dc 100644 --- a/include/asm-x86_64/mpspec.h +++ b/include/asm-x86/mpspec_64.h diff --git a/include/asm-i386/mpspec_def.h b/include/asm-x86/mpspec_def.h index 13bafb16e7a..13bafb16e7a 100644 --- a/include/asm-i386/mpspec_def.h +++ b/include/asm-x86/mpspec_def.h diff --git a/include/asm-x86/msgbuf.h b/include/asm-x86/msgbuf.h new file mode 100644 index 00000000000..154f7d64e86 --- /dev/null +++ b/include/asm-x86/msgbuf.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "msgbuf_32.h" +# else +# include "msgbuf_64.h" +# endif +#else +# ifdef __i386__ +# include "msgbuf_32.h" +# else +# include "msgbuf_64.h" +# endif +#endif diff --git a/include/asm-i386/msgbuf.h b/include/asm-x86/msgbuf_32.h index b8d659c157a..b8d659c157a 100644 --- a/include/asm-i386/msgbuf.h +++ b/include/asm-x86/msgbuf_32.h diff --git a/include/asm-x86_64/msgbuf.h b/include/asm-x86/msgbuf_64.h index cd6f95dd54d..cd6f95dd54d 100644 --- a/include/asm-x86_64/msgbuf.h +++ b/include/asm-x86/msgbuf_64.h diff --git a/include/asm-i386/msidef.h b/include/asm-x86/msidef.h index 5b8acddb70f..5b8acddb70f 100644 --- a/include/asm-i386/msidef.h +++ b/include/asm-x86/msidef.h diff --git a/include/asm-i386/msr-index.h b/include/asm-x86/msr-index.h index a02eb299134..a02eb299134 100644 --- a/include/asm-i386/msr-index.h +++ b/include/asm-x86/msr-index.h diff --git a/include/asm-x86/msr.h b/include/asm-x86/msr.h new file mode 100644 index 00000000000..2f87ce00700 --- /dev/null +++ b/include/asm-x86/msr.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "msr_32.h" +# else +# include "msr_64.h" +# endif +#else +# ifdef __i386__ +# include "msr_32.h" +# else +# include "msr_64.h" +# endif +#endif diff --git a/include/asm-i386/msr.h b/include/asm-x86/msr_32.h index df21ea04936..df21ea04936 100644 --- a/include/asm-i386/msr.h +++ b/include/asm-x86/msr_32.h diff --git a/include/asm-x86_64/msr.h b/include/asm-x86/msr_64.h index d5c55b80da5..d5c55b80da5 100644 --- a/include/asm-x86_64/msr.h +++ b/include/asm-x86/msr_64.h diff --git a/include/asm-x86/mtrr.h b/include/asm-x86/mtrr.h new file mode 100644 index 00000000000..34f633b3e00 --- /dev/null +++ b/include/asm-x86/mtrr.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "mtrr_32.h" +# else +# include "mtrr_64.h" +# endif +#else +# ifdef __i386__ +# include "mtrr_32.h" +# else +# include "mtrr_64.h" +# endif +#endif diff --git a/include/asm-i386/mtrr.h b/include/asm-x86/mtrr_32.h index 7e9c7ccbdcf..7e9c7ccbdcf 100644 --- a/include/asm-i386/mtrr.h +++ b/include/asm-x86/mtrr_32.h diff --git a/include/asm-x86_64/mtrr.h b/include/asm-x86/mtrr_64.h index b557c486bef..b557c486bef 100644 --- a/include/asm-x86_64/mtrr.h +++ b/include/asm-x86/mtrr_64.h diff --git a/include/asm-x86/mutex.h b/include/asm-x86/mutex.h new file mode 100644 index 00000000000..a731b9c573a --- /dev/null +++ b/include/asm-x86/mutex.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "mutex_32.h" +#else +# include "mutex_64.h" +#endif diff --git a/include/asm-i386/mutex.h b/include/asm-x86/mutex_32.h index 7a17d9e58ad..7a17d9e58ad 100644 --- a/include/asm-i386/mutex.h +++ b/include/asm-x86/mutex_32.h diff --git a/include/asm-x86_64/mutex.h b/include/asm-x86/mutex_64.h index 6c2949a3c67..6c2949a3c67 100644 --- a/include/asm-x86_64/mutex.h +++ b/include/asm-x86/mutex_64.h diff --git a/include/asm-x86/namei.h b/include/asm-x86/namei.h new file mode 100644 index 00000000000..732f8f0b3dc --- /dev/null +++ b/include/asm-x86/namei.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "namei_32.h" +#else +# include "namei_64.h" +#endif diff --git a/include/asm-i386/namei.h b/include/asm-x86/namei_32.h index 81486508861..81486508861 100644 --- a/include/asm-i386/namei.h +++ b/include/asm-x86/namei_32.h diff --git a/include/asm-x86_64/namei.h b/include/asm-x86/namei_64.h index bef239f5318..bef239f5318 100644 --- a/include/asm-x86_64/namei.h +++ b/include/asm-x86/namei_64.h diff --git a/include/asm-x86/nmi.h b/include/asm-x86/nmi.h new file mode 100644 index 00000000000..53ccac14cea --- /dev/null +++ b/include/asm-x86/nmi.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "nmi_32.h" +#else +# include "nmi_64.h" +#endif diff --git a/include/asm-i386/nmi.h b/include/asm-x86/nmi_32.h index 70a958a8e38..70a958a8e38 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-x86/nmi_32.h diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86/nmi_64.h index 65b6acf3bb5..65b6acf3bb5 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86/nmi_64.h diff --git a/include/asm-x86/numa.h b/include/asm-x86/numa.h new file mode 100644 index 00000000000..27da400d313 --- /dev/null +++ b/include/asm-x86/numa.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "numa_32.h" +#else +# include "numa_64.h" +#endif diff --git a/include/asm-i386/numa.h b/include/asm-x86/numa_32.h index 96fcb157db1..96fcb157db1 100644 --- a/include/asm-i386/numa.h +++ b/include/asm-x86/numa_32.h diff --git a/include/asm-x86_64/numa.h b/include/asm-x86/numa_64.h index 933ff11ece1..933ff11ece1 100644 --- a/include/asm-x86_64/numa.h +++ b/include/asm-x86/numa_64.h diff --git a/include/asm-i386/numaq.h b/include/asm-x86/numaq.h index 38f710dc37f..38f710dc37f 100644 --- a/include/asm-i386/numaq.h +++ b/include/asm-x86/numaq.h diff --git a/include/asm-x86/page.h b/include/asm-x86/page.h new file mode 100644 index 00000000000..a757eb26141 --- /dev/null +++ b/include/asm-x86/page.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "page_32.h" +# else +# include "page_64.h" +# endif +#else +# ifdef __i386__ +# include "page_32.h" +# else +# include "page_64.h" +# endif +#endif diff --git a/include/asm-i386/page.h b/include/asm-x86/page_32.h index 80ecc66b6d8..80ecc66b6d8 100644 --- a/include/asm-i386/page.h +++ b/include/asm-x86/page_32.h diff --git a/include/asm-x86_64/page.h b/include/asm-x86/page_64.h index 88adf1afb0a..88adf1afb0a 100644 --- a/include/asm-x86_64/page.h +++ b/include/asm-x86/page_64.h diff --git a/include/asm-x86/param.h b/include/asm-x86/param.h new file mode 100644 index 00000000000..640851bab12 --- /dev/null +++ b/include/asm-x86/param.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "param_32.h" +# else +# include "param_64.h" +# endif +#else +# ifdef __i386__ +# include "param_32.h" +# else +# include "param_64.h" +# endif +#endif diff --git a/include/asm-i386/param.h b/include/asm-x86/param_32.h index 21b32466fcd..21b32466fcd 100644 --- a/include/asm-i386/param.h +++ b/include/asm-x86/param_32.h diff --git a/include/asm-x86_64/param.h b/include/asm-x86/param_64.h index a728786c3c7..a728786c3c7 100644 --- a/include/asm-x86_64/param.h +++ b/include/asm-x86/param_64.h diff --git a/include/asm-i386/paravirt.h b/include/asm-x86/paravirt.h index 9fa3fa9e62d..9fa3fa9e62d 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-x86/paravirt.h diff --git a/include/asm-x86/parport.h b/include/asm-x86/parport.h new file mode 100644 index 00000000000..2a31157349c --- /dev/null +++ b/include/asm-x86/parport.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "parport_32.h" +#else +# include "parport_64.h" +#endif diff --git a/include/asm-i386/parport.h b/include/asm-x86/parport_32.h index fa0e321e498..fa0e321e498 100644 --- a/include/asm-i386/parport.h +++ b/include/asm-x86/parport_32.h diff --git a/include/asm-x86_64/parport.h b/include/asm-x86/parport_64.h index 7135ef977c9..7135ef977c9 100644 --- a/include/asm-x86_64/parport.h +++ b/include/asm-x86/parport_64.h diff --git a/include/asm-x86_64/pci-direct.h b/include/asm-x86/pci-direct.h index 6823fa4f1af..6823fa4f1af 100644 --- a/include/asm-x86_64/pci-direct.h +++ b/include/asm-x86/pci-direct.h diff --git a/include/asm-x86/pci.h b/include/asm-x86/pci.h new file mode 100644 index 00000000000..a8cac8c2cde --- /dev/null +++ b/include/asm-x86/pci.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "pci_32.h" +#else +# include "pci_64.h" +#endif diff --git a/include/asm-i386/pci.h b/include/asm-x86/pci_32.h index 4fcacc71138..4fcacc71138 100644 --- a/include/asm-i386/pci.h +++ b/include/asm-x86/pci_32.h diff --git a/include/asm-x86_64/pci.h b/include/asm-x86/pci_64.h index 5da8cb0c059..5da8cb0c059 100644 --- a/include/asm-x86_64/pci.h +++ b/include/asm-x86/pci_64.h diff --git a/include/asm-x86_64/pda.h b/include/asm-x86/pda.h index 5642634843c..5642634843c 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86/pda.h diff --git a/include/asm-x86/percpu.h b/include/asm-x86/percpu.h new file mode 100644 index 00000000000..a1aaad274cc --- /dev/null +++ b/include/asm-x86/percpu.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "percpu_32.h" +#else +# include "percpu_64.h" +#endif diff --git a/include/asm-i386/percpu.h b/include/asm-x86/percpu_32.h index a7ebd436f3c..a7ebd436f3c 100644 --- a/include/asm-i386/percpu.h +++ b/include/asm-x86/percpu_32.h diff --git a/include/asm-x86_64/percpu.h b/include/asm-x86/percpu_64.h index 5abd4827010..5abd4827010 100644 --- a/include/asm-x86_64/percpu.h +++ b/include/asm-x86/percpu_64.h diff --git a/include/asm-x86/pgalloc.h b/include/asm-x86/pgalloc.h new file mode 100644 index 00000000000..5886eed0588 --- /dev/null +++ b/include/asm-x86/pgalloc.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "pgalloc_32.h" +#else +# include "pgalloc_64.h" +#endif diff --git a/include/asm-i386/pgalloc.h b/include/asm-x86/pgalloc_32.h index f2fc33ceb9f..f2fc33ceb9f 100644 --- a/include/asm-i386/pgalloc.h +++ b/include/asm-x86/pgalloc_32.h diff --git a/include/asm-x86_64/pgalloc.h b/include/asm-x86/pgalloc_64.h index 8bb56468786..8bb56468786 100644 --- a/include/asm-x86_64/pgalloc.h +++ b/include/asm-x86/pgalloc_64.h diff --git a/include/asm-i386/pgtable-2level-defs.h b/include/asm-x86/pgtable-2level-defs.h index 0f71c9f13da..0f71c9f13da 100644 --- a/include/asm-i386/pgtable-2level-defs.h +++ b/include/asm-x86/pgtable-2level-defs.h diff --git a/include/asm-i386/pgtable-2level.h b/include/asm-x86/pgtable-2level.h index 84b03cf56a7..84b03cf56a7 100644 --- a/include/asm-i386/pgtable-2level.h +++ b/include/asm-x86/pgtable-2level.h diff --git a/include/asm-i386/pgtable-3level-defs.h b/include/asm-x86/pgtable-3level-defs.h index c0df89f66e8..c0df89f66e8 100644 --- a/include/asm-i386/pgtable-3level-defs.h +++ b/include/asm-x86/pgtable-3level-defs.h diff --git a/include/asm-i386/pgtable-3level.h b/include/asm-x86/pgtable-3level.h index 948a3341411..948a3341411 100644 --- a/include/asm-i386/pgtable-3level.h +++ b/include/asm-x86/pgtable-3level.h diff --git a/include/asm-x86/pgtable.h b/include/asm-x86/pgtable.h new file mode 100644 index 00000000000..1039140652a --- /dev/null +++ b/include/asm-x86/pgtable.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "pgtable_32.h" +#else +# include "pgtable_64.h" +#endif diff --git a/include/asm-i386/pgtable.h b/include/asm-x86/pgtable_32.h index c7fefa6b12f..c7fefa6b12f 100644 --- a/include/asm-i386/pgtable.h +++ b/include/asm-x86/pgtable_32.h diff --git a/include/asm-x86_64/pgtable.h b/include/asm-x86/pgtable_64.h index 57dd6b3107e..57dd6b3107e 100644 --- a/include/asm-x86_64/pgtable.h +++ b/include/asm-x86/pgtable_64.h diff --git a/include/asm-i386/poll.h b/include/asm-x86/poll.h index c98509d3149..c98509d3149 100644 --- a/include/asm-i386/poll.h +++ b/include/asm-x86/poll.h diff --git a/include/asm-x86/posix_types.h b/include/asm-x86/posix_types.h new file mode 100644 index 00000000000..bb7133dc155 --- /dev/null +++ b/include/asm-x86/posix_types.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "posix_types_32.h" +# else +# include "posix_types_64.h" +# endif +#else +# ifdef __i386__ +# include "posix_types_32.h" +# else +# include "posix_types_64.h" +# endif +#endif diff --git a/include/asm-i386/posix_types.h b/include/asm-x86/posix_types_32.h index 133e31e7dfd..133e31e7dfd 100644 --- a/include/asm-i386/posix_types.h +++ b/include/asm-x86/posix_types_32.h diff --git a/include/asm-x86_64/posix_types.h b/include/asm-x86/posix_types_64.h index 9926aa43775..9926aa43775 100644 --- a/include/asm-x86_64/posix_types.h +++ b/include/asm-x86/posix_types_64.h diff --git a/include/asm-x86_64/prctl.h b/include/asm-x86/prctl.h index 52952adef1c..52952adef1c 100644 --- a/include/asm-x86_64/prctl.h +++ b/include/asm-x86/prctl.h diff --git a/include/asm-i386/processor-cyrix.h b/include/asm-x86/processor-cyrix.h index 97568ada1f9..97568ada1f9 100644 --- a/include/asm-i386/processor-cyrix.h +++ b/include/asm-x86/processor-cyrix.h diff --git a/include/asm-i386/processor-flags.h b/include/asm-x86/processor-flags.h index 5404e90edd5..5404e90edd5 100644 --- a/include/asm-i386/processor-flags.h +++ b/include/asm-x86/processor-flags.h diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h new file mode 100644 index 00000000000..46e1c04e309 --- /dev/null +++ b/include/asm-x86/processor.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "processor_32.h" +#else +# include "processor_64.h" +#endif diff --git a/include/asm-i386/processor.h b/include/asm-x86/processor_32.h index 3845fe72383..3845fe72383 100644 --- a/include/asm-i386/processor.h +++ b/include/asm-x86/processor_32.h diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h new file mode 100644 index 00000000000..31f579b828f --- /dev/null +++ b/include/asm-x86/processor_64.h @@ -0,0 +1,439 @@ +/* + * include/asm-x86_64/processor.h + * + * Copyright (C) 1994 Linus Torvalds + */ + +#ifndef __ASM_X86_64_PROCESSOR_H +#define __ASM_X86_64_PROCESSOR_H + +#include <asm/segment.h> +#include <asm/page.h> +#include <asm/types.h> +#include <asm/sigcontext.h> +#include <asm/cpufeature.h> +#include <linux/threads.h> +#include <asm/msr.h> +#include <asm/current.h> +#include <asm/system.h> +#include <asm/mmsegment.h> +#include <asm/percpu.h> +#include <linux/personality.h> +#include <linux/cpumask.h> +#include <asm/processor-flags.h> + +#define TF_MASK 0x00000100 +#define IF_MASK 0x00000200 +#define IOPL_MASK 0x00003000 +#define NT_MASK 0x00004000 +#define VM_MASK 0x00020000 +#define AC_MASK 0x00040000 +#define VIF_MASK 0x00080000 /* virtual interrupt flag */ +#define VIP_MASK 0x00100000 /* virtual interrupt pending */ +#define ID_MASK 0x00200000 + +#define desc_empty(desc) \ + (!((desc)->a | (desc)->b)) + +#define desc_equal(desc1, desc2) \ + (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) + +/* + * Default implementation of macro that returns current + * instruction pointer ("program counter"). + */ +#define current_text_addr() ({ void *pc; asm volatile("leaq 1f(%%rip),%0\n1:":"=r"(pc)); pc; }) + +/* + * CPU type and hardware bug flags. Kept separately for each CPU. + */ + +struct cpuinfo_x86 { + __u8 x86; /* CPU family */ + __u8 x86_vendor; /* CPU vendor */ + __u8 x86_model; + __u8 x86_mask; + int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ + __u32 x86_capability[NCAPINTS]; + char x86_vendor_id[16]; + char x86_model_id[64]; + int x86_cache_size; /* in KB */ + int x86_clflush_size; + int x86_cache_alignment; + int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/ + __u8 x86_virt_bits, x86_phys_bits; + __u8 x86_max_cores; /* cpuid returned max cores value */ + __u32 x86_power; + __u32 extended_cpuid_level; /* Max extended CPUID function supported */ + unsigned long loops_per_jiffy; +#ifdef CONFIG_SMP + cpumask_t llc_shared_map; /* cpus sharing the last level cache */ +#endif + __u8 apicid; +#ifdef CONFIG_SMP + __u8 booted_cores; /* number of cores as seen by OS */ + __u8 phys_proc_id; /* Physical Processor id. */ + __u8 cpu_core_id; /* Core id. */ +#endif +} ____cacheline_aligned; + +#define X86_VENDOR_INTEL 0 +#define X86_VENDOR_CYRIX 1 +#define X86_VENDOR_AMD 2 +#define X86_VENDOR_UMC 3 +#define X86_VENDOR_NEXGEN 4 +#define X86_VENDOR_CENTAUR 5 +#define X86_VENDOR_TRANSMETA 7 +#define X86_VENDOR_NUM 8 +#define X86_VENDOR_UNKNOWN 0xff + +#ifdef CONFIG_SMP +extern struct cpuinfo_x86 cpu_data[]; +#define current_cpu_data cpu_data[smp_processor_id()] +#else +#define cpu_data (&boot_cpu_data) +#define current_cpu_data boot_cpu_data +#endif + +extern char ignore_irq13; + +extern void identify_cpu(struct cpuinfo_x86 *); +extern void print_cpu_info(struct cpuinfo_x86 *); +extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); +extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); +extern unsigned short num_cache_leaves; + +/* + * Save the cr4 feature set we're using (ie + * Pentium 4MB enable and PPro Global page + * enable), so that any CPU's that boot up + * after us can get the correct flags. + */ +extern unsigned long mmu_cr4_features; + +static inline void set_in_cr4 (unsigned long mask) +{ + mmu_cr4_features |= mask; + __asm__("movq %%cr4,%%rax\n\t" + "orq %0,%%rax\n\t" + "movq %%rax,%%cr4\n" + : : "irg" (mask) + :"ax"); +} + +static inline void clear_in_cr4 (unsigned long mask) +{ + mmu_cr4_features &= ~mask; + __asm__("movq %%cr4,%%rax\n\t" + "andq %0,%%rax\n\t" + "movq %%rax,%%cr4\n" + : : "irg" (~mask) + :"ax"); +} + + +/* + * User space process size. 47bits minus one guard page. + */ +#define TASK_SIZE64 (0x800000000000UL - 4096) + +/* This decides where the kernel will search for a free chunk of vm + * space during mmap's. + */ +#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000) + +#define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64) +#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) + +#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3) + +/* + * Size of io_bitmap. + */ +#define IO_BITMAP_BITS 65536 +#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) +#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) +#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) +#define INVALID_IO_BITMAP_OFFSET 0x8000 + +struct i387_fxsave_struct { + u16 cwd; + u16 swd; + u16 twd; + u16 fop; + u64 rip; + u64 rdp; + u32 mxcsr; + u32 mxcsr_mask; + u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ + u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ + u32 padding[24]; +} __attribute__ ((aligned (16))); + +union i387_union { + struct i387_fxsave_struct fxsave; +}; + +struct tss_struct { + u32 reserved1; + u64 rsp0; + u64 rsp1; + u64 rsp2; + u64 reserved2; + u64 ist[7]; + u32 reserved3; + u32 reserved4; + u16 reserved5; + u16 io_bitmap_base; + /* + * The extra 1 is there because the CPU will access an + * additional byte beyond the end of the IO permission + * bitmap. The extra byte must be all 1 bits, and must + * be within the limit. Thus we have: + * + * 128 bytes, the bitmap itself, for ports 0..0x3ff + * 8 bytes, for an extra "long" of ~0UL + */ + unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; +} __attribute__((packed)) ____cacheline_aligned; + + +extern struct cpuinfo_x86 boot_cpu_data; +DECLARE_PER_CPU(struct tss_struct,init_tss); +/* Save the original ist values for checking stack pointers during debugging */ +struct orig_ist { + unsigned long ist[7]; +}; +DECLARE_PER_CPU(struct orig_ist, orig_ist); + +#ifdef CONFIG_X86_VSMP +#define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT) +#define ARCH_MIN_MMSTRUCT_ALIGN (1 << INTERNODE_CACHE_SHIFT) +#else +#define ARCH_MIN_TASKALIGN 16 +#define ARCH_MIN_MMSTRUCT_ALIGN 0 +#endif + +struct thread_struct { + unsigned long rsp0; + unsigned long rsp; + unsigned long userrsp; /* Copy from PDA */ + unsigned long fs; + unsigned long gs; + unsigned short es, ds, fsindex, gsindex; +/* Hardware debugging registers */ + unsigned long debugreg0; + unsigned long debugreg1; + unsigned long debugreg2; + unsigned long debugreg3; + unsigned long debugreg6; + unsigned long debugreg7; +/* fault info */ + unsigned long cr2, trap_no, error_code; +/* floating point info */ + union i387_union i387 __attribute__((aligned(16))); +/* IO permissions. the bitmap could be moved into the GDT, that would make + switch faster for a limited number of ioperm using tasks. -AK */ + int ioperm; + unsigned long *io_bitmap_ptr; + unsigned io_bitmap_max; +/* cached TLS descriptors. */ + u64 tls_array[GDT_ENTRY_TLS_ENTRIES]; +} __attribute__((aligned(16))); + +#define INIT_THREAD { \ + .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ +} + +#define INIT_TSS { \ + .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ +} + +#define INIT_MMAP \ +{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } + +#define start_thread(regs,new_rip,new_rsp) do { \ + asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \ + load_gs_index(0); \ + (regs)->rip = (new_rip); \ + (regs)->rsp = (new_rsp); \ + write_pda(oldrsp, (new_rsp)); \ + (regs)->cs = __USER_CS; \ + (regs)->ss = __USER_DS; \ + (regs)->eflags = 0x200; \ + set_fs(USER_DS); \ +} while(0) + +#define get_debugreg(var, register) \ + __asm__("movq %%db" #register ", %0" \ + :"=r" (var)) +#define set_debugreg(value, register) \ + __asm__("movq %0,%%db" #register \ + : /* no output */ \ + :"r" (value)) + +struct task_struct; +struct mm_struct; + +/* Free all resources held by a thread. */ +extern void release_thread(struct task_struct *); + +/* Prepare to copy thread state - unlazy all lazy status */ +extern void prepare_to_copy(struct task_struct *tsk); + +/* + * create a kernel thread without removing it from tasklists + */ +extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); + +/* + * Return saved PC of a blocked thread. + * What is this good for? it will be always the scheduler or ret_from_fork. + */ +#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8)) + +extern unsigned long get_wchan(struct task_struct *p); +#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.rsp0 - 1) +#define KSTK_EIP(tsk) (task_pt_regs(tsk)->rip) +#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ + + +struct microcode_header { + unsigned int hdrver; + unsigned int rev; + unsigned int date; + unsigned int sig; + unsigned int cksum; + unsigned int ldrver; + unsigned int pf; + unsigned int datasize; + unsigned int totalsize; + unsigned int reserved[3]; +}; + +struct microcode { + struct microcode_header hdr; + unsigned int bits[0]; +}; + +typedef struct microcode microcode_t; +typedef struct microcode_header microcode_header_t; + +/* microcode format is extended from prescott processors */ +struct extended_signature { + unsigned int sig; + unsigned int pf; + unsigned int cksum; +}; + +struct extended_sigtable { + unsigned int count; + unsigned int cksum; + unsigned int reserved[3]; + struct extended_signature sigs[0]; +}; + + +#define ASM_NOP1 K8_NOP1 +#define ASM_NOP2 K8_NOP2 +#define ASM_NOP3 K8_NOP3 +#define ASM_NOP4 K8_NOP4 +#define ASM_NOP5 K8_NOP5 +#define ASM_NOP6 K8_NOP6 +#define ASM_NOP7 K8_NOP7 +#define ASM_NOP8 K8_NOP8 + +/* Opteron nops */ +#define K8_NOP1 ".byte 0x90\n" +#define K8_NOP2 ".byte 0x66,0x90\n" +#define K8_NOP3 ".byte 0x66,0x66,0x90\n" +#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" +#define K8_NOP5 K8_NOP3 K8_NOP2 +#define K8_NOP6 K8_NOP3 K8_NOP3 +#define K8_NOP7 K8_NOP4 K8_NOP3 +#define K8_NOP8 K8_NOP4 K8_NOP4 + +#define ASM_NOP_MAX 8 + +/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ +static inline void rep_nop(void) +{ + __asm__ __volatile__("rep;nop": : :"memory"); +} + +/* Stop speculative execution */ +static inline void sync_core(void) +{ + int tmp; + asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory"); +} + +#define ARCH_HAS_PREFETCH +static inline void prefetch(void *x) +{ + asm volatile("prefetcht0 (%0)" :: "r" (x)); +} + +#define ARCH_HAS_PREFETCHW 1 +static inline void prefetchw(void *x) +{ + alternative_input("prefetcht0 (%1)", + "prefetchw (%1)", + X86_FEATURE_3DNOW, + "r" (x)); +} + +#define ARCH_HAS_SPINLOCK_PREFETCH 1 + +#define spin_lock_prefetch(x) prefetchw(x) + +#define cpu_relax() rep_nop() + +static inline void serialize_cpu(void) +{ + __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); +} + +static inline void __monitor(const void *eax, unsigned long ecx, + unsigned long edx) +{ + /* "monitor %eax,%ecx,%edx;" */ + asm volatile( + ".byte 0x0f,0x01,0xc8;" + : :"a" (eax), "c" (ecx), "d"(edx)); +} + +static inline void __mwait(unsigned long eax, unsigned long ecx) +{ + /* "mwait %eax,%ecx;" */ + asm volatile( + ".byte 0x0f,0x01,0xc9;" + : :"a" (eax), "c" (ecx)); +} + +static inline void __sti_mwait(unsigned long eax, unsigned long ecx) +{ + /* "mwait %eax,%ecx;" */ + asm volatile( + "sti; .byte 0x0f,0x01,0xc9;" + : :"a" (eax), "c" (ecx)); +} + +extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); + +#define stack_current() \ +({ \ + struct thread_info *ti; \ + asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \ + ti->task; \ +}) + +#define cache_line_size() (boot_cpu_data.x86_cache_alignment) + +extern unsigned long boot_option_idle_override; +/* Boot loader type from the setup header */ +extern int bootloader_type; + +#define HAVE_ARCH_PICK_MMAP_LAYOUT 1 + +#endif /* __ASM_X86_64_PROCESSOR_H */ diff --git a/include/asm-x86_64/proto.h b/include/asm-x86/proto.h index 31f20ad6587..31f20ad6587 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86/proto.h diff --git a/include/asm-x86/ptrace-abi.h b/include/asm-x86/ptrace-abi.h new file mode 100644 index 00000000000..6824c49def1 --- /dev/null +++ b/include/asm-x86/ptrace-abi.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ptrace-abi_32.h" +# else +# include "ptrace-abi_64.h" +# endif +#else +# ifdef __i386__ +# include "ptrace-abi_32.h" +# else +# include "ptrace-abi_64.h" +# endif +#endif diff --git a/include/asm-i386/ptrace-abi.h b/include/asm-x86/ptrace-abi_32.h index a44901817a2..a44901817a2 100644 --- a/include/asm-i386/ptrace-abi.h +++ b/include/asm-x86/ptrace-abi_32.h diff --git a/include/asm-x86_64/ptrace-abi.h b/include/asm-x86/ptrace-abi_64.h index 19184b0806b..19184b0806b 100644 --- a/include/asm-x86_64/ptrace-abi.h +++ b/include/asm-x86/ptrace-abi_64.h diff --git a/include/asm-x86/ptrace.h b/include/asm-x86/ptrace.h new file mode 100644 index 00000000000..bc4d64a8768 --- /dev/null +++ b/include/asm-x86/ptrace.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ptrace_32.h" +# else +# include "ptrace_64.h" +# endif +#else +# ifdef __i386__ +# include "ptrace_32.h" +# else +# include "ptrace_64.h" +# endif +#endif diff --git a/include/asm-i386/ptrace.h b/include/asm-x86/ptrace_32.h index 6002597b9e1..6002597b9e1 100644 --- a/include/asm-i386/ptrace.h +++ b/include/asm-x86/ptrace_32.h diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86/ptrace_64.h index 7f166ccb060..7f166ccb060 100644 --- a/include/asm-x86_64/ptrace.h +++ b/include/asm-x86/ptrace_64.h diff --git a/include/asm-i386/reboot.h b/include/asm-x86/reboot.h index e9e3ffc22c0..e9e3ffc22c0 100644 --- a/include/asm-i386/reboot.h +++ b/include/asm-x86/reboot.h diff --git a/include/asm-i386/reboot_fixups.h b/include/asm-x86/reboot_fixups.h index 0cb7d87c2b6..0cb7d87c2b6 100644 --- a/include/asm-i386/reboot_fixups.h +++ b/include/asm-x86/reboot_fixups.h diff --git a/include/asm-x86/required-features.h b/include/asm-x86/required-features.h new file mode 100644 index 00000000000..8b64f3ea2b7 --- /dev/null +++ b/include/asm-x86/required-features.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "required-features_32.h" +#else +# include "required-features_64.h" +#endif diff --git a/include/asm-i386/required-features.h b/include/asm-x86/required-features_32.h index 618feb98f9f..618feb98f9f 100644 --- a/include/asm-i386/required-features.h +++ b/include/asm-x86/required-features_32.h diff --git a/include/asm-x86_64/required-features.h b/include/asm-x86/required-features_64.h index e80d5761b00..e80d5761b00 100644 --- a/include/asm-x86_64/required-features.h +++ b/include/asm-x86/required-features_64.h diff --git a/include/asm-x86/resource.h b/include/asm-x86/resource.h new file mode 100644 index 00000000000..732410a8c02 --- /dev/null +++ b/include/asm-x86/resource.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "resource_32.h" +# else +# include "resource_64.h" +# endif +#else +# ifdef __i386__ +# include "resource_32.h" +# else +# include "resource_64.h" +# endif +#endif diff --git a/include/asm-i386/resource.h b/include/asm-x86/resource_32.h index 6c1ea37c771..6c1ea37c771 100644 --- a/include/asm-i386/resource.h +++ b/include/asm-x86/resource_32.h diff --git a/include/asm-x86_64/resource.h b/include/asm-x86/resource_64.h index f40b4062323..f40b4062323 100644 --- a/include/asm-x86_64/resource.h +++ b/include/asm-x86/resource_64.h diff --git a/include/asm-x86/resume-trace.h b/include/asm-x86/resume-trace.h new file mode 100644 index 00000000000..9b6dd093a9f --- /dev/null +++ b/include/asm-x86/resume-trace.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "resume-trace_32.h" +#else +# include "resume-trace_64.h" +#endif diff --git a/include/asm-i386/resume-trace.h b/include/asm-x86/resume-trace_32.h index ec9cfd65623..ec9cfd65623 100644 --- a/include/asm-i386/resume-trace.h +++ b/include/asm-x86/resume-trace_32.h diff --git a/include/asm-x86_64/resume-trace.h b/include/asm-x86/resume-trace_64.h index 34bf998fdf6..34bf998fdf6 100644 --- a/include/asm-x86_64/resume-trace.h +++ b/include/asm-x86/resume-trace_64.h diff --git a/include/asm-x86_64/rio.h b/include/asm-x86/rio.h index c7350f6d201..c7350f6d201 100644 --- a/include/asm-x86_64/rio.h +++ b/include/asm-x86/rio.h diff --git a/include/asm-x86/rtc.h b/include/asm-x86/rtc.h new file mode 100644 index 00000000000..1f0c98eb2e3 --- /dev/null +++ b/include/asm-x86/rtc.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "rtc_32.h" +#else +# include "rtc_64.h" +#endif diff --git a/include/asm-i386/rtc.h b/include/asm-x86/rtc_32.h index ffd02109a0e..ffd02109a0e 100644 --- a/include/asm-i386/rtc.h +++ b/include/asm-x86/rtc_32.h diff --git a/include/asm-x86_64/rtc.h b/include/asm-x86/rtc_64.h index 18ed713ac7d..18ed713ac7d 100644 --- a/include/asm-x86_64/rtc.h +++ b/include/asm-x86/rtc_64.h diff --git a/include/asm-x86/rwlock.h b/include/asm-x86/rwlock.h new file mode 100644 index 00000000000..a3be7d8364a --- /dev/null +++ b/include/asm-x86/rwlock.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "rwlock_32.h" +#else +# include "rwlock_64.h" +#endif diff --git a/include/asm-i386/rwlock.h b/include/asm-x86/rwlock_32.h index c3e5db32fa4..c3e5db32fa4 100644 --- a/include/asm-i386/rwlock.h +++ b/include/asm-x86/rwlock_32.h diff --git a/include/asm-x86_64/rwlock.h b/include/asm-x86/rwlock_64.h index 72aeebed920..72aeebed920 100644 --- a/include/asm-x86_64/rwlock.h +++ b/include/asm-x86/rwlock_64.h diff --git a/include/asm-i386/rwsem.h b/include/asm-x86/rwsem.h index 041906f3c6d..041906f3c6d 100644 --- a/include/asm-i386/rwsem.h +++ b/include/asm-x86/rwsem.h diff --git a/include/asm-x86/scatterlist.h b/include/asm-x86/scatterlist.h new file mode 100644 index 00000000000..3a1e76257a2 --- /dev/null +++ b/include/asm-x86/scatterlist.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "scatterlist_32.h" +#else +# include "scatterlist_64.h" +#endif diff --git a/include/asm-i386/scatterlist.h b/include/asm-x86/scatterlist_32.h index d7e45a8f1aa..d7e45a8f1aa 100644 --- a/include/asm-i386/scatterlist.h +++ b/include/asm-x86/scatterlist_32.h diff --git a/include/asm-x86_64/scatterlist.h b/include/asm-x86/scatterlist_64.h index eaf7ada27e1..eaf7ada27e1 100644 --- a/include/asm-x86_64/scatterlist.h +++ b/include/asm-x86/scatterlist_64.h diff --git a/include/asm-x86/seccomp.h b/include/asm-x86/seccomp.h new file mode 100644 index 00000000000..c62e58a5a90 --- /dev/null +++ b/include/asm-x86/seccomp.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "seccomp_32.h" +#else +# include "seccomp_64.h" +#endif diff --git a/include/asm-i386/seccomp.h b/include/asm-x86/seccomp_32.h index 18da19e89bf..18da19e89bf 100644 --- a/include/asm-i386/seccomp.h +++ b/include/asm-x86/seccomp_32.h diff --git a/include/asm-x86_64/seccomp.h b/include/asm-x86/seccomp_64.h index 553af65a228..553af65a228 100644 --- a/include/asm-x86_64/seccomp.h +++ b/include/asm-x86/seccomp_64.h diff --git a/include/asm-x86/sections.h b/include/asm-x86/sections.h new file mode 100644 index 00000000000..ae6c69d9be3 --- /dev/null +++ b/include/asm-x86/sections.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "sections_32.h" +#else +# include "sections_64.h" +#endif diff --git a/include/asm-i386/sections.h b/include/asm-x86/sections_32.h index 2dcbb92918b..2dcbb92918b 100644 --- a/include/asm-i386/sections.h +++ b/include/asm-x86/sections_32.h diff --git a/include/asm-x86_64/sections.h b/include/asm-x86/sections_64.h index c746d9f1e70..c746d9f1e70 100644 --- a/include/asm-x86_64/sections.h +++ b/include/asm-x86/sections_64.h diff --git a/include/asm-x86/segment.h b/include/asm-x86/segment.h new file mode 100644 index 00000000000..605068280e2 --- /dev/null +++ b/include/asm-x86/segment.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "segment_32.h" +#else +# include "segment_64.h" +#endif diff --git a/include/asm-i386/segment.h b/include/asm-x86/segment_32.h index 597a47c2515..597a47c2515 100644 --- a/include/asm-i386/segment.h +++ b/include/asm-x86/segment_32.h diff --git a/include/asm-x86_64/segment.h b/include/asm-x86/segment_64.h index 04b8ab21328..04b8ab21328 100644 --- a/include/asm-x86_64/segment.h +++ b/include/asm-x86/segment_64.h diff --git a/include/asm-x86/semaphore.h b/include/asm-x86/semaphore.h new file mode 100644 index 00000000000..572c0b67a6b --- /dev/null +++ b/include/asm-x86/semaphore.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "semaphore_32.h" +#else +# include "semaphore_64.h" +#endif diff --git a/include/asm-i386/semaphore.h b/include/asm-x86/semaphore_32.h index 4e34a468c38..4e34a468c38 100644 --- a/include/asm-i386/semaphore.h +++ b/include/asm-x86/semaphore_32.h diff --git a/include/asm-x86_64/semaphore.h b/include/asm-x86/semaphore_64.h index 1194888536b..1194888536b 100644 --- a/include/asm-x86_64/semaphore.h +++ b/include/asm-x86/semaphore_64.h diff --git a/include/asm-x86/sembuf.h b/include/asm-x86/sembuf.h new file mode 100644 index 00000000000..e42c971e383 --- /dev/null +++ b/include/asm-x86/sembuf.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "sembuf_32.h" +# else +# include "sembuf_64.h" +# endif +#else +# ifdef __i386__ +# include "sembuf_32.h" +# else +# include "sembuf_64.h" +# endif +#endif diff --git a/include/asm-i386/sembuf.h b/include/asm-x86/sembuf_32.h index 323835166c1..323835166c1 100644 --- a/include/asm-i386/sembuf.h +++ b/include/asm-x86/sembuf_32.h diff --git a/include/asm-x86_64/sembuf.h b/include/asm-x86/sembuf_64.h index 63b52925ae2..63b52925ae2 100644 --- a/include/asm-x86_64/sembuf.h +++ b/include/asm-x86/sembuf_64.h diff --git a/include/asm-x86/serial.h b/include/asm-x86/serial.h new file mode 100644 index 00000000000..cf1b05227b2 --- /dev/null +++ b/include/asm-x86/serial.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "serial_32.h" +#else +# include "serial_64.h" +#endif diff --git a/include/asm-i386/serial.h b/include/asm-x86/serial_32.h index bd67480ca10..bd67480ca10 100644 --- a/include/asm-i386/serial.h +++ b/include/asm-x86/serial_32.h diff --git a/include/asm-x86_64/serial.h b/include/asm-x86/serial_64.h index b0496e0d72a..b0496e0d72a 100644 --- a/include/asm-x86_64/serial.h +++ b/include/asm-x86/serial_64.h diff --git a/include/asm-x86/setup.h b/include/asm-x86/setup.h new file mode 100644 index 00000000000..81c0d98bb1c --- /dev/null +++ b/include/asm-x86/setup.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "setup_32.h" +# else +# include "setup_64.h" +# endif +#else +# ifdef __i386__ +# include "setup_32.h" +# else +# include "setup_64.h" +# endif +#endif diff --git a/include/asm-i386/setup.h b/include/asm-x86/setup_32.h index 7862fe858a9..7862fe858a9 100644 --- a/include/asm-i386/setup.h +++ b/include/asm-x86/setup_32.h diff --git a/include/asm-x86_64/setup.h b/include/asm-x86/setup_64.h index eaeff73d6c1..eaeff73d6c1 100644 --- a/include/asm-x86_64/setup.h +++ b/include/asm-x86/setup_64.h diff --git a/include/asm-x86/shmbuf.h b/include/asm-x86/shmbuf.h new file mode 100644 index 00000000000..e85f1cb1121 --- /dev/null +++ b/include/asm-x86/shmbuf.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "shmbuf_32.h" +# else +# include "shmbuf_64.h" +# endif +#else +# ifdef __i386__ +# include "shmbuf_32.h" +# else +# include "shmbuf_64.h" +# endif +#endif diff --git a/include/asm-i386/shmbuf.h b/include/asm-x86/shmbuf_32.h index d1cdc3cb079..d1cdc3cb079 100644 --- a/include/asm-i386/shmbuf.h +++ b/include/asm-x86/shmbuf_32.h diff --git a/include/asm-x86_64/shmbuf.h b/include/asm-x86/shmbuf_64.h index 5a6d6dda7c4..5a6d6dda7c4 100644 --- a/include/asm-x86_64/shmbuf.h +++ b/include/asm-x86/shmbuf_64.h diff --git a/include/asm-x86/shmparam.h b/include/asm-x86/shmparam.h new file mode 100644 index 00000000000..165627cc534 --- /dev/null +++ b/include/asm-x86/shmparam.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "shmparam_32.h" +# else +# include "shmparam_64.h" +# endif +#else +# ifdef __i386__ +# include "shmparam_32.h" +# else +# include "shmparam_64.h" +# endif +#endif diff --git a/include/asm-i386/shmparam.h b/include/asm-x86/shmparam_32.h index 786243a5b31..786243a5b31 100644 --- a/include/asm-i386/shmparam.h +++ b/include/asm-x86/shmparam_32.h diff --git a/include/asm-x86_64/shmparam.h b/include/asm-x86/shmparam_64.h index d7021620dcb..d7021620dcb 100644 --- a/include/asm-x86_64/shmparam.h +++ b/include/asm-x86/shmparam_64.h diff --git a/include/asm-x86/sigcontext.h b/include/asm-x86/sigcontext.h new file mode 100644 index 00000000000..0d16ceff159 --- /dev/null +++ b/include/asm-x86/sigcontext.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "sigcontext_32.h" +# else +# include "sigcontext_64.h" +# endif +#else +# ifdef __i386__ +# include "sigcontext_32.h" +# else +# include "sigcontext_64.h" +# endif +#endif diff --git a/include/asm-x86_64/sigcontext32.h b/include/asm-x86/sigcontext32.h index 3d657038ab7..3d657038ab7 100644 --- a/include/asm-x86_64/sigcontext32.h +++ b/include/asm-x86/sigcontext32.h diff --git a/include/asm-i386/sigcontext.h b/include/asm-x86/sigcontext_32.h index aaef089a778..aaef089a778 100644 --- a/include/asm-i386/sigcontext.h +++ b/include/asm-x86/sigcontext_32.h diff --git a/include/asm-x86_64/sigcontext.h b/include/asm-x86/sigcontext_64.h index b4e40236666..b4e40236666 100644 --- a/include/asm-x86_64/sigcontext.h +++ b/include/asm-x86/sigcontext_64.h diff --git a/include/asm-x86/siginfo.h b/include/asm-x86/siginfo.h new file mode 100644 index 00000000000..0b8e4bb47d2 --- /dev/null +++ b/include/asm-x86/siginfo.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "siginfo_32.h" +# else +# include "siginfo_64.h" +# endif +#else +# ifdef __i386__ +# include "siginfo_32.h" +# else +# include "siginfo_64.h" +# endif +#endif diff --git a/include/asm-i386/siginfo.h b/include/asm-x86/siginfo_32.h index fe18f98fccf..fe18f98fccf 100644 --- a/include/asm-i386/siginfo.h +++ b/include/asm-x86/siginfo_32.h diff --git a/include/asm-x86_64/siginfo.h b/include/asm-x86/siginfo_64.h index d09a1e6e724..d09a1e6e724 100644 --- a/include/asm-x86_64/siginfo.h +++ b/include/asm-x86/siginfo_64.h diff --git a/include/asm-x86/signal.h b/include/asm-x86/signal.h new file mode 100644 index 00000000000..bf5a63f457d --- /dev/null +++ b/include/asm-x86/signal.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "signal_32.h" +# else +# include "signal_64.h" +# endif +#else +# ifdef __i386__ +# include "signal_32.h" +# else +# include "signal_64.h" +# endif +#endif diff --git a/include/asm-i386/signal.h b/include/asm-x86/signal_32.h index c3e8adec591..c3e8adec591 100644 --- a/include/asm-i386/signal.h +++ b/include/asm-x86/signal_32.h diff --git a/include/asm-x86_64/signal.h b/include/asm-x86/signal_64.h index 4581f978b29..4581f978b29 100644 --- a/include/asm-x86_64/signal.h +++ b/include/asm-x86/signal_64.h diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h new file mode 100644 index 00000000000..f2e8319a6b0 --- /dev/null +++ b/include/asm-x86/smp.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "smp_32.h" +#else +# include "smp_64.h" +#endif diff --git a/include/asm-i386/smp.h b/include/asm-x86/smp_32.h index 1f73bde165b..1f73bde165b 100644 --- a/include/asm-i386/smp.h +++ b/include/asm-x86/smp_32.h diff --git a/include/asm-x86_64/smp.h b/include/asm-x86/smp_64.h index 3f303d2365e..3f303d2365e 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86/smp_64.h diff --git a/include/asm-i386/socket.h b/include/asm-x86/socket.h index 99ca648b94c..99ca648b94c 100644 --- a/include/asm-i386/socket.h +++ b/include/asm-x86/socket.h diff --git a/include/asm-x86/sockios.h b/include/asm-x86/sockios.h new file mode 100644 index 00000000000..5a134fc70b9 --- /dev/null +++ b/include/asm-x86/sockios.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "sockios_32.h" +# else +# include "sockios_64.h" +# endif +#else +# ifdef __i386__ +# include "sockios_32.h" +# else +# include "sockios_64.h" +# endif +#endif diff --git a/include/asm-i386/sockios.h b/include/asm-x86/sockios_32.h index ff528c7d255..ff528c7d255 100644 --- a/include/asm-i386/sockios.h +++ b/include/asm-x86/sockios_32.h diff --git a/include/asm-x86_64/sockios.h b/include/asm-x86/sockios_64.h index d726ba2513e..d726ba2513e 100644 --- a/include/asm-x86_64/sockios.h +++ b/include/asm-x86/sockios_64.h diff --git a/include/asm-x86/sparsemem.h b/include/asm-x86/sparsemem.h new file mode 100644 index 00000000000..3f203b1d9ee --- /dev/null +++ b/include/asm-x86/sparsemem.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "sparsemem_32.h" +#else +# include "sparsemem_64.h" +#endif diff --git a/include/asm-i386/sparsemem.h b/include/asm-x86/sparsemem_32.h index cfeed990585..cfeed990585 100644 --- a/include/asm-i386/sparsemem.h +++ b/include/asm-x86/sparsemem_32.h diff --git a/include/asm-x86_64/sparsemem.h b/include/asm-x86/sparsemem_64.h index dabb16714a7..dabb16714a7 100644 --- a/include/asm-x86_64/sparsemem.h +++ b/include/asm-x86/sparsemem_64.h diff --git a/include/asm-x86/spinlock.h b/include/asm-x86/spinlock.h new file mode 100644 index 00000000000..d74d85e71dc --- /dev/null +++ b/include/asm-x86/spinlock.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "spinlock_32.h" +#else +# include "spinlock_64.h" +#endif diff --git a/include/asm-i386/spinlock.h b/include/asm-x86/spinlock_32.h index d3bcebed60c..d3bcebed60c 100644 --- a/include/asm-i386/spinlock.h +++ b/include/asm-x86/spinlock_32.h diff --git a/include/asm-x86_64/spinlock.h b/include/asm-x86/spinlock_64.h index 88bf981e73c..88bf981e73c 100644 --- a/include/asm-x86_64/spinlock.h +++ b/include/asm-x86/spinlock_64.h diff --git a/include/asm-i386/spinlock_types.h b/include/asm-x86/spinlock_types.h index 4da9345c150..4da9345c150 100644 --- a/include/asm-i386/spinlock_types.h +++ b/include/asm-x86/spinlock_types.h diff --git a/include/asm-i386/srat.h b/include/asm-x86/srat.h index 165ab4bdc02..165ab4bdc02 100644 --- a/include/asm-i386/srat.h +++ b/include/asm-x86/srat.h diff --git a/include/asm-x86_64/stacktrace.h b/include/asm-x86/stacktrace.h index 6f0b5459430..6f0b5459430 100644 --- a/include/asm-x86_64/stacktrace.h +++ b/include/asm-x86/stacktrace.h diff --git a/include/asm-x86/stat.h b/include/asm-x86/stat.h new file mode 100644 index 00000000000..3ff6b50ef83 --- /dev/null +++ b/include/asm-x86/stat.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "stat_32.h" +# else +# include "stat_64.h" +# endif +#else +# ifdef __i386__ +# include "stat_32.h" +# else +# include "stat_64.h" +# endif +#endif diff --git a/include/asm-i386/stat.h b/include/asm-x86/stat_32.h index 67eae78323b..67eae78323b 100644 --- a/include/asm-i386/stat.h +++ b/include/asm-x86/stat_32.h diff --git a/include/asm-x86_64/stat.h b/include/asm-x86/stat_64.h index fd9f00d560f..fd9f00d560f 100644 --- a/include/asm-x86_64/stat.h +++ b/include/asm-x86/stat_64.h diff --git a/include/asm-x86/statfs.h b/include/asm-x86/statfs.h new file mode 100644 index 00000000000..327fb5d7a14 --- /dev/null +++ b/include/asm-x86/statfs.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "statfs_32.h" +# else +# include "statfs_64.h" +# endif +#else +# ifdef __i386__ +# include "statfs_32.h" +# else +# include "statfs_64.h" +# endif +#endif diff --git a/include/asm-i386/statfs.h b/include/asm-x86/statfs_32.h index 24972c17513..24972c17513 100644 --- a/include/asm-i386/statfs.h +++ b/include/asm-x86/statfs_32.h diff --git a/include/asm-x86_64/statfs.h b/include/asm-x86/statfs_64.h index b3f4718af30..b3f4718af30 100644 --- a/include/asm-x86_64/statfs.h +++ b/include/asm-x86/statfs_64.h diff --git a/include/asm-x86/string.h b/include/asm-x86/string.h new file mode 100644 index 00000000000..6dfd6d9373a --- /dev/null +++ b/include/asm-x86/string.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "string_32.h" +#else +# include "string_64.h" +#endif diff --git a/include/asm-i386/string.h b/include/asm-x86/string_32.h index a9b64453bdf..a9b64453bdf 100644 --- a/include/asm-i386/string.h +++ b/include/asm-x86/string_32.h diff --git a/include/asm-x86_64/string.h b/include/asm-x86/string_64.h index e583da7918f..e583da7918f 100644 --- a/include/asm-x86_64/string.h +++ b/include/asm-x86/string_64.h diff --git a/include/asm-x86/suspend.h b/include/asm-x86/suspend.h new file mode 100644 index 00000000000..9bd521fe457 --- /dev/null +++ b/include/asm-x86/suspend.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "suspend_32.h" +#else +# include "suspend_64.h" +#endif diff --git a/include/asm-i386/suspend.h b/include/asm-x86/suspend_32.h index a2520732ffd..a2520732ffd 100644 --- a/include/asm-i386/suspend.h +++ b/include/asm-x86/suspend_32.h diff --git a/include/asm-x86_64/suspend.h b/include/asm-x86/suspend_64.h index b897e8cb55f..b897e8cb55f 100644 --- a/include/asm-x86_64/suspend.h +++ b/include/asm-x86/suspend_64.h diff --git a/include/asm-x86_64/swiotlb.h b/include/asm-x86/swiotlb.h index f9c589539a8..f9c589539a8 100644 --- a/include/asm-x86_64/swiotlb.h +++ b/include/asm-x86/swiotlb.h diff --git a/include/asm-i386/sync_bitops.h b/include/asm-x86/sync_bitops.h index cbce08a2d13..cbce08a2d13 100644 --- a/include/asm-i386/sync_bitops.h +++ b/include/asm-x86/sync_bitops.h diff --git a/include/asm-x86/system.h b/include/asm-x86/system.h new file mode 100644 index 00000000000..692562b48f2 --- /dev/null +++ b/include/asm-x86/system.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "system_32.h" +#else +# include "system_64.h" +#endif diff --git a/include/asm-x86/system_32.h b/include/asm-x86/system_32.h new file mode 100644 index 00000000000..d69ba937e09 --- /dev/null +++ b/include/asm-x86/system_32.h @@ -0,0 +1,313 @@ +#ifndef __ASM_SYSTEM_H +#define __ASM_SYSTEM_H + +#include <linux/kernel.h> +#include <asm/segment.h> +#include <asm/cpufeature.h> +#include <asm/cmpxchg.h> + +#ifdef __KERNEL__ + +struct task_struct; /* one of the stranger aspects of C forward declarations.. */ +extern struct task_struct * FASTCALL(__switch_to(struct task_struct *prev, struct task_struct *next)); + +/* + * Saving eflags is important. It switches not only IOPL between tasks, + * it also protects other tasks from NT leaking through sysenter etc. + */ +#define switch_to(prev,next,last) do { \ + unsigned long esi,edi; \ + asm volatile("pushfl\n\t" /* Save flags */ \ + "pushl %%ebp\n\t" \ + "movl %%esp,%0\n\t" /* save ESP */ \ + "movl %5,%%esp\n\t" /* restore ESP */ \ + "movl $1f,%1\n\t" /* save EIP */ \ + "pushl %6\n\t" /* restore EIP */ \ + "jmp __switch_to\n" \ + "1:\t" \ + "popl %%ebp\n\t" \ + "popfl" \ + :"=m" (prev->thread.esp),"=m" (prev->thread.eip), \ + "=a" (last),"=S" (esi),"=D" (edi) \ + :"m" (next->thread.esp),"m" (next->thread.eip), \ + "2" (prev), "d" (next)); \ +} while (0) + +#define _set_base(addr,base) do { unsigned long __pr; \ +__asm__ __volatile__ ("movw %%dx,%1\n\t" \ + "rorl $16,%%edx\n\t" \ + "movb %%dl,%2\n\t" \ + "movb %%dh,%3" \ + :"=&d" (__pr) \ + :"m" (*((addr)+2)), \ + "m" (*((addr)+4)), \ + "m" (*((addr)+7)), \ + "0" (base) \ + ); } while(0) + +#define _set_limit(addr,limit) do { unsigned long __lr; \ +__asm__ __volatile__ ("movw %%dx,%1\n\t" \ + "rorl $16,%%edx\n\t" \ + "movb %2,%%dh\n\t" \ + "andb $0xf0,%%dh\n\t" \ + "orb %%dh,%%dl\n\t" \ + "movb %%dl,%2" \ + :"=&d" (__lr) \ + :"m" (*(addr)), \ + "m" (*((addr)+6)), \ + "0" (limit) \ + ); } while(0) + +#define set_base(ldt,base) _set_base( ((char *)&(ldt)) , (base) ) +#define set_limit(ldt,limit) _set_limit( ((char *)&(ldt)) , ((limit)-1) ) + +/* + * Load a segment. Fall back on loading the zero + * segment if something goes wrong.. + */ +#define loadsegment(seg,value) \ + asm volatile("\n" \ + "1:\t" \ + "mov %0,%%" #seg "\n" \ + "2:\n" \ + ".section .fixup,\"ax\"\n" \ + "3:\t" \ + "pushl $0\n\t" \ + "popl %%" #seg "\n\t" \ + "jmp 2b\n" \ + ".previous\n" \ + ".section __ex_table,\"a\"\n\t" \ + ".align 4\n\t" \ + ".long 1b,3b\n" \ + ".previous" \ + : :"rm" (value)) + +/* + * Save a segment register away + */ +#define savesegment(seg, value) \ + asm volatile("mov %%" #seg ",%0":"=rm" (value)) + + +static inline void native_clts(void) +{ + asm volatile ("clts"); +} + +static inline unsigned long native_read_cr0(void) +{ + unsigned long val; + asm volatile("movl %%cr0,%0\n\t" :"=r" (val)); + return val; +} + +static inline void native_write_cr0(unsigned long val) +{ + asm volatile("movl %0,%%cr0": :"r" (val)); +} + +static inline unsigned long native_read_cr2(void) +{ + unsigned long val; + asm volatile("movl %%cr2,%0\n\t" :"=r" (val)); + return val; +} + +static inline void native_write_cr2(unsigned long val) +{ + asm volatile("movl %0,%%cr2": :"r" (val)); +} + +static inline unsigned long native_read_cr3(void) +{ + unsigned long val; + asm volatile("movl %%cr3,%0\n\t" :"=r" (val)); + return val; +} + +static inline void native_write_cr3(unsigned long val) +{ + asm volatile("movl %0,%%cr3": :"r" (val)); +} + +static inline unsigned long native_read_cr4(void) +{ + unsigned long val; + asm volatile("movl %%cr4,%0\n\t" :"=r" (val)); + return val; +} + +static inline unsigned long native_read_cr4_safe(void) +{ + unsigned long val; + /* This could fault if %cr4 does not exist */ + asm("1: movl %%cr4, %0 \n" + "2: \n" + ".section __ex_table,\"a\" \n" + ".long 1b,2b \n" + ".previous \n" + : "=r" (val): "0" (0)); + return val; +} + +static inline void native_write_cr4(unsigned long val) +{ + asm volatile("movl %0,%%cr4": :"r" (val)); +} + +static inline void native_wbinvd(void) +{ + asm volatile("wbinvd": : :"memory"); +} + + +#ifdef CONFIG_PARAVIRT +#include <asm/paravirt.h> +#else +#define read_cr0() (native_read_cr0()) +#define write_cr0(x) (native_write_cr0(x)) +#define read_cr2() (native_read_cr2()) +#define write_cr2(x) (native_write_cr2(x)) +#define read_cr3() (native_read_cr3()) +#define write_cr3(x) (native_write_cr3(x)) +#define read_cr4() (native_read_cr4()) +#define read_cr4_safe() (native_read_cr4_safe()) +#define write_cr4(x) (native_write_cr4(x)) +#define wbinvd() (native_wbinvd()) + +/* Clear the 'TS' bit */ +#define clts() (native_clts()) + +#endif/* CONFIG_PARAVIRT */ + +/* Set the 'TS' bit */ +#define stts() write_cr0(8 | read_cr0()) + +#endif /* __KERNEL__ */ + +static inline unsigned long get_limit(unsigned long segment) +{ + unsigned long __limit; + __asm__("lsll %1,%0" + :"=r" (__limit):"r" (segment)); + return __limit+1; +} + +#define nop() __asm__ __volatile__ ("nop") + +/* + * Force strict CPU ordering. + * And yes, this is required on UP too when we're talking + * to devices. + * + * For now, "wmb()" doesn't actually do anything, as all + * Intel CPU's follow what Intel calls a *Processor Order*, + * in which all writes are seen in the program order even + * outside the CPU. + * + * I expect future Intel CPU's to have a weaker ordering, + * but I'd also expect them to finally get their act together + * and add some real memory barriers if so. + * + * Some non intel clones support out of order store. wmb() ceases to be a + * nop for these. + */ + + +#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2) +#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2) + +/** + * read_barrier_depends - Flush all pending reads that subsequents reads + * depend on. + * + * No data-dependent reads from memory-like regions are ever reordered + * over this barrier. All reads preceding this primitive are guaranteed + * to access memory (but not necessarily other CPUs' caches) before any + * reads following this primitive that depend on the data return by + * any of the preceding reads. This primitive is much lighter weight than + * rmb() on most CPUs, and is never heavier weight than is + * rmb(). + * + * These ordering constraints are respected by both the local CPU + * and the compiler. + * + * Ordering is not guaranteed by anything other than these primitives, + * not even by data dependencies. See the documentation for + * memory_barrier() for examples and URLs to more information. + * + * For example, the following code would force ordering (the initial + * value of "a" is zero, "b" is one, and "p" is "&a"): + * + * <programlisting> + * CPU 0 CPU 1 + * + * b = 2; + * memory_barrier(); + * p = &b; q = p; + * read_barrier_depends(); + * d = *q; + * </programlisting> + * + * because the read of "*q" depends on the read of "p" and these + * two reads are separated by a read_barrier_depends(). However, + * the following code, with the same initial values for "a" and "b": + * + * <programlisting> + * CPU 0 CPU 1 + * + * a = 2; + * memory_barrier(); + * b = 3; y = b; + * read_barrier_depends(); + * x = a; + * </programlisting> + * + * does not enforce ordering, since there is no data dependency between + * the read of "a" and the read of "b". Therefore, on some CPUs, such + * as Alpha, "y" could be set to 3 and "x" to 0. Use rmb() + * in cases like this where there are no data dependencies. + **/ + +#define read_barrier_depends() do { } while(0) + +#ifdef CONFIG_X86_OOSTORE +/* Actually there are no OOO store capable CPUs for now that do SSE, + but make it already an possibility. */ +#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM) +#else +#define wmb() __asm__ __volatile__ ("": : :"memory") +#endif + +#ifdef CONFIG_SMP +#define smp_mb() mb() +#define smp_rmb() rmb() +#define smp_wmb() wmb() +#define smp_read_barrier_depends() read_barrier_depends() +#define set_mb(var, value) do { (void) xchg(&var, value); } while (0) +#else +#define smp_mb() barrier() +#define smp_rmb() barrier() +#define smp_wmb() barrier() +#define smp_read_barrier_depends() do { } while(0) +#define set_mb(var, value) do { var = value; barrier(); } while (0) +#endif + +#include <linux/irqflags.h> + +/* + * disable hlt during certain critical i/o operations + */ +#define HAVE_DISABLE_HLT +void disable_hlt(void); +void enable_hlt(void); + +extern int es7000_plat; +void cpu_idle_wait(void); + +extern unsigned long arch_align_stack(unsigned long sp); +extern void free_init_pages(char *what, unsigned long begin, unsigned long end); + +void default_idle(void); + +#endif diff --git a/include/asm-x86_64/system.h b/include/asm-x86/system_64.h index 02175aa1d16..02175aa1d16 100644 --- a/include/asm-x86_64/system.h +++ b/include/asm-x86/system_64.h diff --git a/include/asm-x86_64/tce.h b/include/asm-x86/tce.h index cd955d3d112..cd955d3d112 100644 --- a/include/asm-x86_64/tce.h +++ b/include/asm-x86/tce.h diff --git a/include/asm-x86/termbits.h b/include/asm-x86/termbits.h new file mode 100644 index 00000000000..69f3080e2a1 --- /dev/null +++ b/include/asm-x86/termbits.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "termbits_32.h" +# else +# include "termbits_64.h" +# endif +#else +# ifdef __i386__ +# include "termbits_32.h" +# else +# include "termbits_64.h" +# endif +#endif diff --git a/include/asm-i386/termbits.h b/include/asm-x86/termbits_32.h index a21700352e7..a21700352e7 100644 --- a/include/asm-i386/termbits.h +++ b/include/asm-x86/termbits_32.h diff --git a/include/asm-x86_64/termbits.h b/include/asm-x86/termbits_64.h index 7405756dd41..7405756dd41 100644 --- a/include/asm-x86_64/termbits.h +++ b/include/asm-x86/termbits_64.h diff --git a/include/asm-x86/termios.h b/include/asm-x86/termios.h new file mode 100644 index 00000000000..a4f4ae20a59 --- /dev/null +++ b/include/asm-x86/termios.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "termios_32.h" +# else +# include "termios_64.h" +# endif +#else +# ifdef __i386__ +# include "termios_32.h" +# else +# include "termios_64.h" +# endif +#endif diff --git a/include/asm-x86/termios_32.h b/include/asm-x86/termios_32.h new file mode 100644 index 00000000000..6fdb2c841b7 --- /dev/null +++ b/include/asm-x86/termios_32.h @@ -0,0 +1,90 @@ +#ifndef _I386_TERMIOS_H +#define _I386_TERMIOS_H + +#include <asm/termbits.h> +#include <asm/ioctls.h> + +struct winsize { + unsigned short ws_row; + unsigned short ws_col; + unsigned short ws_xpixel; + unsigned short ws_ypixel; +}; + +#define NCC 8 +struct termio { + unsigned short c_iflag; /* input mode flags */ + unsigned short c_oflag; /* output mode flags */ + unsigned short c_cflag; /* control mode flags */ + unsigned short c_lflag; /* local mode flags */ + unsigned char c_line; /* line discipline */ + unsigned char c_cc[NCC]; /* control characters */ +}; + +/* modem lines */ +#define TIOCM_LE 0x001 +#define TIOCM_DTR 0x002 +#define TIOCM_RTS 0x004 +#define TIOCM_ST 0x008 +#define TIOCM_SR 0x010 +#define TIOCM_CTS 0x020 +#define TIOCM_CAR 0x040 +#define TIOCM_RNG 0x080 +#define TIOCM_DSR 0x100 +#define TIOCM_CD TIOCM_CAR +#define TIOCM_RI TIOCM_RNG +#define TIOCM_OUT1 0x2000 +#define TIOCM_OUT2 0x4000 +#define TIOCM_LOOP 0x8000 + +/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ + +#ifdef __KERNEL__ + +/* intr=^C quit=^\ erase=del kill=^U + eof=^D vtime=\0 vmin=\1 sxtc=\0 + start=^Q stop=^S susp=^Z eol=\0 + reprint=^R discard=^U werase=^W lnext=^V + eol2=\0 +*/ +#define INIT_C_CC "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" + +/* + * Translate a "termio" structure into a "termios". Ugh. + */ +#define SET_LOW_TERMIOS_BITS(termios, termio, x) { \ + unsigned short __tmp; \ + get_user(__tmp,&(termio)->x); \ + *(unsigned short *) &(termios)->x = __tmp; \ +} + +#define user_termio_to_kernel_termios(termios, termio) \ +({ \ + SET_LOW_TERMIOS_BITS(termios, termio, c_iflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_oflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_cflag); \ + SET_LOW_TERMIOS_BITS(termios, termio, c_lflag); \ + copy_from_user((termios)->c_cc, (termio)->c_cc, NCC); \ +}) + +/* + * Translate a "termios" structure into a "termio". Ugh. + */ +#define kernel_termios_to_user_termio(termio, termios) \ +({ \ + put_user((termios)->c_iflag, &(termio)->c_iflag); \ + put_user((termios)->c_oflag, &(termio)->c_oflag); \ + put_user((termios)->c_cflag, &(termio)->c_cflag); \ + put_user((termios)->c_lflag, &(termio)->c_lflag); \ + put_user((termios)->c_line, &(termio)->c_line); \ + copy_to_user((termio)->c_cc, (termios)->c_cc, NCC); \ +}) + +#define user_termios_to_kernel_termios(k, u) copy_from_user(k, u, sizeof(struct termios2)) +#define kernel_termios_to_user_termios(u, k) copy_to_user(u, k, sizeof(struct termios2)) +#define user_termios_to_kernel_termios_1(k, u) copy_from_user(k, u, sizeof(struct termios)) +#define kernel_termios_to_user_termios_1(u, k) copy_to_user(u, k, sizeof(struct termios)) + +#endif /* __KERNEL__ */ + +#endif /* _I386_TERMIOS_H */ diff --git a/include/asm-x86_64/termios.h b/include/asm-x86/termios_64.h index 35ee59b7832..35ee59b7832 100644 --- a/include/asm-x86_64/termios.h +++ b/include/asm-x86/termios_64.h diff --git a/include/asm-i386/therm_throt.h b/include/asm-x86/therm_throt.h index 399bf6026b1..399bf6026b1 100644 --- a/include/asm-i386/therm_throt.h +++ b/include/asm-x86/therm_throt.h diff --git a/include/asm-x86/thread_info.h b/include/asm-x86/thread_info.h new file mode 100644 index 00000000000..d5fd12f2abd --- /dev/null +++ b/include/asm-x86/thread_info.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "thread_info_32.h" +#else +# include "thread_info_64.h" +#endif diff --git a/include/asm-i386/thread_info.h b/include/asm-x86/thread_info_32.h index 22a8cbcd35e..22a8cbcd35e 100644 --- a/include/asm-i386/thread_info.h +++ b/include/asm-x86/thread_info_32.h diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86/thread_info_64.h index beae2bfb62c..beae2bfb62c 100644 --- a/include/asm-x86_64/thread_info.h +++ b/include/asm-x86/thread_info_64.h diff --git a/include/asm-i386/time.h b/include/asm-x86/time.h index eac011366dc..eac011366dc 100644 --- a/include/asm-i386/time.h +++ b/include/asm-x86/time.h diff --git a/include/asm-i386/timer.h b/include/asm-x86/timer.h index 0db7e994fb8..0db7e994fb8 100644 --- a/include/asm-i386/timer.h +++ b/include/asm-x86/timer.h diff --git a/include/asm-x86/timex.h b/include/asm-x86/timex.h new file mode 100644 index 00000000000..d01c18cfcce --- /dev/null +++ b/include/asm-x86/timex.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "timex_32.h" +#else +# include "timex_64.h" +#endif diff --git a/include/asm-i386/timex.h b/include/asm-x86/timex_32.h index 3666044409f..3666044409f 100644 --- a/include/asm-i386/timex.h +++ b/include/asm-x86/timex_32.h diff --git a/include/asm-x86_64/timex.h b/include/asm-x86/timex_64.h index 6ed21f44d30..6ed21f44d30 100644 --- a/include/asm-x86_64/timex.h +++ b/include/asm-x86/timex_64.h diff --git a/include/asm-x86/tlb.h b/include/asm-x86/tlb.h new file mode 100644 index 00000000000..7d55c3762b4 --- /dev/null +++ b/include/asm-x86/tlb.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "tlb_32.h" +#else +# include "tlb_64.h" +#endif diff --git a/include/asm-i386/tlb.h b/include/asm-x86/tlb_32.h index c006c5c92be..c006c5c92be 100644 --- a/include/asm-i386/tlb.h +++ b/include/asm-x86/tlb_32.h diff --git a/include/asm-x86_64/tlb.h b/include/asm-x86/tlb_64.h index cd4c3c590a0..cd4c3c590a0 100644 --- a/include/asm-x86_64/tlb.h +++ b/include/asm-x86/tlb_64.h diff --git a/include/asm-x86/tlbflush.h b/include/asm-x86/tlbflush.h new file mode 100644 index 00000000000..9af4cc83a1a --- /dev/null +++ b/include/asm-x86/tlbflush.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "tlbflush_32.h" +#else +# include "tlbflush_64.h" +#endif diff --git a/include/asm-i386/tlbflush.h b/include/asm-x86/tlbflush_32.h index a50fa674148..a50fa674148 100644 --- a/include/asm-i386/tlbflush.h +++ b/include/asm-x86/tlbflush_32.h diff --git a/include/asm-x86_64/tlbflush.h b/include/asm-x86/tlbflush_64.h index 888eb4abdd0..888eb4abdd0 100644 --- a/include/asm-x86_64/tlbflush.h +++ b/include/asm-x86/tlbflush_64.h diff --git a/include/asm-x86/topology.h b/include/asm-x86/topology.h new file mode 100644 index 00000000000..b10fde9798e --- /dev/null +++ b/include/asm-x86/topology.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "topology_32.h" +#else +# include "topology_64.h" +#endif diff --git a/include/asm-i386/topology.h b/include/asm-x86/topology_32.h index 19b2dafd0c8..19b2dafd0c8 100644 --- a/include/asm-i386/topology.h +++ b/include/asm-x86/topology_32.h diff --git a/include/asm-x86_64/topology.h b/include/asm-x86/topology_64.h index 36e52fba796..36e52fba796 100644 --- a/include/asm-x86_64/topology.h +++ b/include/asm-x86/topology_64.h diff --git a/include/asm-i386/tsc.h b/include/asm-x86/tsc.h index a4d806610b7..a4d806610b7 100644 --- a/include/asm-i386/tsc.h +++ b/include/asm-x86/tsc.h diff --git a/include/asm-x86/types.h b/include/asm-x86/types.h new file mode 100644 index 00000000000..a777a9b8397 --- /dev/null +++ b/include/asm-x86/types.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "types_32.h" +# else +# include "types_64.h" +# endif +#else +# ifdef __i386__ +# include "types_32.h" +# else +# include "types_64.h" +# endif +#endif diff --git a/include/asm-i386/types.h b/include/asm-x86/types_32.h index ad0a55bd782..ad0a55bd782 100644 --- a/include/asm-i386/types.h +++ b/include/asm-x86/types_32.h diff --git a/include/asm-x86_64/types.h b/include/asm-x86/types_64.h index 2d4491aae28..2d4491aae28 100644 --- a/include/asm-x86_64/types.h +++ b/include/asm-x86/types_64.h diff --git a/include/asm-x86/uaccess.h b/include/asm-x86/uaccess.h new file mode 100644 index 00000000000..9fefd2947e7 --- /dev/null +++ b/include/asm-x86/uaccess.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "uaccess_32.h" +#else +# include "uaccess_64.h" +#endif diff --git a/include/asm-i386/uaccess.h b/include/asm-x86/uaccess_32.h index d2a4f7be9c2..d2a4f7be9c2 100644 --- a/include/asm-i386/uaccess.h +++ b/include/asm-x86/uaccess_32.h diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86/uaccess_64.h index f4ce8768ad4..f4ce8768ad4 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86/uaccess_64.h diff --git a/include/asm-x86/ucontext.h b/include/asm-x86/ucontext.h new file mode 100644 index 00000000000..175c8cb5973 --- /dev/null +++ b/include/asm-x86/ucontext.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "ucontext_32.h" +# else +# include "ucontext_64.h" +# endif +#else +# ifdef __i386__ +# include "ucontext_32.h" +# else +# include "ucontext_64.h" +# endif +#endif diff --git a/include/asm-i386/ucontext.h b/include/asm-x86/ucontext_32.h index b0db36925f5..b0db36925f5 100644 --- a/include/asm-i386/ucontext.h +++ b/include/asm-x86/ucontext_32.h diff --git a/include/asm-x86_64/ucontext.h b/include/asm-x86/ucontext_64.h index 159a3da9e11..159a3da9e11 100644 --- a/include/asm-x86_64/ucontext.h +++ b/include/asm-x86/ucontext_64.h diff --git a/include/asm-x86/unaligned.h b/include/asm-x86/unaligned.h new file mode 100644 index 00000000000..68067150fbc --- /dev/null +++ b/include/asm-x86/unaligned.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "unaligned_32.h" +#else +# include "unaligned_64.h" +#endif diff --git a/include/asm-i386/unaligned.h b/include/asm-x86/unaligned_32.h index 7acd7957621..7acd7957621 100644 --- a/include/asm-i386/unaligned.h +++ b/include/asm-x86/unaligned_32.h diff --git a/include/asm-x86_64/unaligned.h b/include/asm-x86/unaligned_64.h index d4bf78dc6f3..d4bf78dc6f3 100644 --- a/include/asm-x86_64/unaligned.h +++ b/include/asm-x86/unaligned_64.h diff --git a/include/asm-x86/unistd.h b/include/asm-x86/unistd.h new file mode 100644 index 00000000000..2a58ed3e51d --- /dev/null +++ b/include/asm-x86/unistd.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "unistd_32.h" +# else +# include "unistd_64.h" +# endif +#else +# ifdef __i386__ +# include "unistd_32.h" +# else +# include "unistd_64.h" +# endif +#endif diff --git a/include/asm-i386/unistd.h b/include/asm-x86/unistd_32.h index 9b15545eb9b..9b15545eb9b 100644 --- a/include/asm-i386/unistd.h +++ b/include/asm-x86/unistd_32.h diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86/unistd_64.h index fc4e73f5f1f..fc4e73f5f1f 100644 --- a/include/asm-x86_64/unistd.h +++ b/include/asm-x86/unistd_64.h diff --git a/include/asm-x86/unwind.h b/include/asm-x86/unwind.h new file mode 100644 index 00000000000..7e4d7ad5520 --- /dev/null +++ b/include/asm-x86/unwind.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "unwind_32.h" +#else +# include "unwind_64.h" +#endif diff --git a/include/asm-i386/unwind.h b/include/asm-x86/unwind_32.h index 43c70c3de2f..43c70c3de2f 100644 --- a/include/asm-i386/unwind.h +++ b/include/asm-x86/unwind_32.h diff --git a/include/asm-x86_64/unwind.h b/include/asm-x86/unwind_64.h index 02710f6a456..02710f6a456 100644 --- a/include/asm-x86_64/unwind.h +++ b/include/asm-x86/unwind_64.h diff --git a/include/asm-x86/user.h b/include/asm-x86/user.h new file mode 100644 index 00000000000..484715abe74 --- /dev/null +++ b/include/asm-x86/user.h @@ -0,0 +1,13 @@ +#ifdef __KERNEL__ +# ifdef CONFIG_X86_32 +# include "user_32.h" +# else +# include "user_64.h" +# endif +#else +# ifdef __i386__ +# include "user_32.h" +# else +# include "user_64.h" +# endif +#endif diff --git a/include/asm-x86_64/user32.h b/include/asm-x86/user32.h index f769872debe..f769872debe 100644 --- a/include/asm-x86_64/user32.h +++ b/include/asm-x86/user32.h diff --git a/include/asm-i386/user.h b/include/asm-x86/user_32.h index 0e85d2a5e33..0e85d2a5e33 100644 --- a/include/asm-i386/user.h +++ b/include/asm-x86/user_32.h diff --git a/include/asm-x86_64/user.h b/include/asm-x86/user_64.h index 12785c649ac..12785c649ac 100644 --- a/include/asm-x86_64/user.h +++ b/include/asm-x86/user_64.h diff --git a/include/asm-i386/vga.h b/include/asm-x86/vga.h index 0ecf68ac03a..0ecf68ac03a 100644 --- a/include/asm-i386/vga.h +++ b/include/asm-x86/vga.h diff --git a/include/asm-x86_64/vgtod.h b/include/asm-x86/vgtod.h index 3301f092934..3301f092934 100644 --- a/include/asm-x86_64/vgtod.h +++ b/include/asm-x86/vgtod.h diff --git a/include/asm-i386/vic.h b/include/asm-x86/vic.h index 53100f35361..53100f35361 100644 --- a/include/asm-i386/vic.h +++ b/include/asm-x86/vic.h diff --git a/include/asm-i386/vm86.h b/include/asm-x86/vm86.h index a5edf517b99..a5edf517b99 100644 --- a/include/asm-i386/vm86.h +++ b/include/asm-x86/vm86.h diff --git a/include/asm-i386/vmi.h b/include/asm-x86/vmi.h index eb8bd892c01..eb8bd892c01 100644 --- a/include/asm-i386/vmi.h +++ b/include/asm-x86/vmi.h diff --git a/include/asm-i386/vmi_time.h b/include/asm-x86/vmi_time.h index 47818813032..47818813032 100644 --- a/include/asm-i386/vmi_time.h +++ b/include/asm-x86/vmi_time.h diff --git a/include/asm-i386/voyager.h b/include/asm-x86/voyager.h index 91a9932937a..91a9932937a 100644 --- a/include/asm-i386/voyager.h +++ b/include/asm-x86/voyager.h diff --git a/include/asm-x86_64/vsyscall.h b/include/asm-x86/vsyscall.h index 3b8ceb4af2c..3b8ceb4af2c 100644 --- a/include/asm-x86_64/vsyscall.h +++ b/include/asm-x86/vsyscall.h diff --git a/include/asm-x86_64/vsyscall32.h b/include/asm-x86/vsyscall32.h index c631c082f8f..c631c082f8f 100644 --- a/include/asm-x86_64/vsyscall32.h +++ b/include/asm-x86/vsyscall32.h diff --git a/include/asm-i386/xen/hypercall.h b/include/asm-x86/xen/hypercall.h index bc0ee7d961c..bc0ee7d961c 100644 --- a/include/asm-i386/xen/hypercall.h +++ b/include/asm-x86/xen/hypercall.h diff --git a/include/asm-i386/xen/hypervisor.h b/include/asm-x86/xen/hypervisor.h index 8e15dd28c91..8e15dd28c91 100644 --- a/include/asm-i386/xen/hypervisor.h +++ b/include/asm-x86/xen/hypervisor.h diff --git a/include/asm-i386/xen/interface.h b/include/asm-x86/xen/interface.h index 165c3968e13..165c3968e13 100644 --- a/include/asm-i386/xen/interface.h +++ b/include/asm-x86/xen/interface.h diff --git a/include/asm-x86/xor.h b/include/asm-x86/xor.h new file mode 100644 index 00000000000..11b3bb86e17 --- /dev/null +++ b/include/asm-x86/xor.h @@ -0,0 +1,5 @@ +#ifdef CONFIG_X86_32 +# include "xor_32.h" +#else +# include "xor_64.h" +#endif diff --git a/include/asm-i386/xor.h b/include/asm-x86/xor_32.h index 23c86cef3b2..23c86cef3b2 100644 --- a/include/asm-i386/xor.h +++ b/include/asm-x86/xor_32.h diff --git a/include/asm-x86_64/xor.h b/include/asm-x86/xor_64.h index f942fcc2183..f942fcc2183 100644 --- a/include/asm-x86_64/xor.h +++ b/include/asm-x86/xor_64.h diff --git a/include/asm-x86_64/Kbuild b/include/asm-x86_64/Kbuild deleted file mode 100644 index 75a2deffca6..00000000000 --- a/include/asm-x86_64/Kbuild +++ /dev/null @@ -1,21 +0,0 @@ -include include/asm-generic/Kbuild.asm - -ALTARCH := i386 -ARCHDEF := defined __x86_64__ -ALTARCHDEF := defined __i386__ - -header-y += boot.h -header-y += bootsetup.h -header-y += debugreg.h -header-y += ldt.h -header-y += msr-index.h -header-y += prctl.h -header-y += ptrace-abi.h -header-y += sigcontext32.h -header-y += ucontext.h -header-y += vsyscall32.h - -unifdef-y += mce.h -unifdef-y += msr.h -unifdef-y += mtrr.h -unifdef-y += vsyscall.h diff --git a/include/asm-x86_64/boot.h b/include/asm-x86_64/boot.h deleted file mode 100644 index 3c46cea8db7..00000000000 --- a/include/asm-x86_64/boot.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/boot.h> diff --git a/include/asm-x86_64/bootparam.h b/include/asm-x86_64/bootparam.h deleted file mode 100644 index aa82e5238d8..00000000000 --- a/include/asm-x86_64/bootparam.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/bootparam.h> diff --git a/include/asm-x86_64/cpu.h b/include/asm-x86_64/cpu.h deleted file mode 100644 index 8eea076525a..00000000000 --- a/include/asm-x86_64/cpu.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/cpu.h> diff --git a/include/asm-x86_64/cpufeature.h b/include/asm-x86_64/cpufeature.h deleted file mode 100644 index 8baefc3beb2..00000000000 --- a/include/asm-x86_64/cpufeature.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * cpufeature.h - * - * Defines x86 CPU feature bits - */ - -#ifndef __ASM_X8664_CPUFEATURE_H -#define __ASM_X8664_CPUFEATURE_H - -#include <asm-i386/cpufeature.h> - -#undef cpu_has_vme -#define cpu_has_vme 0 - -#undef cpu_has_pae -#define cpu_has_pae ___BUG___ - -#undef cpu_has_mp -#define cpu_has_mp 1 /* XXX */ - -#undef cpu_has_k6_mtrr -#define cpu_has_k6_mtrr 0 - -#undef cpu_has_cyrix_arr -#define cpu_has_cyrix_arr 0 - -#undef cpu_has_centaur_mcr -#define cpu_has_centaur_mcr 0 - -#endif /* __ASM_X8664_CPUFEATURE_H */ diff --git a/include/asm-x86_64/emergency-restart.h b/include/asm-x86_64/emergency-restart.h deleted file mode 100644 index 680c3956334..00000000000 --- a/include/asm-x86_64/emergency-restart.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef _ASM_EMERGENCY_RESTART_H -#define _ASM_EMERGENCY_RESTART_H - -extern void machine_emergency_restart(void); - -#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/include/asm-x86_64/fcntl.h b/include/asm-x86_64/fcntl.h deleted file mode 100644 index 46ab12db573..00000000000 --- a/include/asm-x86_64/fcntl.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/fcntl.h> diff --git a/include/asm-x86_64/hpet.h b/include/asm-x86_64/hpet.h deleted file mode 100644 index 79bb950f82c..00000000000 --- a/include/asm-x86_64/hpet.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef _ASM_X8664_HPET_H -#define _ASM_X8664_HPET_H 1 - -#include <asm-i386/hpet.h> - -#define HPET_TICK_RATE (HZ * 100000UL) - -extern int hpet_rtc_timer_init(void); -extern int hpet_arch_init(void); -extern int hpet_timer_stop_set_go(unsigned long tick); -extern int hpet_reenable(void); -extern unsigned int hpet_calibrate_tsc(void); - -extern int hpet_use_timer; -extern unsigned long hpet_period; -extern unsigned long hpet_tick; - -#endif diff --git a/include/asm-x86_64/hypertransport.h b/include/asm-x86_64/hypertransport.h deleted file mode 100644 index 5cbf9fa5e0b..00000000000 --- a/include/asm-x86_64/hypertransport.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/hypertransport.h> diff --git a/include/asm-x86_64/ide.h b/include/asm-x86_64/ide.h deleted file mode 100644 index 4cef0ef6187..00000000000 --- a/include/asm-x86_64/ide.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/ide.h> diff --git a/include/asm-x86_64/ioctl.h b/include/asm-x86_64/ioctl.h deleted file mode 100644 index b279fe06dfe..00000000000 --- a/include/asm-x86_64/ioctl.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/ioctl.h> diff --git a/include/asm-x86_64/ist.h b/include/asm-x86_64/ist.h deleted file mode 100644 index 338857ecbc6..00000000000 --- a/include/asm-x86_64/ist.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/ist.h> diff --git a/include/asm-x86_64/msidef.h b/include/asm-x86_64/msidef.h deleted file mode 100644 index 083ad5827e4..00000000000 --- a/include/asm-x86_64/msidef.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/msidef.h> diff --git a/include/asm-x86_64/msr-index.h b/include/asm-x86_64/msr-index.h deleted file mode 100644 index d77a63f1ddf..00000000000 --- a/include/asm-x86_64/msr-index.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/msr-index.h> diff --git a/include/asm-x86_64/node.h b/include/asm-x86_64/node.h deleted file mode 100644 index 0ee6f88db04..00000000000 --- a/include/asm-x86_64/node.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/node.h> diff --git a/include/asm-x86_64/poll.h b/include/asm-x86_64/poll.h deleted file mode 100644 index c98509d3149..00000000000 --- a/include/asm-x86_64/poll.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-generic/poll.h> diff --git a/include/asm-x86_64/processor-flags.h b/include/asm-x86_64/processor-flags.h deleted file mode 100644 index ec99a57b2c6..00000000000 --- a/include/asm-x86_64/processor-flags.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/processor-flags.h> diff --git a/include/asm-x86_64/processor.h b/include/asm-x86_64/processor.h deleted file mode 100644 index 19525175b91..00000000000 --- a/include/asm-x86_64/processor.h +++ /dev/null @@ -1,439 +0,0 @@ -/* - * include/asm-x86_64/processor.h - * - * Copyright (C) 1994 Linus Torvalds - */ - -#ifndef __ASM_X86_64_PROCESSOR_H -#define __ASM_X86_64_PROCESSOR_H - -#include <asm/segment.h> -#include <asm/page.h> -#include <asm/types.h> -#include <asm/sigcontext.h> -#include <asm/cpufeature.h> -#include <linux/threads.h> -#include <asm/msr.h> -#include <asm/current.h> -#include <asm/system.h> -#include <asm/mmsegment.h> -#include <asm/percpu.h> -#include <linux/personality.h> -#include <linux/cpumask.h> -#include <asm/processor-flags.h> - -#define TF_MASK 0x00000100 -#define IF_MASK 0x00000200 -#define IOPL_MASK 0x00003000 -#define NT_MASK 0x00004000 -#define VM_MASK 0x00020000 -#define AC_MASK 0x00040000 -#define VIF_MASK 0x00080000 /* virtual interrupt flag */ -#define VIP_MASK 0x00100000 /* virtual interrupt pending */ -#define ID_MASK 0x00200000 - -#define desc_empty(desc) \ - (!((desc)->a | (desc)->b)) - -#define desc_equal(desc1, desc2) \ - (((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b)) - -/* - * Default implementation of macro that returns current - * instruction pointer ("program counter"). - */ -#define current_text_addr() ({ void *pc; asm volatile("leaq 1f(%%rip),%0\n1:":"=r"(pc)); pc; }) - -/* - * CPU type and hardware bug flags. Kept separately for each CPU. - */ - -struct cpuinfo_x86 { - __u8 x86; /* CPU family */ - __u8 x86_vendor; /* CPU vendor */ - __u8 x86_model; - __u8 x86_mask; - int cpuid_level; /* Maximum supported CPUID level, -1=no CPUID */ - __u32 x86_capability[NCAPINTS]; - char x86_vendor_id[16]; - char x86_model_id[64]; - int x86_cache_size; /* in KB */ - int x86_clflush_size; - int x86_cache_alignment; - int x86_tlbsize; /* number of 4K pages in DTLB/ITLB combined(in pages)*/ - __u8 x86_virt_bits, x86_phys_bits; - __u8 x86_max_cores; /* cpuid returned max cores value */ - __u32 x86_power; - __u32 extended_cpuid_level; /* Max extended CPUID function supported */ - unsigned long loops_per_jiffy; -#ifdef CONFIG_SMP - cpumask_t llc_shared_map; /* cpus sharing the last level cache */ -#endif - __u8 apicid; -#ifdef CONFIG_SMP - __u8 booted_cores; /* number of cores as seen by OS */ - __u8 phys_proc_id; /* Physical Processor id. */ - __u8 cpu_core_id; /* Core id. */ -#endif -} ____cacheline_aligned; - -#define X86_VENDOR_INTEL 0 -#define X86_VENDOR_CYRIX 1 -#define X86_VENDOR_AMD 2 -#define X86_VENDOR_UMC 3 -#define X86_VENDOR_NEXGEN 4 -#define X86_VENDOR_CENTAUR 5 -#define X86_VENDOR_TRANSMETA 7 -#define X86_VENDOR_NUM 8 -#define X86_VENDOR_UNKNOWN 0xff - -#ifdef CONFIG_SMP -extern struct cpuinfo_x86 cpu_data[]; -#define current_cpu_data cpu_data[smp_processor_id()] -#else -#define cpu_data (&boot_cpu_data) -#define current_cpu_data boot_cpu_data -#endif - -extern char ignore_irq13; - -extern void identify_cpu(struct cpuinfo_x86 *); -extern void print_cpu_info(struct cpuinfo_x86 *); -extern void init_scattered_cpuid_features(struct cpuinfo_x86 *c); -extern unsigned int init_intel_cacheinfo(struct cpuinfo_x86 *c); -extern unsigned short num_cache_leaves; - -/* - * Save the cr4 feature set we're using (ie - * Pentium 4MB enable and PPro Global page - * enable), so that any CPU's that boot up - * after us can get the correct flags. - */ -extern unsigned long mmu_cr4_features; - -static inline void set_in_cr4 (unsigned long mask) -{ - mmu_cr4_features |= mask; - __asm__("movq %%cr4,%%rax\n\t" - "orq %0,%%rax\n\t" - "movq %%rax,%%cr4\n" - : : "irg" (mask) - :"ax"); -} - -static inline void clear_in_cr4 (unsigned long mask) -{ - mmu_cr4_features &= ~mask; - __asm__("movq %%cr4,%%rax\n\t" - "andq %0,%%rax\n\t" - "movq %%rax,%%cr4\n" - : : "irg" (~mask) - :"ax"); -} - - -/* - * User space process size. 47bits minus one guard page. - */ -#define TASK_SIZE64 (0x800000000000UL - 4096) - -/* This decides where the kernel will search for a free chunk of vm - * space during mmap's. - */ -#define IA32_PAGE_OFFSET ((current->personality & ADDR_LIMIT_3GB) ? 0xc0000000 : 0xFFFFe000) - -#define TASK_SIZE (test_thread_flag(TIF_IA32) ? IA32_PAGE_OFFSET : TASK_SIZE64) -#define TASK_SIZE_OF(child) ((test_tsk_thread_flag(child, TIF_IA32)) ? IA32_PAGE_OFFSET : TASK_SIZE64) - -#define TASK_UNMAPPED_BASE PAGE_ALIGN(TASK_SIZE/3) - -/* - * Size of io_bitmap. - */ -#define IO_BITMAP_BITS 65536 -#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) -#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) -#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) -#define INVALID_IO_BITMAP_OFFSET 0x8000 - -struct i387_fxsave_struct { - u16 cwd; - u16 swd; - u16 twd; - u16 fop; - u64 rip; - u64 rdp; - u32 mxcsr; - u32 mxcsr_mask; - u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ - u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ - u32 padding[24]; -} __attribute__ ((aligned (16))); - -union i387_union { - struct i387_fxsave_struct fxsave; -}; - -struct tss_struct { - u32 reserved1; - u64 rsp0; - u64 rsp1; - u64 rsp2; - u64 reserved2; - u64 ist[7]; - u32 reserved3; - u32 reserved4; - u16 reserved5; - u16 io_bitmap_base; - /* - * The extra 1 is there because the CPU will access an - * additional byte beyond the end of the IO permission - * bitmap. The extra byte must be all 1 bits, and must - * be within the limit. Thus we have: - * - * 128 bytes, the bitmap itself, for ports 0..0x3ff - * 8 bytes, for an extra "long" of ~0UL - */ - unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; -} __attribute__((packed)) ____cacheline_aligned; - - -extern struct cpuinfo_x86 boot_cpu_data; -DECLARE_PER_CPU(struct tss_struct,init_tss); -/* Save the original ist values for checking stack pointers during debugging */ -struct orig_ist { - unsigned long ist[7]; -}; -DECLARE_PER_CPU(struct orig_ist, orig_ist); - -#ifdef CONFIG_X86_VSMP -#define ARCH_MIN_TASKALIGN (1 << INTERNODE_CACHE_SHIFT) -#define ARCH_MIN_MMSTRUCT_ALIGN (1 << INTERNODE_CACHE_SHIFT) -#else -#define ARCH_MIN_TASKALIGN 16 -#define ARCH_MIN_MMSTRUCT_ALIGN 0 -#endif - -struct thread_struct { - unsigned long rsp0; - unsigned long rsp; - unsigned long userrsp; /* Copy from PDA */ - unsigned long fs; - unsigned long gs; - unsigned short es, ds, fsindex, gsindex; -/* Hardware debugging registers */ - unsigned long debugreg0; - unsigned long debugreg1; - unsigned long debugreg2; - unsigned long debugreg3; - unsigned long debugreg6; - unsigned long debugreg7; -/* fault info */ - unsigned long cr2, trap_no, error_code; -/* floating point info */ - union i387_union i387 __attribute__((aligned(16))); -/* IO permissions. the bitmap could be moved into the GDT, that would make - switch faster for a limited number of ioperm using tasks. -AK */ - int ioperm; - unsigned long *io_bitmap_ptr; - unsigned io_bitmap_max; -/* cached TLS descriptors. */ - u64 tls_array[GDT_ENTRY_TLS_ENTRIES]; -} __attribute__((aligned(16))); - -#define INIT_THREAD { \ - .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ -} - -#define INIT_TSS { \ - .rsp0 = (unsigned long)&init_stack + sizeof(init_stack) \ -} - -#define INIT_MMAP \ -{ &init_mm, 0, 0, NULL, PAGE_SHARED, VM_READ | VM_WRITE | VM_EXEC, 1, NULL, NULL } - -#define start_thread(regs,new_rip,new_rsp) do { \ - asm volatile("movl %0,%%fs; movl %0,%%es; movl %0,%%ds": :"r" (0)); \ - load_gs_index(0); \ - (regs)->rip = (new_rip); \ - (regs)->rsp = (new_rsp); \ - write_pda(oldrsp, (new_rsp)); \ - (regs)->cs = __USER_CS; \ - (regs)->ss = __USER_DS; \ - (regs)->eflags = 0x200; \ - set_fs(USER_DS); \ -} while(0) - -#define get_debugreg(var, register) \ - __asm__("movq %%db" #register ", %0" \ - :"=r" (var)) -#define set_debugreg(value, register) \ - __asm__("movq %0,%%db" #register \ - : /* no output */ \ - :"r" (value)) - -struct task_struct; -struct mm_struct; - -/* Free all resources held by a thread. */ -extern void release_thread(struct task_struct *); - -/* Prepare to copy thread state - unlazy all lazy status */ -extern void prepare_to_copy(struct task_struct *tsk); - -/* - * create a kernel thread without removing it from tasklists - */ -extern long kernel_thread(int (*fn)(void *), void * arg, unsigned long flags); - -/* - * Return saved PC of a blocked thread. - * What is this good for? it will be always the scheduler or ret_from_fork. - */ -#define thread_saved_pc(t) (*(unsigned long *)((t)->thread.rsp - 8)) - -extern unsigned long get_wchan(struct task_struct *p); -#define task_pt_regs(tsk) ((struct pt_regs *)(tsk)->thread.rsp0 - 1) -#define KSTK_EIP(tsk) (task_pt_regs(tsk)->rip) -#define KSTK_ESP(tsk) -1 /* sorry. doesn't work for syscall. */ - - -struct microcode_header { - unsigned int hdrver; - unsigned int rev; - unsigned int date; - unsigned int sig; - unsigned int cksum; - unsigned int ldrver; - unsigned int pf; - unsigned int datasize; - unsigned int totalsize; - unsigned int reserved[3]; -}; - -struct microcode { - struct microcode_header hdr; - unsigned int bits[0]; -}; - -typedef struct microcode microcode_t; -typedef struct microcode_header microcode_header_t; - -/* microcode format is extended from prescott processors */ -struct extended_signature { - unsigned int sig; - unsigned int pf; - unsigned int cksum; -}; - -struct extended_sigtable { - unsigned int count; - unsigned int cksum; - unsigned int reserved[3]; - struct extended_signature sigs[0]; -}; - - -#define ASM_NOP1 K8_NOP1 -#define ASM_NOP2 K8_NOP2 -#define ASM_NOP3 K8_NOP3 -#define ASM_NOP4 K8_NOP4 -#define ASM_NOP5 K8_NOP5 -#define ASM_NOP6 K8_NOP6 -#define ASM_NOP7 K8_NOP7 -#define ASM_NOP8 K8_NOP8 - -/* Opteron nops */ -#define K8_NOP1 ".byte 0x90\n" -#define K8_NOP2 ".byte 0x66,0x90\n" -#define K8_NOP3 ".byte 0x66,0x66,0x90\n" -#define K8_NOP4 ".byte 0x66,0x66,0x66,0x90\n" -#define K8_NOP5 K8_NOP3 K8_NOP2 -#define K8_NOP6 K8_NOP3 K8_NOP3 -#define K8_NOP7 K8_NOP4 K8_NOP3 -#define K8_NOP8 K8_NOP4 K8_NOP4 - -#define ASM_NOP_MAX 8 - -/* REP NOP (PAUSE) is a good thing to insert into busy-wait loops. */ -static inline void rep_nop(void) -{ - __asm__ __volatile__("rep;nop": : :"memory"); -} - -/* Stop speculative execution */ -static inline void sync_core(void) -{ - int tmp; - asm volatile("cpuid" : "=a" (tmp) : "0" (1) : "ebx","ecx","edx","memory"); -} - -#define ARCH_HAS_PREFETCH -static inline void prefetch(void *x) -{ - asm volatile("prefetcht0 %0" :: "m" (*(unsigned long *)x)); -} - -#define ARCH_HAS_PREFETCHW 1 -static inline void prefetchw(void *x) -{ - alternative_input("prefetcht0 (%1)", - "prefetchw (%1)", - X86_FEATURE_3DNOW, - "r" (x)); -} - -#define ARCH_HAS_SPINLOCK_PREFETCH 1 - -#define spin_lock_prefetch(x) prefetchw(x) - -#define cpu_relax() rep_nop() - -static inline void serialize_cpu(void) -{ - __asm__ __volatile__ ("cpuid" : : : "ax", "bx", "cx", "dx"); -} - -static inline void __monitor(const void *eax, unsigned long ecx, - unsigned long edx) -{ - /* "monitor %eax,%ecx,%edx;" */ - asm volatile( - ".byte 0x0f,0x01,0xc8;" - : :"a" (eax), "c" (ecx), "d"(edx)); -} - -static inline void __mwait(unsigned long eax, unsigned long ecx) -{ - /* "mwait %eax,%ecx;" */ - asm volatile( - ".byte 0x0f,0x01,0xc9;" - : :"a" (eax), "c" (ecx)); -} - -static inline void __sti_mwait(unsigned long eax, unsigned long ecx) -{ - /* "mwait %eax,%ecx;" */ - asm volatile( - "sti; .byte 0x0f,0x01,0xc9;" - : :"a" (eax), "c" (ecx)); -} - -extern void mwait_idle_with_hints(unsigned long eax, unsigned long ecx); - -#define stack_current() \ -({ \ - struct thread_info *ti; \ - asm("andq %%rsp,%0; ":"=r" (ti) : "0" (CURRENT_MASK)); \ - ti->task; \ -}) - -#define cache_line_size() (boot_cpu_data.x86_cache_alignment) - -extern unsigned long boot_option_idle_override; -/* Boot loader type from the setup header */ -extern int bootloader_type; - -#define HAVE_ARCH_PICK_MMAP_LAYOUT 1 - -#endif /* __ASM_X86_64_PROCESSOR_H */ diff --git a/include/asm-x86_64/socket.h b/include/asm-x86_64/socket.h deleted file mode 100644 index 90af60cf3c0..00000000000 --- a/include/asm-x86_64/socket.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef _ASM_SOCKET_H -#define _ASM_SOCKET_H - -#include <asm/sockios.h> - -/* For setsockopt(2) */ -#define SOL_SOCKET 1 - -#define SO_DEBUG 1 -#define SO_REUSEADDR 2 -#define SO_TYPE 3 -#define SO_ERROR 4 -#define SO_DONTROUTE 5 -#define SO_BROADCAST 6 -#define SO_SNDBUF 7 -#define SO_RCVBUF 8 -#define SO_SNDBUFFORCE 32 -#define SO_RCVBUFFORCE 33 -#define SO_KEEPALIVE 9 -#define SO_OOBINLINE 10 -#define SO_NO_CHECK 11 -#define SO_PRIORITY 12 -#define SO_LINGER 13 -#define SO_BSDCOMPAT 14 -/* To add :#define SO_REUSEPORT 15 */ -#define SO_PASSCRED 16 -#define SO_PEERCRED 17 -#define SO_RCVLOWAT 18 -#define SO_SNDLOWAT 19 -#define SO_RCVTIMEO 20 -#define SO_SNDTIMEO 21 - -/* Security levels - as per NRL IPv6 - don't actually do anything */ -#define SO_SECURITY_AUTHENTICATION 22 -#define SO_SECURITY_ENCRYPTION_TRANSPORT 23 -#define SO_SECURITY_ENCRYPTION_NETWORK 24 - -#define SO_BINDTODEVICE 25 - -/* Socket filtering */ -#define SO_ATTACH_FILTER 26 -#define SO_DETACH_FILTER 27 - -#define SO_PEERNAME 28 -#define SO_TIMESTAMP 29 -#define SCM_TIMESTAMP SO_TIMESTAMP - -#define SO_ACCEPTCONN 30 - -#define SO_PEERSEC 31 -#define SO_PASSSEC 34 -#define SO_TIMESTAMPNS 35 -#define SCM_TIMESTAMPNS SO_TIMESTAMPNS - -#endif /* _ASM_SOCKET_H */ diff --git a/include/asm-x86_64/spinlock_types.h b/include/asm-x86_64/spinlock_types.h deleted file mode 100644 index 4da9345c150..00000000000 --- a/include/asm-x86_64/spinlock_types.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __ASM_SPINLOCK_TYPES_H -#define __ASM_SPINLOCK_TYPES_H - -#ifndef __LINUX_SPINLOCK_TYPES_H -# error "please don't include this file directly" -#endif - -typedef struct { - unsigned int slock; -} raw_spinlock_t; - -#define __RAW_SPIN_LOCK_UNLOCKED { 1 } - -typedef struct { - unsigned int lock; -} raw_rwlock_t; - -#define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } - -#endif diff --git a/include/asm-x86_64/therm_throt.h b/include/asm-x86_64/therm_throt.h deleted file mode 100644 index 5aac059007b..00000000000 --- a/include/asm-x86_64/therm_throt.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/therm_throt.h> diff --git a/include/asm-x86_64/tsc.h b/include/asm-x86_64/tsc.h deleted file mode 100644 index d66ba6ef25f..00000000000 --- a/include/asm-x86_64/tsc.h +++ /dev/null @@ -1 +0,0 @@ -#include <asm-i386/tsc.h> diff --git a/include/asm-x86_64/vga.h b/include/asm-x86_64/vga.h deleted file mode 100644 index 0ecf68ac03a..00000000000 --- a/include/asm-x86_64/vga.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Access to VGA videoram - * - * (c) 1998 Martin Mares <mj@ucw.cz> - */ - -#ifndef _LINUX_ASM_VGA_H_ -#define _LINUX_ASM_VGA_H_ - -/* - * On the PC, we can just recalculate addresses and then - * access the videoram directly without any black magic. - */ - -#define VGA_MAP_MEM(x,s) (unsigned long)phys_to_virt(x) - -#define vga_readb(x) (*(x)) -#define vga_writeb(x,y) (*(y) = (x)) - -#endif diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 963051a967d..3ec6e7ff5fb 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -32,15 +32,7 @@ * CPUFREQ NOTIFIER INTERFACE * *********************************************************************/ -#ifdef CONFIG_CPU_FREQ int cpufreq_register_notifier(struct notifier_block *nb, unsigned int list); -#else -static inline int cpufreq_register_notifier(struct notifier_block *nb, - unsigned int list) -{ - return 0; -} -#endif int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list); #define CPUFREQ_TRANSITION_NOTIFIER (0) @@ -268,22 +260,17 @@ struct freq_attr { int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu); int cpufreq_update_policy(unsigned int cpu); +/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ +unsigned int cpufreq_get(unsigned int cpu); -/* - * query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it - */ +/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ #ifdef CONFIG_CPU_FREQ unsigned int cpufreq_quick_get(unsigned int cpu); -unsigned int cpufreq_get(unsigned int cpu); #else static inline unsigned int cpufreq_quick_get(unsigned int cpu) { return 0; } -static inline unsigned int cpufreq_get(unsigned int cpu) -{ - return 0; -} #endif diff --git a/include/linux/sched.h b/include/linux/sched.h index a01ac6dd5f5..313c6b6e774 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -113,7 +113,7 @@ extern unsigned long avenrun[]; /* Load averages */ #define FSHIFT 11 /* nr of bits of precision */ #define FIXED_1 (1<<FSHIFT) /* 1.0 as fixed-point */ -#define LOAD_FREQ (5*HZ) /* 5 sec intervals */ +#define LOAD_FREQ (5*HZ+1) /* 5 sec intervals */ #define EXP_1 1884 /* 1/exp(5sec/1min) as fixed-point */ #define EXP_5 2014 /* 1/exp(5sec/5min) */ #define EXP_15 2037 /* 1/exp(5sec/15min) */ diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 4ef4d22e5e4..b4af6bcb7b7 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h @@ -127,7 +127,7 @@ int sync_page_range(struct inode *inode, struct address_space *mapping, loff_t pos, loff_t count); int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, loff_t pos, loff_t count); -void set_page_dirty_balance(struct page *page); +void set_page_dirty_balance(struct page *page, int page_mkwrite); void writeback_set_ratelimit(void); /* pdflush.c */ diff --git a/include/net/rose.h b/include/net/rose.h index a4047d3cf5d..e5bb084d875 100644 --- a/include/net/rose.h +++ b/include/net/rose.h @@ -188,7 +188,7 @@ extern void rose_kick(struct sock *); extern void rose_enquiry_response(struct sock *); /* rose_route.c */ -extern struct rose_neigh rose_loopback_neigh; +extern struct rose_neigh *rose_loopback_neigh; extern const struct file_operations rose_neigh_fops; extern const struct file_operations rose_nodes_fops; extern const struct file_operations rose_routes_fops; diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 991c85bb9e3..e8e3a64eb32 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h @@ -114,7 +114,6 @@ sctp_state_fn_t sctp_sf_do_4_C; sctp_state_fn_t sctp_sf_eat_data_6_2; sctp_state_fn_t sctp_sf_eat_data_fast_4_4; sctp_state_fn_t sctp_sf_eat_sack_6_2; -sctp_state_fn_t sctp_sf_tabort_8_4_8; sctp_state_fn_t sctp_sf_operr_notify; sctp_state_fn_t sctp_sf_t1_init_timer_expire; sctp_state_fn_t sctp_sf_t1_cookie_timer_expire; @@ -247,6 +246,9 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, int, __be16); struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, union sctp_addr *addr); +int sctp_verify_asconf(const struct sctp_association *asoc, + struct sctp_paramhdr *param_hdr, void *chunk_end, + struct sctp_paramhdr **errp); struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, struct sctp_chunk *asconf); int sctp_process_asconf_ack(struct sctp_association *asoc, diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index c2fe2dcc9af..baff49dfcdb 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h @@ -421,6 +421,7 @@ struct sctp_signed_cookie { * internally. */ union sctp_addr_param { + struct sctp_paramhdr p; struct sctp_ipv4addr_param v4; struct sctp_ipv6addr_param v6; }; @@ -1156,7 +1157,7 @@ int sctp_bind_addr_copy(struct sctp_bind_addr *dest, int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, __u8 use_as_src, gfp_t gfp); int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *, - void (*rcu_call)(struct rcu_head *, + void fastcall (*rcu_call)(struct rcu_head *, void (*func)(struct rcu_head *))); int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, struct sctp_sock *); diff --git a/include/net/tcp.h b/include/net/tcp.h index 185c7ecce4c..54053de0bdd 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -1059,14 +1059,12 @@ struct tcp_md5sig_key { }; struct tcp4_md5sig_key { - u8 *key; - u16 keylen; + struct tcp_md5sig_key base; __be32 addr; }; struct tcp6_md5sig_key { - u8 *key; - u16 keylen; + struct tcp_md5sig_key base; #if 0 u32 scope_id; /* XXX */ #endif diff --git a/kernel/futex.c b/kernel/futex.c index e8935b195e8..fcc94e7b408 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -1943,9 +1943,10 @@ static inline int fetch_robust_entry(struct robust_list __user **entry, void exit_robust_list(struct task_struct *curr) { struct robust_list_head __user *head = curr->robust_list; - struct robust_list __user *entry, *pending; - unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; + struct robust_list __user *entry, *next_entry, *pending; + unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; unsigned long futex_offset; + int rc; /* * Fetch the list head (which was registered earlier, via @@ -1965,12 +1966,14 @@ void exit_robust_list(struct task_struct *curr) if (fetch_robust_entry(&pending, &head->list_op_pending, &pip)) return; - if (pending) - handle_futex_death((void __user *)pending + futex_offset, - curr, pip); - + next_entry = NULL; /* avoid warning with gcc */ while (entry != &head->list) { /* + * Fetch the next entry in the list before calling + * handle_futex_death: + */ + rc = fetch_robust_entry(&next_entry, &entry->next, &next_pi); + /* * A pending lock might already be on the list, so * don't process it twice: */ @@ -1978,11 +1981,10 @@ void exit_robust_list(struct task_struct *curr) if (handle_futex_death((void __user *)entry + futex_offset, curr, pi)) return; - /* - * Fetch the next entry in the list: - */ - if (fetch_robust_entry(&entry, &entry->next, &pi)) + if (rc) return; + entry = next_entry; + pi = next_pi; /* * Avoid excessively long or circular lists: */ @@ -1991,6 +1993,10 @@ void exit_robust_list(struct task_struct *curr) cond_resched(); } + + if (pending) + handle_futex_death((void __user *)pending + futex_offset, + curr, pip); } long do_futex(u32 __user *uaddr, int op, u32 val, ktime_t *timeout, diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c index 7e52eb051f2..2c2e2954b71 100644 --- a/kernel/futex_compat.c +++ b/kernel/futex_compat.c @@ -38,10 +38,11 @@ fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, void compat_exit_robust_list(struct task_struct *curr) { struct compat_robust_list_head __user *head = curr->compat_robust_list; - struct robust_list __user *entry, *pending; - unsigned int limit = ROBUST_LIST_LIMIT, pi, pip; - compat_uptr_t uentry, upending; + struct robust_list __user *entry, *next_entry, *pending; + unsigned int limit = ROBUST_LIST_LIMIT, pi, next_pi, pip; + compat_uptr_t uentry, next_uentry, upending; compat_long_t futex_offset; + int rc; /* * Fetch the list head (which was registered earlier, via @@ -61,11 +62,16 @@ void compat_exit_robust_list(struct task_struct *curr) if (fetch_robust_entry(&upending, &pending, &head->list_op_pending, &pip)) return; - if (pending) - handle_futex_death((void __user *)pending + futex_offset, curr, pip); + next_entry = NULL; /* avoid warning with gcc */ while (entry != (struct robust_list __user *) &head->list) { /* + * Fetch the next entry in the list before calling + * handle_futex_death: + */ + rc = fetch_robust_entry(&next_uentry, &next_entry, + (compat_uptr_t __user *)&entry->next, &next_pi); + /* * A pending lock might already be on the list, so * dont process it twice: */ @@ -74,12 +80,11 @@ void compat_exit_robust_list(struct task_struct *curr) curr, pi)) return; - /* - * Fetch the next entry in the list: - */ - if (fetch_robust_entry(&uentry, &entry, - (compat_uptr_t __user *)&entry->next, &pi)) + if (rc) return; + uentry = next_uentry; + entry = next_entry; + pi = next_pi; /* * Avoid excessively long or circular lists: */ @@ -88,6 +93,9 @@ void compat_exit_robust_list(struct task_struct *curr) cond_resched(); } + if (pending) + handle_futex_death((void __user *)pending + futex_offset, + curr, pip); } asmlinkage long diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index c8580a1e687..14b0e10dc95 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -110,7 +110,7 @@ config SUSPEND config HIBERNATION_UP_POSSIBLE bool - depends on X86 || PPC64_SWSUSP || FRV || PPC32 + depends on X86 || PPC64_SWSUSP || PPC32 depends on !SMP default y diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index c9fbe8e73a4..67c67a87146 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -639,6 +639,16 @@ static void enqueue_sleeper(struct cfs_rq *cfs_rq, struct sched_entity *se) se->block_start = 0; se->sum_sleep_runtime += delta; + + /* + * Blocking time is in units of nanosecs, so shift by 20 to + * get a milliseconds-range estimation of the amount of + * time that the task spent sleeping: + */ + if (unlikely(prof_on == SLEEP_PROFILING)) { + profile_hits(SLEEP_PROFILING, (void *)get_wchan(tsk), + delta >> 20); + } } #endif } diff --git a/kernel/signal.c b/kernel/signal.c index 9fb91a32edd..79295238109 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -531,18 +531,18 @@ static int check_kill_permission(int sig, struct siginfo *info, if (!valid_signal(sig)) return error; - error = audit_signal_info(sig, t); /* Let audit system see the signal */ - if (error) - return error; - - error = -EPERM; - if ((info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info))) - && ((sig != SIGCONT) || - (process_session(current) != process_session(t))) - && (current->euid ^ t->suid) && (current->euid ^ t->uid) - && (current->uid ^ t->suid) && (current->uid ^ t->uid) - && !capable(CAP_KILL)) + if (info == SEND_SIG_NOINFO || (!is_si_special(info) && SI_FROMUSER(info))) { + error = audit_signal_info(sig, t); /* Let audit system see the signal */ + if (error) + return error; + error = -EPERM; + if (((sig != SIGCONT) || + (process_session(current) != process_session(t))) + && (current->euid ^ t->suid) && (current->euid ^ t->uid) + && (current->uid ^ t->suid) && (current->uid ^ t->uid) + && !capable(CAP_KILL)) return error; + } return security_task_kill(t, info, sig, 0); } diff --git a/kernel/sys.c b/kernel/sys.c index 1b33b05d346..8ae2e636eb1 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -32,6 +32,7 @@ #include <linux/getcpu.h> #include <linux/task_io_accounting_ops.h> #include <linux/seccomp.h> +#include <linux/cpu.h> #include <linux/compat.h> #include <linux/syscalls.h> @@ -878,6 +879,7 @@ void kernel_power_off(void) kernel_shutdown_prepare(SYSTEM_POWER_OFF); if (pm_power_off_prepare) pm_power_off_prepare(); + disable_nonboot_cpus(); sysdev_shutdown(); printk(KERN_EMERG "Power down.\n"); machine_power_off(); diff --git a/kernel/time/timer_stats.c b/kernel/time/timer_stats.c index 3c38fb5eae1..c36bb7ed030 100644 --- a/kernel/time/timer_stats.c +++ b/kernel/time/timer_stats.c @@ -327,8 +327,9 @@ static int tstats_show(struct seq_file *m, void *v) ms = 1; if (events && period.tv_sec) - seq_printf(m, "%ld total events, %ld.%ld events/sec\n", events, - events / period.tv_sec, events * 1000 / ms); + seq_printf(m, "%ld total events, %ld.%03ld events/sec\n", + events, events * 1000 / ms, + (events * 1000000 / ms) % 1000); else seq_printf(m, "%ld total events\n", events); diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 50a94eee4d9..cdc9b099e62 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -284,7 +284,7 @@ config LOCKDEP select KALLSYMS_ALL config LOCK_STAT - bool "Lock usage statisitics" + bool "Lock usage statistics" depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT select LOCKDEP select DEBUG_SPINLOCK @@ -294,6 +294,8 @@ config LOCK_STAT help This feature enables tracking lock contention points + For more details, see Documentation/lockstat.txt + config DEBUG_LOCKDEP bool "Lock dependency engine debugging" depends on DEBUG_KERNEL && LOCKDEP diff --git a/lib/Makefile b/lib/Makefile index 6b0ba8cf4e5..4f3f3e25650 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -2,7 +2,7 @@ # Makefile for some libs needed in the kernel. # -lib-y := ctype.o string.o vsprintf.o kasprintf.o cmdline.o \ +lib-y := ctype.o string.o vsprintf.o cmdline.o \ rbtree.o radix-tree.o dump_stack.o \ idr.o int_sqrt.o bitmap.o extable.o prio_tree.o \ sha1.o irq_regs.o reciprocal_div.o argv_split.o @@ -13,7 +13,7 @@ lib-$(CONFIG_SMP) += cpumask.o lib-y += kobject.o kref.o kobject_uevent.o klist.o obj-y += div64.o sort.o parser.o halfmd4.o debug_locks.o random32.o \ - bust_spinlocks.o hexdump.o + bust_spinlocks.o hexdump.o kasprintf.o ifeq ($(CONFIG_DEBUG_KOBJECT),y) CFLAGS_kobject.o += -DDEBUG diff --git a/mm/Kconfig b/mm/Kconfig index e24d348083c..a7609cbcb00 100644 --- a/mm/Kconfig +++ b/mm/Kconfig @@ -137,6 +137,7 @@ config SPLIT_PTLOCK_CPUS int default "4096" if ARM && !CPU_CACHE_VIPT default "4096" if PARISC && !PA20 + default "4096" if XEN default "4" # diff --git a/mm/filemap.c b/mm/filemap.c index 90b657b50f8..15c8413ee92 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1388,6 +1388,7 @@ retry_find: size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; if (unlikely(vmf->pgoff >= size)) { unlock_page(page); + page_cache_release(page); goto outside_data_content; } diff --git a/mm/fremap.c b/mm/fremap.c index c395b1abf08..95bcb5641c7 100644 --- a/mm/fremap.c +++ b/mm/fremap.c @@ -160,7 +160,7 @@ asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size, if (vma->vm_private_data && !(vma->vm_flags & VM_NONLINEAR)) goto out; - if (!vma->vm_flags & VM_CAN_NONLINEAR) + if (!(vma->vm_flags & VM_CAN_NONLINEAR)) goto out; if (end <= start || start < vma->vm_start || end > vma->vm_end) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 84c795ee2d6..eab8c428cc9 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -42,7 +42,7 @@ static void clear_huge_page(struct page *page, unsigned long addr) might_sleep(); for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); i++) { cond_resched(); - clear_user_highpage(page + i, addr); + clear_user_highpage(page + i, addr + i * PAGE_SIZE); } } diff --git a/mm/memory.c b/mm/memory.c index ca8cac11bd2..f82b359b274 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1639,6 +1639,7 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, struct page *old_page, *new_page; pte_t entry; int reuse = 0, ret = 0; + int page_mkwrite = 0; struct page *dirty_page = NULL; old_page = vm_normal_page(vma, address, orig_pte); @@ -1687,6 +1688,8 @@ static int do_wp_page(struct mm_struct *mm, struct vm_area_struct *vma, page_cache_release(old_page); if (!pte_same(*page_table, orig_pte)) goto unlock; + + page_mkwrite = 1; } dirty_page = old_page; get_page(dirty_page); @@ -1774,7 +1777,7 @@ unlock: * do_no_page is protected similarly. */ wait_on_page_locked(dirty_page); - set_page_dirty_balance(dirty_page); + set_page_dirty_balance(dirty_page, page_mkwrite); put_page(dirty_page); } return ret; @@ -2307,13 +2310,14 @@ oom: * do not need to flush old virtual caches or the TLB. * * We enter with non-exclusive mmap_sem (to exclude vma changes, - * but allow concurrent faults), and pte mapped but not yet locked. + * but allow concurrent faults), and pte neither mapped nor locked. * We return with mmap_sem still held, but pte unmapped and unlocked. */ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, - unsigned long address, pte_t *page_table, pmd_t *pmd, + unsigned long address, pmd_t *pmd, pgoff_t pgoff, unsigned int flags, pte_t orig_pte) { + pte_t *page_table; spinlock_t *ptl; struct page *page; pte_t entry; @@ -2321,13 +2325,13 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, struct page *dirty_page = NULL; struct vm_fault vmf; int ret; + int page_mkwrite = 0; vmf.virtual_address = (void __user *)(address & PAGE_MASK); vmf.pgoff = pgoff; vmf.flags = flags; vmf.page = NULL; - pte_unmap(page_table); BUG_ON(vma->vm_flags & VM_PFNMAP); if (likely(vma->vm_ops->fault)) { @@ -2398,6 +2402,7 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma, anon = 1; /* no anon but release vmf.page */ goto out; } + page_mkwrite = 1; } } @@ -2453,7 +2458,7 @@ out_unlocked: if (anon) page_cache_release(vmf.page); else if (dirty_page) { - set_page_dirty_balance(dirty_page); + set_page_dirty_balance(dirty_page, page_mkwrite); put_page(dirty_page); } @@ -2468,8 +2473,8 @@ static int do_linear_fault(struct mm_struct *mm, struct vm_area_struct *vma, - vma->vm_start) >> PAGE_CACHE_SHIFT) + vma->vm_pgoff; unsigned int flags = (write_access ? FAULT_FLAG_WRITE : 0); - return __do_fault(mm, vma, address, page_table, pmd, pgoff, - flags, orig_pte); + pte_unmap(page_table); + return __do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte); } @@ -2552,9 +2557,7 @@ static int do_nonlinear_fault(struct mm_struct *mm, struct vm_area_struct *vma, } pgoff = pte_to_pgoff(orig_pte); - - return __do_fault(mm, vma, address, page_table, pmd, pgoff, - flags, orig_pte); + return __do_fault(mm, vma, address, pmd, pgoff, flags, orig_pte); } /* diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 63512a9ed57..44720363374 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c @@ -274,9 +274,9 @@ static void balance_dirty_pages(struct address_space *mapping) pdflush_operation(background_writeout, 0); } -void set_page_dirty_balance(struct page *page) +void set_page_dirty_balance(struct page *page, int page_mkwrite) { - if (set_page_dirty(page)) { + if (set_page_dirty(page) || page_mkwrite) { struct address_space *mapping = page_mapping(page); if (mapping) diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c index f2de2e48b02..6284c99b456 100644 --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c @@ -366,6 +366,12 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, frag = WLAN_GET_SEQ_FRAG(sc); hdrlen = ieee80211_get_hdrlen(fc); + if (skb->len < hdrlen) { + printk(KERN_INFO "%s: invalid SKB length %d\n", + dev->name, skb->len); + goto rx_dropped; + } + /* Put this code here so that we avoid duplicating it in all * Rx paths. - Jean II */ #ifdef CONFIG_WIRELESS_EXT diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index afb6c6698b2..e475f2e1be1 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c @@ -273,8 +273,6 @@ ieee80211softmac_assoc_work(struct work_struct *work) ieee80211softmac_notify(mac->dev, IEEE80211SOFTMAC_EVENT_SCAN_FINISHED, ieee80211softmac_assoc_notify_scan, NULL); if (ieee80211softmac_start_scan(mac)) { dprintk(KERN_INFO PFX "Associate: failed to initiate scan. Is device up?\n"); - mac->associnfo.associating = 0; - mac->associnfo.associated = 0; } goto out; } else { diff --git a/net/ieee80211/softmac/ieee80211softmac_wx.c b/net/ieee80211/softmac/ieee80211softmac_wx.c index d054e9224b3..5742dc803b7 100644 --- a/net/ieee80211/softmac/ieee80211softmac_wx.c +++ b/net/ieee80211/softmac/ieee80211softmac_wx.c @@ -70,44 +70,30 @@ ieee80211softmac_wx_set_essid(struct net_device *net_dev, char *extra) { struct ieee80211softmac_device *sm = ieee80211_priv(net_dev); - struct ieee80211softmac_network *n; struct ieee80211softmac_auth_queue_item *authptr; int length = 0; check_assoc_again: mutex_lock(&sm->associnfo.mutex); - /* Check if we're already associating to this or another network - * If it's another network, cancel and start over with our new network - * If it's our network, ignore the change, we're already doing it! - */ if((sm->associnfo.associating || sm->associnfo.associated) && (data->essid.flags && data->essid.length)) { - /* Get the associating network */ - n = ieee80211softmac_get_network_by_bssid(sm, sm->associnfo.bssid); - if(n && n->essid.len == data->essid.length && - !memcmp(n->essid.data, extra, n->essid.len)) { - dprintk(KERN_INFO PFX "Already associating or associated to "MAC_FMT"\n", - MAC_ARG(sm->associnfo.bssid)); - goto out; - } else { - dprintk(KERN_INFO PFX "Canceling existing associate request!\n"); - /* Cancel assoc work */ - cancel_delayed_work(&sm->associnfo.work); - /* We don't have to do this, but it's a little cleaner */ - list_for_each_entry(authptr, &sm->auth_queue, list) - cancel_delayed_work(&authptr->work); - sm->associnfo.bssvalid = 0; - sm->associnfo.bssfixed = 0; - sm->associnfo.associating = 0; - sm->associnfo.associated = 0; - /* We must unlock to avoid deadlocks with the assoc workqueue - * on the associnfo.mutex */ - mutex_unlock(&sm->associnfo.mutex); - flush_scheduled_work(); - /* Avoid race! Check assoc status again. Maybe someone started an - * association while we flushed. */ - goto check_assoc_again; - } + dprintk(KERN_INFO PFX "Canceling existing associate request!\n"); + /* Cancel assoc work */ + cancel_delayed_work(&sm->associnfo.work); + /* We don't have to do this, but it's a little cleaner */ + list_for_each_entry(authptr, &sm->auth_queue, list) + cancel_delayed_work(&authptr->work); + sm->associnfo.bssvalid = 0; + sm->associnfo.bssfixed = 0; + sm->associnfo.associating = 0; + sm->associnfo.associated = 0; + /* We must unlock to avoid deadlocks with the assoc workqueue + * on the associnfo.mutex */ + mutex_unlock(&sm->associnfo.mutex); + flush_scheduled_work(); + /* Avoid race! Check assoc status again. Maybe someone started an + * association while we flushed. */ + goto check_assoc_again; } sm->associnfo.static_essid = 0; @@ -128,7 +114,7 @@ check_assoc_again: sm->associnfo.associating = 1; /* queue lower level code to do work (if necessary) */ schedule_delayed_work(&sm->associnfo.work, 0); -out: + mutex_unlock(&sm->associnfo.mutex); return 0; @@ -153,13 +139,13 @@ ieee80211softmac_wx_get_essid(struct net_device *net_dev, data->essid.length = sm->associnfo.req_essid.len; data->essid.flags = 1; /* active */ memcpy(extra, sm->associnfo.req_essid.data, sm->associnfo.req_essid.len); - } - + dprintk(KERN_INFO PFX "Getting essid from req_essid\n"); + } else if (sm->associnfo.associated || sm->associnfo.associating) { /* If we're associating/associated, return that */ - if (sm->associnfo.associated || sm->associnfo.associating) { data->essid.length = sm->associnfo.associate_essid.len; data->essid.flags = 1; /* active */ memcpy(extra, sm->associnfo.associate_essid.data, sm->associnfo.associate_essid.len); + dprintk(KERN_INFO PFX "Getting essid from associate_essid\n"); } mutex_unlock(&sm->associnfo.mutex); diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index bbad2cdb74b..f893e90061e 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2420,6 +2420,9 @@ static int tcp_tso_acked(struct sock *sk, struct sk_buff *skb, __u32 dval = min(tp->fackets_out, packets_acked); tp->fackets_out -= dval; } + /* hint's skb might be NULL but we don't need to care */ + tp->fastpath_cnt_hint -= min_t(u32, packets_acked, + tp->fastpath_cnt_hint); tp->packets_out -= packets_acked; BUG_ON(tcp_skb_pcount(skb) == 0); diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 9c94627c8c7..e089a978e12 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -833,8 +833,7 @@ static struct tcp_md5sig_key * return NULL; for (i = 0; i < tp->md5sig_info->entries4; i++) { if (tp->md5sig_info->keys4[i].addr == addr) - return (struct tcp_md5sig_key *) - &tp->md5sig_info->keys4[i]; + return &tp->md5sig_info->keys4[i].base; } return NULL; } @@ -865,9 +864,9 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, key = (struct tcp4_md5sig_key *)tcp_v4_md5_do_lookup(sk, addr); if (key) { /* Pre-existing entry - just update that one. */ - kfree(key->key); - key->key = newkey; - key->keylen = newkeylen; + kfree(key->base.key); + key->base.key = newkey; + key->base.keylen = newkeylen; } else { struct tcp_md5sig_info *md5sig; @@ -906,9 +905,9 @@ int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, md5sig->alloced4++; } md5sig->entries4++; - md5sig->keys4[md5sig->entries4 - 1].addr = addr; - md5sig->keys4[md5sig->entries4 - 1].key = newkey; - md5sig->keys4[md5sig->entries4 - 1].keylen = newkeylen; + md5sig->keys4[md5sig->entries4 - 1].addr = addr; + md5sig->keys4[md5sig->entries4 - 1].base.key = newkey; + md5sig->keys4[md5sig->entries4 - 1].base.keylen = newkeylen; } return 0; } @@ -930,7 +929,7 @@ int tcp_v4_md5_do_del(struct sock *sk, __be32 addr) for (i = 0; i < tp->md5sig_info->entries4; i++) { if (tp->md5sig_info->keys4[i].addr == addr) { /* Free the key */ - kfree(tp->md5sig_info->keys4[i].key); + kfree(tp->md5sig_info->keys4[i].base.key); tp->md5sig_info->entries4--; if (tp->md5sig_info->entries4 == 0) { @@ -964,7 +963,7 @@ static void tcp_v4_clear_md5_list(struct sock *sk) if (tp->md5sig_info->entries4) { int i; for (i = 0; i < tp->md5sig_info->entries4; i++) - kfree(tp->md5sig_info->keys4[i].key); + kfree(tp->md5sig_info->keys4[i].base.key); tp->md5sig_info->entries4 = 0; tcp_free_md5sig_pool(); } diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c index 73a894a2152..5b596659177 100644 --- a/net/ipv6/ndisc.c +++ b/net/ipv6/ndisc.c @@ -1268,9 +1268,10 @@ static void ndisc_redirect_rcv(struct sk_buff *skb) if (ipv6_addr_equal(dest, target)) { on_link = 1; - } else if (!(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { + } else if (ipv6_addr_type(target) != + (IPV6_ADDR_UNICAST|IPV6_ADDR_LINKLOCAL)) { ND_PRINTK2(KERN_WARNING - "ICMPv6 Redirect: target address is not link-local.\n"); + "ICMPv6 Redirect: target address is not link-local unicast.\n"); return; } @@ -1344,9 +1345,9 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh, } if (!ipv6_addr_equal(&ipv6_hdr(skb)->daddr, target) && - !(ipv6_addr_type(target) & IPV6_ADDR_LINKLOCAL)) { + ipv6_addr_type(target) != (IPV6_ADDR_UNICAST|IPV6_ADDR_LINKLOCAL)) { ND_PRINTK2(KERN_WARNING - "ICMPv6 Redirect: target address is not link-local.\n"); + "ICMPv6 Redirect: target address is not link-local unicast.\n"); return; } diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 0f7defb482e..3e06799b37a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -539,7 +539,7 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk, for (i = 0; i < tp->md5sig_info->entries6; i++) { if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, addr) == 0) - return (struct tcp_md5sig_key *)&tp->md5sig_info->keys6[i]; + return &tp->md5sig_info->keys6[i].base; } return NULL; } @@ -567,9 +567,9 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer); if (key) { /* modify existing entry - just update that one */ - kfree(key->key); - key->key = newkey; - key->keylen = newkeylen; + kfree(key->base.key); + key->base.key = newkey; + key->base.keylen = newkeylen; } else { /* reallocate new list if current one is full. */ if (!tp->md5sig_info) { @@ -603,8 +603,8 @@ static int tcp_v6_md5_do_add(struct sock *sk, struct in6_addr *peer, ipv6_addr_copy(&tp->md5sig_info->keys6[tp->md5sig_info->entries6].addr, peer); - tp->md5sig_info->keys6[tp->md5sig_info->entries6].key = newkey; - tp->md5sig_info->keys6[tp->md5sig_info->entries6].keylen = newkeylen; + tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.key = newkey; + tp->md5sig_info->keys6[tp->md5sig_info->entries6].base.keylen = newkeylen; tp->md5sig_info->entries6++; } @@ -626,7 +626,7 @@ static int tcp_v6_md5_do_del(struct sock *sk, struct in6_addr *peer) for (i = 0; i < tp->md5sig_info->entries6; i++) { if (ipv6_addr_cmp(&tp->md5sig_info->keys6[i].addr, peer) == 0) { /* Free the key */ - kfree(tp->md5sig_info->keys6[i].key); + kfree(tp->md5sig_info->keys6[i].base.key); tp->md5sig_info->entries6--; if (tp->md5sig_info->entries6 == 0) { @@ -657,7 +657,7 @@ static void tcp_v6_clear_md5_list (struct sock *sk) if (tp->md5sig_info->entries6) { for (i = 0; i < tp->md5sig_info->entries6; i++) - kfree(tp->md5sig_info->keys6[i].key); + kfree(tp->md5sig_info->keys6[i].base.key); tp->md5sig_info->entries6 = 0; tcp_free_md5sig_pool(); } @@ -668,7 +668,7 @@ static void tcp_v6_clear_md5_list (struct sock *sk) if (tp->md5sig_info->entries4) { for (i = 0; i < tp->md5sig_info->entries4; i++) - kfree(tp->md5sig_info->keys4[i].key); + kfree(tp->md5sig_info->keys4[i].base.key); tp->md5sig_info->entries4 = 0; tcp_free_md5sig_pool(); } diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 7286c389a4d..ff2172ffd86 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c @@ -5259,7 +5259,7 @@ static void __exit ieee80211_exit(void) } -module_init(ieee80211_init); +subsys_initcall(ieee80211_init); module_exit(ieee80211_exit); MODULE_DESCRIPTION("IEEE 802.11 subsystem"); diff --git a/net/mac80211/rc80211_simple.c b/net/mac80211/rc80211_simple.c index f6780d63b34..17b9f46bbf2 100644 --- a/net/mac80211/rc80211_simple.c +++ b/net/mac80211/rc80211_simple.c @@ -431,7 +431,7 @@ static void __exit rate_control_simple_exit(void) } -module_init(rate_control_simple_init); +subsys_initcall(rate_control_simple_init); module_exit(rate_control_simple_exit); MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211"); diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c index 89ce8152969..7ab82b376e1 100644 --- a/net/mac80211/wme.c +++ b/net/mac80211/wme.c @@ -424,7 +424,7 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct rtattr *opt) skb_queue_head_init(&q->requeued[i]); q->queues[i] = qdisc_create_dflt(qd->dev, &pfifo_qdisc_ops, qd->handle); - if (q->queues[i] == 0) { + if (!q->queues[i]) { q->queues[i] = &noop_qdisc; printk(KERN_ERR "%s child qdisc %i creation failed", dev->name, i); } diff --git a/net/rose/rose_loopback.c b/net/rose/rose_loopback.c index cd01642f049..114df6eec8c 100644 --- a/net/rose/rose_loopback.c +++ b/net/rose/rose_loopback.c @@ -79,7 +79,7 @@ static void rose_loopback_timer(unsigned long param) skb_reset_transport_header(skb); - sk = rose_find_socket(lci_o, &rose_loopback_neigh); + sk = rose_find_socket(lci_o, rose_loopback_neigh); if (sk) { if (rose_process_rx_frame(sk, skb) == 0) kfree_skb(skb); @@ -88,7 +88,7 @@ static void rose_loopback_timer(unsigned long param) if (frametype == ROSE_CALL_REQUEST) { if ((dev = rose_dev_get(dest)) != NULL) { - if (rose_rx_call_request(skb, dev, &rose_loopback_neigh, lci_o) == 0) + if (rose_rx_call_request(skb, dev, rose_loopback_neigh, lci_o) == 0) kfree_skb(skb); } else { kfree_skb(skb); diff --git a/net/rose/rose_route.c b/net/rose/rose_route.c index bbcbad1da0d..96f61a71b25 100644 --- a/net/rose/rose_route.c +++ b/net/rose/rose_route.c @@ -45,7 +45,7 @@ static DEFINE_SPINLOCK(rose_neigh_list_lock); static struct rose_route *rose_route_list; static DEFINE_SPINLOCK(rose_route_list_lock); -struct rose_neigh rose_loopback_neigh; +struct rose_neigh *rose_loopback_neigh; /* * Add a new route to a node, and in the process add the node and the @@ -362,7 +362,12 @@ out: */ void rose_add_loopback_neigh(void) { - struct rose_neigh *sn = &rose_loopback_neigh; + struct rose_neigh *sn; + + rose_loopback_neigh = kmalloc(sizeof(struct rose_neigh), GFP_KERNEL); + if (!rose_loopback_neigh) + return; + sn = rose_loopback_neigh; sn->callsign = null_ax25_address; sn->digipeat = NULL; @@ -417,13 +422,13 @@ int rose_add_loopback_node(rose_address *address) rose_node->mask = 10; rose_node->count = 1; rose_node->loopback = 1; - rose_node->neighbour[0] = &rose_loopback_neigh; + rose_node->neighbour[0] = rose_loopback_neigh; /* Insert at the head of list. Address is always mask=10 */ rose_node->next = rose_node_list; rose_node_list = rose_node; - rose_loopback_neigh.count++; + rose_loopback_neigh->count++; out: spin_unlock_bh(&rose_node_list_lock); @@ -454,7 +459,7 @@ void rose_del_loopback_node(rose_address *address) rose_remove_node(rose_node); - rose_loopback_neigh.count--; + rose_loopback_neigh->count--; out: spin_unlock_bh(&rose_node_list_lock); diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index 8dbe36912ec..d4d5d2f271d 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c @@ -502,7 +502,7 @@ static int u32_set_parms(struct tcf_proto *tp, unsigned long base, #ifdef CONFIG_NET_CLS_IND if (tb[TCA_U32_INDEV-1]) { - int err = tcf_change_indev(tp, n->indev, tb[TCA_U32_INDEV-1]); + err = tcf_change_indev(tp, n->indev, tb[TCA_U32_INDEV-1]); if (err < 0) goto errout; } diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 3a23e30bc79..b542c875e15 100644 --- a/net/sched/sch_sfq.c +++ b/net/sched/sch_sfq.c @@ -19,6 +19,7 @@ #include <linux/init.h> #include <linux/ipv6.h> #include <linux/skbuff.h> +#include <linux/jhash.h> #include <net/ip.h> #include <net/netlink.h> #include <net/pkt_sched.h> @@ -95,7 +96,7 @@ struct sfq_sched_data /* Variables */ struct timer_list perturb_timer; - int perturbation; + u32 perturbation; sfq_index tail; /* Index of current slot in round */ sfq_index max_depth; /* Maximal depth */ @@ -109,12 +110,7 @@ struct sfq_sched_data static __inline__ unsigned sfq_fold_hash(struct sfq_sched_data *q, u32 h, u32 h1) { - int pert = q->perturbation; - - /* Have we any rotation primitives? If not, WHY? */ - h ^= (h1<<pert) ^ (h1>>(0x1F - pert)); - h ^= h>>10; - return h & 0x3FF; + return jhash_2words(h, h1, q->perturbation) & (SFQ_HASH_DIVISOR - 1); } static unsigned sfq_hash(struct sfq_sched_data *q, struct sk_buff *skb) @@ -256,6 +252,13 @@ sfq_enqueue(struct sk_buff *skb, struct Qdisc* sch) q->ht[hash] = x = q->dep[SFQ_DEPTH].next; q->hash[x] = hash; } + /* If selected queue has length q->limit, this means that + * all another queues are empty and that we do simple tail drop, + * i.e. drop _this_ packet. + */ + if (q->qs[x].qlen >= q->limit) + return qdisc_drop(skb, sch); + sch->qstats.backlog += skb->len; __skb_queue_tail(&q->qs[x], skb); sfq_inc(q, x); @@ -294,6 +297,19 @@ sfq_requeue(struct sk_buff *skb, struct Qdisc* sch) } sch->qstats.backlog += skb->len; __skb_queue_head(&q->qs[x], skb); + /* If selected queue has length q->limit+1, this means that + * all another queues are empty and we do simple tail drop. + * This packet is still requeued at head of queue, tail packet + * is dropped. + */ + if (q->qs[x].qlen > q->limit) { + skb = q->qs[x].prev; + __skb_unlink(skb, &q->qs[x]); + sch->qstats.drops++; + sch->qstats.backlog -= skb->len; + kfree_skb(skb); + return NET_XMIT_CN; + } sfq_inc(q, x); if (q->qs[x].qlen == 1) { /* The flow is new */ if (q->tail == SFQ_DEPTH) { /* It is the first flow */ @@ -370,12 +386,10 @@ static void sfq_perturbation(unsigned long arg) struct Qdisc *sch = (struct Qdisc*)arg; struct sfq_sched_data *q = qdisc_priv(sch); - q->perturbation = net_random()&0x1F; + get_random_bytes(&q->perturbation, 4); - if (q->perturb_period) { - q->perturb_timer.expires = jiffies + q->perturb_period; - add_timer(&q->perturb_timer); - } + if (q->perturb_period) + mod_timer(&q->perturb_timer, jiffies + q->perturb_period); } static int sfq_change(struct Qdisc *sch, struct rtattr *opt) @@ -391,7 +405,7 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) q->quantum = ctl->quantum ? : psched_mtu(sch->dev); q->perturb_period = ctl->perturb_period*HZ; if (ctl->limit) - q->limit = min_t(u32, ctl->limit, SFQ_DEPTH - 2); + q->limit = min_t(u32, ctl->limit, SFQ_DEPTH - 1); qlen = sch->q.qlen; while (sch->q.qlen > q->limit) @@ -400,8 +414,8 @@ static int sfq_change(struct Qdisc *sch, struct rtattr *opt) del_timer(&q->perturb_timer); if (q->perturb_period) { - q->perturb_timer.expires = jiffies + q->perturb_period; - add_timer(&q->perturb_timer); + mod_timer(&q->perturb_timer, jiffies + q->perturb_period); + get_random_bytes(&q->perturbation, 4); } sch_tree_unlock(sch); return 0; @@ -423,12 +437,13 @@ static int sfq_init(struct Qdisc *sch, struct rtattr *opt) q->dep[i+SFQ_DEPTH].next = i+SFQ_DEPTH; q->dep[i+SFQ_DEPTH].prev = i+SFQ_DEPTH; } - q->limit = SFQ_DEPTH - 2; + q->limit = SFQ_DEPTH - 1; q->max_depth = 0; q->tail = SFQ_DEPTH; if (opt == NULL) { q->quantum = psched_mtu(sch->dev); q->perturb_period = 0; + get_random_bytes(&q->perturbation, 4); } else { int err = sfq_change(sch, opt); if (err) diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c index d35cbf5aae3..dfffa94fb9f 100644 --- a/net/sctp/bind_addr.c +++ b/net/sctp/bind_addr.c @@ -181,7 +181,7 @@ int sctp_add_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *new, * structure. */ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr, - void (*rcu_call)(struct rcu_head *head, + void fastcall (*rcu_call)(struct rcu_head *head, void (*func)(struct rcu_head *head))) { struct sctp_sockaddr_entry *addr, *temp; diff --git a/net/sctp/input.c b/net/sctp/input.c index 47e56017f4c..f9a0c9276e3 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c @@ -622,6 +622,14 @@ static int sctp_rcv_ootb(struct sk_buff *skb) if (SCTP_CID_SHUTDOWN_COMPLETE == ch->type) goto discard; + /* RFC 4460, 2.11.2 + * This will discard packets with INIT chunk bundled as + * subsequent chunks in the packet. When INIT is first, + * the normal INIT processing will discard the chunk. + */ + if (SCTP_CID_INIT == ch->type && (void *)ch != skb->data) + goto discard; + /* RFC 8.4, 7) If the packet contains a "Stale cookie" ERROR * or a COOKIE ACK the SCTP Packet should be silently * discarded. diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c index 88aa2240754..e4ea7fdf36e 100644 --- a/net/sctp/inqueue.c +++ b/net/sctp/inqueue.c @@ -130,6 +130,14 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue) /* Force chunk->skb->data to chunk->chunk_end. */ skb_pull(chunk->skb, chunk->chunk_end - chunk->skb->data); + + /* Verify that we have at least chunk headers + * worth of buffer left. + */ + if (skb_headlen(chunk->skb) < sizeof(sctp_chunkhdr_t)) { + sctp_chunk_free(chunk); + chunk = queue->in_progress = NULL; + } } } diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 2e34220d94c..23ae37ec871 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -2499,6 +2499,52 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc, return SCTP_ERROR_NO_ERROR; } +/* Verify the ASCONF packet before we process it. */ +int sctp_verify_asconf(const struct sctp_association *asoc, + struct sctp_paramhdr *param_hdr, void *chunk_end, + struct sctp_paramhdr **errp) { + sctp_addip_param_t *asconf_param; + union sctp_params param; + int length, plen; + + param.v = (sctp_paramhdr_t *) param_hdr; + while (param.v <= chunk_end - sizeof(sctp_paramhdr_t)) { + length = ntohs(param.p->length); + *errp = param.p; + + if (param.v > chunk_end - length || + length < sizeof(sctp_paramhdr_t)) + return 0; + + switch (param.p->type) { + case SCTP_PARAM_ADD_IP: + case SCTP_PARAM_DEL_IP: + case SCTP_PARAM_SET_PRIMARY: + asconf_param = (sctp_addip_param_t *)param.v; + plen = ntohs(asconf_param->param_hdr.length); + if (plen < sizeof(sctp_addip_param_t) + + sizeof(sctp_paramhdr_t)) + return 0; + break; + case SCTP_PARAM_SUCCESS_REPORT: + case SCTP_PARAM_ADAPTATION_LAYER_IND: + if (length != sizeof(sctp_addip_param_t)) + return 0; + + break; + default: + break; + } + + param.v += WORD_ROUND(length); + } + + if (param.v != chunk_end) + return 0; + + return 1; +} + /* Process an incoming ASCONF chunk with the next expected serial no. and * return an ASCONF_ACK chunk to be sent in response. */ diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 177528ed3e1..a583d67cab6 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -90,6 +90,11 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, const sctp_subtype_t type, void *arg, sctp_cmd_seq_t *commands); +static sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const sctp_subtype_t type, + void *arg, + sctp_cmd_seq_t *commands); static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, @@ -98,6 +103,7 @@ static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, struct sctp_transport *transport); static sctp_disposition_t sctp_sf_abort_violation( + const struct sctp_endpoint *ep, const struct sctp_association *asoc, void *arg, sctp_cmd_seq_t *commands, @@ -111,6 +117,13 @@ static sctp_disposition_t sctp_sf_violation_chunklen( void *arg, sctp_cmd_seq_t *commands); +static sctp_disposition_t sctp_sf_violation_paramlen( + const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const sctp_subtype_t type, + void *arg, + sctp_cmd_seq_t *commands); + static sctp_disposition_t sctp_sf_violation_ctsn( const struct sctp_endpoint *ep, const struct sctp_association *asoc, @@ -118,6 +131,13 @@ static sctp_disposition_t sctp_sf_violation_ctsn( void *arg, sctp_cmd_seq_t *commands); +static sctp_disposition_t sctp_sf_violation_chunk( + const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const sctp_subtype_t type, + void *arg, + sctp_cmd_seq_t *commands); + /* Small helper function that checks if the chunk length * is of the appropriate length. The 'required_length' argument * is set to be the size of a specific chunk we are testing. @@ -181,16 +201,21 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep, struct sctp_chunk *chunk = arg; struct sctp_ulpevent *ev; + if (!sctp_vtag_verify_either(chunk, asoc)) + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* RFC 2960 6.10 Bundling * * An endpoint MUST NOT bundle INIT, INIT ACK or * SHUTDOWN COMPLETE with any other chunks. */ if (!chunk->singleton) - return SCTP_DISPOSITION_VIOLATION; + return sctp_sf_violation_chunk(ep, asoc, type, arg, commands); - if (!sctp_vtag_verify_either(chunk, asoc)) - return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* Make sure that the SHUTDOWN_COMPLETE chunk has a valid length. */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); /* RFC 2960 10.2 SCTP-to-ULP * @@ -450,17 +475,17 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, if (!sctp_vtag_verify(chunk, asoc)) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); - /* Make sure that the INIT-ACK chunk has a valid length */ - if (!sctp_chunk_length_valid(chunk, sizeof(sctp_initack_chunk_t))) - return sctp_sf_violation_chunklen(ep, asoc, type, arg, - commands); /* 6.10 Bundling * An endpoint MUST NOT bundle INIT, INIT ACK or * SHUTDOWN COMPLETE with any other chunks. */ if (!chunk->singleton) - return SCTP_DISPOSITION_VIOLATION; + return sctp_sf_violation_chunk(ep, asoc, type, arg, commands); + /* Make sure that the INIT-ACK chunk has a valid length */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_initack_chunk_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); /* Grab the INIT header. */ chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; @@ -585,7 +610,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep, * control endpoint, respond with an ABORT. */ if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) - return sctp_sf_ootb(ep, asoc, type, arg, commands); + return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); /* Make sure that the COOKIE_ECHO chunk has a valid length. * In this case, we check that we have enough for at least a @@ -2496,6 +2521,11 @@ sctp_disposition_t sctp_sf_do_9_2_reshutack(const struct sctp_endpoint *ep, struct sctp_chunk *chunk = (struct sctp_chunk *) arg; struct sctp_chunk *reply; + /* Make sure that the chunk has a valid length */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + /* Since we are not going to really process this INIT, there * is no point in verifying chunk boundries. Just generate * the SHUTDOWN ACK. @@ -2929,7 +2959,7 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(const struct sctp_endpoint *ep, * * The return value is the disposition of the chunk. */ -sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, +static sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, const struct sctp_association *asoc, const sctp_subtype_t type, void *arg, @@ -2965,6 +2995,7 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep, SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); + sctp_sf_pdiscard(ep, asoc, type, arg, commands); return SCTP_DISPOSITION_CONSUME; } @@ -3125,14 +3156,14 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, ch = (sctp_chunkhdr_t *) chunk->chunk_hdr; do { - /* Break out if chunk length is less then minimal. */ + /* Report violation if the chunk is less then minimal */ if (ntohs(ch->length) < sizeof(sctp_chunkhdr_t)) - break; - - ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); - if (ch_end > skb_tail_pointer(skb)) - break; + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + /* Now that we know we at least have a chunk header, + * do things that are type appropriate. + */ if (SCTP_CID_SHUTDOWN_ACK == ch->type) ootb_shut_ack = 1; @@ -3144,15 +3175,19 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep, if (SCTP_CID_ABORT == ch->type) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + /* Report violation if chunk len overflows */ + ch_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); + if (ch_end > skb_tail_pointer(skb)) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + ch = (sctp_chunkhdr_t *) ch_end; } while (ch_end < skb_tail_pointer(skb)); if (ootb_shut_ack) - sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands); + return sctp_sf_shut_8_4_5(ep, asoc, type, arg, commands); else - sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); - - return sctp_sf_pdiscard(ep, asoc, type, arg, commands); + return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); } /* @@ -3218,7 +3253,11 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) return sctp_sf_pdiscard(ep, asoc, type, arg, commands); - return SCTP_DISPOSITION_CONSUME; + /* We need to discard the rest of the packet to prevent + * potential bomming attacks from additional bundled chunks. + * This is documented in SCTP Threats ID. + */ + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); } return SCTP_DISPOSITION_NOMEM; @@ -3241,6 +3280,13 @@ sctp_disposition_t sctp_sf_do_8_5_1_E_sa(const struct sctp_endpoint *ep, void *arg, sctp_cmd_seq_t *commands) { + struct sctp_chunk *chunk = arg; + + /* Make sure that the SHUTDOWN_ACK chunk has a valid length. */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + /* Although we do have an association in this case, it corresponds * to a restarted association. So the packet is treated as an OOTB * packet and the state function that handles OOTB SHUTDOWN_ACK is @@ -3257,8 +3303,11 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep, { struct sctp_chunk *chunk = arg; struct sctp_chunk *asconf_ack = NULL; + struct sctp_paramhdr *err_param = NULL; sctp_addiphdr_t *hdr; + union sctp_addr_param *addr_param; __u32 serial; + int length; if (!sctp_vtag_verify(chunk, asoc)) { sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, @@ -3274,6 +3323,20 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep, hdr = (sctp_addiphdr_t *)chunk->skb->data; serial = ntohl(hdr->serial); + addr_param = (union sctp_addr_param *)hdr->params; + length = ntohs(addr_param->p.length); + if (length < sizeof(sctp_paramhdr_t)) + return sctp_sf_violation_paramlen(ep, asoc, type, + (void *)addr_param, commands); + + /* Verify the ASCONF chunk before processing it. */ + if (!sctp_verify_asconf(asoc, + (sctp_paramhdr_t *)((void *)addr_param + length), + (void *)chunk->chunk_end, + &err_param)) + return sctp_sf_violation_paramlen(ep, asoc, type, + (void *)&err_param, commands); + /* ADDIP 4.2 C1) Compare the value of the serial number to the value * the endpoint stored in a new association variable * 'Peer-Serial-Number'. @@ -3328,6 +3391,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, struct sctp_chunk *asconf_ack = arg; struct sctp_chunk *last_asconf = asoc->addip_last_asconf; struct sctp_chunk *abort; + struct sctp_paramhdr *err_param = NULL; sctp_addiphdr_t *addip_hdr; __u32 sent_serial, rcvd_serial; @@ -3345,6 +3409,14 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, addip_hdr = (sctp_addiphdr_t *)asconf_ack->skb->data; rcvd_serial = ntohl(addip_hdr->serial); + /* Verify the ASCONF-ACK chunk before processing it. */ + if (!sctp_verify_asconf(asoc, + (sctp_paramhdr_t *)addip_hdr->params, + (void *)asconf_ack->chunk_end, + &err_param)) + return sctp_sf_violation_paramlen(ep, asoc, type, + (void *)&err_param, commands); + if (last_asconf) { addip_hdr = (sctp_addiphdr_t *)last_asconf->subh.addip_hdr; sent_serial = ntohl(addip_hdr->serial); @@ -3655,6 +3727,16 @@ sctp_disposition_t sctp_sf_discard_chunk(const struct sctp_endpoint *ep, void *arg, sctp_cmd_seq_t *commands) { + struct sctp_chunk *chunk = arg; + + /* Make sure that the chunk has a valid length. + * Since we don't know the chunk type, we use a general + * chunkhdr structure to make a comparison. + */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + SCTP_DEBUG_PRINTK("Chunk %d is discarded\n", type.chunk); return SCTP_DISPOSITION_DISCARD; } @@ -3710,6 +3792,13 @@ sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep, void *arg, sctp_cmd_seq_t *commands) { + struct sctp_chunk *chunk = arg; + + /* Make sure that the chunk has a valid length. */ + if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) + return sctp_sf_violation_chunklen(ep, asoc, type, arg, + commands); + return SCTP_DISPOSITION_VIOLATION; } @@ -3717,12 +3806,14 @@ sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep, * Common function to handle a protocol violation. */ static sctp_disposition_t sctp_sf_abort_violation( + const struct sctp_endpoint *ep, const struct sctp_association *asoc, void *arg, sctp_cmd_seq_t *commands, const __u8 *payload, const size_t paylen) { + struct sctp_packet *packet = NULL; struct sctp_chunk *chunk = arg; struct sctp_chunk *abort = NULL; @@ -3731,30 +3822,51 @@ static sctp_disposition_t sctp_sf_abort_violation( if (!abort) goto nomem; - sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); - SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); + if (asoc) { + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(abort)); + SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); - if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { - sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, - SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); - sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, - SCTP_ERROR(ECONNREFUSED)); - sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, - SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); + if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { + sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, + SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); + sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, + SCTP_ERROR(ECONNREFUSED)); + sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, + SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); + } else { + sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, + SCTP_ERROR(ECONNABORTED)); + sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, + SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); + SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); + } } else { - sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, - SCTP_ERROR(ECONNABORTED)); - sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, - SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); - SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); + packet = sctp_ootb_pkt_new(asoc, chunk); + + if (!packet) + goto nomem_pkt; + + if (sctp_test_T_bit(abort)) + packet->vtag = ntohl(chunk->sctp_hdr->vtag); + + abort->skb->sk = ep->base.sk; + + sctp_packet_append_chunk(packet, abort); + + sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, + SCTP_PACKET(packet)); + + SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); } - sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL()); + sctp_sf_pdiscard(ep, asoc, SCTP_ST_CHUNK(0), arg, commands); SCTP_INC_STATS(SCTP_MIB_ABORTEDS); return SCTP_DISPOSITION_ABORT; +nomem_pkt: + sctp_chunk_free(abort); nomem: return SCTP_DISPOSITION_NOMEM; } @@ -3787,7 +3899,24 @@ static sctp_disposition_t sctp_sf_violation_chunklen( { char err_str[]="The following chunk had invalid length:"; - return sctp_sf_abort_violation(asoc, arg, commands, err_str, + return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, + sizeof(err_str)); +} + +/* + * Handle a protocol violation when the parameter length is invalid. + * "Invalid" length is identified as smaller then the minimal length a + * given parameter can be. + */ +static sctp_disposition_t sctp_sf_violation_paramlen( + const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const sctp_subtype_t type, + void *arg, + sctp_cmd_seq_t *commands) { + char err_str[] = "The following parameter had invalid length:"; + + return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, sizeof(err_str)); } @@ -3806,10 +3935,31 @@ static sctp_disposition_t sctp_sf_violation_ctsn( { char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; - return sctp_sf_abort_violation(asoc, arg, commands, err_str, + return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, sizeof(err_str)); } +/* Handle protocol violation of an invalid chunk bundling. For example, + * when we have an association and we recieve bundled INIT-ACK, or + * SHUDOWN-COMPLETE, our peer is clearly violationg the "MUST NOT bundle" + * statement from the specs. Additinally, there might be an attacker + * on the path and we may not want to continue this communication. + */ +static sctp_disposition_t sctp_sf_violation_chunk( + const struct sctp_endpoint *ep, + const struct sctp_association *asoc, + const sctp_subtype_t type, + void *arg, + sctp_cmd_seq_t *commands) +{ + char err_str[]="The following chunk violates protocol:"; + + if (!asoc) + return sctp_sf_violation(ep, asoc, type, arg, commands); + + return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, + sizeof(err_str)); +} /*************************************************************************** * These are the state functions for handling primitive (Section 10) events. ***************************************************************************/ @@ -5176,7 +5326,22 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc * association exists, otherwise, use the peer's vtag. */ if (asoc) { - vtag = asoc->peer.i.init_tag; + /* Special case the INIT-ACK as there is no peer's vtag + * yet. + */ + switch(chunk->chunk_hdr->type) { + case SCTP_CID_INIT_ACK: + { + sctp_initack_chunk_t *initack; + + initack = (sctp_initack_chunk_t *)chunk->chunk_hdr; + vtag = ntohl(initack->init_hdr.init_tag); + break; + } + default: + vtag = asoc->peer.i.init_tag; + break; + } } else { /* Special case the INIT and stale COOKIE_ECHO as there is no * vtag yet. diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c index 70a91ece3c4..ddb0ba3974b 100644 --- a/net/sctp/sm_statetable.c +++ b/net/sctp/sm_statetable.c @@ -110,7 +110,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -173,7 +173,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -194,7 +194,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -216,7 +216,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_violation), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -258,7 +258,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -300,7 +300,7 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t event_type, /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -499,7 +499,7 @@ static const sctp_sm_table_entry_t addip_chunk_event_table[SCTP_NUM_ADDIP_CHUNK_ /* SCTP_STATE_EMPTY */ \ TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_CLOSED */ \ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \ + TYPE_SCTP_FUNC(sctp_sf_ootb), \ /* SCTP_STATE_COOKIE_WAIT */ \ TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ /* SCTP_STATE_COOKIE_ECHOED */ \ @@ -528,7 +528,7 @@ chunk_event_table_unknown[SCTP_STATE_NUM_STATES] = { /* SCTP_STATE_EMPTY */ TYPE_SCTP_FUNC(sctp_sf_ootb), /* SCTP_STATE_CLOSED */ - TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), + TYPE_SCTP_FUNC(sctp_sf_ootb), /* SCTP_STATE_COOKIE_WAIT */ TYPE_SCTP_FUNC(sctp_sf_unk_chunk), /* SCTP_STATE_COOKIE_ECHOED */ diff --git a/net/socket.c b/net/socket.c index 7d44453dfae..b09eb9036a1 100644 --- a/net/socket.c +++ b/net/socket.c @@ -777,9 +777,6 @@ static ssize_t sock_aio_write(struct kiocb *iocb, const struct iovec *iov, if (pos != 0) return -ESPIPE; - if (iocb->ki_left == 0) /* Match SYS5 behaviour */ - return 0; - x = alloc_sock_iocb(iocb, &siocb); if (!x) return -ENOMEM; diff --git a/net/wireless/core.c b/net/wireless/core.c index 7eabd55417a..9771451eae2 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -213,7 +213,7 @@ out_fail_notifier: out_fail_sysfs: return err; } -module_init(cfg80211_init); +subsys_initcall(cfg80211_init); static void cfg80211_exit(void) { diff --git a/net/wireless/sysfs.c b/net/wireless/sysfs.c index 88aaacd9f82..2d5d2255a27 100644 --- a/net/wireless/sysfs.c +++ b/net/wireless/sysfs.c @@ -52,12 +52,14 @@ static void wiphy_dev_release(struct device *dev) cfg80211_dev_free(rdev); } +#ifdef CONFIG_HOTPLUG static int wiphy_uevent(struct device *dev, char **envp, int num_envp, char *buf, int size) { /* TODO, we probably need stuff here */ return 0; } +#endif struct class ieee80211_class = { .name = "ieee80211", diff --git a/scripts/checksyscalls.sh b/scripts/checksyscalls.sh index 0dcc01ce45a..366f8c7f62b 100755 --- a/scripts/checksyscalls.sh +++ b/scripts/checksyscalls.sh @@ -119,5 +119,5 @@ sed -n -e '/^\#define/ { s/[^_]*__NR_\([^[:space:]]*\).*/\ \#endif/p }' $1 } -(ignore_list && syscall_list ${srctree}/include/asm-i386/unistd.h) | \ +(ignore_list && syscall_list ${srctree}/include/asm-x86/unistd_32.h) | \ $* -E -x c - > /dev/null diff --git a/scripts/namespace.pl b/scripts/namespace.pl index f34373853ef..c6e88c652c2 100755 --- a/scripts/namespace.pl +++ b/scripts/namespace.pl @@ -105,7 +105,7 @@ sub linux_objects if (/.*\.o$/ && ! ( m:/built-in.o$: - || m:arch/i386/kernel/vsyscall-syms.o$: + || m:arch/x86/kernel/vsyscall-syms.o$: || m:arch/ia64/ia32/ia32.o$: || m:arch/ia64/kernel/gate-syms.o$: || m:arch/ia64/lib/__divdi3.o$: @@ -328,9 +328,9 @@ sub list_multiply_defined } # Special case for i386 entry code if ($#{$def{$name}} == 1 && $name =~ /^__kernel_/ && - $def{$name}[0] eq "arch/i386/kernel/vsyscall-int80.o" && - $def{$name}[1] eq "arch/i386/kernel/vsyscall-sysenter.o") { - &drop_def("arch/i386/kernel/vsyscall-sysenter.o", $name); + $def{$name}[0] eq "arch/x86/kernel/vsyscall-int80_32.o" && + $def{$name}[1] eq "arch/x86/kernel/vsyscall-sysenter_32.o") { + &drop_def("arch/x86/kernel/vsyscall-sysenter_32.o", $name); next; } printf "$name is multiply defined in :-\n"; diff --git a/sound/core/memalloc.c b/sound/core/memalloc.c index f057430db0d..9b5656d8bcc 100644 --- a/sound/core/memalloc.c +++ b/sound/core/memalloc.c @@ -27,6 +27,7 @@ #include <linux/pci.h> #include <linux/slab.h> #include <linux/mm.h> +#include <linux/seq_file.h> #include <asm/uaccess.h> #include <linux/dma-mapping.h> #include <linux/moduleparam.h> @@ -481,53 +482,54 @@ static void free_all_reserved_pages(void) #define SND_MEM_PROC_FILE "driver/snd-page-alloc" static struct proc_dir_entry *snd_mem_proc; -static int snd_mem_proc_read(char *page, char **start, off_t off, - int count, int *eof, void *data) +static int snd_mem_proc_read(struct seq_file *seq, void *offset) { - int len = 0; long pages = snd_allocated_pages >> (PAGE_SHIFT-12); struct snd_mem_list *mem; int devno; static char *types[] = { "UNKNOWN", "CONT", "DEV", "DEV-SG", "SBUS" }; mutex_lock(&list_mutex); - len += snprintf(page + len, count - len, - "pages : %li bytes (%li pages per %likB)\n", - pages * PAGE_SIZE, pages, PAGE_SIZE / 1024); + seq_printf(seq, "pages : %li bytes (%li pages per %likB)\n", + pages * PAGE_SIZE, pages, PAGE_SIZE / 1024); devno = 0; list_for_each_entry(mem, &mem_list_head, list) { devno++; - len += snprintf(page + len, count - len, - "buffer %d : ID %08x : type %s\n", - devno, mem->id, types[mem->buffer.dev.type]); - len += snprintf(page + len, count - len, - " addr = 0x%lx, size = %d bytes\n", - (unsigned long)mem->buffer.addr, (int)mem->buffer.bytes); + seq_printf(seq, "buffer %d : ID %08x : type %s\n", + devno, mem->id, types[mem->buffer.dev.type]); + seq_printf(seq, " addr = 0x%lx, size = %d bytes\n", + (unsigned long)mem->buffer.addr, + (int)mem->buffer.bytes); } mutex_unlock(&list_mutex); - return len; + return 0; +} + +static int snd_mem_proc_open(struct inode *inode, struct file *file) +{ + return single_open(file, snd_mem_proc_read, NULL); } /* FIXME: for pci only - other bus? */ #ifdef CONFIG_PCI #define gettoken(bufp) strsep(bufp, " \t\n") -static int snd_mem_proc_write(struct file *file, const char __user *buffer, - unsigned long count, void *data) +static ssize_t snd_mem_proc_write(struct file *file, const char __user * buffer, + size_t count, loff_t * ppos) { char buf[128]; char *token, *p; - if (count > ARRAY_SIZE(buf) - 1) - count = ARRAY_SIZE(buf) - 1; + if (count > sizeof(buf) - 1) + return -EINVAL; if (copy_from_user(buf, buffer, count)) return -EFAULT; - buf[ARRAY_SIZE(buf) - 1] = '\0'; + buf[count] = '\0'; p = buf; token = gettoken(&p); if (! token || *token == '#') - return (int)count; + return count; if (strcmp(token, "add") == 0) { char *endp; int vendor, device, size, buffers; @@ -548,7 +550,7 @@ static int snd_mem_proc_write(struct file *file, const char __user *buffer, (buffers = simple_strtol(token, NULL, 0)) <= 0 || buffers > 4) { printk(KERN_ERR "snd-page-alloc: invalid proc write format\n"); - return (int)count; + return count; } vendor &= 0xffff; device &= 0xffff; @@ -560,7 +562,7 @@ static int snd_mem_proc_write(struct file *file, const char __user *buffer, if (pci_set_dma_mask(pci, mask) < 0 || pci_set_consistent_dma_mask(pci, mask) < 0) { printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", mask, vendor, device); - return (int)count; + return count; } } for (i = 0; i < buffers; i++) { @@ -570,7 +572,7 @@ static int snd_mem_proc_write(struct file *file, const char __user *buffer, size, &dmab) < 0) { printk(KERN_ERR "snd-page-alloc: cannot allocate buffer pages (size = %d)\n", size); pci_dev_put(pci); - return (int)count; + return count; } snd_dma_reserve_buf(&dmab, snd_dma_pci_buf_id(pci)); } @@ -596,9 +598,21 @@ static int snd_mem_proc_write(struct file *file, const char __user *buffer, free_all_reserved_pages(); else printk(KERN_ERR "snd-page-alloc: invalid proc cmd\n"); - return (int)count; + return count; } #endif /* CONFIG_PCI */ + +static const struct file_operations snd_mem_proc_fops = { + .owner = THIS_MODULE, + .open = snd_mem_proc_open, + .read = seq_read, +#ifdef CONFIG_PCI + .write = snd_mem_proc_write, +#endif + .llseek = seq_lseek, + .release = single_release, +}; + #endif /* CONFIG_PROC_FS */ /* @@ -609,12 +623,8 @@ static int __init snd_mem_init(void) { #ifdef CONFIG_PROC_FS snd_mem_proc = create_proc_entry(SND_MEM_PROC_FILE, 0644, NULL); - if (snd_mem_proc) { - snd_mem_proc->read_proc = snd_mem_proc_read; -#ifdef CONFIG_PCI - snd_mem_proc->write_proc = snd_mem_proc_write; -#endif - } + if (snd_mem_proc) + snd_mem_proc->proc_fops = &snd_mem_proc_fops; #endif return 0; } |