From 78d2889797acfa67dfe287fff6ea12d95606e681 Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Thu, 4 Sep 2008 21:02:44 +0200 Subject: [PATCH] --- yaml --- r: 112767 b: refs/heads/master c: 268364a0f48aee2f851f9d1ef8a6cda0f3039ef1 h: refs/heads/master i: 112765: a2c9f1dd65195788c6634750d18b2f35769f89ff 112763: 4de3fb0e745bf66ba053732e5dcfd9682303e479 112759: 00c34a54d90d1138124e6aa6ab001695b5b93906 112751: 2e9593847ea82c49e512398c0055d7b36457963b 112735: 611425d8edf06db7a068f57e918a625984573b4a 112703: 27f372c310f45ba90a548850864eabd3c9e3d96b 112639: 6447e5ac2a59007a7babd51b1271b0a4927ecb29 v: v3 --- [refs] | 2 +- trunk/Documentation/kernel-parameters.txt | 6 - trunk/arch/powerpc/Makefile | 5 + .../arch/powerpc/include/asm/pgtable-ppc64.h | 6 +- trunk/arch/powerpc/kernel/Makefile | 7 +- trunk/arch/powerpc/kernel/align.c | 2 +- trunk/arch/powerpc/kernel/idle_6xx.S | 2 +- trunk/arch/powerpc/kernel/idle_e500.S | 3 +- trunk/arch/powerpc/kernel/vmlinux.lds.S | 7 +- trunk/arch/powerpc/mm/hash_utils_64.c | 18 +- .../arch/powerpc/platforms/powermac/Makefile | 2 +- trunk/arch/um/sys-x86_64/syscall_table.c | 4 +- trunk/arch/x86/Kconfig | 8 - trunk/arch/x86/Kconfig.cpu | 70 -- trunk/arch/x86/boot/compressed/misc.c | 2 +- trunk/arch/x86/boot/cpucheck.c | 8 +- trunk/arch/x86/boot/mkcpustr.c | 2 +- trunk/arch/x86/kernel/Makefile | 3 - trunk/arch/x86/kernel/acpi/boot.c | 4 +- trunk/arch/x86/kernel/alternative.c | 36 +- trunk/arch/x86/kernel/apic_32.c | 105 +-- trunk/arch/x86/kernel/apic_64.c | 251 +------ trunk/arch/x86/kernel/asm-offsets_64.c | 2 +- trunk/arch/x86/kernel/cpu/Makefile | 32 +- trunk/arch/x86/kernel/cpu/cmpxchg.c | 72 -- trunk/arch/x86/kernel/cpu/common.c | 32 +- trunk/arch/x86/kernel/cpu/common_64.c | 76 +-- trunk/arch/x86/kernel/cpu/cyrix.c | 16 +- trunk/arch/x86/kernel/cpu/feature_names.c | 83 +++ trunk/arch/x86/kernel/cpu/intel.c | 71 ++ trunk/arch/x86/kernel/cpu/intel_cacheinfo.c | 169 +---- trunk/arch/x86/kernel/cpu/mkcapflags.pl | 32 - trunk/arch/x86/kernel/cpu/mtrr/main.c | 2 +- trunk/arch/x86/kernel/cpu/powerflags.c | 20 - trunk/arch/x86/kernel/e820.c | 28 +- trunk/arch/x86/kernel/entry_64.S | 4 +- trunk/arch/x86/kernel/genapic_64.c | 88 ++- trunk/arch/x86/kernel/genapic_flat_64.c | 62 +- trunk/arch/x86/kernel/genx2apic_cluster.c | 164 ----- trunk/arch/x86/kernel/genx2apic_phys.c | 159 ----- trunk/arch/x86/kernel/genx2apic_uv_x.c | 70 +- trunk/arch/x86/kernel/i8259.c | 24 - trunk/arch/x86/kernel/io_apic_32.c | 47 +- trunk/arch/x86/kernel/io_apic_64.c | 639 ++---------------- trunk/arch/x86/kernel/ioport.c | 1 - trunk/arch/x86/kernel/ipi.c | 3 +- trunk/arch/x86/kernel/irqinit_32.c | 49 -- trunk/arch/x86/kernel/ldt.c | 1 - trunk/arch/x86/kernel/mpparse.c | 2 - trunk/arch/x86/kernel/numaq_32.c | 7 - trunk/arch/x86/kernel/paravirt.c | 2 + trunk/arch/x86/kernel/process_32.c | 2 - trunk/arch/x86/kernel/process_64.c | 1 - trunk/arch/x86/kernel/ptrace.c | 2 +- trunk/arch/x86/kernel/setup.c | 2 - trunk/arch/x86/kernel/setup_percpu.c | 9 +- trunk/arch/x86/kernel/signal_32.c | 1 - trunk/arch/x86/kernel/signal_64.c | 1 - trunk/arch/x86/kernel/smpboot.c | 42 +- trunk/arch/x86/kernel/summit_32.c | 2 +- trunk/arch/x86/kernel/sys_i386_32.c | 2 - trunk/arch/x86/kernel/sys_x86_64.c | 1 - trunk/arch/x86/kernel/syscall_64.c | 4 +- trunk/arch/x86/kernel/time_32.c | 1 - trunk/arch/x86/kernel/tls.c | 1 - trunk/arch/x86/kernel/vm86_32.c | 1 - trunk/arch/x86/kernel/vmi_32.c | 4 +- trunk/arch/x86/lguest/boot.c | 38 +- trunk/arch/x86/lib/Makefile | 3 + trunk/arch/x86/lib/usercopy_32.c | 7 - trunk/arch/x86/mach-default/setup.c | 19 +- trunk/arch/x86/mach-es7000/Makefile | 5 + trunk/arch/x86/mach-es7000/es7000.h | 114 ++++ .../es7000_32.c => mach-es7000/es7000plat.c} | 87 +-- trunk/arch/x86/mach-generic/Makefile | 1 + trunk/arch/x86/mach-generic/bigsmp.c | 9 +- trunk/arch/x86/mach-generic/es7000.c | 13 +- trunk/arch/x86/mach-generic/numaq.c | 12 +- trunk/arch/x86/mach-generic/summit.c | 11 +- trunk/arch/x86/mm/fault.c | 3 +- trunk/arch/x86/mm/init_32.c | 1 - trunk/arch/x86/mm/ioremap.c | 4 +- trunk/arch/x86/pci/acpi.c | 5 + trunk/arch/x86/pci/i386.c | 3 - trunk/arch/x86/xen/enlighten.c | 45 +- trunk/drivers/net/bnx2x.h | 5 +- trunk/drivers/net/bnx2x_main.c | 34 +- trunk/drivers/net/ixgbe/ixgbe_main.c | 6 + trunk/drivers/net/netxen/netxen_nic_main.c | 10 - trunk/drivers/net/pcmcia/axnet_cs.c | 1 + trunk/drivers/net/pcmcia/pcnet_cs.c | 2 +- trunk/drivers/net/usb/pegasus.c | 11 +- trunk/drivers/net/wireless/ath9k/main.c | 12 +- trunk/drivers/net/wireless/ath9k/xmit.c | 4 +- .../drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 3 +- trunk/drivers/net/wireless/iwlwifi/iwl-agn.c | 27 +- trunk/drivers/net/wireless/iwlwifi/iwl-core.c | 77 ++- trunk/drivers/net/wireless/iwlwifi/iwl-dev.h | 1 - trunk/drivers/net/wireless/iwlwifi/iwl-rx.c | 5 +- trunk/drivers/net/wireless/iwlwifi/iwl-scan.c | 2 +- trunk/drivers/net/wireless/iwlwifi/iwl-tx.c | 27 +- trunk/drivers/pci/Makefile | 2 - trunk/drivers/pci/dma_remapping.h | 157 ----- trunk/drivers/pci/dmar.c | 397 +---------- trunk/drivers/pci/intel-iommu.c | 164 ++++- trunk/drivers/pci/intel-iommu.h | 233 ++++--- trunk/drivers/pci/intr_remapping.c | 471 ------------- trunk/drivers/pci/intr_remapping.h | 8 - trunk/include/asm-x86/a.out-core.h | 6 +- trunk/include/asm-x86/a.out.h | 6 +- trunk/include/asm-x86/acpi.h | 6 +- trunk/include/asm-x86/agp.h | 6 +- trunk/include/asm-x86/alternative.h | 6 +- trunk/include/asm-x86/amd_iommu.h | 6 +- trunk/include/asm-x86/amd_iommu_types.h | 6 +- trunk/include/asm-x86/apic.h | 76 +-- trunk/include/asm-x86/apicdef.h | 9 +- trunk/include/asm-x86/arch_hooks.h | 8 +- trunk/include/asm-x86/asm.h | 6 +- trunk/include/asm-x86/atomic_32.h | 6 +- trunk/include/asm-x86/atomic_64.h | 6 +- trunk/include/asm-x86/auxvec.h | 6 +- trunk/include/asm-x86/bios_ebda.h | 6 +- trunk/include/asm-x86/bitops.h | 6 +- trunk/include/asm-x86/boot.h | 6 +- trunk/include/asm-x86/bootparam.h | 6 +- trunk/include/asm-x86/bug.h | 6 +- trunk/include/asm-x86/bugs.h | 11 +- trunk/include/asm-x86/byteorder.h | 6 +- trunk/include/asm-x86/cache.h | 6 +- trunk/include/asm-x86/cacheflush.h | 6 +- trunk/include/asm-x86/calgary.h | 6 +- trunk/include/asm-x86/checksum_32.h | 6 +- trunk/include/asm-x86/checksum_64.h | 6 +- trunk/include/asm-x86/cmpxchg_32.h | 6 +- trunk/include/asm-x86/cmpxchg_64.h | 6 +- trunk/include/asm-x86/compat.h | 6 +- trunk/include/asm-x86/cpu.h | 6 +- trunk/include/asm-x86/cpufeature.h | 118 ++-- trunk/include/asm-x86/current.h | 6 +- trunk/include/asm-x86/debugreg.h | 6 +- trunk/include/asm-x86/delay.h | 6 +- trunk/include/asm-x86/desc.h | 6 +- trunk/include/asm-x86/desc_defs.h | 6 +- trunk/include/asm-x86/device.h | 6 +- trunk/include/asm-x86/div64.h | 6 +- trunk/include/asm-x86/dma-mapping.h | 6 +- trunk/include/asm-x86/dma.h | 6 +- trunk/include/asm-x86/dmi.h | 6 +- trunk/include/asm-x86/ds.h | 6 +- trunk/include/asm-x86/dwarf2.h | 6 +- trunk/include/asm-x86/e820.h | 9 +- trunk/include/asm-x86/edac.h | 6 +- trunk/include/asm-x86/efi.h | 6 +- trunk/include/asm-x86/elf.h | 6 +- trunk/include/asm-x86/emergency-restart.h | 6 +- trunk/include/asm-x86/es7000/apicdef.h | 13 - trunk/include/asm-x86/fb.h | 6 +- trunk/include/asm-x86/fixmap.h | 6 +- trunk/include/asm-x86/fixmap_32.h | 6 +- trunk/include/asm-x86/fixmap_64.h | 6 +- trunk/include/asm-x86/floppy.h | 6 +- trunk/include/asm-x86/ftrace.h | 6 +- trunk/include/asm-x86/futex.h | 6 +- trunk/include/asm-x86/gart.h | 6 +- trunk/include/asm-x86/genapic_32.h | 6 +- trunk/include/asm-x86/genapic_64.h | 14 +- trunk/include/asm-x86/geode.h | 6 +- trunk/include/asm-x86/gpio.h | 2 +- trunk/include/asm-x86/hardirq_32.h | 6 +- trunk/include/asm-x86/hardirq_64.h | 6 +- trunk/include/asm-x86/highmem.h | 6 +- trunk/include/asm-x86/hpet.h | 6 +- trunk/include/asm-x86/hugetlb.h | 6 +- trunk/include/asm-x86/hw_irq.h | 29 +- trunk/include/asm-x86/hypertransport.h | 6 +- trunk/include/asm-x86/i387.h | 7 +- trunk/include/asm-x86/i8253.h | 6 +- trunk/include/asm-x86/i8259.h | 9 +- trunk/include/asm-x86/ia32.h | 6 +- trunk/include/asm-x86/ia32_unistd.h | 6 +- trunk/include/asm-x86/idle.h | 6 +- trunk/include/asm-x86/intel_arch_perfmon.h | 6 +- trunk/include/asm-x86/io.h | 8 +- trunk/include/asm-x86/io_32.h | 6 +- trunk/include/asm-x86/io_64.h | 7 +- trunk/include/asm-x86/io_apic.h | 26 +- trunk/include/asm-x86/ioctls.h | 6 +- trunk/include/asm-x86/iommu.h | 6 +- trunk/include/asm-x86/ipcbuf.h | 6 +- trunk/include/asm-x86/ipi.h | 22 +- trunk/include/asm-x86/irq.h | 6 +- trunk/include/asm-x86/irq_regs_32.h | 6 +- trunk/include/asm-x86/irq_remapping.h | 8 - trunk/include/asm-x86/irq_vectors.h | 6 +- trunk/include/asm-x86/ist.h | 6 +- trunk/include/asm-x86/k8.h | 6 +- trunk/include/asm-x86/kdebug.h | 6 +- trunk/include/asm-x86/kexec.h | 6 +- trunk/include/asm-x86/kgdb.h | 6 +- trunk/include/asm-x86/kmap_types.h | 6 +- trunk/include/asm-x86/kprobes.h | 6 +- trunk/include/asm-x86/kvm.h | 6 +- trunk/include/asm-x86/kvm_host.h | 8 +- trunk/include/asm-x86/kvm_para.h | 6 +- trunk/include/asm-x86/kvm_x86_emulate.h | 6 +- trunk/include/asm-x86/ldt.h | 6 +- trunk/include/asm-x86/lguest.h | 6 +- trunk/include/asm-x86/lguest_hcall.h | 6 +- trunk/include/asm-x86/linkage.h | 6 +- trunk/include/asm-x86/local.h | 6 +- .../apic.h => mach-bigsmp/mach_apic.h} | 4 +- .../apicdef.h => mach-bigsmp/mach_apicdef.h} | 6 +- .../{bigsmp/ipi.h => mach-bigsmp/mach_ipi.h} | 0 trunk/include/asm-x86/mach-default/apm.h | 6 +- .../include/asm-x86/mach-default/mach_apic.h | 10 +- .../asm-x86/mach-default/mach_apicdef.h | 12 +- trunk/include/asm-x86/mach-default/mach_ipi.h | 6 +- .../asm-x86/mach-default/mach_mpparse.h | 6 +- .../asm-x86/mach-default/mach_mpspec.h | 6 +- .../include/asm-x86/mach-default/mach_timer.h | 6 +- .../include/asm-x86/mach-default/mach_traps.h | 6 +- .../asm-x86/mach-default/mach_wakecpu.h | 6 +- .../apic.h => mach-es7000/mach_apic.h} | 32 +- .../asm-x86/mach-es7000/mach_apicdef.h | 13 + .../{es7000/ipi.h => mach-es7000/mach_ipi.h} | 6 +- .../mpparse.h => mach-es7000/mach_mpparse.h} | 4 +- .../wakecpu.h => mach-es7000/mach_wakecpu.h} | 6 +- trunk/include/asm-x86/mach-generic/gpio.h | 6 +- .../asm-x86/mach-generic/irq_vectors_limits.h | 6 +- .../include/asm-x86/mach-generic/mach_apic.h | 6 +- .../asm-x86/mach-generic/mach_apicdef.h | 6 +- trunk/include/asm-x86/mach-generic/mach_ipi.h | 6 +- .../asm-x86/mach-generic/mach_mpparse.h | 6 +- .../asm-x86/mach-generic/mach_mpspec.h | 6 +- .../{numaq/apic.h => mach-numaq/mach_apic.h} | 6 +- .../apicdef.h => mach-numaq/mach_apicdef.h} | 4 +- .../{numaq/ipi.h => mach-numaq/mach_ipi.h} | 6 +- .../mpparse.h => mach-numaq/mach_mpparse.h} | 6 +- .../wakecpu.h => mach-numaq/mach_wakecpu.h} | 6 +- trunk/include/asm-x86/mach-rdc321x/gpio.h | 6 +- .../irq_vectors_limits.h | 0 .../apic.h => mach-summit/mach_apic.h} | 24 +- .../asm-x86/mach-summit/mach_apicdef.h | 13 + .../{summit/ipi.h => mach-summit/mach_ipi.h} | 6 +- .../mpparse.h => mach-summit/mach_mpparse.h} | 13 +- trunk/include/asm-x86/math_emu.h | 6 +- trunk/include/asm-x86/mc146818rtc.h | 6 +- trunk/include/asm-x86/mca.h | 6 +- trunk/include/asm-x86/mca_dma.h | 6 +- trunk/include/asm-x86/mce.h | 6 +- trunk/include/asm-x86/mman.h | 6 +- trunk/include/asm-x86/mmconfig.h | 6 +- trunk/include/asm-x86/mmu.h | 6 +- trunk/include/asm-x86/mmu_context.h | 6 +- trunk/include/asm-x86/mmu_context_32.h | 6 +- trunk/include/asm-x86/mmu_context_64.h | 6 +- trunk/include/asm-x86/mmx.h | 6 +- trunk/include/asm-x86/mmzone_32.h | 6 +- trunk/include/asm-x86/mmzone_64.h | 6 +- trunk/include/asm-x86/module.h | 6 +- trunk/include/asm-x86/mpspec.h | 6 +- trunk/include/asm-x86/mpspec_def.h | 6 +- trunk/include/asm-x86/msgbuf.h | 6 +- trunk/include/asm-x86/msidef.h | 10 +- trunk/include/asm-x86/msr-index.h | 6 +- trunk/include/asm-x86/msr.h | 6 +- trunk/include/asm-x86/mtrr.h | 6 +- trunk/include/asm-x86/mutex_32.h | 6 +- trunk/include/asm-x86/mutex_64.h | 6 +- trunk/include/asm-x86/nmi.h | 6 +- trunk/include/asm-x86/nops.h | 6 +- trunk/include/asm-x86/numa_32.h | 6 +- trunk/include/asm-x86/numa_64.h | 6 +- trunk/include/asm-x86/numaq.h | 6 +- trunk/include/asm-x86/olpc.h | 6 +- trunk/include/asm-x86/page.h | 6 +- trunk/include/asm-x86/page_32.h | 7 +- trunk/include/asm-x86/page_64.h | 7 +- trunk/include/asm-x86/param.h | 6 +- trunk/include/asm-x86/paravirt.h | 25 +- trunk/include/asm-x86/parport.h | 6 +- trunk/include/asm-x86/pat.h | 6 +- trunk/include/asm-x86/pci-direct.h | 6 +- trunk/include/asm-x86/pci.h | 6 +- trunk/include/asm-x86/pci_32.h | 6 +- trunk/include/asm-x86/pci_64.h | 6 +- trunk/include/asm-x86/pda.h | 6 +- trunk/include/asm-x86/percpu.h | 6 +- trunk/include/asm-x86/pgalloc.h | 6 +- trunk/include/asm-x86/pgtable-2level-defs.h | 6 +- trunk/include/asm-x86/pgtable-2level.h | 6 +- trunk/include/asm-x86/pgtable-3level-defs.h | 6 +- trunk/include/asm-x86/pgtable-3level.h | 6 +- trunk/include/asm-x86/pgtable.h | 8 +- trunk/include/asm-x86/pgtable_32.h | 7 +- trunk/include/asm-x86/pgtable_64.h | 6 +- trunk/include/asm-x86/posix_types_32.h | 6 +- trunk/include/asm-x86/posix_types_64.h | 6 +- trunk/include/asm-x86/prctl.h | 6 +- trunk/include/asm-x86/processor-cyrix.h | 8 - trunk/include/asm-x86/processor-flags.h | 6 +- trunk/include/asm-x86/processor.h | 10 +- trunk/include/asm-x86/proto.h | 6 +- trunk/include/asm-x86/ptrace-abi.h | 6 +- trunk/include/asm-x86/ptrace.h | 9 +- trunk/include/asm-x86/pvclock-abi.h | 6 +- trunk/include/asm-x86/pvclock.h | 6 +- trunk/include/asm-x86/reboot.h | 6 +- trunk/include/asm-x86/reboot_fixups.h | 6 +- trunk/include/asm-x86/required-features.h | 14 +- trunk/include/asm-x86/resume-trace.h | 6 +- trunk/include/asm-x86/rio.h | 6 +- trunk/include/asm-x86/rwlock.h | 6 +- trunk/include/asm-x86/rwsem.h | 6 +- trunk/include/asm-x86/scatterlist.h | 6 +- trunk/include/asm-x86/seccomp_32.h | 6 +- trunk/include/asm-x86/seccomp_64.h | 6 +- trunk/include/asm-x86/segment.h | 6 +- trunk/include/asm-x86/sembuf.h | 6 +- trunk/include/asm-x86/serial.h | 6 +- trunk/include/asm-x86/setup.h | 8 +- trunk/include/asm-x86/shmbuf.h | 6 +- trunk/include/asm-x86/shmparam.h | 6 +- trunk/include/asm-x86/sigcontext.h | 6 +- trunk/include/asm-x86/sigcontext32.h | 6 +- trunk/include/asm-x86/siginfo.h | 6 +- trunk/include/asm-x86/signal.h | 9 +- trunk/include/asm-x86/smp.h | 27 +- trunk/include/asm-x86/socket.h | 6 +- trunk/include/asm-x86/sockios.h | 6 +- trunk/include/asm-x86/sparsemem.h | 6 +- trunk/include/asm-x86/spinlock.h | 6 +- trunk/include/asm-x86/spinlock_types.h | 6 +- trunk/include/asm-x86/srat.h | 6 +- trunk/include/asm-x86/stacktrace.h | 6 +- trunk/include/asm-x86/stat.h | 6 +- trunk/include/asm-x86/statfs.h | 6 +- trunk/include/asm-x86/string_32.h | 6 +- trunk/include/asm-x86/string_64.h | 6 +- trunk/include/asm-x86/summit/apicdef.h | 13 - trunk/include/asm-x86/suspend_32.h | 6 +- trunk/include/asm-x86/suspend_64.h | 6 +- trunk/include/asm-x86/swiotlb.h | 6 +- trunk/include/asm-x86/sync_bitops.h | 6 +- trunk/include/asm-x86/syscalls.h | 93 --- trunk/include/asm-x86/system.h | 6 +- trunk/include/asm-x86/system_64.h | 6 +- trunk/include/asm-x86/tce.h | 6 +- trunk/include/asm-x86/termbits.h | 6 +- trunk/include/asm-x86/termios.h | 6 +- trunk/include/asm-x86/therm_throt.h | 6 +- trunk/include/asm-x86/thread_info.h | 6 +- trunk/include/asm-x86/time.h | 8 +- trunk/include/asm-x86/timer.h | 11 +- trunk/include/asm-x86/timex.h | 6 +- trunk/include/asm-x86/tlb.h | 6 +- trunk/include/asm-x86/tlbflush.h | 6 +- trunk/include/asm-x86/topology.h | 6 +- trunk/include/asm-x86/trampoline.h | 6 +- trunk/include/asm-x86/traps.h | 10 +- trunk/include/asm-x86/tsc.h | 6 +- trunk/include/asm-x86/types.h | 6 +- trunk/include/asm-x86/uaccess.h | 6 +- trunk/include/asm-x86/uaccess_32.h | 6 +- trunk/include/asm-x86/uaccess_64.h | 6 +- trunk/include/asm-x86/ucontext.h | 6 +- trunk/include/asm-x86/unaligned.h | 6 +- trunk/include/asm-x86/unistd_32.h | 6 +- trunk/include/asm-x86/unistd_64.h | 6 +- trunk/include/asm-x86/unwind.h | 6 +- trunk/include/asm-x86/user32.h | 6 +- trunk/include/asm-x86/user_32.h | 6 +- trunk/include/asm-x86/user_64.h | 6 +- trunk/include/asm-x86/uv/bios.h | 6 +- trunk/include/asm-x86/uv/uv_bau.h | 6 +- trunk/include/asm-x86/uv/uv_hub.h | 6 +- trunk/include/asm-x86/uv/uv_mmrs.h | 6 +- trunk/include/asm-x86/vdso.h | 6 +- trunk/include/asm-x86/vga.h | 6 +- trunk/include/asm-x86/vgtod.h | 6 +- trunk/include/asm-x86/visws/cobalt.h | 6 +- trunk/include/asm-x86/visws/lithium.h | 6 +- trunk/include/asm-x86/visws/piix4.h | 6 +- trunk/include/asm-x86/vm86.h | 6 +- trunk/include/asm-x86/vmi_time.h | 6 +- trunk/include/asm-x86/vsyscall.h | 6 +- trunk/include/asm-x86/xen/events.h | 6 +- trunk/include/asm-x86/xen/grant_table.h | 6 +- trunk/include/asm-x86/xen/hypercall.h | 6 +- trunk/include/asm-x86/xen/hypervisor.h | 6 +- trunk/include/asm-x86/xen/interface.h | 6 +- trunk/include/asm-x86/xen/interface_32.h | 6 +- trunk/include/asm-x86/xen/interface_64.h | 6 +- trunk/include/asm-x86/xen/page.h | 6 +- trunk/include/linux/dmar.h | 127 +--- trunk/include/linux/ioport.h | 3 + trunk/include/linux/irq.h | 1 - trunk/kernel/irq/manage.c | 9 +- trunk/kernel/resource.c | 68 ++ trunk/lib/Kconfig.debug | 6 +- trunk/net/tipc/bcast.c | 22 +- trunk/net/tipc/bcast.h | 22 +- trunk/net/tipc/bearer.c | 2 +- trunk/net/tipc/bearer.h | 2 +- trunk/net/tipc/cluster.c | 16 +- trunk/net/tipc/cluster.h | 10 +- trunk/net/tipc/discover.c | 2 +- trunk/net/tipc/link.c | 26 +- trunk/net/tipc/link.h | 2 +- trunk/net/tipc/name_table.h | 2 +- trunk/net/tipc/net.c | 2 +- trunk/net/tipc/net.h | 2 +- trunk/net/tipc/node.c | 60 +- trunk/net/tipc/node.h | 42 +- trunk/net/tipc/node_subscr.c | 4 +- trunk/net/tipc/node_subscr.h | 10 +- trunk/net/tipc/port.h | 2 +- trunk/net/tipc/zone.c | 4 +- trunk/net/tipc/zone.h | 2 +- trunk/security/selinux/ss/services.c | 6 +- 421 files changed, 2304 insertions(+), 5006 deletions(-) delete mode 100644 trunk/arch/x86/kernel/cpu/cmpxchg.c create mode 100644 trunk/arch/x86/kernel/cpu/feature_names.c delete mode 100644 trunk/arch/x86/kernel/cpu/mkcapflags.pl delete mode 100644 trunk/arch/x86/kernel/cpu/powerflags.c delete mode 100644 trunk/arch/x86/kernel/genx2apic_cluster.c delete mode 100644 trunk/arch/x86/kernel/genx2apic_phys.c create mode 100644 trunk/arch/x86/mach-es7000/Makefile create mode 100644 trunk/arch/x86/mach-es7000/es7000.h rename trunk/arch/x86/{kernel/es7000_32.c => mach-es7000/es7000plat.c} (78%) delete mode 100644 trunk/drivers/pci/dma_remapping.h delete mode 100644 trunk/drivers/pci/intr_remapping.c delete mode 100644 trunk/drivers/pci/intr_remapping.h delete mode 100644 trunk/include/asm-x86/es7000/apicdef.h delete mode 100644 trunk/include/asm-x86/irq_remapping.h rename trunk/include/asm-x86/{bigsmp/apic.h => mach-bigsmp/mach_apic.h} (98%) rename trunk/include/asm-x86/{bigsmp/apicdef.h => mach-bigsmp/mach_apicdef.h} (74%) rename trunk/include/asm-x86/{bigsmp/ipi.h => mach-bigsmp/mach_ipi.h} (100%) rename trunk/include/asm-x86/{es7000/apic.h => mach-es7000/mach_apic.h} (92%) create mode 100644 trunk/include/asm-x86/mach-es7000/mach_apicdef.h rename trunk/include/asm-x86/{es7000/ipi.h => mach-es7000/mach_ipi.h} (83%) rename trunk/include/asm-x86/{es7000/mpparse.h => mach-es7000/mach_mpparse.h} (91%) rename trunk/include/asm-x86/{es7000/wakecpu.h => mach-es7000/mach_wakecpu.h} (95%) rename trunk/include/asm-x86/{numaq/apic.h => mach-numaq/mach_apic.h} (97%) rename trunk/include/asm-x86/{numaq/apicdef.h => mach-numaq/mach_apicdef.h} (75%) rename trunk/include/asm-x86/{numaq/ipi.h => mach-numaq/mach_ipi.h} (83%) rename trunk/include/asm-x86/{numaq/mpparse.h => mach-numaq/mach_mpparse.h} (50%) rename trunk/include/asm-x86/{numaq/wakecpu.h => mach-numaq/mach_wakecpu.h} (91%) rename trunk/include/asm-x86/{summit => mach-summit}/irq_vectors_limits.h (100%) rename trunk/include/asm-x86/{summit/apic.h => mach-summit/mach_apic.h} (94%) create mode 100644 trunk/include/asm-x86/mach-summit/mach_apicdef.h rename trunk/include/asm-x86/{summit/ipi.h => mach-summit/mach_ipi.h} (83%) rename trunk/include/asm-x86/{summit/mpparse.h => mach-summit/mach_mpparse.h} (96%) delete mode 100644 trunk/include/asm-x86/summit/apicdef.h delete mode 100644 trunk/include/asm-x86/syscalls.h diff --git a/[refs] b/[refs] index 00fc46eb1162..ff2184d37f84 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fb481dd56adf3c5b0993b8f052cc9ba966e3959d +refs/heads/master: 268364a0f48aee2f851f9d1ef8a6cda0f3039ef1 diff --git a/trunk/Documentation/kernel-parameters.txt b/trunk/Documentation/kernel-parameters.txt index ba27dd98a18e..1150444a21ab 100644 --- a/trunk/Documentation/kernel-parameters.txt +++ b/trunk/Documentation/kernel-parameters.txt @@ -1425,12 +1425,6 @@ and is between 256 and 4096 characters. It is defined in the file nolapic_timer [X86-32,APIC] Do not use the local APIC timer. - nox2apic [X86-64,APIC] Do not enable x2APIC mode. - - x2apic_phys [X86-64,APIC] Use x2apic physical mode instead of - default x2apic cluster mode on platforms - supporting x2apic. - noltlbs [PPC] Do not use large page/tlb entries for kernel lowmem mapping on PPC40x. diff --git a/trunk/arch/powerpc/Makefile b/trunk/arch/powerpc/Makefile index 9155c9312c1e..c6be19e9ceae 100644 --- a/trunk/arch/powerpc/Makefile +++ b/trunk/arch/powerpc/Makefile @@ -116,6 +116,11 @@ ifeq ($(CONFIG_6xx),y) KBUILD_CFLAGS += -mcpu=powerpc endif +# Work around a gcc code-gen bug with -fno-omit-frame-pointer. +ifeq ($(CONFIG_FTRACE),y) +KBUILD_CFLAGS += -mno-sched-epilog +endif + cpu-as-$(CONFIG_4xx) += -Wa,-m405 cpu-as-$(CONFIG_6xx) += -Wa,-maltivec cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec diff --git a/trunk/arch/powerpc/include/asm/pgtable-ppc64.h b/trunk/arch/powerpc/include/asm/pgtable-ppc64.h index db0b8f3b8807..4597c491e9b5 100644 --- a/trunk/arch/powerpc/include/asm/pgtable-ppc64.h +++ b/trunk/arch/powerpc/include/asm/pgtable-ppc64.h @@ -153,12 +153,10 @@ #define __S110 PAGE_SHARED_X #define __S111 PAGE_SHARED_X -#ifdef CONFIG_HUGETLB_PAGE - +#ifdef CONFIG_PPC_MM_SLICES #define HAVE_ARCH_UNMAPPED_AREA #define HAVE_ARCH_UNMAPPED_AREA_TOPDOWN - -#endif +#endif /* CONFIG_PPC_MM_SLICES */ #ifndef __ASSEMBLY__ diff --git a/trunk/arch/powerpc/kernel/Makefile b/trunk/arch/powerpc/kernel/Makefile index 64f5948ebc9d..946daea780f1 100644 --- a/trunk/arch/powerpc/kernel/Makefile +++ b/trunk/arch/powerpc/kernel/Makefile @@ -14,12 +14,13 @@ endif ifdef CONFIG_FTRACE # Do not trace early boot code -CFLAGS_REMOVE_cputable.o = -pg -CFLAGS_REMOVE_prom_init.o = -pg +CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog +CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog +CFLAGS_REMOVE_btext.o = -pg -mno-sched-epilog ifdef CONFIG_DYNAMIC_FTRACE # dynamic ftrace setup. -CFLAGS_REMOVE_ftrace.o = -pg +CFLAGS_REMOVE_ftrace.o = -pg -mno-sched-epilog endif endif diff --git a/trunk/arch/powerpc/kernel/align.c b/trunk/arch/powerpc/kernel/align.c index 367129789cc0..5af4e9b2dbe2 100644 --- a/trunk/arch/powerpc/kernel/align.c +++ b/trunk/arch/powerpc/kernel/align.c @@ -647,7 +647,7 @@ static int emulate_vsx(unsigned char __user *addr, unsigned int reg, unsigned int flags, unsigned int length) { char *ptr = (char *) ¤t->thread.TS_FPR(reg); - int ret; + int ret = 0; flush_vsx_to_thread(current); diff --git a/trunk/arch/powerpc/kernel/idle_6xx.S b/trunk/arch/powerpc/kernel/idle_6xx.S index 019b02d8844f..15c611de1ee2 100644 --- a/trunk/arch/powerpc/kernel/idle_6xx.S +++ b/trunk/arch/powerpc/kernel/idle_6xx.S @@ -158,7 +158,7 @@ _GLOBAL(power_save_ppc32_restore) stw r9,_NIP(r11) /* make it do a blr */ #ifdef CONFIG_SMP - mfspr r12,SPRN_SPRG3 + rlwinm r12,r11,0,0,31-THREAD_SHIFT lwz r11,TI_CPU(r12) /* get cpu number * 4 */ slwi r11,r11,2 #else diff --git a/trunk/arch/powerpc/kernel/idle_e500.S b/trunk/arch/powerpc/kernel/idle_e500.S index 06304034b393..47a1a983ff88 100644 --- a/trunk/arch/powerpc/kernel/idle_e500.S +++ b/trunk/arch/powerpc/kernel/idle_e500.S @@ -84,10 +84,11 @@ _GLOBAL(power_save_ppc32_restore) stw r9,_NIP(r11) /* make it do a blr */ #ifdef CONFIG_SMP - mfspr r12,SPRN_SPRG3 + rlwinm r12,r1,0,0,31-THREAD_SHIFT lwz r11,TI_CPU(r12) /* get cpu number * 4 */ slwi r11,r11,2 #else li r11,0 #endif + b transfer_to_handler_cont diff --git a/trunk/arch/powerpc/kernel/vmlinux.lds.S b/trunk/arch/powerpc/kernel/vmlinux.lds.S index 4a8ce62fe112..9f6c1ca1739e 100644 --- a/trunk/arch/powerpc/kernel/vmlinux.lds.S +++ b/trunk/arch/powerpc/kernel/vmlinux.lds.S @@ -66,11 +66,12 @@ SECTIONS __got2_end = .; #endif /* CONFIG_PPC32 */ - . = ALIGN(PAGE_SIZE); - _etext = .; - PROVIDE32 (etext = .); } :kernel + . = ALIGN(PAGE_SIZE); + _etext = .; + PROVIDE32 (etext = .); + /* Read-only data */ RODATA diff --git a/trunk/arch/powerpc/mm/hash_utils_64.c b/trunk/arch/powerpc/mm/hash_utils_64.c index 14be408dfc9b..8920eea34528 100644 --- a/trunk/arch/powerpc/mm/hash_utils_64.c +++ b/trunk/arch/powerpc/mm/hash_utils_64.c @@ -191,12 +191,17 @@ int htab_bolt_mapping(unsigned long vstart, unsigned long vend, unsigned long hash, hpteg; unsigned long vsid = get_kernel_vsid(vaddr, ssize); unsigned long va = hpt_va(vaddr, vsid, ssize); + unsigned long tprot = prot; + + /* Make kernel text executable */ + if (in_kernel_text(vaddr)) + tprot &= ~HPTE_R_N; hash = hpt_hash(va, shift, ssize); hpteg = ((hash & htab_hash_mask) * HPTES_PER_GROUP); BUG_ON(!ppc_md.hpte_insert); - ret = ppc_md.hpte_insert(hpteg, va, paddr, prot, + ret = ppc_md.hpte_insert(hpteg, va, paddr, tprot, HPTE_V_BOLTED, psize, ssize); if (ret < 0) @@ -584,7 +589,7 @@ void __init htab_initialize(void) { unsigned long table; unsigned long pteg_count; - unsigned long prot, tprot; + unsigned long prot; unsigned long base = 0, size = 0, limit; int i; @@ -660,10 +665,9 @@ void __init htab_initialize(void) for (i=0; i < lmb.memory.cnt; i++) { base = (unsigned long)__va(lmb.memory.region[i].base); size = lmb.memory.region[i].size; - tprot = prot | (in_kernel_text(base) ? _PAGE_EXEC : 0); DBG("creating mapping for region: %lx..%lx (prot: %x)\n", - base, size, tprot); + base, size, prot); #ifdef CONFIG_U3_DART /* Do not map the DART space. Fortunately, it will be aligned @@ -680,21 +684,21 @@ void __init htab_initialize(void) unsigned long dart_table_end = dart_tablebase + 16 * MB; if (base != dart_tablebase) BUG_ON(htab_bolt_mapping(base, dart_tablebase, - __pa(base), tprot, + __pa(base), prot, mmu_linear_psize, mmu_kernel_ssize)); if ((base + size) > dart_table_end) BUG_ON(htab_bolt_mapping(dart_tablebase+16*MB, base + size, __pa(dart_table_end), - tprot, + prot, mmu_linear_psize, mmu_kernel_ssize)); continue; } #endif /* CONFIG_U3_DART */ BUG_ON(htab_bolt_mapping(base, base + size, __pa(base), - tprot, mmu_linear_psize, mmu_kernel_ssize)); + prot, mmu_linear_psize, mmu_kernel_ssize)); } /* diff --git a/trunk/arch/powerpc/platforms/powermac/Makefile b/trunk/arch/powerpc/platforms/powermac/Makefile index 58ecdd72630f..be60d64be7ad 100644 --- a/trunk/arch/powerpc/platforms/powermac/Makefile +++ b/trunk/arch/powerpc/platforms/powermac/Makefile @@ -2,7 +2,7 @@ CFLAGS_bootx_init.o += -fPIC ifdef CONFIG_FTRACE # Do not trace early boot code -CFLAGS_REMOVE_bootx_init.o = -pg +CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog endif obj-y += pic.o setup.o time.o feature.o pci.o \ diff --git a/trunk/arch/um/sys-x86_64/syscall_table.c b/trunk/arch/um/sys-x86_64/syscall_table.c index 32f5fbe2d0d2..c128eb897008 100644 --- a/trunk/arch/um/sys-x86_64/syscall_table.c +++ b/trunk/arch/um/sys-x86_64/syscall_table.c @@ -41,12 +41,12 @@ #define stub_rt_sigreturn sys_rt_sigreturn #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; -#undef ASM_X86__UNISTD_64_H +#undef _ASM_X86_64_UNISTD_H_ #include #undef __SYSCALL #define __SYSCALL(nr, sym) [ nr ] = sym, -#undef ASM_X86__UNISTD_64_H +#undef _ASM_X86_64_UNISTD_H_ typedef void (*sys_call_ptr_t)(void); diff --git a/trunk/arch/x86/Kconfig b/trunk/arch/x86/Kconfig index 21ef9dd36187..ed92864d1325 100644 --- a/trunk/arch/x86/Kconfig +++ b/trunk/arch/x86/Kconfig @@ -1643,14 +1643,6 @@ config DMAR_FLOPPY_WA workaround will setup a 1:1 mapping for the first 16M to make floppy (an ISA device) work. -config INTR_REMAP - bool "Support for Interrupt Remapping (EXPERIMENTAL)" - depends on X86_64 && X86_IO_APIC && PCI_MSI && ACPI && EXPERIMENTAL - help - Supports Interrupt remapping for IO-APIC and MSI devices. - To use x2apic mode in the CPU's which support x2APIC enhancements or - to support platforms with CPU's having > 8 bit APIC ID, say Y. - source "drivers/pci/pcie/Kconfig" source "drivers/pci/Kconfig" diff --git a/trunk/arch/x86/Kconfig.cpu b/trunk/arch/x86/Kconfig.cpu index 6156ac25ff8c..2c518fbc52ec 100644 --- a/trunk/arch/x86/Kconfig.cpu +++ b/trunk/arch/x86/Kconfig.cpu @@ -415,73 +415,3 @@ config X86_MINIMUM_CPU_FAMILY config X86_DEBUGCTLMSR def_bool y depends on !(MK6 || MWINCHIPC6 || MWINCHIP2 || MWINCHIP3D || MCYRIXIII || M586MMX || M586TSC || M586 || M486 || M386) - -menuconfig PROCESSOR_SELECT - default y - bool "Supported processor vendors" if EMBEDDED - help - This lets you choose what x86 vendor support code your kernel - will include. - -config CPU_SUP_INTEL_32 - default y - bool "Support Intel processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for Intel processors - -config CPU_SUP_INTEL_64 - default y - bool "Support Intel processors" if PROCESSOR_SELECT - depends on 64BIT - help - This enables extended support for Intel processors - -config CPU_SUP_CYRIX_32 - default y - bool "Support Cyrix processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for Cyrix processors - -config CPU_SUP_AMD_32 - default y - bool "Support AMD processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for AMD processors - -config CPU_SUP_AMD_64 - default y - bool "Support AMD processors" if PROCESSOR_SELECT - depends on 64BIT - help - This enables extended support for AMD processors - -config CPU_SUP_CENTAUR_32 - default y - bool "Support Centaur processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for Centaur processors - -config CPU_SUP_CENTAUR_64 - default y - bool "Support Centaur processors" if PROCESSOR_SELECT - depends on 64BIT - help - This enables extended support for Centaur processors - -config CPU_SUP_TRANSMETA_32 - default y - bool "Support Transmeta processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for Transmeta processors - -config CPU_SUP_UMC_32 - default y - bool "Support UMC processors" if PROCESSOR_SELECT - depends on !64BIT - help - This enables extended support for UMC processors diff --git a/trunk/arch/x86/boot/compressed/misc.c b/trunk/arch/x86/boot/compressed/misc.c index aaf5a2131efc..9fea73706479 100644 --- a/trunk/arch/x86/boot/compressed/misc.c +++ b/trunk/arch/x86/boot/compressed/misc.c @@ -16,7 +16,7 @@ */ #undef CONFIG_PARAVIRT #ifdef CONFIG_X86_32 -#define ASM_X86__DESC_H 1 +#define _ASM_DESC_H_ 1 #endif #ifdef CONFIG_X86_64 diff --git a/trunk/arch/x86/boot/cpucheck.c b/trunk/arch/x86/boot/cpucheck.c index 4d3ff037201f..4b9ae7c56748 100644 --- a/trunk/arch/x86/boot/cpucheck.c +++ b/trunk/arch/x86/boot/cpucheck.c @@ -38,12 +38,12 @@ static const u32 req_flags[NCAPINTS] = { REQUIRED_MASK0, REQUIRED_MASK1, - 0, /* REQUIRED_MASK2 not implemented in this file */ - 0, /* REQUIRED_MASK3 not implemented in this file */ + REQUIRED_MASK2, + REQUIRED_MASK3, REQUIRED_MASK4, - 0, /* REQUIRED_MASK5 not implemented in this file */ + REQUIRED_MASK5, REQUIRED_MASK6, - 0, /* REQUIRED_MASK7 not implemented in this file */ + REQUIRED_MASK7, }; #define A32(a, b, c, d) (((d) << 24)+((c) << 16)+((b) << 8)+(a)) diff --git a/trunk/arch/x86/boot/mkcpustr.c b/trunk/arch/x86/boot/mkcpustr.c index 4589caa3e9d1..bbe76953bae9 100644 --- a/trunk/arch/x86/boot/mkcpustr.c +++ b/trunk/arch/x86/boot/mkcpustr.c @@ -15,7 +15,7 @@ #include -#include "../kernel/cpu/capflags.c" +#include "../kernel/cpu/feature_names.c" #if NCAPFLAGS > 8 # error "Need to adjust the boot code handling of CPUID strings" diff --git a/trunk/arch/x86/kernel/Makefile b/trunk/arch/x86/kernel/Makefile index dac24c4390dd..3db651fc8ec5 100644 --- a/trunk/arch/x86/kernel/Makefile +++ b/trunk/arch/x86/kernel/Makefile @@ -69,7 +69,6 @@ obj-$(CONFIG_KEXEC) += machine_kexec_$(BITS).o obj-$(CONFIG_KEXEC) += relocate_kernel_$(BITS).o crash.o obj-$(CONFIG_CRASH_DUMP) += crash_dump_$(BITS).o obj-$(CONFIG_X86_NUMAQ) += numaq_32.o -obj-$(CONFIG_X86_ES7000) += es7000_32.o obj-$(CONFIG_X86_SUMMIT_NUMA) += summit_32.o obj-y += vsmp_64.o obj-$(CONFIG_KPROBES) += kprobes.o @@ -105,8 +104,6 @@ obj-$(CONFIG_OLPC) += olpc.o ifeq ($(CONFIG_X86_64),y) obj-y += genapic_64.o genapic_flat_64.o genx2apic_uv_x.o tlb_uv.o obj-y += bios_uv.o - obj-y += genx2apic_cluster.o - obj-y += genx2apic_phys.o obj-$(CONFIG_X86_PM_TIMER) += pmtimer_64.o obj-$(CONFIG_AUDIT) += audit_64.o diff --git a/trunk/arch/x86/kernel/acpi/boot.c b/trunk/arch/x86/kernel/acpi/boot.c index 27ef365e757d..bfd10fd211cd 100644 --- a/trunk/arch/x86/kernel/acpi/boot.c +++ b/trunk/arch/x86/kernel/acpi/boot.c @@ -775,7 +775,7 @@ static void __init acpi_register_lapic_address(unsigned long address) set_fixmap_nocache(FIX_APIC_BASE, address); if (boot_cpu_physical_apicid == -1U) { - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); #ifdef CONFIG_X86_32 apic_version[boot_cpu_physical_apicid] = GET_APIC_VERSION(apic_read(APIC_LVR)); @@ -1351,9 +1351,7 @@ static void __init acpi_process_madt(void) acpi_ioapic = 1; smp_found_config = 1; -#ifdef CONFIG_X86_32 setup_apic_routing(); -#endif } } if (error == -EINVAL) { diff --git a/trunk/arch/x86/kernel/alternative.c b/trunk/arch/x86/kernel/alternative.c index 65a0c1b48696..2763cb37b553 100644 --- a/trunk/arch/x86/kernel/alternative.c +++ b/trunk/arch/x86/kernel/alternative.c @@ -145,25 +145,35 @@ static const unsigned char *const p6_nops[ASM_NOP_MAX+1] = { extern char __vsyscall_0; const unsigned char *const *find_nop_table(void) { - if (boot_cpu_data.x86_vendor == X86_VENDOR_INTEL && - boot_cpu_has(X86_FEATURE_NOPL)) - return p6_nops; - else - return k8_nops; + return boot_cpu_data.x86_vendor != X86_VENDOR_INTEL || + boot_cpu_data.x86 < 6 ? k8_nops : p6_nops; } #else /* CONFIG_X86_64 */ +static const struct nop { + int cpuid; + const unsigned char *const *noptable; +} noptypes[] = { + { X86_FEATURE_K8, k8_nops }, + { X86_FEATURE_K7, k7_nops }, + { X86_FEATURE_P4, p6_nops }, + { X86_FEATURE_P3, p6_nops }, + { -1, NULL } +}; + const unsigned char *const *find_nop_table(void) { - if (boot_cpu_has(X86_FEATURE_K8)) - return k8_nops; - else if (boot_cpu_has(X86_FEATURE_K7)) - return k7_nops; - else if (boot_cpu_has(X86_FEATURE_NOPL)) - return p6_nops; - else - return intel_nops; + const unsigned char *const *noptable = intel_nops; + int i; + + for (i = 0; noptypes[i].cpuid >= 0; i++) { + if (boot_cpu_has(noptypes[i].cpuid)) { + noptable = noptypes[i].noptable; + break; + } + } + return noptable; } #endif /* CONFIG_X86_64 */ diff --git a/trunk/arch/x86/kernel/apic_32.c b/trunk/arch/x86/kernel/apic_32.c index 584272105051..f88bd0d982b0 100644 --- a/trunk/arch/x86/kernel/apic_32.c +++ b/trunk/arch/x86/kernel/apic_32.c @@ -145,18 +145,13 @@ static int modern_apic(void) return lapic_get_version() >= 0x14; } -/* - * Paravirt kernels also might be using these below ops. So we still - * use generic apic_read()/apic_write(), which might be pointing to different - * ops in PARAVIRT case. - */ -void xapic_wait_icr_idle(void) +void apic_wait_icr_idle(void) { while (apic_read(APIC_ICR) & APIC_ICR_BUSY) cpu_relax(); } -u32 safe_xapic_wait_icr_idle(void) +u32 safe_apic_wait_icr_idle(void) { u32 send_status; int timeout; @@ -172,48 +167,16 @@ u32 safe_xapic_wait_icr_idle(void) return send_status; } -void xapic_icr_write(u32 low, u32 id) -{ - apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(id)); - apic_write(APIC_ICR, low); -} - -u64 xapic_icr_read(void) -{ - u32 icr1, icr2; - - icr2 = apic_read(APIC_ICR2); - icr1 = apic_read(APIC_ICR); - - return icr1 | ((u64)icr2 << 32); -} - -static struct apic_ops xapic_ops = { - .read = native_apic_mem_read, - .write = native_apic_mem_write, - .icr_read = xapic_icr_read, - .icr_write = xapic_icr_write, - .wait_icr_idle = xapic_wait_icr_idle, - .safe_wait_icr_idle = safe_xapic_wait_icr_idle, -}; - -struct apic_ops __read_mostly *apic_ops = &xapic_ops; -EXPORT_SYMBOL_GPL(apic_ops); - /** * enable_NMI_through_LVT0 - enable NMI through local vector table 0 */ void __cpuinit enable_NMI_through_LVT0(void) { - unsigned int v; + unsigned int v = APIC_DM_NMI; - /* unmask and set to NMI */ - v = APIC_DM_NMI; - - /* Level triggered for 82489DX (32bit mode) */ + /* Level triggered for 82489DX */ if (!lapic_is_integrated()) v |= APIC_LVT_LEVEL_TRIGGER; - apic_write(APIC_LVT0, v); } @@ -230,13 +193,9 @@ int get_physical_broadcast(void) */ int lapic_get_maxlvt(void) { - unsigned int v; + unsigned int v = apic_read(APIC_LVR); - v = apic_read(APIC_LVR); - /* - * - we always have APIC integrated on 64bit mode - * - 82489DXs do not report # of LVT entries - */ + /* 82489DXs do not report # of LVT entries. */ return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; } @@ -1246,7 +1205,7 @@ void __init init_apic_mappings(void) * default configuration (or the MP table is broken). */ if (boot_cpu_physical_apicid == -1U) - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); } @@ -1283,7 +1242,7 @@ int __init APIC_init_uniprocessor(void) * might be zero if read from MP tables. Get it from LAPIC. */ #ifdef CONFIG_CRASH_DUMP - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); #endif physid_set_mask_of_physid(boot_cpu_physical_apicid, &phys_cpu_present_map); @@ -1362,6 +1321,54 @@ void smp_error_interrupt(struct pt_regs *regs) irq_exit(); } +#ifdef CONFIG_SMP +void __init smp_intr_init(void) +{ + /* + * IRQ0 must be given a fixed assignment and initialized, + * because it's used before the IO-APIC is set up. + */ + set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); + + /* + * The reschedule interrupt is a CPU-to-CPU reschedule-helper + * IPI, driven by wakeup. + */ + alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); + + /* IPI for invalidation */ + alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); + + /* IPI for generic function call */ + alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); + + /* IPI for single call function */ + set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, + call_function_single_interrupt); +} +#endif + +/* + * Initialize APIC interrupts + */ +void __init apic_intr_init(void) +{ +#ifdef CONFIG_SMP + smp_intr_init(); +#endif + /* self generated IPI for local APIC timer */ + alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); + + /* IPI vectors for APIC spurious and error interrupts */ + alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); + alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); + + /* thermal monitor LVT interrupt */ +#ifdef CONFIG_X86_MCE_P4THERMAL + alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); +#endif +} + /** * connect_bsp_APIC - attach the APIC to the interrupt system */ diff --git a/trunk/arch/x86/kernel/apic_64.c b/trunk/arch/x86/kernel/apic_64.c index 1a6011855af3..446c062e831c 100644 --- a/trunk/arch/x86/kernel/apic_64.c +++ b/trunk/arch/x86/kernel/apic_64.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -40,7 +39,6 @@ #include #include #include -#include #include #include @@ -48,11 +46,6 @@ static int disable_apic_timer __cpuinitdata; static int apic_calibrate_pmtmr __initdata; int disable_apic; -int disable_x2apic; -int x2apic; - -/* x2apic enabled before OS handover */ -int x2apic_preenabled; /* Local APIC timer works in C2 */ int local_apic_timer_c2_ok; @@ -125,13 +118,13 @@ static int modern_apic(void) return lapic_get_version() >= 0x14; } -void xapic_wait_icr_idle(void) +void apic_wait_icr_idle(void) { while (apic_read(APIC_ICR) & APIC_ICR_BUSY) cpu_relax(); } -u32 safe_xapic_wait_icr_idle(void) +u32 safe_apic_wait_icr_idle(void) { u32 send_status; int timeout; @@ -147,69 +140,6 @@ u32 safe_xapic_wait_icr_idle(void) return send_status; } -void xapic_icr_write(u32 low, u32 id) -{ - apic_write(APIC_ICR2, id << 24); - apic_write(APIC_ICR, low); -} - -u64 xapic_icr_read(void) -{ - u32 icr1, icr2; - - icr2 = apic_read(APIC_ICR2); - icr1 = apic_read(APIC_ICR); - - return (icr1 | ((u64)icr2 << 32)); -} - -static struct apic_ops xapic_ops = { - .read = native_apic_mem_read, - .write = native_apic_mem_write, - .icr_read = xapic_icr_read, - .icr_write = xapic_icr_write, - .wait_icr_idle = xapic_wait_icr_idle, - .safe_wait_icr_idle = safe_xapic_wait_icr_idle, -}; - -struct apic_ops __read_mostly *apic_ops = &xapic_ops; - -EXPORT_SYMBOL_GPL(apic_ops); - -static void x2apic_wait_icr_idle(void) -{ - /* no need to wait for icr idle in x2apic */ - return; -} - -static u32 safe_x2apic_wait_icr_idle(void) -{ - /* no need to wait for icr idle in x2apic */ - return 0; -} - -void x2apic_icr_write(u32 low, u32 id) -{ - wrmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), ((__u64) id) << 32 | low); -} - -u64 x2apic_icr_read(void) -{ - unsigned long val; - - rdmsrl(APIC_BASE_MSR + (APIC_ICR >> 4), val); - return val; -} - -static struct apic_ops x2apic_ops = { - .read = native_apic_msr_read, - .write = native_apic_msr_write, - .icr_read = x2apic_icr_read, - .icr_write = x2apic_icr_write, - .wait_icr_idle = x2apic_wait_icr_idle, - .safe_wait_icr_idle = safe_x2apic_wait_icr_idle, -}; - /** * enable_NMI_through_LVT0 - enable NMI through local vector table 0 */ @@ -219,11 +149,6 @@ void __cpuinit enable_NMI_through_LVT0(void) /* unmask and set to NMI */ v = APIC_DM_NMI; - - /* Level triggered for 82489DX (32bit mode) */ - if (!lapic_is_integrated()) - v |= APIC_LVT_LEVEL_TRIGGER; - apic_write(APIC_LVT0, v); } @@ -232,14 +157,11 @@ void __cpuinit enable_NMI_through_LVT0(void) */ int lapic_get_maxlvt(void) { - unsigned int v; + unsigned int v, maxlvt; v = apic_read(APIC_LVR); - /* - * - we always have APIC integrated on 64bit mode - * - 82489DXs do not report # of LVT entries - */ - return APIC_INTEGRATED(GET_APIC_VERSION(v)) ? GET_APIC_MAXLVT(v) : 2; + maxlvt = GET_APIC_MAXLVT(v); + return maxlvt; } /* @@ -707,10 +629,10 @@ int __init verify_local_APIC(void) /* * The ID register is read/write in a real APIC. */ - reg0 = apic_read(APIC_ID); + reg0 = read_apic_id(); apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg0); apic_write(APIC_ID, reg0 ^ APIC_ID_MASK); - reg1 = apic_read(APIC_ID); + reg1 = read_apic_id(); apic_printk(APIC_DEBUG, "Getting ID: %x\n", reg1); apic_write(APIC_ID, reg0); if (reg1 != (reg0 ^ APIC_ID_MASK)) @@ -911,125 +833,6 @@ void __cpuinit end_local_APIC_setup(void) apic_pm_activate(); } -void check_x2apic(void) -{ - int msr, msr2; - - rdmsr(MSR_IA32_APICBASE, msr, msr2); - - if (msr & X2APIC_ENABLE) { - printk("x2apic enabled by BIOS, switching to x2apic ops\n"); - x2apic_preenabled = x2apic = 1; - apic_ops = &x2apic_ops; - } -} - -void enable_x2apic(void) -{ - int msr, msr2; - - rdmsr(MSR_IA32_APICBASE, msr, msr2); - if (!(msr & X2APIC_ENABLE)) { - printk("Enabling x2apic\n"); - wrmsr(MSR_IA32_APICBASE, msr | X2APIC_ENABLE, 0); - } -} - -void enable_IR_x2apic(void) -{ -#ifdef CONFIG_INTR_REMAP - int ret; - unsigned long flags; - - if (!cpu_has_x2apic) - return; - - if (!x2apic_preenabled && disable_x2apic) { - printk(KERN_INFO - "Skipped enabling x2apic and Interrupt-remapping " - "because of nox2apic\n"); - return; - } - - if (x2apic_preenabled && disable_x2apic) - panic("Bios already enabled x2apic, can't enforce nox2apic"); - - if (!x2apic_preenabled && skip_ioapic_setup) { - printk(KERN_INFO - "Skipped enabling x2apic and Interrupt-remapping " - "because of skipping io-apic setup\n"); - return; - } - - ret = dmar_table_init(); - if (ret) { - printk(KERN_INFO - "dmar_table_init() failed with %d:\n", ret); - - if (x2apic_preenabled) - panic("x2apic enabled by bios. But IR enabling failed"); - else - printk(KERN_INFO - "Not enabling x2apic,Intr-remapping\n"); - return; - } - - local_irq_save(flags); - mask_8259A(); - save_mask_IO_APIC_setup(); - - ret = enable_intr_remapping(1); - - if (ret && x2apic_preenabled) { - local_irq_restore(flags); - panic("x2apic enabled by bios. But IR enabling failed"); - } - - if (ret) - goto end; - - if (!x2apic) { - x2apic = 1; - apic_ops = &x2apic_ops; - enable_x2apic(); - } -end: - if (ret) - /* - * IR enabling failed - */ - restore_IO_APIC_setup(); - else - reinit_intr_remapped_IO_APIC(x2apic_preenabled); - - unmask_8259A(); - local_irq_restore(flags); - - if (!ret) { - if (!x2apic_preenabled) - printk(KERN_INFO - "Enabled x2apic and interrupt-remapping\n"); - else - printk(KERN_INFO - "Enabled Interrupt-remapping\n"); - } else - printk(KERN_ERR - "Failed to enable Interrupt-remapping and x2apic\n"); -#else - if (!cpu_has_x2apic) - return; - - if (x2apic_preenabled) - panic("x2apic enabled prior OS handover," - " enable CONFIG_INTR_REMAP"); - - printk(KERN_INFO "Enable CONFIG_INTR_REMAP for enabling intr-remapping " - " and x2apic\n"); -#endif - - return; -} - /* * Detect and enable local APICs on non-SMP boards. * Original code written by Keir Fraser. @@ -1069,7 +872,7 @@ void __init early_init_lapic_mapping(void) * Fetch the APIC ID of the BSP in case we have a * default configuration (or the MP table is broken). */ - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); } /** @@ -1077,11 +880,6 @@ void __init early_init_lapic_mapping(void) */ void __init init_apic_mappings(void) { - if (x2apic) { - boot_cpu_physical_apicid = read_apic_id(); - return; - } - /* * If no local APIC can be found then set up a fake all * zeroes page to simulate the local APIC and another @@ -1101,7 +899,7 @@ void __init init_apic_mappings(void) * Fetch the APIC ID of the BSP in case we have a * default configuration (or the MP table is broken). */ - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); } /* @@ -1120,9 +918,6 @@ int __init APIC_init_uniprocessor(void) return -1; } - enable_IR_x2apic(); - setup_apic_routing(); - verify_local_APIC(); connect_bsp_APIC(); @@ -1298,11 +1093,6 @@ void __cpuinit generic_processor_info(int apicid, int version) cpu_set(cpu, cpu_present_map); } -int hard_smp_processor_id(void) -{ - return read_apic_id(); -} - /* * Power management */ @@ -1339,7 +1129,7 @@ static int lapic_suspend(struct sys_device *dev, pm_message_t state) maxlvt = lapic_get_maxlvt(); - apic_pm_state.apic_id = apic_read(APIC_ID); + apic_pm_state.apic_id = read_apic_id(); apic_pm_state.apic_taskpri = apic_read(APIC_TASKPRI); apic_pm_state.apic_ldr = apic_read(APIC_LDR); apic_pm_state.apic_dfr = apic_read(APIC_DFR); @@ -1374,14 +1164,10 @@ static int lapic_resume(struct sys_device *dev) maxlvt = lapic_get_maxlvt(); local_irq_save(flags); - if (!x2apic) { - rdmsr(MSR_IA32_APICBASE, l, h); - l &= ~MSR_IA32_APICBASE_BASE; - l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; - wrmsr(MSR_IA32_APICBASE, l, h); - } else - enable_x2apic(); - + rdmsr(MSR_IA32_APICBASE, l, h); + l &= ~MSR_IA32_APICBASE_BASE; + l |= MSR_IA32_APICBASE_ENABLE | mp_lapic_addr; + wrmsr(MSR_IA32_APICBASE, l, h); apic_write(APIC_LVTERR, ERROR_APIC_VECTOR | APIC_LVT_MASKED); apic_write(APIC_ID, apic_pm_state.apic_id); apic_write(APIC_DFR, apic_pm_state.apic_dfr); @@ -1521,15 +1307,6 @@ __cpuinit int apic_is_clustered_box(void) return (clusters > 2); } -static __init int setup_nox2apic(char *str) -{ - disable_x2apic = 1; - clear_cpu_cap(&boot_cpu_data, X86_FEATURE_X2APIC); - return 0; -} -early_param("nox2apic", setup_nox2apic); - - /* * APIC command line parameters */ diff --git a/trunk/arch/x86/kernel/asm-offsets_64.c b/trunk/arch/x86/kernel/asm-offsets_64.c index 505543a75a56..aa89387006fe 100644 --- a/trunk/arch/x86/kernel/asm-offsets_64.c +++ b/trunk/arch/x86/kernel/asm-offsets_64.c @@ -22,7 +22,7 @@ #define __NO_STUBS 1 #undef __SYSCALL -#undef ASM_X86__UNISTD_64_H +#undef _ASM_X86_64_UNISTD_H_ #define __SYSCALL(nr, sym) [nr] = 1, static char syscalls[] = { #include diff --git a/trunk/arch/x86/kernel/cpu/Makefile b/trunk/arch/x86/kernel/cpu/Makefile index 3ede19a4e0b2..ee76eaad3001 100644 --- a/trunk/arch/x86/kernel/cpu/Makefile +++ b/trunk/arch/x86/kernel/cpu/Makefile @@ -3,32 +3,22 @@ # obj-y := intel_cacheinfo.o addon_cpuid_features.o -obj-y += proc.o capflags.o powerflags.o +obj-y += proc.o feature_names.o -obj-$(CONFIG_X86_32) += common.o bugs.o cmpxchg.o +obj-$(CONFIG_X86_32) += common.o bugs.o obj-$(CONFIG_X86_64) += common_64.o bugs_64.o - -obj-$(CONFIG_CPU_SUP_AMD_32) += amd.o -obj-$(CONFIG_CPU_SUP_AMD_64) += amd_64.o -obj-$(CONFIG_CPU_SUP_CYRIX_32) += cyrix.o -obj-$(CONFIG_CPU_SUP_CENTAUR_32) += centaur.o -obj-$(CONFIG_CPU_SUP_CENTAUR_64) += centaur_64.o -obj-$(CONFIG_CPU_SUP_TRANSMETA_32) += transmeta.o -obj-$(CONFIG_CPU_SUP_INTEL_32) += intel.o -obj-$(CONFIG_CPU_SUP_INTEL_64) += intel_64.o -obj-$(CONFIG_CPU_SUP_UMC_32) += umc.o +obj-$(CONFIG_X86_32) += amd.o +obj-$(CONFIG_X86_64) += amd_64.o +obj-$(CONFIG_X86_32) += cyrix.o +obj-$(CONFIG_X86_32) += centaur.o +obj-$(CONFIG_X86_64) += centaur_64.o +obj-$(CONFIG_X86_32) += transmeta.o +obj-$(CONFIG_X86_32) += intel.o +obj-$(CONFIG_X86_64) += intel_64.o +obj-$(CONFIG_X86_32) += umc.o obj-$(CONFIG_X86_MCE) += mcheck/ obj-$(CONFIG_MTRR) += mtrr/ obj-$(CONFIG_CPU_FREQ) += cpufreq/ obj-$(CONFIG_X86_LOCAL_APIC) += perfctr-watchdog.o - -quiet_cmd_mkcapflags = MKCAP $@ - cmd_mkcapflags = $(PERL) $(srctree)/$(src)/mkcapflags.pl $< $@ - -cpufeature = $(src)/../../../../include/asm-x86/cpufeature.h - -targets += capflags.c -$(obj)/capflags.c: $(cpufeature) $(src)/mkcapflags.pl FORCE - $(call if_changed,mkcapflags) diff --git a/trunk/arch/x86/kernel/cpu/cmpxchg.c b/trunk/arch/x86/kernel/cpu/cmpxchg.c deleted file mode 100644 index 2056ccf572cc..000000000000 --- a/trunk/arch/x86/kernel/cpu/cmpxchg.c +++ /dev/null @@ -1,72 +0,0 @@ -/* - * cmpxchg*() fallbacks for CPU not supporting these instructions - */ - -#include -#include -#include - -#ifndef CONFIG_X86_CMPXCHG -unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) -{ - u8 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u8 *)ptr; - if (prev == old) - *(u8 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u8); - -unsigned long cmpxchg_386_u16(volatile void *ptr, u16 old, u16 new) -{ - u16 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u16 *)ptr; - if (prev == old) - *(u16 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u16); - -unsigned long cmpxchg_386_u32(volatile void *ptr, u32 old, u32 new) -{ - u32 prev; - unsigned long flags; - - /* Poor man's cmpxchg for 386. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u32 *)ptr; - if (prev == old) - *(u32 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_386_u32); -#endif - -#ifndef CONFIG_X86_CMPXCHG64 -unsigned long long cmpxchg_486_u64(volatile void *ptr, u64 old, u64 new) -{ - u64 prev; - unsigned long flags; - - /* Poor man's cmpxchg8b for 386 and 486. Unsuitable for SMP */ - local_irq_save(flags); - prev = *(u64 *)ptr; - if (prev == old) - *(u64 *)ptr = new; - local_irq_restore(flags); - return prev; -} -EXPORT_SYMBOL(cmpxchg_486_u64); -#endif - diff --git a/trunk/arch/x86/kernel/cpu/common.c b/trunk/arch/x86/kernel/cpu/common.c index 0785b3c8d043..80ab20d4fa39 100644 --- a/trunk/arch/x86/kernel/cpu/common.c +++ b/trunk/arch/x86/kernel/cpu/common.c @@ -13,7 +13,6 @@ #include #include #include -#include #ifdef CONFIG_X86_LOCAL_APIC #include #include @@ -342,35 +341,6 @@ static void __init early_cpu_detect(void) early_get_cap(c); } -/* - * The NOPL instruction is supposed to exist on all CPUs with - * family >= 6, unfortunately, that's not true in practice because - * of early VIA chips and (more importantly) broken virtualizers that - * are not easy to detect. Hence, probe for it based on first - * principles. - */ -static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) -{ - const u32 nopl_signature = 0x888c53b1; /* Random number */ - u32 has_nopl = nopl_signature; - - clear_cpu_cap(c, X86_FEATURE_NOPL); - if (c->x86 >= 6) { - asm volatile("\n" - "1: .byte 0x0f,0x1f,0xc0\n" /* nopl %eax */ - "2:\n" - " .section .fixup,\"ax\"\n" - "3: xor %0,%0\n" - " jmp 2b\n" - " .previous\n" - _ASM_EXTABLE(1b,3b) - : "+a" (has_nopl)); - - if (has_nopl == nopl_signature) - set_cpu_cap(c, X86_FEATURE_NOPL); - } -} - static void __cpuinit generic_identify(struct cpuinfo_x86 *c) { u32 tfms, xlvl; @@ -425,8 +395,8 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c) } init_scattered_cpuid_features(c); - detect_nopl(c); } + } static void __cpuinit squash_the_stupid_serial_number(struct cpuinfo_x86 *c) diff --git a/trunk/arch/x86/kernel/cpu/common_64.c b/trunk/arch/x86/kernel/cpu/common_64.c index 35d11efdf1fe..dd6e3f15017e 100644 --- a/trunk/arch/x86/kernel/cpu/common_64.c +++ b/trunk/arch/x86/kernel/cpu/common_64.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #ifdef CONFIG_X86_LOCAL_APIC #include @@ -216,39 +215,6 @@ static void __init early_cpu_support_print(void) } } -/* - * The NOPL instruction is supposed to exist on all CPUs with - * family >= 6, unfortunately, that's not true in practice because - * of early VIA chips and (more importantly) broken virtualizers that - * are not easy to detect. Hence, probe for it based on first - * principles. - * - * Note: no 64-bit chip is known to lack these, but put the code here - * for consistency with 32 bits, and to make it utterly trivial to - * diagnose the problem should it ever surface. - */ -static void __cpuinit detect_nopl(struct cpuinfo_x86 *c) -{ - const u32 nopl_signature = 0x888c53b1; /* Random number */ - u32 has_nopl = nopl_signature; - - clear_cpu_cap(c, X86_FEATURE_NOPL); - if (c->x86 >= 6) { - asm volatile("\n" - "1: .byte 0x0f,0x1f,0xc0\n" /* nopl %eax */ - "2:\n" - " .section .fixup,\"ax\"\n" - "3: xor %0,%0\n" - " jmp 2b\n" - " .previous\n" - _ASM_EXTABLE(1b,3b) - : "+a" (has_nopl)); - - if (has_nopl == nopl_signature) - set_cpu_cap(c, X86_FEATURE_NOPL); - } -} - static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c); void __init early_cpu_init(void) @@ -347,8 +313,6 @@ static void __cpuinit early_identify_cpu(struct cpuinfo_x86 *c) c->x86_phys_bits = eax & 0xff; } - detect_nopl(c); - if (c->x86_vendor != X86_VENDOR_UNKNOWN && cpu_devs[c->x86_vendor]->c_early_init) cpu_devs[c->x86_vendor]->c_early_init(c); @@ -529,20 +493,17 @@ void pda_init(int cpu) /* others are initialized in smpboot.c */ pda->pcurrent = &init_task; pda->irqstackptr = boot_cpu_stack; - pda->irqstackptr += IRQSTACKSIZE - 64; } else { - if (!pda->irqstackptr) { - pda->irqstackptr = (char *) - __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); - if (!pda->irqstackptr) - panic("cannot allocate irqstack for cpu %d", - cpu); - pda->irqstackptr += IRQSTACKSIZE - 64; - } + pda->irqstackptr = (char *) + __get_free_pages(GFP_ATOMIC, IRQSTACK_ORDER); + if (!pda->irqstackptr) + panic("cannot allocate irqstack for cpu %d", cpu); if (pda->nodenumber == 0 && cpu_to_node(cpu) != NUMA_NO_NODE) pda->nodenumber = cpu_to_node(cpu); } + + pda->irqstackptr += IRQSTACKSIZE-64; } char boot_exception_stacks[(N_EXCEPTION_STACKS - 1) * EXCEPTION_STKSZ + @@ -636,28 +597,23 @@ void __cpuinit cpu_init(void) barrier(); check_efer(); - if (cpu != 0 && x2apic) - enable_x2apic(); /* * set up and load the per-CPU TSS */ - if (!orig_ist->ist[0]) { + for (v = 0; v < N_EXCEPTION_STACKS; v++) { static const unsigned int order[N_EXCEPTION_STACKS] = { - [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, - [DEBUG_STACK - 1] = DEBUG_STACK_ORDER + [0 ... N_EXCEPTION_STACKS - 1] = EXCEPTION_STACK_ORDER, + [DEBUG_STACK - 1] = DEBUG_STACK_ORDER }; - for (v = 0; v < N_EXCEPTION_STACKS; v++) { - if (cpu) { - estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); - if (!estacks) - panic("Cannot allocate exception " - "stack %ld %d\n", v, cpu); - } - estacks += PAGE_SIZE << order[v]; - orig_ist->ist[v] = t->x86_tss.ist[v] = - (unsigned long)estacks; + if (cpu) { + estacks = (char *)__get_free_pages(GFP_ATOMIC, order[v]); + if (!estacks) + panic("Cannot allocate exception stack %ld %d\n", + v, cpu); } + estacks += PAGE_SIZE << order[v]; + orig_ist->ist[v] = t->x86_tss.ist[v] = (unsigned long)estacks; } t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap); diff --git a/trunk/arch/x86/kernel/cpu/cyrix.c b/trunk/arch/x86/kernel/cpu/cyrix.c index ada50505a5c8..e710a21bb6e8 100644 --- a/trunk/arch/x86/kernel/cpu/cyrix.c +++ b/trunk/arch/x86/kernel/cpu/cyrix.c @@ -116,7 +116,7 @@ static void __cpuinit set_cx86_reorder(void) setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ /* Load/Store Serialize to mem access disable (=reorder it) */ - setCx86_old(CX86_PCR0, getCx86_old(CX86_PCR0) & ~0x80); + setCx86(CX86_PCR0, getCx86(CX86_PCR0) & ~0x80); /* set load/store serialize from 1GB to 4GB */ ccr3 |= 0xe0; setCx86(CX86_CCR3, ccr3); @@ -127,11 +127,11 @@ static void __cpuinit set_cx86_memwb(void) printk(KERN_INFO "Enable Memory-Write-back mode on Cyrix/NSC processor.\n"); /* CCR2 bit 2: unlock NW bit */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) & ~0x04); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) & ~0x04); /* set 'Not Write-through' */ write_cr0(read_cr0() | X86_CR0_NW); /* CCR2 bit 2: lock NW bit and set WT1 */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x14); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14); } /* @@ -145,14 +145,14 @@ static void __cpuinit geode_configure(void) local_irq_save(flags); /* Suspend on halt power saving and enable #SUSP pin */ - setCx86_old(CX86_CCR2, getCx86_old(CX86_CCR2) | 0x88); + setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88); ccr3 = getCx86(CX86_CCR3); setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ /* FPU fast, DTE cache, Mem bypass */ - setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x38); + setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x38); setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ set_cx86_memwb(); @@ -268,7 +268,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) /* GXm supports extended cpuid levels 'ala' AMD */ if (c->cpuid_level == 2) { /* Enable cxMMX extensions (GX1 Datasheet 54) */ - setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7) | 1); + setCx86(CX86_CCR7, getCx86(CX86_CCR7) | 1); /* * GXm : 0x30 ... 0x5f GXm datasheet 51 @@ -291,7 +291,7 @@ static void __cpuinit init_cyrix(struct cpuinfo_x86 *c) if (dir1 > 7) { dir0_msn++; /* M II */ /* Enable MMX extensions (App note 108) */ - setCx86_old(CX86_CCR7, getCx86_old(CX86_CCR7)|1); + setCx86(CX86_CCR7, getCx86(CX86_CCR7)|1); } else { c->coma_bug = 1; /* 6x86MX, it has the bug. */ } @@ -406,7 +406,7 @@ static void __cpuinit cyrix_identify(struct cpuinfo_x86 *c) local_irq_save(flags); ccr3 = getCx86(CX86_CCR3); setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ - setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80); /* enable cpuid */ + setCx86(CX86_CCR4, getCx86(CX86_CCR4) | 0x80); /* enable cpuid */ setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ local_irq_restore(flags); } diff --git a/trunk/arch/x86/kernel/cpu/feature_names.c b/trunk/arch/x86/kernel/cpu/feature_names.c new file mode 100644 index 000000000000..e43ad4ad4cba --- /dev/null +++ b/trunk/arch/x86/kernel/cpu/feature_names.c @@ -0,0 +1,83 @@ +/* + * Strings for the various x86 capability flags. + * + * This file must not contain any executable code. + */ + +#include + +/* + * These flag bits must match the definitions in . + * NULL means this bit is undefined or reserved; either way it doesn't + * have meaning as far as Linux is concerned. Note that it's important + * to realize there is a difference between this table and CPUID -- if + * applications want to get the raw CPUID data, they should access + * /dev/cpu//cpuid instead. + */ +const char * const x86_cap_flags[NCAPINTS*32] = { + /* Intel-defined */ + "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", + "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", + "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx", + "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe", + + /* AMD-defined */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, + NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, + NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", + "3dnowext", "3dnow", + + /* Transmeta-defined */ + "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* Other (Linux-defined) */ + "cxmmx", "k6_mtrr", "cyrix_arr", "centaur_mcr", + NULL, NULL, NULL, NULL, + "constant_tsc", "up", NULL, "arch_perfmon", + "pebs", "bts", NULL, NULL, + "rep_good", NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* Intel-defined (#2) */ + "pni", NULL, NULL, "monitor", "ds_cpl", "vmx", "smx", "est", + "tm2", "ssse3", "cid", NULL, NULL, "cx16", "xtpr", NULL, + NULL, NULL, "dca", "sse4_1", "sse4_2", NULL, NULL, "popcnt", + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* VIA/Cyrix/Centaur-defined */ + NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en", + "ace2", "ace2_en", "phe", "phe_en", "pmm", "pmm_en", NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* AMD-defined (#2) */ + "lahf_lm", "cmp_legacy", "svm", "extapic", + "cr8_legacy", "abm", "sse4a", "misalignsse", + "3dnowprefetch", "osvw", "ibs", "sse5", + "skinit", "wdt", NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + + /* Auxiliary (Linux-defined) */ + "ida", NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +const char *const x86_power_flags[32] = { + "ts", /* temperature sensor */ + "fid", /* frequency id control */ + "vid", /* voltage id control */ + "ttp", /* thermal trip */ + "tm", + "stc", + "100mhzsteps", + "hwpstate", + "", /* tsc invariant mapped to constant_tsc */ + /* nothing */ +}; diff --git a/trunk/arch/x86/kernel/cpu/intel.c b/trunk/arch/x86/kernel/cpu/intel.c index 77618c717d76..b75f2569b8f8 100644 --- a/trunk/arch/x86/kernel/cpu/intel.c +++ b/trunk/arch/x86/kernel/cpu/intel.c @@ -23,6 +23,13 @@ #include #endif +#ifdef CONFIG_X86_INTEL_USERCOPY +/* + * Alignment at which movsl is preferred for bulk memory copies. + */ +struct movsl_mask movsl_mask __read_mostly; +#endif + static void __cpuinit early_init_intel(struct cpuinfo_x86 *c) { /* Netburst reports 64 bytes clflush size, but does IO in 128 bytes */ @@ -307,5 +314,69 @@ static struct cpu_dev intel_cpu_dev __cpuinitdata = { cpu_vendor_dev_register(X86_VENDOR_INTEL, &intel_cpu_dev); +#ifndef CONFIG_X86_CMPXCHG +unsigned long cmpxchg_386_u8(volatile void *ptr, u8 old, u8 new) +{ + u8 prev; + unsigned long flags; + + /* Poor man's cmpxchg for 386. Unsuitable for SMP */ + local_irq_save(flags); + prev = *(u8 *)ptr; + if (prev == old) + *(u8 *)ptr = new; + local_irq_restore(flags); + return prev; +} +EXPORT_SYMBOL(cmpxchg_386_u8); + +unsigned long cmpxchg_386_u16(volatile void *ptr, u16 old, u16 new) +{ + u16 prev; + unsigned long flags; + + /* Poor man's cmpxchg for 386. Unsuitable for SMP */ + local_irq_save(flags); + prev = *(u16 *)ptr; + if (prev == old) + *(u16 *)ptr = new; + local_irq_restore(flags); + return prev; +} +EXPORT_SYMBOL(cmpxchg_386_u16); + +unsigned long cmpxchg_386_u32(volatile void *ptr, u32 old, u32 new) +{ + u32 prev; + unsigned long flags; + + /* Poor man's cmpxchg for 386. Unsuitable for SMP */ + local_irq_save(flags); + prev = *(u32 *)ptr; + if (prev == old) + *(u32 *)ptr = new; + local_irq_restore(flags); + return prev; +} +EXPORT_SYMBOL(cmpxchg_386_u32); +#endif + +#ifndef CONFIG_X86_CMPXCHG64 +unsigned long long cmpxchg_486_u64(volatile void *ptr, u64 old, u64 new) +{ + u64 prev; + unsigned long flags; + + /* Poor man's cmpxchg8b for 386 and 486. Unsuitable for SMP */ + local_irq_save(flags); + prev = *(u64 *)ptr; + if (prev == old) + *(u64 *)ptr = new; + local_irq_restore(flags); + return prev; +} +EXPORT_SYMBOL(cmpxchg_486_u64); +#endif + /* arch_initcall(intel_cpu_init); */ diff --git a/trunk/arch/x86/kernel/cpu/intel_cacheinfo.c b/trunk/arch/x86/kernel/cpu/intel_cacheinfo.c index 3f46afbb1cf1..6b0a10b002f1 100644 --- a/trunk/arch/x86/kernel/cpu/intel_cacheinfo.c +++ b/trunk/arch/x86/kernel/cpu/intel_cacheinfo.c @@ -1,8 +1,8 @@ /* - * Routines to indentify caches on Intel CPU. + * Routines to indentify caches on Intel CPU. * - * Changes: - * Venkatesh Pallipadi : Adding cache identification through cpuid(4) + * Changes: + * Venkatesh Pallipadi : Adding cache identification through cpuid(4) * Ashok Raj : Work with CPU hotplug infrastructure. * Andi Kleen / Andreas Herrmann : CPUID4 emulation on AMD. */ @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -131,18 +130,9 @@ struct _cpuid4_info { union _cpuid4_leaf_ebx ebx; union _cpuid4_leaf_ecx ecx; unsigned long size; - unsigned long can_disable; cpumask_t shared_cpu_map; /* future?: only cpus/node is needed */ }; -#ifdef CONFIG_PCI -static struct pci_device_id k8_nb_id[] = { - { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1103) }, - { PCI_DEVICE(PCI_VENDOR_ID_AMD, 0x1203) }, - {} -}; -#endif - unsigned short num_cache_leaves; /* AMD doesn't have CPUID4. Emulate it here to report the same @@ -192,10 +182,9 @@ static unsigned short assocs[] __cpuinitdata = { static unsigned char levels[] __cpuinitdata = { 1, 1, 2, 3 }; static unsigned char types[] __cpuinitdata = { 1, 2, 3, 3 }; -static void __cpuinit -amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, - union _cpuid4_leaf_ebx *ebx, - union _cpuid4_leaf_ecx *ecx) +static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, + union _cpuid4_leaf_ebx *ebx, + union _cpuid4_leaf_ecx *ecx) { unsigned dummy; unsigned line_size, lines_per_tag, assoc, size_in_kb; @@ -262,40 +251,27 @@ amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax, (ebx->split.ways_of_associativity + 1) - 1; } -static void __cpuinit -amd_check_l3_disable(int index, struct _cpuid4_info *this_leaf) -{ - if (index < 3) - return; - this_leaf->can_disable = 1; -} - -static int -__cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) +static int __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf) { union _cpuid4_leaf_eax eax; union _cpuid4_leaf_ebx ebx; union _cpuid4_leaf_ecx ecx; unsigned edx; - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) { + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) amd_cpuid4(index, &eax, &ebx, &ecx); - if (boot_cpu_data.x86 >= 0x10) - amd_check_l3_disable(index, this_leaf); - } else { - cpuid_count(4, index, &eax.full, &ebx.full, &ecx.full, &edx); - } - + else + cpuid_count(4, index, &eax.full, &ebx.full, &ecx.full, &edx); if (eax.split.type == CACHE_TYPE_NULL) return -EIO; /* better error ? */ this_leaf->eax = eax; this_leaf->ebx = ebx; this_leaf->ecx = ecx; - this_leaf->size = (ecx.split.number_of_sets + 1) * - (ebx.split.coherency_line_size + 1) * - (ebx.split.physical_line_partition + 1) * - (ebx.split.ways_of_associativity + 1); + this_leaf->size = (ecx.split.number_of_sets + 1) * + (ebx.split.coherency_line_size + 1) * + (ebx.split.physical_line_partition + 1) * + (ebx.split.ways_of_associativity + 1); return 0; } @@ -477,7 +453,7 @@ unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c) /* pointer to _cpuid4_info array (for each cache leaf) */ static DEFINE_PER_CPU(struct _cpuid4_info *, cpuid4_info); -#define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) +#define CPUID4_INFO_IDX(x, y) (&((per_cpu(cpuid4_info, x))[y])) #ifdef CONFIG_SMP static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index) @@ -514,7 +490,7 @@ static void __cpuinit cache_remove_shared_cpu_map(unsigned int cpu, int index) this_leaf = CPUID4_INFO_IDX(cpu, index); for_each_cpu_mask_nr(sibling, this_leaf->shared_cpu_map) { - sibling_leaf = CPUID4_INFO_IDX(sibling, index); + sibling_leaf = CPUID4_INFO_IDX(sibling, index); cpu_clear(cpu, sibling_leaf->shared_cpu_map); } } @@ -596,7 +572,7 @@ struct _index_kobject { /* pointer to array of kobjects for cpuX/cache/indexY */ static DEFINE_PER_CPU(struct _index_kobject *, index_kobject); -#define INDEX_KOBJECT_PTR(x, y) (&((per_cpu(index_kobject, x))[y])) +#define INDEX_KOBJECT_PTR(x, y) (&((per_cpu(index_kobject, x))[y])) #define show_one_plus(file_name, object, val) \ static ssize_t show_##file_name \ @@ -661,99 +637,6 @@ static ssize_t show_type(struct _cpuid4_info *this_leaf, char *buf) { } } -#define to_object(k) container_of(k, struct _index_kobject, kobj) -#define to_attr(a) container_of(a, struct _cache_attr, attr) - -#ifdef CONFIG_PCI -static struct pci_dev *get_k8_northbridge(int node) -{ - struct pci_dev *dev = NULL; - int i; - - for (i = 0; i <= node; i++) { - do { - dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev); - if (!dev) - break; - } while (!pci_match_id(&k8_nb_id[0], dev)); - if (!dev) - break; - } - return dev; -} -#else -static struct pci_dev *get_k8_northbridge(int node) -{ - return NULL; -} -#endif - -static ssize_t show_cache_disable(struct _cpuid4_info *this_leaf, char *buf) -{ - int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map)); - struct pci_dev *dev = NULL; - ssize_t ret = 0; - int i; - - if (!this_leaf->can_disable) - return sprintf(buf, "Feature not enabled\n"); - - dev = get_k8_northbridge(node); - if (!dev) { - printk(KERN_ERR "Attempting AMD northbridge operation on a system with no northbridge\n"); - return -EINVAL; - } - - for (i = 0; i < 2; i++) { - unsigned int reg; - - pci_read_config_dword(dev, 0x1BC + i * 4, ®); - - ret += sprintf(buf, "%sEntry: %d\n", buf, i); - ret += sprintf(buf, "%sReads: %s\tNew Entries: %s\n", - buf, - reg & 0x80000000 ? "Disabled" : "Allowed", - reg & 0x40000000 ? "Disabled" : "Allowed"); - ret += sprintf(buf, "%sSubCache: %x\tIndex: %x\n", - buf, (reg & 0x30000) >> 16, reg & 0xfff); - } - return ret; -} - -static ssize_t -store_cache_disable(struct _cpuid4_info *this_leaf, const char *buf, - size_t count) -{ - int node = cpu_to_node(first_cpu(this_leaf->shared_cpu_map)); - struct pci_dev *dev = NULL; - unsigned int ret, index, val; - - if (!this_leaf->can_disable) - return 0; - - if (strlen(buf) > 15) - return -EINVAL; - - ret = sscanf(buf, "%x %x", &index, &val); - if (ret != 2) - return -EINVAL; - if (index > 1) - return -EINVAL; - - val |= 0xc0000000; - dev = get_k8_northbridge(node); - if (!dev) { - printk(KERN_ERR "Attempting AMD northbridge operation on a system with no northbridge\n"); - return -EINVAL; - } - - pci_write_config_dword(dev, 0x1BC + index * 4, val & ~0x40000000); - wbinvd(); - pci_write_config_dword(dev, 0x1BC + index * 4, val); - - return 1; -} - struct _cache_attr { struct attribute attr; ssize_t (*show)(struct _cpuid4_info *, char *); @@ -774,8 +657,6 @@ define_one_ro(size); define_one_ro(shared_cpu_map); define_one_ro(shared_cpu_list); -static struct _cache_attr cache_disable = __ATTR(cache_disable, 0644, show_cache_disable, store_cache_disable); - static struct attribute * default_attrs[] = { &type.attr, &level.attr, @@ -786,10 +667,12 @@ static struct attribute * default_attrs[] = { &size.attr, &shared_cpu_map.attr, &shared_cpu_list.attr, - &cache_disable.attr, NULL }; +#define to_object(k) container_of(k, struct _index_kobject, kobj) +#define to_attr(a) container_of(a, struct _cache_attr, attr) + static ssize_t show(struct kobject * kobj, struct attribute * attr, char * buf) { struct _cache_attr *fattr = to_attr(attr); @@ -799,22 +682,14 @@ static ssize_t show(struct kobject * kobj, struct attribute * attr, char * buf) ret = fattr->show ? fattr->show(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), buf) : - 0; + 0; return ret; } static ssize_t store(struct kobject * kobj, struct attribute * attr, const char * buf, size_t count) { - struct _cache_attr *fattr = to_attr(attr); - struct _index_kobject *this_leaf = to_object(kobj); - ssize_t ret; - - ret = fattr->store ? - fattr->store(CPUID4_INFO_IDX(this_leaf->cpu, this_leaf->index), - buf, count) : - 0; - return ret; + return 0; } static struct sysfs_ops sysfs_ops = { diff --git a/trunk/arch/x86/kernel/cpu/mkcapflags.pl b/trunk/arch/x86/kernel/cpu/mkcapflags.pl deleted file mode 100644 index dfea390e1608..000000000000 --- a/trunk/arch/x86/kernel/cpu/mkcapflags.pl +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/perl -# -# Generate the x86_cap_flags[] array from include/asm-x86/cpufeature.h -# - -($in, $out) = @ARGV; - -open(IN, "< $in\0") or die "$0: cannot open: $in: $!\n"; -open(OUT, "> $out\0") or die "$0: cannot create: $out: $!\n"; - -print OUT "#include \n\n"; -print OUT "const char * const x86_cap_flags[NCAPINTS*32] = {\n"; - -while (defined($line = )) { - if ($line =~ /^\s*\#\s*define\s+(X86_FEATURE_(\S+))\s+(.*)$/) { - $macro = $1; - $feature = $2; - $tail = $3; - if ($tail =~ /\/\*\s*\"([^"]*)\".*\*\//) { - $feature = $1; - } - - if ($feature ne '') { - printf OUT "\t%-32s = \"%s\",\n", - "[$macro]", "\L$feature"; - } - } -} -print OUT "};\n"; - -close(IN); -close(OUT); diff --git a/trunk/arch/x86/kernel/cpu/mtrr/main.c b/trunk/arch/x86/kernel/cpu/mtrr/main.c index 58ac5d3d4361..b117d7f8a564 100644 --- a/trunk/arch/x86/kernel/cpu/mtrr/main.c +++ b/trunk/arch/x86/kernel/cpu/mtrr/main.c @@ -729,7 +729,7 @@ struct var_mtrr_range_state { mtrr_type type; }; -static struct var_mtrr_range_state __initdata range_state[RANGE_NUM]; +struct var_mtrr_range_state __initdata range_state[RANGE_NUM]; static int __initdata debug_print; static int __init diff --git a/trunk/arch/x86/kernel/cpu/powerflags.c b/trunk/arch/x86/kernel/cpu/powerflags.c deleted file mode 100644 index 5abbea297e0c..000000000000 --- a/trunk/arch/x86/kernel/cpu/powerflags.c +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Strings for the various x86 power flags - * - * This file must not contain any executable code. - */ - -#include - -const char *const x86_power_flags[32] = { - "ts", /* temperature sensor */ - "fid", /* frequency id control */ - "vid", /* voltage id control */ - "ttp", /* thermal trip */ - "tm", - "stc", - "100mhzsteps", - "hwpstate", - "", /* tsc invariant mapped to constant_tsc */ - /* nothing */ -}; diff --git a/trunk/arch/x86/kernel/e820.c b/trunk/arch/x86/kernel/e820.c index a7a71339bfb0..9af89078f7bb 100644 --- a/trunk/arch/x86/kernel/e820.c +++ b/trunk/arch/x86/kernel/e820.c @@ -148,9 +148,6 @@ void __init e820_print_map(char *who) case E820_NVS: printk(KERN_CONT "(ACPI NVS)\n"); break; - case E820_UNUSABLE: - printk("(unusable)\n"); - break; default: printk(KERN_CONT "type %u\n", e820.map[i].type); break; @@ -1263,7 +1260,6 @@ static inline const char *e820_type_to_string(int e820_type) case E820_RAM: return "System RAM"; case E820_ACPI: return "ACPI Tables"; case E820_NVS: return "ACPI Non-volatile Storage"; - case E820_UNUSABLE: return "Unusable memory"; default: return "reserved"; } } @@ -1271,7 +1267,6 @@ static inline const char *e820_type_to_string(int e820_type) /* * Mark e820 reserved areas as busy for the resource manager. */ -static struct resource __initdata *e820_res; void __init e820_reserve_resources(void) { int i; @@ -1279,7 +1274,6 @@ void __init e820_reserve_resources(void) u64 end; res = alloc_bootmem_low(sizeof(struct resource) * e820.nr_map); - e820_res = res; for (i = 0; i < e820.nr_map; i++) { end = e820.map[i].addr + e820.map[i].size - 1; #ifndef CONFIG_RESOURCES_64BIT @@ -1293,14 +1287,7 @@ void __init e820_reserve_resources(void) res->end = end; res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; - - /* - * don't register the region that could be conflicted with - * pci device BAR resource and insert them later in - * pcibios_resource_survey() - */ - if (e820.map[i].type != E820_RESERVED || res->start < (1ULL<<20)) - insert_resource(&iomem_resource, res); + insert_resource(&iomem_resource, res); res++; } @@ -1312,19 +1299,6 @@ void __init e820_reserve_resources(void) } } -void __init e820_reserve_resources_late(void) -{ - int i; - struct resource *res; - - res = e820_res; - for (i = 0; i < e820.nr_map; i++) { - if (!res->parent && res->end) - insert_resource(&iomem_resource, res); - res++; - } -} - char *__init default_machine_specific_memory_setup(void) { char *who = "BIOS-e820"; diff --git a/trunk/arch/x86/kernel/entry_64.S b/trunk/arch/x86/kernel/entry_64.S index cf3a0b2d0059..89434d439605 100644 --- a/trunk/arch/x86/kernel/entry_64.S +++ b/trunk/arch/x86/kernel/entry_64.S @@ -275,9 +275,9 @@ ENTRY(native_usergs_sysret64) ENTRY(ret_from_fork) CFI_DEFAULT_STACK push kernel_eflags(%rip) - CFI_ADJUST_CFA_OFFSET 8 + CFI_ADJUST_CFA_OFFSET 4 popf # reset kernel eflags - CFI_ADJUST_CFA_OFFSET -8 + CFI_ADJUST_CFA_OFFSET -4 call schedule_tail GET_THREAD_INFO(%rcx) testl $(_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT),TI_flags(%rcx) diff --git a/trunk/arch/x86/kernel/genapic_64.c b/trunk/arch/x86/kernel/genapic_64.c index 6c9bfc9e1e95..eaff0bbb1444 100644 --- a/trunk/arch/x86/kernel/genapic_64.c +++ b/trunk/arch/x86/kernel/genapic_64.c @@ -16,63 +16,87 @@ #include #include #include -#include #include #include #include -extern struct genapic apic_flat; -extern struct genapic apic_physflat; -extern struct genapic apic_x2xpic_uv_x; -extern struct genapic apic_x2apic_phys; -extern struct genapic apic_x2apic_cluster; +#ifdef CONFIG_ACPI +#include +#endif + +DEFINE_PER_CPU(int, x2apic_extra_bits); struct genapic __read_mostly *genapic = &apic_flat; -static struct genapic *apic_probe[] __initdata = { - &apic_x2apic_uv_x, - &apic_x2apic_phys, - &apic_x2apic_cluster, - &apic_physflat, - NULL, -}; +static enum uv_system_type uv_system_type; /* * Check the APIC IDs in bios_cpu_apicid and choose the APIC mode. */ void __init setup_apic_routing(void) { - if (genapic == &apic_x2apic_phys || genapic == &apic_x2apic_cluster) { - if (!intr_remapping_enabled) - genapic = &apic_flat; - } + if (uv_system_type == UV_NON_UNIQUE_APIC) + genapic = &apic_x2apic_uv_x; + else +#ifdef CONFIG_ACPI + /* + * Quirk: some x86_64 machines can only use physical APIC mode + * regardless of how many processors are present (x86_64 ES7000 + * is an example). + */ + if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && + (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) + genapic = &apic_physflat; + else +#endif - if (genapic == &apic_flat) { - if (max_physical_apicid >= 8) - genapic = &apic_physflat; - printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); - } + if (max_physical_apicid < 8) + genapic = &apic_flat; + else + genapic = &apic_physflat; + + printk(KERN_INFO "Setting APIC routing to %s\n", genapic->name); } /* Same for both flat and physical. */ -void apic_send_IPI_self(int vector) +void send_IPI_self(int vector) { __send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL); } int __init acpi_madt_oem_check(char *oem_id, char *oem_table_id) { - int i; - - for (i = 0; apic_probe[i]; ++i) { - if (apic_probe[i]->acpi_madt_oem_check(oem_id, oem_table_id)) { - genapic = apic_probe[i]; - printk(KERN_INFO "Setting APIC routing to %s.\n", - genapic->name); - return 1; - } + if (!strcmp(oem_id, "SGI")) { + if (!strcmp(oem_table_id, "UVL")) + uv_system_type = UV_LEGACY_APIC; + else if (!strcmp(oem_table_id, "UVX")) + uv_system_type = UV_X2APIC; + else if (!strcmp(oem_table_id, "UVH")) + uv_system_type = UV_NON_UNIQUE_APIC; } return 0; } + +unsigned int read_apic_id(void) +{ + unsigned int id; + + WARN_ON(preemptible() && num_online_cpus() > 1); + id = apic_read(APIC_ID); + if (uv_system_type >= UV_X2APIC) + id |= __get_cpu_var(x2apic_extra_bits); + return id; +} + +enum uv_system_type get_uv_system_type(void) +{ + return uv_system_type; +} + +int is_uv_system(void) +{ + return uv_system_type != UV_NONE; +} +EXPORT_SYMBOL_GPL(is_uv_system); diff --git a/trunk/arch/x86/kernel/genapic_flat_64.c b/trunk/arch/x86/kernel/genapic_flat_64.c index 9eca5ba7a6b1..786548a62d38 100644 --- a/trunk/arch/x86/kernel/genapic_flat_64.c +++ b/trunk/arch/x86/kernel/genapic_flat_64.c @@ -15,20 +15,9 @@ #include #include #include -#include #include #include #include -#include - -#ifdef CONFIG_ACPI -#include -#endif - -static int __init flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ - return 1; -} static cpumask_t flat_target_cpus(void) { @@ -106,33 +95,9 @@ static void flat_send_IPI_all(int vector) __send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); } -static unsigned int get_apic_id(unsigned long x) -{ - unsigned int id; - - id = (((x)>>24) & 0xFFu); - return id; -} - -static unsigned long set_apic_id(unsigned int id) -{ - unsigned long x; - - x = ((id & 0xFFu)<<24); - return x; -} - -static unsigned int read_xapic_id(void) -{ - unsigned int id; - - id = get_apic_id(apic_read(APIC_ID)); - return id; -} - static int flat_apic_id_registered(void) { - return physid_isset(read_xapic_id(), phys_cpu_present_map); + return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); } static unsigned int flat_cpu_mask_to_apicid(cpumask_t cpumask) @@ -147,7 +112,6 @@ static unsigned int phys_pkg_id(int index_msb) struct genapic apic_flat = { .name = "flat", - .acpi_madt_oem_check = flat_acpi_madt_oem_check, .int_delivery_mode = dest_LowestPrio, .int_dest_mode = (APIC_DEST_LOGICAL != 0), .target_cpus = flat_target_cpus, @@ -157,12 +121,8 @@ struct genapic apic_flat = { .send_IPI_all = flat_send_IPI_all, .send_IPI_allbutself = flat_send_IPI_allbutself, .send_IPI_mask = flat_send_IPI_mask, - .send_IPI_self = apic_send_IPI_self, .cpu_mask_to_apicid = flat_cpu_mask_to_apicid, .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFu<<24), }; /* @@ -170,21 +130,6 @@ struct genapic apic_flat = { * We cannot use logical delivery in this case because the mask * overflows, so use physical mode. */ -static int __init physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ -#ifdef CONFIG_ACPI - /* - * Quirk: some x86_64 machines can only use physical APIC mode - * regardless of how many processors are present (x86_64 ES7000 - * is an example). - */ - if (acpi_gbl_FADT.header.revision > FADT2_REVISION_ID && - (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL)) - return 1; -#endif - - return 0; -} static cpumask_t physflat_target_cpus(void) { @@ -231,7 +176,6 @@ static unsigned int physflat_cpu_mask_to_apicid(cpumask_t cpumask) struct genapic apic_physflat = { .name = "physical flat", - .acpi_madt_oem_check = physflat_acpi_madt_oem_check, .int_delivery_mode = dest_Fixed, .int_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = physflat_target_cpus, @@ -241,10 +185,6 @@ struct genapic apic_physflat = { .send_IPI_all = physflat_send_IPI_all, .send_IPI_allbutself = physflat_send_IPI_allbutself, .send_IPI_mask = physflat_send_IPI_mask, - .send_IPI_self = apic_send_IPI_self, .cpu_mask_to_apicid = physflat_cpu_mask_to_apicid, .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFu<<24), }; diff --git a/trunk/arch/x86/kernel/genx2apic_cluster.c b/trunk/arch/x86/kernel/genx2apic_cluster.c deleted file mode 100644 index fed9f68efd66..000000000000 --- a/trunk/arch/x86/kernel/genx2apic_cluster.c +++ /dev/null @@ -1,164 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid); - -static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ - if (cpu_has_x2apic) - return 1; - - return 0; -} - -/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ - -static cpumask_t x2apic_target_cpus(void) -{ - return cpumask_of_cpu(0); -} - -/* - * for now each logical cpu is in its own vector allocation domain. - */ -static cpumask_t x2apic_vector_allocation_domain(int cpu) -{ - cpumask_t domain = CPU_MASK_NONE; - cpu_set(cpu, domain); - return domain; -} - -static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, - unsigned int dest) -{ - unsigned long cfg; - - cfg = __prepare_ICR(0, vector, dest); - - /* - * send the IPI. - */ - x2apic_icr_write(cfg, apicid); -} - -/* - * for now, we send the IPI's one by one in the cpumask. - * TBD: Based on the cpu mask, we can send the IPI's to the cluster group - * at once. We have 16 cpu's in a cluster. This will minimize IPI register - * writes. - */ -static void x2apic_send_IPI_mask(cpumask_t mask, int vector) -{ - unsigned long flags; - unsigned long query_cpu; - - local_irq_save(flags); - for_each_cpu_mask(query_cpu, mask) { - __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_logical_apicid, query_cpu), - vector, APIC_DEST_LOGICAL); - } - local_irq_restore(flags); -} - -static void x2apic_send_IPI_allbutself(int vector) -{ - cpumask_t mask = cpu_online_map; - - cpu_clear(smp_processor_id(), mask); - - if (!cpus_empty(mask)) - x2apic_send_IPI_mask(mask, vector); -} - -static void x2apic_send_IPI_all(int vector) -{ - x2apic_send_IPI_mask(cpu_online_map, vector); -} - -static int x2apic_apic_id_registered(void) -{ - return 1; -} - -static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask) -{ - int cpu; - - /* - * We're using fixed IRQ delivery, can only return one phys APIC ID. - * May as well be the first. - */ - cpu = first_cpu(cpumask); - if ((unsigned)cpu < NR_CPUS) - return per_cpu(x86_cpu_to_logical_apicid, cpu); - else - return BAD_APICID; -} - -static unsigned int get_apic_id(unsigned long x) -{ - unsigned int id; - - id = x; - return id; -} - -static unsigned long set_apic_id(unsigned int id) -{ - unsigned long x; - - x = id; - return x; -} - -static unsigned int x2apic_read_id(void) -{ - return apic_read(APIC_ID); -} - -static unsigned int phys_pkg_id(int index_msb) -{ - return x2apic_read_id() >> index_msb; -} - -static void x2apic_send_IPI_self(int vector) -{ - apic_write(APIC_SELF_IPI, vector); -} - -static void init_x2apic_ldr(void) -{ - int cpu = smp_processor_id(); - - per_cpu(x86_cpu_to_logical_apicid, cpu) = apic_read(APIC_LDR); - return; -} - -struct genapic apic_x2apic_cluster = { - .name = "cluster x2apic", - .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, - .int_delivery_mode = dest_LowestPrio, - .int_dest_mode = (APIC_DEST_LOGICAL != 0), - .target_cpus = x2apic_target_cpus, - .vector_allocation_domain = x2apic_vector_allocation_domain, - .apic_id_registered = x2apic_apic_id_registered, - .init_apic_ldr = init_x2apic_ldr, - .send_IPI_all = x2apic_send_IPI_all, - .send_IPI_allbutself = x2apic_send_IPI_allbutself, - .send_IPI_mask = x2apic_send_IPI_mask, - .send_IPI_self = x2apic_send_IPI_self, - .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu), -}; diff --git a/trunk/arch/x86/kernel/genx2apic_phys.c b/trunk/arch/x86/kernel/genx2apic_phys.c deleted file mode 100644 index 958d537b4cc9..000000000000 --- a/trunk/arch/x86/kernel/genx2apic_phys.c +++ /dev/null @@ -1,159 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -static int x2apic_phys; - -static int set_x2apic_phys_mode(char *arg) -{ - x2apic_phys = 1; - return 0; -} -early_param("x2apic_phys", set_x2apic_phys_mode); - -static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ - if (cpu_has_x2apic && x2apic_phys) - return 1; - - return 0; -} - -/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ - -static cpumask_t x2apic_target_cpus(void) -{ - return cpumask_of_cpu(0); -} - -static cpumask_t x2apic_vector_allocation_domain(int cpu) -{ - cpumask_t domain = CPU_MASK_NONE; - cpu_set(cpu, domain); - return domain; -} - -static void __x2apic_send_IPI_dest(unsigned int apicid, int vector, - unsigned int dest) -{ - unsigned long cfg; - - cfg = __prepare_ICR(0, vector, dest); - - /* - * send the IPI. - */ - x2apic_icr_write(cfg, apicid); -} - -static void x2apic_send_IPI_mask(cpumask_t mask, int vector) -{ - unsigned long flags; - unsigned long query_cpu; - - local_irq_save(flags); - for_each_cpu_mask(query_cpu, mask) { - __x2apic_send_IPI_dest(per_cpu(x86_cpu_to_apicid, query_cpu), - vector, APIC_DEST_PHYSICAL); - } - local_irq_restore(flags); -} - -static void x2apic_send_IPI_allbutself(int vector) -{ - cpumask_t mask = cpu_online_map; - - cpu_clear(smp_processor_id(), mask); - - if (!cpus_empty(mask)) - x2apic_send_IPI_mask(mask, vector); -} - -static void x2apic_send_IPI_all(int vector) -{ - x2apic_send_IPI_mask(cpu_online_map, vector); -} - -static int x2apic_apic_id_registered(void) -{ - return 1; -} - -static unsigned int x2apic_cpu_mask_to_apicid(cpumask_t cpumask) -{ - int cpu; - - /* - * We're using fixed IRQ delivery, can only return one phys APIC ID. - * May as well be the first. - */ - cpu = first_cpu(cpumask); - if ((unsigned)cpu < NR_CPUS) - return per_cpu(x86_cpu_to_apicid, cpu); - else - return BAD_APICID; -} - -static unsigned int get_apic_id(unsigned long x) -{ - unsigned int id; - - id = x; - return id; -} - -static unsigned long set_apic_id(unsigned int id) -{ - unsigned long x; - - x = id; - return x; -} - -static unsigned int x2apic_read_id(void) -{ - return apic_read(APIC_ID); -} - -static unsigned int phys_pkg_id(int index_msb) -{ - return x2apic_read_id() >> index_msb; -} - -void x2apic_send_IPI_self(int vector) -{ - apic_write(APIC_SELF_IPI, vector); -} - -void init_x2apic_ldr(void) -{ - return; -} - -struct genapic apic_x2apic_phys = { - .name = "physical x2apic", - .acpi_madt_oem_check = x2apic_acpi_madt_oem_check, - .int_delivery_mode = dest_Fixed, - .int_dest_mode = (APIC_DEST_PHYSICAL != 0), - .target_cpus = x2apic_target_cpus, - .vector_allocation_domain = x2apic_vector_allocation_domain, - .apic_id_registered = x2apic_apic_id_registered, - .init_apic_ldr = init_x2apic_ldr, - .send_IPI_all = x2apic_send_IPI_all, - .send_IPI_allbutself = x2apic_send_IPI_allbutself, - .send_IPI_mask = x2apic_send_IPI_mask, - .send_IPI_self = x2apic_send_IPI_self, - .cpu_mask_to_apicid = x2apic_cpu_mask_to_apicid, - .phys_pkg_id = phys_pkg_id, - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu), -}; diff --git a/trunk/arch/x86/kernel/genx2apic_uv_x.c b/trunk/arch/x86/kernel/genx2apic_uv_x.c index ae2ffc8a400c..bfa837cb16be 100644 --- a/trunk/arch/x86/kernel/genx2apic_uv_x.c +++ b/trunk/arch/x86/kernel/genx2apic_uv_x.c @@ -12,12 +12,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -26,36 +26,6 @@ #include #include -DEFINE_PER_CPU(int, x2apic_extra_bits); - -static enum uv_system_type uv_system_type; - -static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) -{ - if (!strcmp(oem_id, "SGI")) { - if (!strcmp(oem_table_id, "UVL")) - uv_system_type = UV_LEGACY_APIC; - else if (!strcmp(oem_table_id, "UVX")) - uv_system_type = UV_X2APIC; - else if (!strcmp(oem_table_id, "UVH")) { - uv_system_type = UV_NON_UNIQUE_APIC; - return 1; - } - } - return 0; -} - -enum uv_system_type get_uv_system_type(void) -{ - return uv_system_type; -} - -int is_uv_system(void) -{ - return uv_system_type != UV_NONE; -} -EXPORT_SYMBOL_GPL(is_uv_system); - DEFINE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info); @@ -153,10 +123,6 @@ static int uv_apic_id_registered(void) return 1; } -static void uv_init_apic_ldr(void) -{ -} - static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask) { int cpu; @@ -172,34 +138,9 @@ static unsigned int uv_cpu_mask_to_apicid(cpumask_t cpumask) return BAD_APICID; } -static unsigned int get_apic_id(unsigned long x) -{ - unsigned int id; - - WARN_ON(preemptible() && num_online_cpus() > 1); - id = x | __get_cpu_var(x2apic_extra_bits); - - return id; -} - -static unsigned long set_apic_id(unsigned int id) -{ - unsigned long x; - - /* maskout x2apic_extra_bits ? */ - x = id; - return x; -} - -static unsigned int uv_read_apic_id(void) -{ - - return get_apic_id(apic_read(APIC_ID)); -} - static unsigned int phys_pkg_id(int index_msb) { - return uv_read_apic_id() >> index_msb; + return GET_APIC_ID(read_apic_id()) >> index_msb; } #ifdef ZZZ /* Needs x2apic patch */ @@ -211,22 +152,17 @@ static void uv_send_IPI_self(int vector) struct genapic apic_x2apic_uv_x = { .name = "UV large system", - .acpi_madt_oem_check = uv_acpi_madt_oem_check, .int_delivery_mode = dest_Fixed, .int_dest_mode = (APIC_DEST_PHYSICAL != 0), .target_cpus = uv_target_cpus, .vector_allocation_domain = uv_vector_allocation_domain,/* Fixme ZZZ */ .apic_id_registered = uv_apic_id_registered, - .init_apic_ldr = uv_init_apic_ldr, .send_IPI_all = uv_send_IPI_all, .send_IPI_allbutself = uv_send_IPI_allbutself, .send_IPI_mask = uv_send_IPI_mask, /* ZZZ.send_IPI_self = uv_send_IPI_self, */ .cpu_mask_to_apicid = uv_cpu_mask_to_apicid, .phys_pkg_id = phys_pkg_id, /* Fixme ZZZ */ - .get_apic_id = get_apic_id, - .set_apic_id = set_apic_id, - .apic_id_mask = (0xFFFFFFFFu), }; static __cpuinit void set_x2apic_extra_bits(int pnode) @@ -465,5 +401,3 @@ void __cpuinit uv_cpu_init(void) if (get_uv_system_type() == UV_NON_UNIQUE_APIC) set_x2apic_extra_bits(uv_hub_info->pnode); } - - diff --git a/trunk/arch/x86/kernel/i8259.c b/trunk/arch/x86/kernel/i8259.c index 4b8a53d841f7..dc92b49d9204 100644 --- a/trunk/arch/x86/kernel/i8259.c +++ b/trunk/arch/x86/kernel/i8259.c @@ -282,30 +282,6 @@ static int __init i8259A_init_sysfs(void) device_initcall(i8259A_init_sysfs); -void mask_8259A(void) -{ - unsigned long flags; - - spin_lock_irqsave(&i8259A_lock, flags); - - outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ - outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */ - - spin_unlock_irqrestore(&i8259A_lock, flags); -} - -void unmask_8259A(void) -{ - unsigned long flags; - - spin_lock_irqsave(&i8259A_lock, flags); - - outb(cached_master_mask, PIC_MASTER_IMR); /* restore master IRQ mask */ - outb(cached_slave_mask, PIC_SLAVE_IMR); /* restore slave IRQ mask */ - - spin_unlock_irqrestore(&i8259A_lock, flags); -} - void init_8259A(int auto_eoi) { unsigned long flags; diff --git a/trunk/arch/x86/kernel/io_apic_32.c b/trunk/arch/x86/kernel/io_apic_32.c index e710289f673e..09cddb57bec4 100644 --- a/trunk/arch/x86/kernel/io_apic_32.c +++ b/trunk/arch/x86/kernel/io_apic_32.c @@ -46,13 +46,10 @@ #include #include #include -#include #include #include -#define __apicdebuginit(type) static type __init - int (*ioapic_renumber_irq)(int ioapic, int irq); atomic_t irq_mis_count; @@ -1344,8 +1341,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, ioapic_write_entry(apic, pin, entry); } - -__apicdebuginit(void) print_IO_APIC(void) +void __init print_IO_APIC(void) { int apic, i; union IO_APIC_reg_00 reg_00; @@ -1460,7 +1456,9 @@ __apicdebuginit(void) print_IO_APIC(void) return; } -__apicdebuginit(void) print_APIC_bitfield(int base) +#if 0 + +static void print_APIC_bitfield(int base) { unsigned int v; int i, j; @@ -1481,10 +1479,9 @@ __apicdebuginit(void) print_APIC_bitfield(int base) } } -__apicdebuginit(void) print_local_APIC(void *dummy) +void /*__init*/ print_local_APIC(void *dummy) { unsigned int v, ver, maxlvt; - u64 icr; if (apic_verbosity == APIC_QUIET) return; @@ -1493,7 +1490,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy) smp_processor_id(), hard_smp_processor_id()); v = apic_read(APIC_ID); printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, - GET_APIC_ID(v)); + GET_APIC_ID(read_apic_id())); v = apic_read(APIC_LVR); printk(KERN_INFO "... APIC VERSION: %08x\n", v); ver = GET_APIC_VERSION(v); @@ -1535,9 +1532,10 @@ __apicdebuginit(void) print_local_APIC(void *dummy) printk(KERN_DEBUG "... APIC ESR: %08x\n", v); } - icr = apic_icr_read(); - printk(KERN_DEBUG "... APIC ICR: %08x\n", icr); - printk(KERN_DEBUG "... APIC ICR2: %08x\n", icr >> 32); + v = apic_read(APIC_ICR); + printk(KERN_DEBUG "... APIC ICR: %08x\n", v); + v = apic_read(APIC_ICR2); + printk(KERN_DEBUG "... APIC ICR2: %08x\n", v); v = apic_read(APIC_LVTT); printk(KERN_DEBUG "... APIC LVTT: %08x\n", v); @@ -1565,12 +1563,12 @@ __apicdebuginit(void) print_local_APIC(void *dummy) printk("\n"); } -__apicdebuginit(void) print_all_local_APICs(void) +void print_all_local_APICs(void) { on_each_cpu(print_local_APIC, NULL, 1); } -__apicdebuginit(void) print_PIC(void) +void /*__init*/ print_PIC(void) { unsigned int v; unsigned long flags; @@ -1602,17 +1600,7 @@ __apicdebuginit(void) print_PIC(void) printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); } -__apicdebuginit(int) print_all_ICs(void) -{ - print_PIC(); - print_all_local_APICs(); - print_IO_APIC(); - - return 0; -} - -fs_initcall(print_all_ICs); - +#endif /* 0 */ static void __init enable_IO_APIC(void) { @@ -1710,7 +1698,8 @@ void disable_IO_APIC(void) entry.dest_mode = 0; /* Physical */ entry.delivery_mode = dest_ExtINT; /* ExtInt */ entry.vector = 0; - entry.dest.physical.physical_dest = read_apic_id(); + entry.dest.physical.physical_dest = + GET_APIC_ID(read_apic_id()); /* * Add it to the IO-APIC irq-routing table: @@ -1736,8 +1725,10 @@ static void __init setup_ioapic_ids_from_mpc(void) unsigned char old_id; unsigned long flags; - if (x86_quirks->setup_ioapic_ids && x86_quirks->setup_ioapic_ids()) +#ifdef CONFIG_X86_NUMAQ + if (found_numaq) return; +#endif /* * Don't check I/O APIC IDs for xAPIC systems. They have @@ -2338,6 +2329,8 @@ void __init setup_IO_APIC(void) setup_IO_APIC_irqs(); init_IO_APIC_traps(); check_timer(); + if (!acpi_ioapic) + print_IO_APIC(); } /* diff --git a/trunk/arch/x86/kernel/io_apic_64.c b/trunk/arch/x86/kernel/io_apic_64.c index a1bec2969c6a..61a83b70c18f 100644 --- a/trunk/arch/x86/kernel/io_apic_64.c +++ b/trunk/arch/x86/kernel/io_apic_64.c @@ -37,7 +37,6 @@ #include #endif #include -#include #include #include @@ -50,13 +49,10 @@ #include #include #include -#include #include #include -#define __apicdebuginit(type) static type __init - struct irq_cfg { cpumask_t domain; cpumask_t old_domain; @@ -91,6 +87,8 @@ int first_system_vector = 0xfe; char system_vectors[NR_VECTORS] = { [0 ... NR_VECTORS-1] = SYS_VECTOR_FREE}; +#define __apicdebuginit __init + int sis_apic_bug; /* not actually supported, dummy for compile */ static int no_timer_check; @@ -110,9 +108,6 @@ static DEFINE_SPINLOCK(vector_lock); */ int nr_ioapic_registers[MAX_IO_APICS]; -/* I/O APIC RTE contents at the OS boot up */ -struct IO_APIC_route_entry *early_ioapic_entries[MAX_IO_APICS]; - /* I/O APIC entries */ struct mp_config_ioapic mp_ioapics[MAX_IO_APICS]; int nr_ioapics; @@ -308,12 +303,7 @@ static void __target_IO_APIC_irq(unsigned int irq, unsigned int dest, u8 vector) pin = entry->pin; if (pin == -1) break; - /* - * With interrupt-remapping, destination information comes - * from interrupt-remapping table entry. - */ - if (!irq_remapped(irq)) - io_apic_write(apic, 0x11 + pin*2, dest); + io_apic_write(apic, 0x11 + pin*2, dest); reg = io_apic_read(apic, 0x10 + pin*2); reg &= ~IO_APIC_REDIR_VECTOR_MASK; reg |= vector; @@ -450,69 +440,6 @@ static void clear_IO_APIC (void) clear_IO_APIC_pin(apic, pin); } -/* - * Saves and masks all the unmasked IO-APIC RTE's - */ -int save_mask_IO_APIC_setup(void) -{ - union IO_APIC_reg_01 reg_01; - unsigned long flags; - int apic, pin; - - /* - * The number of IO-APIC IRQ registers (== #pins): - */ - for (apic = 0; apic < nr_ioapics; apic++) { - spin_lock_irqsave(&ioapic_lock, flags); - reg_01.raw = io_apic_read(apic, 1); - spin_unlock_irqrestore(&ioapic_lock, flags); - nr_ioapic_registers[apic] = reg_01.bits.entries+1; - } - - for (apic = 0; apic < nr_ioapics; apic++) { - early_ioapic_entries[apic] = - kzalloc(sizeof(struct IO_APIC_route_entry) * - nr_ioapic_registers[apic], GFP_KERNEL); - if (!early_ioapic_entries[apic]) - return -ENOMEM; - } - - for (apic = 0; apic < nr_ioapics; apic++) - for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) { - struct IO_APIC_route_entry entry; - - entry = early_ioapic_entries[apic][pin] = - ioapic_read_entry(apic, pin); - if (!entry.mask) { - entry.mask = 1; - ioapic_write_entry(apic, pin, entry); - } - } - return 0; -} - -void restore_IO_APIC_setup(void) -{ - int apic, pin; - - for (apic = 0; apic < nr_ioapics; apic++) - for (pin = 0; pin < nr_ioapic_registers[apic]; pin++) - ioapic_write_entry(apic, pin, - early_ioapic_entries[apic][pin]); -} - -void reinit_intr_remapped_IO_APIC(int intr_remapping) -{ - /* - * for now plain restore of previous settings. - * TBD: In the case of OS enabling interrupt-remapping, - * IO-APIC RTE's need to be setup to point to interrupt-remapping - * table entries. for now, do a plain restore, and wait for - * the setup_IO_APIC_irqs() to do proper initialization. - */ - restore_IO_APIC_setup(); -} - int skip_ioapic_setup; int ioapic_force; @@ -912,98 +839,18 @@ void __setup_vector_irq(int cpu) } static struct irq_chip ioapic_chip; -#ifdef CONFIG_INTR_REMAP -static struct irq_chip ir_ioapic_chip; -#endif static void ioapic_register_intr(int irq, unsigned long trigger) { - if (trigger) + if (trigger) { irq_desc[irq].status |= IRQ_LEVEL; - else - irq_desc[irq].status &= ~IRQ_LEVEL; - -#ifdef CONFIG_INTR_REMAP - if (irq_remapped(irq)) { - irq_desc[irq].status |= IRQ_MOVE_PCNTXT; - if (trigger) - set_irq_chip_and_handler_name(irq, &ir_ioapic_chip, - handle_fasteoi_irq, - "fasteoi"); - else - set_irq_chip_and_handler_name(irq, &ir_ioapic_chip, - handle_edge_irq, "edge"); - return; - } -#endif - if (trigger) set_irq_chip_and_handler_name(irq, &ioapic_chip, - handle_fasteoi_irq, - "fasteoi"); - else + handle_fasteoi_irq, "fasteoi"); + } else { + irq_desc[irq].status &= ~IRQ_LEVEL; set_irq_chip_and_handler_name(irq, &ioapic_chip, handle_edge_irq, "edge"); -} - -static int setup_ioapic_entry(int apic, int irq, - struct IO_APIC_route_entry *entry, - unsigned int destination, int trigger, - int polarity, int vector) -{ - /* - * add it to the IO-APIC irq-routing table: - */ - memset(entry,0,sizeof(*entry)); - -#ifdef CONFIG_INTR_REMAP - if (intr_remapping_enabled) { - struct intel_iommu *iommu = map_ioapic_to_ir(apic); - struct irte irte; - struct IR_IO_APIC_route_entry *ir_entry = - (struct IR_IO_APIC_route_entry *) entry; - int index; - - if (!iommu) - panic("No mapping iommu for ioapic %d\n", apic); - - index = alloc_irte(iommu, irq, 1); - if (index < 0) - panic("Failed to allocate IRTE for ioapic %d\n", apic); - - memset(&irte, 0, sizeof(irte)); - - irte.present = 1; - irte.dst_mode = INT_DEST_MODE; - irte.trigger_mode = trigger; - irte.dlvry_mode = INT_DELIVERY_MODE; - irte.vector = vector; - irte.dest_id = IRTE_DEST(destination); - - modify_irte(irq, &irte); - - ir_entry->index2 = (index >> 15) & 0x1; - ir_entry->zero = 0; - ir_entry->format = 1; - ir_entry->index = (index & 0x7fff); - } else -#endif - { - entry->delivery_mode = INT_DELIVERY_MODE; - entry->dest_mode = INT_DEST_MODE; - entry->dest = destination; } - - entry->mask = 0; /* enable IRQ */ - entry->trigger = trigger; - entry->polarity = polarity; - entry->vector = vector; - - /* Mask level triggered irqs. - * Use IRQ_DELAYED_DISABLE for edge triggered irqs. - */ - if (trigger) - entry->mask = 1; - return 0; } static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, @@ -1028,15 +875,24 @@ static void setup_IO_APIC_irq(int apic, int pin, unsigned int irq, apic, mp_ioapics[apic].mp_apicid, pin, cfg->vector, irq, trigger, polarity); + /* + * add it to the IO-APIC irq-routing table: + */ + memset(&entry,0,sizeof(entry)); + + entry.delivery_mode = INT_DELIVERY_MODE; + entry.dest_mode = INT_DEST_MODE; + entry.dest = cpu_mask_to_apicid(mask); + entry.mask = 0; /* enable IRQ */ + entry.trigger = trigger; + entry.polarity = polarity; + entry.vector = cfg->vector; - if (setup_ioapic_entry(mp_ioapics[apic].mp_apicid, irq, &entry, - cpu_mask_to_apicid(mask), trigger, polarity, - cfg->vector)) { - printk("Failed to setup ioapic entry for ioapic %d, pin %d\n", - mp_ioapics[apic].mp_apicid, pin); - __clear_irq_vector(irq); - return; - } + /* Mask level triggered irqs. + * Use IRQ_DELAYED_DISABLE for edge triggered irqs. + */ + if (trigger) + entry.mask = 1; ioapic_register_intr(irq, trigger); if (irq < 16) @@ -1088,9 +944,6 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, { struct IO_APIC_route_entry entry; - if (intr_remapping_enabled) - return; - memset(&entry, 0, sizeof(entry)); /* @@ -1117,8 +970,7 @@ static void __init setup_timer_IRQ0_pin(unsigned int apic, unsigned int pin, ioapic_write_entry(apic, pin, entry); } - -__apicdebuginit(void) print_IO_APIC(void) +void __apicdebuginit print_IO_APIC(void) { int apic, i; union IO_APIC_reg_00 reg_00; @@ -1212,7 +1064,9 @@ __apicdebuginit(void) print_IO_APIC(void) return; } -__apicdebuginit(void) print_APIC_bitfield(int base) +#if 0 + +static __apicdebuginit void print_APIC_bitfield (int base) { unsigned int v; int i, j; @@ -1233,10 +1087,9 @@ __apicdebuginit(void) print_APIC_bitfield(int base) } } -__apicdebuginit(void) print_local_APIC(void *dummy) +void __apicdebuginit print_local_APIC(void * dummy) { unsigned int v, ver, maxlvt; - unsigned long icr; if (apic_verbosity == APIC_QUIET) return; @@ -1244,7 +1097,7 @@ __apicdebuginit(void) print_local_APIC(void *dummy) printk("\n" KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n", smp_processor_id(), hard_smp_processor_id()); v = apic_read(APIC_ID); - printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, read_apic_id()); + printk(KERN_INFO "... APIC ID: %08x (%01x)\n", v, GET_APIC_ID(read_apic_id())); v = apic_read(APIC_LVR); printk(KERN_INFO "... APIC VERSION: %08x\n", v); ver = GET_APIC_VERSION(v); @@ -1280,9 +1133,10 @@ __apicdebuginit(void) print_local_APIC(void *dummy) v = apic_read(APIC_ESR); printk(KERN_DEBUG "... APIC ESR: %08x\n", v); - icr = apic_icr_read(); - printk(KERN_DEBUG "... APIC ICR: %08x\n", icr); - printk(KERN_DEBUG "... APIC ICR2: %08x\n", icr >> 32); + v = apic_read(APIC_ICR); + printk(KERN_DEBUG "... APIC ICR: %08x\n", v); + v = apic_read(APIC_ICR2); + printk(KERN_DEBUG "... APIC ICR2: %08x\n", v); v = apic_read(APIC_LVTT); printk(KERN_DEBUG "... APIC LVTT: %08x\n", v); @@ -1310,12 +1164,12 @@ __apicdebuginit(void) print_local_APIC(void *dummy) printk("\n"); } -__apicdebuginit(void) print_all_local_APICs(void) +void print_all_local_APICs (void) { on_each_cpu(print_local_APIC, NULL, 1); } -__apicdebuginit(void) print_PIC(void) +void __apicdebuginit print_PIC(void) { unsigned int v; unsigned long flags; @@ -1347,17 +1201,7 @@ __apicdebuginit(void) print_PIC(void) printk(KERN_DEBUG "... PIC ELCR: %04x\n", v); } -__apicdebuginit(int) print_all_ICs(void) -{ - print_PIC(); - print_all_local_APICs(); - print_IO_APIC(); - - return 0; -} - -fs_initcall(print_all_ICs); - +#endif /* 0 */ void __init enable_IO_APIC(void) { @@ -1447,7 +1291,7 @@ void disable_IO_APIC(void) entry.dest_mode = 0; /* Physical */ entry.delivery_mode = dest_ExtINT; /* ExtInt */ entry.vector = 0; - entry.dest = read_apic_id(); + entry.dest = GET_APIC_ID(read_apic_id()); /* * Add it to the IO-APIC irq-routing table: @@ -1553,147 +1397,6 @@ static int ioapic_retrigger_irq(unsigned int irq) */ #ifdef CONFIG_SMP - -#ifdef CONFIG_INTR_REMAP -static void ir_irq_migration(struct work_struct *work); - -static DECLARE_DELAYED_WORK(ir_migration_work, ir_irq_migration); - -/* - * Migrate the IO-APIC irq in the presence of intr-remapping. - * - * For edge triggered, irq migration is a simple atomic update(of vector - * and cpu destination) of IRTE and flush the hardware cache. - * - * For level triggered, we need to modify the io-apic RTE aswell with the update - * vector information, along with modifying IRTE with vector and destination. - * So irq migration for level triggered is little bit more complex compared to - * edge triggered migration. But the good news is, we use the same algorithm - * for level triggered migration as we have today, only difference being, - * we now initiate the irq migration from process context instead of the - * interrupt context. - * - * In future, when we do a directed EOI (combined with cpu EOI broadcast - * suppression) to the IO-APIC, level triggered irq migration will also be - * as simple as edge triggered migration and we can do the irq migration - * with a simple atomic update to IO-APIC RTE. - */ -static void migrate_ioapic_irq(int irq, cpumask_t mask) -{ - struct irq_cfg *cfg = irq_cfg + irq; - struct irq_desc *desc = irq_desc + irq; - cpumask_t tmp, cleanup_mask; - struct irte irte; - int modify_ioapic_rte = desc->status & IRQ_LEVEL; - unsigned int dest; - unsigned long flags; - - cpus_and(tmp, mask, cpu_online_map); - if (cpus_empty(tmp)) - return; - - if (get_irte(irq, &irte)) - return; - - if (assign_irq_vector(irq, mask)) - return; - - cpus_and(tmp, cfg->domain, mask); - dest = cpu_mask_to_apicid(tmp); - - if (modify_ioapic_rte) { - spin_lock_irqsave(&ioapic_lock, flags); - __target_IO_APIC_irq(irq, dest, cfg->vector); - spin_unlock_irqrestore(&ioapic_lock, flags); - } - - irte.vector = cfg->vector; - irte.dest_id = IRTE_DEST(dest); - - /* - * Modified the IRTE and flushes the Interrupt entry cache. - */ - modify_irte(irq, &irte); - - if (cfg->move_in_progress) { - cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); - cfg->move_cleanup_count = cpus_weight(cleanup_mask); - send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); - cfg->move_in_progress = 0; - } - - irq_desc[irq].affinity = mask; -} - -static int migrate_irq_remapped_level(int irq) -{ - int ret = -1; - - mask_IO_APIC_irq(irq); - - if (io_apic_level_ack_pending(irq)) { - /* - * Interrupt in progress. Migrating irq now will change the - * vector information in the IO-APIC RTE and that will confuse - * the EOI broadcast performed by cpu. - * So, delay the irq migration to the next instance. - */ - schedule_delayed_work(&ir_migration_work, 1); - goto unmask; - } - - /* everthing is clear. we have right of way */ - migrate_ioapic_irq(irq, irq_desc[irq].pending_mask); - - ret = 0; - irq_desc[irq].status &= ~IRQ_MOVE_PENDING; - cpus_clear(irq_desc[irq].pending_mask); - -unmask: - unmask_IO_APIC_irq(irq); - return ret; -} - -static void ir_irq_migration(struct work_struct *work) -{ - int irq; - - for (irq = 0; irq < NR_IRQS; irq++) { - struct irq_desc *desc = irq_desc + irq; - if (desc->status & IRQ_MOVE_PENDING) { - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - if (!desc->chip->set_affinity || - !(desc->status & IRQ_MOVE_PENDING)) { - desc->status &= ~IRQ_MOVE_PENDING; - spin_unlock_irqrestore(&desc->lock, flags); - continue; - } - - desc->chip->set_affinity(irq, - irq_desc[irq].pending_mask); - spin_unlock_irqrestore(&desc->lock, flags); - } - } -} - -/* - * Migrates the IRQ destination in the process context. - */ -static void set_ir_ioapic_affinity_irq(unsigned int irq, cpumask_t mask) -{ - if (irq_desc[irq].status & IRQ_LEVEL) { - irq_desc[irq].status |= IRQ_MOVE_PENDING; - irq_desc[irq].pending_mask = mask; - migrate_irq_remapped_level(irq); - return; - } - - migrate_ioapic_irq(irq, mask); -} -#endif - asmlinkage void smp_irq_move_cleanup_interrupt(void) { unsigned vector, me; @@ -1750,17 +1453,6 @@ static void irq_complete_move(unsigned int irq) #else static inline void irq_complete_move(unsigned int irq) {} #endif -#ifdef CONFIG_INTR_REMAP -static void ack_x2apic_level(unsigned int irq) -{ - ack_x2APIC_irq(); -} - -static void ack_x2apic_edge(unsigned int irq) -{ - ack_x2APIC_irq(); -} -#endif static void ack_apic_edge(unsigned int irq) { @@ -1835,21 +1527,6 @@ static struct irq_chip ioapic_chip __read_mostly = { .retrigger = ioapic_retrigger_irq, }; -#ifdef CONFIG_INTR_REMAP -static struct irq_chip ir_ioapic_chip __read_mostly = { - .name = "IR-IO-APIC", - .startup = startup_ioapic_irq, - .mask = mask_IO_APIC_irq, - .unmask = unmask_IO_APIC_irq, - .ack = ack_x2apic_edge, - .eoi = ack_x2apic_level, -#ifdef CONFIG_SMP - .set_affinity = set_ir_ioapic_affinity_irq, -#endif - .retrigger = ioapic_retrigger_irq, -}; -#endif - static inline void init_IO_APIC_traps(void) { int irq; @@ -2035,8 +1712,6 @@ static inline void __init check_timer(void) * 8259A. */ if (pin1 == -1) { - if (intr_remapping_enabled) - panic("BIOS bug: timer not connected to IO-APIC"); pin1 = pin2; apic1 = apic2; no_pin1 = 1; @@ -2063,8 +1738,6 @@ static inline void __init check_timer(void) clear_IO_APIC_pin(0, pin1); goto out; } - if (intr_remapping_enabled) - panic("timer doesn't work through Interrupt-remapped IO-APIC"); clear_IO_APIC_pin(apic1, pin1); if (!no_pin1) apic_printk(APIC_QUIET, KERN_ERR "..MP-BIOS bug: " @@ -2181,6 +1854,8 @@ void __init setup_IO_APIC(void) setup_IO_APIC_irqs(); init_IO_APIC_traps(); check_timer(); + if (!acpi_ioapic) + print_IO_APIC(); } struct sysfs_ioapic_data { @@ -2302,9 +1977,6 @@ void destroy_irq(unsigned int irq) dynamic_irq_cleanup(irq); -#ifdef CONFIG_INTR_REMAP - free_irte(irq); -#endif spin_lock_irqsave(&vector_lock, flags); __clear_irq_vector(irq); spin_unlock_irqrestore(&vector_lock, flags); @@ -2323,41 +1995,10 @@ static int msi_compose_msg(struct pci_dev *pdev, unsigned int irq, struct msi_ms tmp = TARGET_CPUS; err = assign_irq_vector(irq, tmp); - if (err) - return err; - - cpus_and(tmp, cfg->domain, tmp); - dest = cpu_mask_to_apicid(tmp); - -#ifdef CONFIG_INTR_REMAP - if (irq_remapped(irq)) { - struct irte irte; - int ir_index; - u16 sub_handle; - - ir_index = map_irq_to_irte_handle(irq, &sub_handle); - BUG_ON(ir_index == -1); - - memset (&irte, 0, sizeof(irte)); - - irte.present = 1; - irte.dst_mode = INT_DEST_MODE; - irte.trigger_mode = 0; /* edge */ - irte.dlvry_mode = INT_DELIVERY_MODE; - irte.vector = cfg->vector; - irte.dest_id = IRTE_DEST(dest); - - modify_irte(irq, &irte); + if (!err) { + cpus_and(tmp, cfg->domain, tmp); + dest = cpu_mask_to_apicid(tmp); - msg->address_hi = MSI_ADDR_BASE_HI; - msg->data = sub_handle; - msg->address_lo = MSI_ADDR_BASE_LO | MSI_ADDR_IR_EXT_INT | - MSI_ADDR_IR_SHV | - MSI_ADDR_IR_INDEX1(ir_index) | - MSI_ADDR_IR_INDEX2(ir_index); - } else -#endif - { msg->address_hi = MSI_ADDR_BASE_HI; msg->address_lo = MSI_ADDR_BASE_LO | @@ -2408,55 +2049,6 @@ static void set_msi_irq_affinity(unsigned int irq, cpumask_t mask) write_msi_msg(irq, &msg); irq_desc[irq].affinity = mask; } - -#ifdef CONFIG_INTR_REMAP -/* - * Migrate the MSI irq to another cpumask. This migration is - * done in the process context using interrupt-remapping hardware. - */ -static void ir_set_msi_irq_affinity(unsigned int irq, cpumask_t mask) -{ - struct irq_cfg *cfg = irq_cfg + irq; - unsigned int dest; - cpumask_t tmp, cleanup_mask; - struct irte irte; - - cpus_and(tmp, mask, cpu_online_map); - if (cpus_empty(tmp)) - return; - - if (get_irte(irq, &irte)) - return; - - if (assign_irq_vector(irq, mask)) - return; - - cpus_and(tmp, cfg->domain, mask); - dest = cpu_mask_to_apicid(tmp); - - irte.vector = cfg->vector; - irte.dest_id = IRTE_DEST(dest); - - /* - * atomically update the IRTE with the new destination and vector. - */ - modify_irte(irq, &irte); - - /* - * After this point, all the interrupts will start arriving - * at the new destination. So, time to cleanup the previous - * vector allocation. - */ - if (cfg->move_in_progress) { - cpus_and(cleanup_mask, cfg->old_domain, cpu_online_map); - cfg->move_cleanup_count = cpus_weight(cleanup_mask); - send_IPI_mask(cleanup_mask, IRQ_MOVE_CLEANUP_VECTOR); - cfg->move_in_progress = 0; - } - - irq_desc[irq].affinity = mask; -} -#endif #endif /* CONFIG_SMP */ /* @@ -2474,157 +2066,26 @@ static struct irq_chip msi_chip = { .retrigger = ioapic_retrigger_irq, }; -#ifdef CONFIG_INTR_REMAP -static struct irq_chip msi_ir_chip = { - .name = "IR-PCI-MSI", - .unmask = unmask_msi_irq, - .mask = mask_msi_irq, - .ack = ack_x2apic_edge, -#ifdef CONFIG_SMP - .set_affinity = ir_set_msi_irq_affinity, -#endif - .retrigger = ioapic_retrigger_irq, -}; - -/* - * Map the PCI dev to the corresponding remapping hardware unit - * and allocate 'nvec' consecutive interrupt-remapping table entries - * in it. - */ -static int msi_alloc_irte(struct pci_dev *dev, int irq, int nvec) -{ - struct intel_iommu *iommu; - int index; - - iommu = map_dev_to_ir(dev); - if (!iommu) { - printk(KERN_ERR - "Unable to map PCI %s to iommu\n", pci_name(dev)); - return -ENOENT; - } - - index = alloc_irte(iommu, irq, nvec); - if (index < 0) { - printk(KERN_ERR - "Unable to allocate %d IRTE for PCI %s\n", nvec, - pci_name(dev)); - return -ENOSPC; - } - return index; -} -#endif - -static int setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc, int irq) -{ - int ret; - struct msi_msg msg; - - ret = msi_compose_msg(dev, irq, &msg); - if (ret < 0) - return ret; - - set_irq_msi(irq, desc); - write_msi_msg(irq, &msg); - -#ifdef CONFIG_INTR_REMAP - if (irq_remapped(irq)) { - struct irq_desc *desc = irq_desc + irq; - /* - * irq migration in process context - */ - desc->status |= IRQ_MOVE_PCNTXT; - set_irq_chip_and_handler_name(irq, &msi_ir_chip, handle_edge_irq, "edge"); - } else -#endif - set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge"); - - return 0; -} - int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) { + struct msi_msg msg; int irq, ret; - irq = create_irq(); if (irq < 0) return irq; -#ifdef CONFIG_INTR_REMAP - if (!intr_remapping_enabled) - goto no_ir; - - ret = msi_alloc_irte(dev, irq, 1); - if (ret < 0) - goto error; -no_ir: -#endif - ret = setup_msi_irq(dev, desc, irq); + ret = msi_compose_msg(dev, irq, &msg); if (ret < 0) { destroy_irq(irq); return ret; } - return 0; - -#ifdef CONFIG_INTR_REMAP -error: - destroy_irq(irq); - return ret; -#endif -} -int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) -{ - int irq, ret, sub_handle; - struct msi_desc *desc; -#ifdef CONFIG_INTR_REMAP - struct intel_iommu *iommu = 0; - int index = 0; -#endif + set_irq_msi(irq, desc); + write_msi_msg(irq, &msg); - sub_handle = 0; - list_for_each_entry(desc, &dev->msi_list, list) { - irq = create_irq(); - if (irq < 0) - return irq; -#ifdef CONFIG_INTR_REMAP - if (!intr_remapping_enabled) - goto no_ir; + set_irq_chip_and_handler_name(irq, &msi_chip, handle_edge_irq, "edge"); - if (!sub_handle) { - /* - * allocate the consecutive block of IRTE's - * for 'nvec' - */ - index = msi_alloc_irte(dev, irq, nvec); - if (index < 0) { - ret = index; - goto error; - } - } else { - iommu = map_dev_to_ir(dev); - if (!iommu) { - ret = -ENOENT; - goto error; - } - /* - * setup the mapping between the irq and the IRTE - * base index, the sub_handle pointing to the - * appropriate interrupt remap table entry. - */ - set_irte_irq(irq, iommu, index, sub_handle); - } -no_ir: -#endif - ret = setup_msi_irq(dev, desc, irq); - if (ret < 0) - goto error; - sub_handle++; - } return 0; - -error: - destroy_irq(irq); - return ret; } void arch_teardown_msi_irq(unsigned int irq) @@ -2872,10 +2333,6 @@ void __init setup_ioapic_dest(void) setup_IO_APIC_irq(ioapic, pin, irq, irq_trigger(irq_entry), irq_polarity(irq_entry)); -#ifdef CONFIG_INTR_REMAP - else if (intr_remapping_enabled) - set_ir_ioapic_affinity_irq(irq, TARGET_CPUS); -#endif else set_ioapic_affinity_irq(irq, TARGET_CPUS); } diff --git a/trunk/arch/x86/kernel/ioport.c b/trunk/arch/x86/kernel/ioport.c index 191914302744..50e5e4a31c85 100644 --- a/trunk/arch/x86/kernel/ioport.c +++ b/trunk/arch/x86/kernel/ioport.c @@ -14,7 +14,6 @@ #include #include #include -#include /* Set EXTENT bits starting at BASE in BITMAP to value TURN_ON. */ static void set_bitmap(unsigned long *bitmap, unsigned int base, diff --git a/trunk/arch/x86/kernel/ipi.c b/trunk/arch/x86/kernel/ipi.c index f1c688e46f35..3f7537b669d3 100644 --- a/trunk/arch/x86/kernel/ipi.c +++ b/trunk/arch/x86/kernel/ipi.c @@ -20,8 +20,6 @@ #ifdef CONFIG_X86_32 #include -#include - /* * the following functions deal with sending IPIs between CPUs. * @@ -149,6 +147,7 @@ void send_IPI_mask_sequence(cpumask_t mask, int vector) } /* must come after the send_IPI functions above for inlining */ +#include static int convert_apicid_to_cpu(int apic_id) { int i; diff --git a/trunk/arch/x86/kernel/irqinit_32.c b/trunk/arch/x86/kernel/irqinit_32.c index 9200a1e2752d..d66914287ee1 100644 --- a/trunk/arch/x86/kernel/irqinit_32.c +++ b/trunk/arch/x86/kernel/irqinit_32.c @@ -74,15 +74,6 @@ void __init init_ISA_irqs (void) } } -/* - * IRQ2 is cascade interrupt to second interrupt controller - */ -static struct irqaction irq2 = { - .handler = no_action, - .mask = CPU_MASK_NONE, - .name = "cascade", -}; - /* Overridden in paravirt.c */ void init_IRQ(void) __attribute__((weak, alias("native_init_IRQ"))); @@ -107,46 +98,6 @@ void __init native_init_IRQ(void) set_intr_gate(vector, interrupt[i]); } -#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_SMP) - /* - * IRQ0 must be given a fixed assignment and initialized, - * because it's used before the IO-APIC is set up. - */ - set_intr_gate(FIRST_DEVICE_VECTOR, interrupt[0]); - - /* - * The reschedule interrupt is a CPU-to-CPU reschedule-helper - * IPI, driven by wakeup. - */ - alloc_intr_gate(RESCHEDULE_VECTOR, reschedule_interrupt); - - /* IPI for invalidation */ - alloc_intr_gate(INVALIDATE_TLB_VECTOR, invalidate_interrupt); - - /* IPI for generic function call */ - alloc_intr_gate(CALL_FUNCTION_VECTOR, call_function_interrupt); - - /* IPI for single call function */ - set_intr_gate(CALL_FUNCTION_SINGLE_VECTOR, call_function_single_interrupt); -#endif - -#ifdef CONFIG_X86_LOCAL_APIC - /* self generated IPI for local APIC timer */ - alloc_intr_gate(LOCAL_TIMER_VECTOR, apic_timer_interrupt); - - /* IPI vectors for APIC spurious and error interrupts */ - alloc_intr_gate(SPURIOUS_APIC_VECTOR, spurious_interrupt); - alloc_intr_gate(ERROR_APIC_VECTOR, error_interrupt); -#endif - -#if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86_MCE_P4THERMAL) - /* thermal monitor LVT interrupt */ - alloc_intr_gate(THERMAL_APIC_VECTOR, thermal_interrupt); -#endif - - if (!acpi_ioapic) - setup_irq(2, &irq2); - /* setup after call gates are initialised (usually add in * the architecture specific gates) */ diff --git a/trunk/arch/x86/kernel/ldt.c b/trunk/arch/x86/kernel/ldt.c index 0ed5f939b905..b68e21f06f4f 100644 --- a/trunk/arch/x86/kernel/ldt.c +++ b/trunk/arch/x86/kernel/ldt.c @@ -18,7 +18,6 @@ #include #include #include -#include #ifdef CONFIG_SMP static void flush_ldt(void *current_mm) diff --git a/trunk/arch/x86/kernel/mpparse.c b/trunk/arch/x86/kernel/mpparse.c index f98f4e1dba09..b3fb430725cb 100644 --- a/trunk/arch/x86/kernel/mpparse.c +++ b/trunk/arch/x86/kernel/mpparse.c @@ -397,9 +397,7 @@ static int __init smp_read_mpc(struct mp_config_table *mpc, unsigned early) generic_bigsmp_probe(); #endif -#ifdef CONFIG_X86_32 setup_apic_routing(); -#endif if (!num_processors) printk(KERN_ERR "MPTABLE: no processors registered!\n"); return num_processors; diff --git a/trunk/arch/x86/kernel/numaq_32.c b/trunk/arch/x86/kernel/numaq_32.c index 4caff39078e0..eecc8c18f010 100644 --- a/trunk/arch/x86/kernel/numaq_32.c +++ b/trunk/arch/x86/kernel/numaq_32.c @@ -229,12 +229,6 @@ static void __init smp_read_mpc_oem(struct mp_config_oemtable *oemtable, } } -static int __init numaq_setup_ioapic_ids(void) -{ - /* so can skip it */ - return 1; -} - static struct x86_quirks numaq_x86_quirks __initdata = { .arch_pre_time_init = numaq_pre_time_init, .arch_time_init = NULL, @@ -249,7 +243,6 @@ static struct x86_quirks numaq_x86_quirks __initdata = { .mpc_oem_bus_info = mpc_oem_bus_info, .mpc_oem_pci_bus = mpc_oem_pci_bus, .smp_read_mpc_oem = smp_read_mpc_oem, - .setup_ioapic_ids = numaq_setup_ioapic_ids, }; void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, diff --git a/trunk/arch/x86/kernel/paravirt.c b/trunk/arch/x86/kernel/paravirt.c index 4090cd6f8436..300da17e61cb 100644 --- a/trunk/arch/x86/kernel/paravirt.c +++ b/trunk/arch/x86/kernel/paravirt.c @@ -373,6 +373,8 @@ struct pv_cpu_ops pv_cpu_ops = { struct pv_apic_ops pv_apic_ops = { #ifdef CONFIG_X86_LOCAL_APIC + .apic_write = native_apic_write, + .apic_read = native_apic_read, .setup_boot_clock = setup_boot_APIC_clock, .setup_secondary_clock = setup_secondary_APIC_clock, .startup_ipi_hook = paravirt_nop, diff --git a/trunk/arch/x86/kernel/process_32.c b/trunk/arch/x86/kernel/process_32.c index 2c9abc95e026..3b7a1ddcc0bc 100644 --- a/trunk/arch/x86/kernel/process_32.c +++ b/trunk/arch/x86/kernel/process_32.c @@ -55,8 +55,6 @@ #include #include #include -#include -#include asmlinkage void ret_from_fork(void) __asm__("ret_from_fork"); diff --git a/trunk/arch/x86/kernel/process_64.c b/trunk/arch/x86/kernel/process_64.c index 00263c9e6500..71553b664e2a 100644 --- a/trunk/arch/x86/kernel/process_64.c +++ b/trunk/arch/x86/kernel/process_64.c @@ -51,7 +51,6 @@ #include #include #include -#include asmlinkage extern void ret_from_fork(void); diff --git a/trunk/arch/x86/kernel/ptrace.c b/trunk/arch/x86/kernel/ptrace.c index fc3e8dcd9da6..e37dccce85db 100644 --- a/trunk/arch/x86/kernel/ptrace.c +++ b/trunk/arch/x86/kernel/ptrace.c @@ -69,7 +69,7 @@ static inline bool invalid_selector(u16 value) #define FLAG_MASK FLAG_MASK_32 -static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno) +static long *pt_regs_access(struct pt_regs *regs, unsigned long regno) { BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0); regno >>= 2; diff --git a/trunk/arch/x86/kernel/setup.c b/trunk/arch/x86/kernel/setup.c index 673f12cf6eb0..362d4e7f2d38 100644 --- a/trunk/arch/x86/kernel/setup.c +++ b/trunk/arch/x86/kernel/setup.c @@ -739,8 +739,6 @@ void __init setup_arch(char **cmdline_p) num_physpages = max_pfn; check_efer(); - if (cpu_has_x2apic) - check_x2apic(); /* How many end-of-memory variables you have, grandma! */ /* need this before calling reserve_initrd */ diff --git a/trunk/arch/x86/kernel/setup_percpu.c b/trunk/arch/x86/kernel/setup_percpu.c index 0e67f72d9316..76e305e064f9 100644 --- a/trunk/arch/x86/kernel/setup_percpu.c +++ b/trunk/arch/x86/kernel/setup_percpu.c @@ -162,16 +162,9 @@ void __init setup_per_cpu_areas(void) printk(KERN_INFO "cpu %d has no node %d or node-local memory\n", cpu, node); - if (ptr) - printk(KERN_DEBUG "per cpu data for cpu%d at %016lx\n", - cpu, __pa(ptr)); } - else { + else ptr = alloc_bootmem_pages_node(NODE_DATA(node), size); - if (ptr) - printk(KERN_DEBUG "per cpu data for cpu%d on node%d at %016lx\n", - cpu, node, __pa(ptr)); - } #endif per_cpu_offset(cpu) = ptr - __per_cpu_start; memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); diff --git a/trunk/arch/x86/kernel/signal_32.c b/trunk/arch/x86/kernel/signal_32.c index 0c727f64e79b..6fb5bcdd8933 100644 --- a/trunk/arch/x86/kernel/signal_32.c +++ b/trunk/arch/x86/kernel/signal_32.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "sigframe.h" diff --git a/trunk/arch/x86/kernel/signal_64.c b/trunk/arch/x86/kernel/signal_64.c index 2f1464050059..ca316b5b742c 100644 --- a/trunk/arch/x86/kernel/signal_64.c +++ b/trunk/arch/x86/kernel/signal_64.c @@ -26,7 +26,6 @@ #include #include #include -#include #include "sigframe.h" #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP))) diff --git a/trunk/arch/x86/kernel/smpboot.c b/trunk/arch/x86/kernel/smpboot.c index aa804c64b167..7985c5b3f916 100644 --- a/trunk/arch/x86/kernel/smpboot.c +++ b/trunk/arch/x86/kernel/smpboot.c @@ -88,7 +88,7 @@ static DEFINE_PER_CPU(struct task_struct *, idle_thread_array); #define get_idle_for_cpu(x) (per_cpu(idle_thread_array, x)) #define set_idle_for_cpu(x, p) (per_cpu(idle_thread_array, x) = (p)) #else -static struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ; +struct task_struct *idle_thread_array[NR_CPUS] __cpuinitdata ; #define get_idle_for_cpu(x) (idle_thread_array[(x)]) #define set_idle_for_cpu(x, p) (idle_thread_array[(x)] = (p)) #endif @@ -123,12 +123,13 @@ EXPORT_PER_CPU_SYMBOL(cpu_info); static atomic_t init_deasserted; +static int boot_cpu_logical_apicid; /* representing cpus for which sibling maps can be computed */ static cpumask_t cpu_sibling_setup_map; /* Set if we find a B stepping CPU */ -static int __cpuinitdata smp_b_stepping; +int __cpuinitdata smp_b_stepping; #if defined(CONFIG_NUMA) && defined(CONFIG_X86_32) @@ -164,8 +165,6 @@ static void unmap_cpu_to_node(int cpu) #endif #ifdef CONFIG_X86_32 -static int boot_cpu_logical_apicid; - u8 cpu_2_logical_apicid[NR_CPUS] __read_mostly = { [0 ... NR_CPUS-1] = BAD_APICID }; @@ -211,7 +210,7 @@ static void __cpuinit smp_callin(void) /* * (This works even if the APIC is not enabled.) */ - phys_id = read_apic_id(); + phys_id = GET_APIC_ID(read_apic_id()); cpuid = smp_processor_id(); if (cpu_isset(cpuid, cpu_callin_map)) { panic("%s: phys CPU#%d, CPU#%d already present??\n", __func__, @@ -551,7 +550,8 @@ static inline void __inquire_remote_apic(int apicid) printk(KERN_CONT "a previous APIC delivery may have failed\n"); - apic_icr_write(APIC_DM_REMRD | regs[i], apicid); + apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(apicid)); + apic_write(APIC_ICR, APIC_DM_REMRD | regs[i]); timeout = 0; do { @@ -583,9 +583,11 @@ wakeup_secondary_cpu(int logical_apicid, unsigned long start_eip) int maxlvt; /* Target chip */ + apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(logical_apicid)); + /* Boot on the stack */ /* Kick the second */ - apic_icr_write(APIC_DM_NMI | APIC_DEST_LOGICAL, logical_apicid); + apic_write(APIC_ICR, APIC_DM_NMI | APIC_DEST_LOGICAL); pr_debug("Waiting for send to finish...\n"); send_status = safe_apic_wait_icr_idle(); @@ -638,11 +640,13 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) /* * Turn INIT on target chip */ + apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid)); + /* * Send IPI */ - apic_icr_write(APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT, - phys_apicid); + apic_write(APIC_ICR, + APIC_INT_LEVELTRIG | APIC_INT_ASSERT | APIC_DM_INIT); pr_debug("Waiting for send to finish...\n"); send_status = safe_apic_wait_icr_idle(); @@ -652,8 +656,10 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) pr_debug("Deasserting INIT.\n"); /* Target chip */ + apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid)); + /* Send IPI */ - apic_icr_write(APIC_INT_LEVELTRIG | APIC_DM_INIT, phys_apicid); + apic_write(APIC_ICR, APIC_INT_LEVELTRIG | APIC_DM_INIT); pr_debug("Waiting for send to finish...\n"); send_status = safe_apic_wait_icr_idle(); @@ -696,10 +702,11 @@ wakeup_secondary_cpu(int phys_apicid, unsigned long start_eip) */ /* Target chip */ + apic_write(APIC_ICR2, SET_APIC_DEST_FIELD(phys_apicid)); + /* Boot on the stack */ /* Kick the second */ - apic_icr_write(APIC_DM_STARTUP | (start_eip >> 12), - phys_apicid); + apic_write(APIC_ICR, APIC_DM_STARTUP | (start_eip >> 12)); /* * Give the other CPU some time to accept the IPI. @@ -1168,17 +1175,10 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) * Setup boot CPU information */ smp_store_cpu_info(0); /* Final full version of the data */ -#ifdef CONFIG_X86_32 boot_cpu_logical_apicid = logical_smp_processor_id(); -#endif current_thread_info()->cpu = 0; /* needed? */ set_cpu_sibling_map(0); -#ifdef CONFIG_X86_64 - enable_IR_x2apic(); - setup_apic_routing(); -#endif - if (smp_sanity_check(max_cpus) < 0) { printk(KERN_INFO "SMP disabled\n"); disable_smp(); @@ -1186,9 +1186,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) } preempt_disable(); - if (read_apic_id() != boot_cpu_physical_apicid) { + if (GET_APIC_ID(read_apic_id()) != boot_cpu_physical_apicid) { panic("Boot APIC ID in local APIC unexpected (%d vs %d)", - read_apic_id(), boot_cpu_physical_apicid); + GET_APIC_ID(read_apic_id()), boot_cpu_physical_apicid); /* Or can we switch back to PIC here? */ } preempt_enable(); diff --git a/trunk/arch/x86/kernel/summit_32.c b/trunk/arch/x86/kernel/summit_32.c index 7b987852e876..d67ce5f044ba 100644 --- a/trunk/arch/x86/kernel/summit_32.c +++ b/trunk/arch/x86/kernel/summit_32.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include static struct rio_table_hdr *rio_table_hdr __initdata; static struct scal_detail *scal_devs[MAX_NUMNODES] __initdata; diff --git a/trunk/arch/x86/kernel/sys_i386_32.c b/trunk/arch/x86/kernel/sys_i386_32.c index 1884a8d12bfa..7066cb855a60 100644 --- a/trunk/arch/x86/kernel/sys_i386_32.c +++ b/trunk/arch/x86/kernel/sys_i386_32.c @@ -22,8 +22,6 @@ #include #include -#include - asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long pgoff) diff --git a/trunk/arch/x86/kernel/sys_x86_64.c b/trunk/arch/x86/kernel/sys_x86_64.c index c9288c883e20..3b360ef33817 100644 --- a/trunk/arch/x86/kernel/sys_x86_64.c +++ b/trunk/arch/x86/kernel/sys_x86_64.c @@ -16,7 +16,6 @@ #include #include -#include asmlinkage long sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, unsigned long flags, unsigned long fd, unsigned long off) diff --git a/trunk/arch/x86/kernel/syscall_64.c b/trunk/arch/x86/kernel/syscall_64.c index 3d1be4f0fac5..170d43c17487 100644 --- a/trunk/arch/x86/kernel/syscall_64.c +++ b/trunk/arch/x86/kernel/syscall_64.c @@ -8,12 +8,12 @@ #define __NO_STUBS #define __SYSCALL(nr, sym) extern asmlinkage void sym(void) ; -#undef ASM_X86__UNISTD_64_H +#undef _ASM_X86_64_UNISTD_H_ #include #undef __SYSCALL #define __SYSCALL(nr, sym) [nr] = sym, -#undef ASM_X86__UNISTD_64_H +#undef _ASM_X86_64_UNISTD_H_ typedef void (*sys_call_ptr_t)(void); diff --git a/trunk/arch/x86/kernel/time_32.c b/trunk/arch/x86/kernel/time_32.c index bbecf8b6bf96..ffe3c664afc0 100644 --- a/trunk/arch/x86/kernel/time_32.c +++ b/trunk/arch/x86/kernel/time_32.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "do_timer.h" diff --git a/trunk/arch/x86/kernel/tls.c b/trunk/arch/x86/kernel/tls.c index 6bb7b8579e70..ab6bf375a307 100644 --- a/trunk/arch/x86/kernel/tls.c +++ b/trunk/arch/x86/kernel/tls.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "tls.h" diff --git a/trunk/arch/x86/kernel/vm86_32.c b/trunk/arch/x86/kernel/vm86_32.c index 4eeb5cf9720d..38f566fa27d2 100644 --- a/trunk/arch/x86/kernel/vm86_32.c +++ b/trunk/arch/x86/kernel/vm86_32.c @@ -46,7 +46,6 @@ #include #include #include -#include /* * Known problems: diff --git a/trunk/arch/x86/kernel/vmi_32.c b/trunk/arch/x86/kernel/vmi_32.c index 61531d5c9507..6ca515d6db54 100644 --- a/trunk/arch/x86/kernel/vmi_32.c +++ b/trunk/arch/x86/kernel/vmi_32.c @@ -905,8 +905,8 @@ static inline int __init activate_vmi(void) #endif #ifdef CONFIG_X86_LOCAL_APIC - para_fill(apic_ops->read, APICRead); - para_fill(apic_ops->write, APICWrite); + para_fill(pv_apic_ops.apic_read, APICRead); + para_fill(pv_apic_ops.apic_write, APICWrite); #endif /* diff --git a/trunk/arch/x86/lguest/boot.c b/trunk/arch/x86/lguest/boot.c index 65f0b8a47bed..d9249a882aa5 100644 --- a/trunk/arch/x86/lguest/boot.c +++ b/trunk/arch/x86/lguest/boot.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include @@ -784,44 +783,14 @@ static void lguest_wbinvd(void) * code qualifies for Advanced. It will also never interrupt anything. It * does, however, allow us to get through the Linux boot code. */ #ifdef CONFIG_X86_LOCAL_APIC -static void lguest_apic_write(u32 reg, u32 v) +static void lguest_apic_write(unsigned long reg, u32 v) { } -static u32 lguest_apic_read(u32 reg) +static u32 lguest_apic_read(unsigned long reg) { return 0; } - -static u64 lguest_apic_icr_read(void) -{ - return 0; -} - -static void lguest_apic_icr_write(u32 low, u32 id) -{ - /* Warn to see if there's any stray references */ - WARN_ON(1); -} - -static void lguest_apic_wait_icr_idle(void) -{ - return; -} - -static u32 lguest_apic_safe_wait_icr_idle(void) -{ - return 0; -} - -static struct apic_ops lguest_basic_apic_ops = { - .read = lguest_apic_read, - .write = lguest_apic_write, - .icr_read = lguest_apic_icr_read, - .icr_write = lguest_apic_icr_write, - .wait_icr_idle = lguest_apic_wait_icr_idle, - .safe_wait_icr_idle = lguest_apic_safe_wait_icr_idle, -}; #endif /* STOP! Until an interrupt comes in. */ @@ -1021,7 +990,8 @@ __init void lguest_init(void) #ifdef CONFIG_X86_LOCAL_APIC /* apic read/write intercepts */ - apic_ops = &lguest_basic_apic_ops; + pv_apic_ops.apic_write = lguest_apic_write; + pv_apic_ops.apic_read = lguest_apic_read; #endif /* time operations */ diff --git a/trunk/arch/x86/lib/Makefile b/trunk/arch/x86/lib/Makefile index 55e11aa6d66c..aa3fa4119424 100644 --- a/trunk/arch/x86/lib/Makefile +++ b/trunk/arch/x86/lib/Makefile @@ -17,6 +17,9 @@ ifeq ($(CONFIG_X86_32),y) lib-$(CONFIG_X86_USE_3DNOW) += mmx_32.o else obj-y += io_64.o iomap_copy_64.o + + CFLAGS_csum-partial_64.o := -funroll-loops + lib-y += csum-partial_64.o csum-copy_64.o csum-wrappers_64.o lib-y += thunk_64.o clear_page_64.o copy_page_64.o lib-y += memmove_64.o memset_64.o diff --git a/trunk/arch/x86/lib/usercopy_32.c b/trunk/arch/x86/lib/usercopy_32.c index 9e68075544f6..24e60944971a 100644 --- a/trunk/arch/x86/lib/usercopy_32.c +++ b/trunk/arch/x86/lib/usercopy_32.c @@ -14,13 +14,6 @@ #include #include -#ifdef CONFIG_X86_INTEL_USERCOPY -/* - * Alignment at which movsl is preferred for bulk memory copies. - */ -struct movsl_mask movsl_mask __read_mostly; -#endif - static inline int __movsl_is_ok(unsigned long a1, unsigned long a2, unsigned long n) { #ifdef CONFIG_X86_INTEL_USERCOPY diff --git a/trunk/arch/x86/mach-default/setup.c b/trunk/arch/x86/mach-default/setup.c index 37b9ae4d44c5..3d317836be9e 100644 --- a/trunk/arch/x86/mach-default/setup.c +++ b/trunk/arch/x86/mach-default/setup.c @@ -10,15 +10,13 @@ #include #include -#include - #ifdef CONFIG_HOTPLUG_CPU #define DEFAULT_SEND_IPI (1) #else #define DEFAULT_SEND_IPI (0) #endif -int no_broadcast = DEFAULT_SEND_IPI; +int no_broadcast=DEFAULT_SEND_IPI; /** * pre_intr_init_hook - initialisation prior to setting up interrupt vectors @@ -38,6 +36,15 @@ void __init pre_intr_init_hook(void) init_ISA_irqs(); } +/* + * IRQ2 is cascade interrupt to second interrupt controller + */ +static struct irqaction irq2 = { + .handler = no_action, + .mask = CPU_MASK_NONE, + .name = "cascade", +}; + /** * intr_init_hook - post gate setup interrupt initialisation * @@ -53,6 +60,12 @@ void __init intr_init_hook(void) if (x86_quirks->arch_intr_init()) return; } +#ifdef CONFIG_X86_LOCAL_APIC + apic_intr_init(); +#endif + + if (!acpi_ioapic) + setup_irq(2, &irq2); } /** diff --git a/trunk/arch/x86/mach-es7000/Makefile b/trunk/arch/x86/mach-es7000/Makefile new file mode 100644 index 000000000000..3ef8b43b62fc --- /dev/null +++ b/trunk/arch/x86/mach-es7000/Makefile @@ -0,0 +1,5 @@ +# +# Makefile for the linux kernel. +# + +obj-$(CONFIG_X86_ES7000) := es7000plat.o diff --git a/trunk/arch/x86/mach-es7000/es7000.h b/trunk/arch/x86/mach-es7000/es7000.h new file mode 100644 index 000000000000..c8d5aa132fa0 --- /dev/null +++ b/trunk/arch/x86/mach-es7000/es7000.h @@ -0,0 +1,114 @@ +/* + * Written by: Garry Forsgren, Unisys Corporation + * Natalie Protasevich, Unisys Corporation + * This file contains the code to configure and interface + * with Unisys ES7000 series hardware system manager. + * + * Copyright (c) 2003 Unisys Corporation. All Rights Reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write the Free Software Foundation, Inc., 59 + * Temple Place - Suite 330, Boston MA 02111-1307, USA. + * + * Contact information: Unisys Corporation, Township Line & Union Meeting + * Roads-A, Unisys Way, Blue Bell, Pennsylvania, 19424, or: + * + * http://www.unisys.com + */ + +/* + * ES7000 chipsets + */ + +#define NON_UNISYS 0 +#define ES7000_CLASSIC 1 +#define ES7000_ZORRO 2 + + +#define MIP_REG 1 +#define MIP_PSAI_REG 4 + +#define MIP_BUSY 1 +#define MIP_SPIN 0xf0000 +#define MIP_VALID 0x0100000000000000ULL +#define MIP_PORT(VALUE) ((VALUE >> 32) & 0xffff) + +#define MIP_RD_LO(VALUE) (VALUE & 0xffffffff) + +struct mip_reg_info { + unsigned long long mip_info; + unsigned long long delivery_info; + unsigned long long host_reg; + unsigned long long mip_reg; +}; + +struct part_info { + unsigned char type; + unsigned char length; + unsigned char part_id; + unsigned char apic_mode; + unsigned long snum; + char ptype[16]; + char sname[64]; + char pname[64]; +}; + +struct psai { + unsigned long long entry_type; + unsigned long long addr; + unsigned long long bep_addr; +}; + +struct es7000_mem_info { + unsigned char type; + unsigned char length; + unsigned char resv[6]; + unsigned long long start; + unsigned long long size; +}; + +struct es7000_oem_table { + unsigned long long hdr; + struct mip_reg_info mip; + struct part_info pif; + struct es7000_mem_info shm; + struct psai psai; +}; + +#ifdef CONFIG_ACPI + +struct oem_table { + struct acpi_table_header Header; + u32 OEMTableAddr; + u32 OEMTableSize; +}; + +extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); +#endif + +struct mip_reg { + unsigned long long off_0; + unsigned long long off_8; + unsigned long long off_10; + unsigned long long off_18; + unsigned long long off_20; + unsigned long long off_28; + unsigned long long off_30; + unsigned long long off_38; +}; + +#define MIP_SW_APIC 0x1020b +#define MIP_FUNC(VALUE) (VALUE & 0xff) + +extern int parse_unisys_oem (char *oemptr); +extern void setup_unisys(void); +extern int es7000_start_cpu(int cpu, unsigned long eip); +extern void es7000_sw_apic(void); diff --git a/trunk/arch/x86/kernel/es7000_32.c b/trunk/arch/x86/mach-es7000/es7000plat.c similarity index 78% rename from trunk/arch/x86/kernel/es7000_32.c rename to trunk/arch/x86/mach-es7000/es7000plat.c index 849e5cd485b8..50189af14b85 100644 --- a/trunk/arch/x86/kernel/es7000_32.c +++ b/trunk/arch/x86/mach-es7000/es7000plat.c @@ -39,92 +39,9 @@ #include #include #include +#include "es7000.h" #include -/* - * ES7000 chipsets - */ - -#define NON_UNISYS 0 -#define ES7000_CLASSIC 1 -#define ES7000_ZORRO 2 - - -#define MIP_REG 1 -#define MIP_PSAI_REG 4 - -#define MIP_BUSY 1 -#define MIP_SPIN 0xf0000 -#define MIP_VALID 0x0100000000000000ULL -#define MIP_PORT(VALUE) ((VALUE >> 32) & 0xffff) - -#define MIP_RD_LO(VALUE) (VALUE & 0xffffffff) - -struct mip_reg_info { - unsigned long long mip_info; - unsigned long long delivery_info; - unsigned long long host_reg; - unsigned long long mip_reg; -}; - -struct part_info { - unsigned char type; - unsigned char length; - unsigned char part_id; - unsigned char apic_mode; - unsigned long snum; - char ptype[16]; - char sname[64]; - char pname[64]; -}; - -struct psai { - unsigned long long entry_type; - unsigned long long addr; - unsigned long long bep_addr; -}; - -struct es7000_mem_info { - unsigned char type; - unsigned char length; - unsigned char resv[6]; - unsigned long long start; - unsigned long long size; -}; - -struct es7000_oem_table { - unsigned long long hdr; - struct mip_reg_info mip; - struct part_info pif; - struct es7000_mem_info shm; - struct psai psai; -}; - -#ifdef CONFIG_ACPI - -struct oem_table { - struct acpi_table_header Header; - u32 OEMTableAddr; - u32 OEMTableSize; -}; - -extern int find_unisys_acpi_oem_table(unsigned long *oem_addr); -#endif - -struct mip_reg { - unsigned long long off_0; - unsigned long long off_8; - unsigned long long off_10; - unsigned long long off_18; - unsigned long long off_20; - unsigned long long off_28; - unsigned long long off_30; - unsigned long long off_38; -}; - -#define MIP_SW_APIC 0x1020b -#define MIP_FUNC(VALUE) (VALUE & 0xff) - /* * ES7000 Globals */ @@ -155,7 +72,7 @@ es7000_rename_gsi(int ioapic, int gsi) base += nr_ioapic_registers[i]; } - if (!ioapic && (gsi < 16)) + if (!ioapic && (gsi < 16)) gsi += base; return gsi; } diff --git a/trunk/arch/x86/mach-generic/Makefile b/trunk/arch/x86/mach-generic/Makefile index 6730f4e7c744..0dbd7803a1d5 100644 --- a/trunk/arch/x86/mach-generic/Makefile +++ b/trunk/arch/x86/mach-generic/Makefile @@ -9,3 +9,4 @@ obj-$(CONFIG_X86_NUMAQ) += numaq.o obj-$(CONFIG_X86_SUMMIT) += summit.o obj-$(CONFIG_X86_BIGSMP) += bigsmp.o obj-$(CONFIG_X86_ES7000) += es7000.o +obj-$(CONFIG_X86_ES7000) += ../../x86/mach-es7000/ diff --git a/trunk/arch/x86/mach-generic/bigsmp.c b/trunk/arch/x86/mach-generic/bigsmp.c index df37fc9d6a26..59d771714559 100644 --- a/trunk/arch/x86/mach-generic/bigsmp.c +++ b/trunk/arch/x86/mach-generic/bigsmp.c @@ -5,17 +5,18 @@ #define APIC_DEFINITION 1 #include #include +#include #include #include #include #include #include +#include #include #include -#include -#include -#include -#include +#include +#include +#include #include static int dmi_bigsmp; /* can be set by dmi scanners */ diff --git a/trunk/arch/x86/mach-generic/es7000.c b/trunk/arch/x86/mach-generic/es7000.c index 520cca0ee04e..4742626f08c4 100644 --- a/trunk/arch/x86/mach-generic/es7000.c +++ b/trunk/arch/x86/mach-generic/es7000.c @@ -4,19 +4,20 @@ #define APIC_DEFINITION 1 #include #include +#include #include #include #include #include #include #include -#include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include static int probe_es7000(void) { diff --git a/trunk/arch/x86/mach-generic/numaq.c b/trunk/arch/x86/mach-generic/numaq.c index 8cf58394975e..8091e68764c4 100644 --- a/trunk/arch/x86/mach-generic/numaq.c +++ b/trunk/arch/x86/mach-generic/numaq.c @@ -4,6 +4,7 @@ #define APIC_DEFINITION 1 #include #include +#include #include #include #include @@ -11,12 +12,11 @@ #include #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include static int mps_oem_check(struct mp_config_table *mpc, char *oem, diff --git a/trunk/arch/x86/mach-generic/summit.c b/trunk/arch/x86/mach-generic/summit.c index 6ad6b67a723d..a97ea0f35b1e 100644 --- a/trunk/arch/x86/mach-generic/summit.c +++ b/trunk/arch/x86/mach-generic/summit.c @@ -4,18 +4,19 @@ #define APIC_DEFINITION 1 #include #include +#include #include #include #include #include #include #include -#include -#include #include -#include -#include -#include +#include +#include +#include +#include +#include static int probe_summit(void) { diff --git a/trunk/arch/x86/mm/fault.c b/trunk/arch/x86/mm/fault.c index 8f92cac4e6db..455f3fe67b42 100644 --- a/trunk/arch/x86/mm/fault.c +++ b/trunk/arch/x86/mm/fault.c @@ -35,7 +35,6 @@ #include #include #include -#include /* * Page fault error code bits @@ -358,6 +357,8 @@ static int is_errata100(struct pt_regs *regs, unsigned long address) return 0; } +void do_invalid_op(struct pt_regs *, unsigned long); + static int is_f00f_bug(struct pt_regs *regs, unsigned long address) { #ifdef CONFIG_X86_F00F_BUG diff --git a/trunk/arch/x86/mm/init_32.c b/trunk/arch/x86/mm/init_32.c index 4974e97dedfe..d37f29376b0c 100644 --- a/trunk/arch/x86/mm/init_32.c +++ b/trunk/arch/x86/mm/init_32.c @@ -47,7 +47,6 @@ #include #include #include -#include unsigned int __VMALLOC_RESERVE = 128 << 20; diff --git a/trunk/arch/x86/mm/ioremap.c b/trunk/arch/x86/mm/ioremap.c index cac6da54203b..d4b6e6a29ae3 100644 --- a/trunk/arch/x86/mm/ioremap.c +++ b/trunk/arch/x86/mm/ioremap.c @@ -421,7 +421,7 @@ void unxlate_dev_mem_ptr(unsigned long phys, void *addr) return; } -static int __initdata early_ioremap_debug; +int __initdata early_ioremap_debug; static int __init early_ioremap_debug_setup(char *str) { @@ -547,7 +547,7 @@ static inline void __init early_clear_fixmap(enum fixed_addresses idx) } -static int __initdata early_ioremap_nested; +int __initdata early_ioremap_nested; static int __init check_early_ioremap_leak(void) { diff --git a/trunk/arch/x86/pci/acpi.c b/trunk/arch/x86/pci/acpi.c index 1d88d2b39771..19af06927fbc 100644 --- a/trunk/arch/x86/pci/acpi.c +++ b/trunk/arch/x86/pci/acpi.c @@ -250,5 +250,10 @@ int __init pci_acpi_init(void) acpi_pci_irq_enable(dev); } +#ifdef CONFIG_X86_IO_APIC + if (acpi_ioapic) + print_IO_APIC(); +#endif + return 0; } diff --git a/trunk/arch/x86/pci/i386.c b/trunk/arch/x86/pci/i386.c index 844df0cbbd3e..8791fc55e715 100644 --- a/trunk/arch/x86/pci/i386.c +++ b/trunk/arch/x86/pci/i386.c @@ -33,7 +33,6 @@ #include #include -#include #include "pci.h" @@ -228,8 +227,6 @@ void __init pcibios_resource_survey(void) pcibios_allocate_bus_resources(&pci_root_buses); pcibios_allocate_resources(0); pcibios_allocate_resources(1); - - e820_reserve_resources_late(); } /** diff --git a/trunk/arch/x86/xen/enlighten.c b/trunk/arch/x86/xen/enlighten.c index 8d28925ebed9..9ff6e3cbf08f 100644 --- a/trunk/arch/x86/xen/enlighten.c +++ b/trunk/arch/x86/xen/enlighten.c @@ -36,7 +36,6 @@ #include #include -#include #include #include #include @@ -581,47 +580,16 @@ static void xen_io_delay(void) } #ifdef CONFIG_X86_LOCAL_APIC -static u32 xen_apic_read(u32 reg) +static u32 xen_apic_read(unsigned long reg) { return 0; } -static void xen_apic_write(u32 reg, u32 val) +static void xen_apic_write(unsigned long reg, u32 val) { /* Warn to see if there's any stray references */ WARN_ON(1); } - -static u64 xen_apic_icr_read(void) -{ - return 0; -} - -static void xen_apic_icr_write(u32 low, u32 id) -{ - /* Warn to see if there's any stray references */ - WARN_ON(1); -} - -static void xen_apic_wait_icr_idle(void) -{ - return; -} - -static u32 xen_safe_apic_wait_icr_idle(void) -{ - return 0; -} - -static struct apic_ops xen_basic_apic_ops = { - .read = xen_apic_read, - .write = xen_apic_write, - .icr_read = xen_apic_icr_read, - .icr_write = xen_apic_icr_write, - .wait_icr_idle = xen_apic_wait_icr_idle, - .safe_wait_icr_idle = xen_safe_apic_wait_icr_idle, -}; - #endif static void xen_flush_tlb(void) @@ -1305,6 +1273,8 @@ static const struct pv_irq_ops xen_irq_ops __initdata = { static const struct pv_apic_ops xen_apic_ops __initdata = { #ifdef CONFIG_X86_LOCAL_APIC + .apic_write = xen_apic_write, + .apic_read = xen_apic_read, .setup_boot_clock = paravirt_nop, .setup_secondary_clock = paravirt_nop, .startup_ipi_hook = paravirt_nop, @@ -1707,13 +1677,6 @@ asmlinkage void __init xen_start_kernel(void) pv_apic_ops = xen_apic_ops; pv_mmu_ops = xen_mmu_ops; -#ifdef CONFIG_X86_LOCAL_APIC - /* - * set up the basic apic ops. - */ - apic_ops = &xen_basic_apic_ops; -#endif - if (xen_feature(XENFEAT_mmu_pt_update_preserve_ad)) { pv_mmu_ops.ptep_modify_prot_start = xen_ptep_modify_prot_start; pv_mmu_ops.ptep_modify_prot_commit = xen_ptep_modify_prot_commit; diff --git a/trunk/drivers/net/bnx2x.h b/trunk/drivers/net/bnx2x.h index a14dba1afcc5..fd705d1295a7 100644 --- a/trunk/drivers/net/bnx2x.h +++ b/trunk/drivers/net/bnx2x.h @@ -151,6 +151,8 @@ struct sw_rx_page { #define PAGES_PER_SGE_SHIFT 0 #define PAGES_PER_SGE (1 << PAGES_PER_SGE_SHIFT) +#define BCM_RX_ETH_PAYLOAD_ALIGN 64 + /* SGE ring related macros */ #define NUM_RX_SGE_PAGES 2 #define RX_SGE_CNT (BCM_PAGE_SIZE / sizeof(struct eth_rx_sge)) @@ -750,8 +752,7 @@ struct bnx2x { u32 rx_csum; u32 rx_offset; - u32 rx_buf_use_size; /* useable size */ - u32 rx_buf_size; /* with alignment */ + u32 rx_buf_size; #define ETH_OVREHEAD (ETH_HLEN + 8) /* 8 for CRC + VLAN */ #define ETH_MIN_PACKET_SIZE 60 #define ETH_MAX_PACKET_SIZE 1500 diff --git a/trunk/drivers/net/bnx2x_main.c b/trunk/drivers/net/bnx2x_main.c index 82deea0a63f5..a8eb3c4a47c8 100644 --- a/trunk/drivers/net/bnx2x_main.c +++ b/trunk/drivers/net/bnx2x_main.c @@ -59,8 +59,8 @@ #include "bnx2x.h" #include "bnx2x_init.h" -#define DRV_MODULE_VERSION "1.45.20" -#define DRV_MODULE_RELDATE "2008/08/25" +#define DRV_MODULE_VERSION "1.45.21" +#define DRV_MODULE_RELDATE "2008/09/03" #define BNX2X_BC_VER 0x040200 /* Time in jiffies before concluding the transmitter is hung */ @@ -1027,7 +1027,7 @@ static inline int bnx2x_alloc_rx_skb(struct bnx2x *bp, if (unlikely(skb == NULL)) return -ENOMEM; - mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_use_size, + mapping = pci_map_single(bp->pdev, skb->data, bp->rx_buf_size, PCI_DMA_FROMDEVICE); if (unlikely(dma_mapping_error(&bp->pdev->dev, mapping))) { dev_kfree_skb(skb); @@ -1169,7 +1169,7 @@ static void bnx2x_tpa_start(struct bnx2x_fastpath *fp, u16 queue, /* move empty skb from pool to prod and map it */ prod_rx_buf->skb = fp->tpa_pool[queue].skb; mapping = pci_map_single(bp->pdev, fp->tpa_pool[queue].skb->data, - bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); + bp->rx_buf_size, PCI_DMA_FROMDEVICE); pci_unmap_addr_set(prod_rx_buf, mapping, mapping); /* move partial skb from cons to pool (don't unmap yet) */ @@ -1276,7 +1276,7 @@ static void bnx2x_tpa_stop(struct bnx2x *bp, struct bnx2x_fastpath *fp, pool entry status to BNX2X_TPA_STOP even if new skb allocation fails. */ pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), - bp->rx_buf_use_size, PCI_DMA_FROMDEVICE); + bp->rx_buf_size, PCI_DMA_FROMDEVICE); if (likely(new_skb)) { /* fix ip xsum and give it to the stack */ @@ -1520,7 +1520,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp, int budget) } else if (bnx2x_alloc_rx_skb(bp, fp, bd_prod) == 0) { pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), - bp->rx_buf_use_size, + bp->rx_buf_size, PCI_DMA_FROMDEVICE); skb_reserve(skb, pad); skb_put(skb, len); @@ -4229,7 +4229,7 @@ static inline void bnx2x_free_tpa_pool(struct bnx2x *bp, if (fp->tpa_state[i] == BNX2X_TPA_START) pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), - bp->rx_buf_use_size, + bp->rx_buf_size, PCI_DMA_FROMDEVICE); dev_kfree_skb(skb); @@ -4245,15 +4245,14 @@ static void bnx2x_init_rx_rings(struct bnx2x *bp) u16 ring_prod, cqe_ring_prod; int i, j; - bp->rx_buf_use_size = bp->dev->mtu; - bp->rx_buf_use_size += bp->rx_offset + ETH_OVREHEAD; - bp->rx_buf_size = bp->rx_buf_use_size + 64; + bp->rx_buf_size = bp->dev->mtu; + bp->rx_buf_size += bp->rx_offset + ETH_OVREHEAD + + BCM_RX_ETH_PAYLOAD_ALIGN; if (bp->flags & TPA_ENABLE_FLAG) { DP(NETIF_MSG_IFUP, - "rx_buf_use_size %d rx_buf_size %d effective_mtu %d\n", - bp->rx_buf_use_size, bp->rx_buf_size, - bp->dev->mtu + ETH_OVREHEAD); + "rx_buf_size %d effective_mtu %d\n", + bp->rx_buf_size, bp->dev->mtu + ETH_OVREHEAD); for_each_queue(bp, j) { struct bnx2x_fastpath *fp = &bp->fp[j]; @@ -4462,9 +4461,10 @@ static void bnx2x_init_context(struct bnx2x *bp) context->ustorm_st_context.common.status_block_id = sb_id; context->ustorm_st_context.common.flags = USTORM_ETH_ST_CONTEXT_CONFIG_ENABLE_MC_ALIGNMENT; - context->ustorm_st_context.common.mc_alignment_size = 64; + context->ustorm_st_context.common.mc_alignment_size = + BCM_RX_ETH_PAYLOAD_ALIGN; context->ustorm_st_context.common.bd_buff_size = - bp->rx_buf_use_size; + bp->rx_buf_size; context->ustorm_st_context.common.bd_page_base_hi = U64_HI(fp->rx_desc_mapping); context->ustorm_st_context.common.bd_page_base_lo = @@ -4717,7 +4717,7 @@ static void bnx2x_init_internal_func(struct bnx2x *bp) } /* Init CQ ring mapping and aggregation size */ - max_agg_size = min((u32)(bp->rx_buf_use_size + + max_agg_size = min((u32)(bp->rx_buf_size + 8*BCM_PAGE_SIZE*PAGES_PER_SGE), (u32)0xffff); for_each_queue(bp, i) { @@ -5940,7 +5940,7 @@ static void bnx2x_free_rx_skbs(struct bnx2x *bp) pci_unmap_single(bp->pdev, pci_unmap_addr(rx_buf, mapping), - bp->rx_buf_use_size, + bp->rx_buf_size, PCI_DMA_FROMDEVICE); rx_buf->skb = NULL; diff --git a/trunk/drivers/net/ixgbe/ixgbe_main.c b/trunk/drivers/net/ixgbe/ixgbe_main.c index 53f41b649f03..a417be7f8be5 100644 --- a/trunk/drivers/net/ixgbe/ixgbe_main.c +++ b/trunk/drivers/net/ixgbe/ixgbe_main.c @@ -2303,6 +2303,12 @@ static int __devinit ixgbe_set_interrupt_capability(struct ixgbe_adapter int err = 0; int vector, v_budget; + /* + * Set the default interrupt throttle rate. + */ + adapter->rx_eitr = (1000000 / IXGBE_DEFAULT_ITR_RX_USECS); + adapter->tx_eitr = (1000000 / IXGBE_DEFAULT_ITR_TX_USECS); + /* * It's easy to be greedy for MSI-X vectors, but it really * doesn't do us much good if we have a lot more vectors diff --git a/trunk/drivers/net/netxen/netxen_nic_main.c b/trunk/drivers/net/netxen/netxen_nic_main.c index 32bb47adbe39..008fd6618a5f 100644 --- a/trunk/drivers/net/netxen/netxen_nic_main.c +++ b/trunk/drivers/net/netxen/netxen_nic_main.c @@ -359,16 +359,6 @@ static void netxen_pcie_strap_init(struct netxen_adapter *adapter) int i, pos; struct pci_dev *pdev; - pdev = pci_get_device(0x1166, 0x0140, NULL); - if (pdev) { - pci_dev_put(pdev); - adapter->hw_read_wx(adapter, - NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); - chicken |= 0x4000; - adapter->hw_write_wx(adapter, - NETXEN_PCIE_REG(PCIE_TGT_SPLIT_CHICKEN), &chicken, 4); - } - pdev = adapter->pdev; adapter->hw_read_wx(adapter, diff --git a/trunk/drivers/net/pcmcia/axnet_cs.c b/trunk/drivers/net/pcmcia/axnet_cs.c index 3f682d49a4e6..52bf11b73c6e 100644 --- a/trunk/drivers/net/pcmcia/axnet_cs.c +++ b/trunk/drivers/net/pcmcia/axnet_cs.c @@ -784,6 +784,7 @@ static struct pcmcia_device_id axnet_ids[] = { PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEther PCC-TXD", 0x5261440f, 0x436768c5), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FEtherII PCC-TXD", 0x5261440f, 0x730df72e), PCMCIA_DEVICE_PROD_ID12("Dynalink", "L100C16", 0x55632fd5, 0x66bc2a90), + PCMCIA_DEVICE_PROD_ID12("IO DATA", "ETXPCM", 0x547e66dc, 0x233adac2), PCMCIA_DEVICE_PROD_ID12("Linksys", "EtherFast 10/100 PC Card (PCMPC100 V3)", 0x0733cc81, 0x232019a8), PCMCIA_DEVICE_PROD_ID12("MELCO", "LPC3-TX", 0x481e0094, 0xf91af609), PCMCIA_DEVICE_PROD_ID12("PCMCIA", "100BASE", 0x281f1c5d, 0x7c2add04), diff --git a/trunk/drivers/net/pcmcia/pcnet_cs.c b/trunk/drivers/net/pcmcia/pcnet_cs.c index 2d4c4ad89b8d..ebc1ae6bcbe5 100644 --- a/trunk/drivers/net/pcmcia/pcnet_cs.c +++ b/trunk/drivers/net/pcmcia/pcnet_cs.c @@ -1626,6 +1626,7 @@ static struct pcmcia_device_id pcnet_ids[] = { PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega EtherII PCC-TD", 0x5261440f, 0xc49bd73d), PCMCIA_DEVICE_PROD_ID12("Corega K.K.", "corega EtherII PCC-TD", 0xd4fdcbd8, 0xc49bd73d), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-T", 0x5261440f, 0x6705fcaa), + PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega Ether PCC-TD", 0x5261440f, 0x47d5ca83), PCMCIA_DEVICE_PROD_ID12("corega K.K.", "corega FastEther PCC-TX", 0x5261440f, 0x485e85d9), PCMCIA_DEVICE_PROD_ID12("Corega,K.K.", "Ethernet LAN Card", 0x110d26d9, 0x9fd2f0a2), PCMCIA_DEVICE_PROD_ID12("corega,K.K.", "Ethernet LAN Card", 0x9791a90e, 0x9fd2f0a2), @@ -1737,7 +1738,6 @@ static struct pcmcia_device_id pcnet_ids[] = { PCMCIA_DEVICE_PROD_ID1("CyQ've 10 Base-T LAN CARD", 0x94faf360), PCMCIA_DEVICE_PROD_ID1("EP-210 PCMCIA LAN CARD.", 0x8850b4de), PCMCIA_DEVICE_PROD_ID1("ETHER-C16", 0x06a8514f), - PCMCIA_DEVICE_PROD_ID1("IC-CARD", 0x60cb09a6), PCMCIA_DEVICE_PROD_ID1("NE2000 Compatible", 0x75b8ad5a), PCMCIA_DEVICE_PROD_ID2("EN-6200P2", 0xa996d078), /* too generic! */ diff --git a/trunk/drivers/net/usb/pegasus.c b/trunk/drivers/net/usb/pegasus.c index a84ba487c713..8c19307e5040 100644 --- a/trunk/drivers/net/usb/pegasus.c +++ b/trunk/drivers/net/usb/pegasus.c @@ -117,7 +117,7 @@ static void ctrl_callback(struct urb *urb) case -ENOENT: break; default: - if (netif_msg_drv(pegasus)) + if (netif_msg_drv(pegasus) && printk_ratelimit()) dev_dbg(&pegasus->intf->dev, "%s, status %d\n", __FUNCTION__, urb->status); } @@ -166,7 +166,7 @@ static int get_registers(pegasus_t * pegasus, __u16 indx, __u16 size, set_current_state(TASK_RUNNING); if (ret == -ENODEV) netif_device_detach(pegasus->net); - if (netif_msg_drv(pegasus)) + if (netif_msg_drv(pegasus) && printk_ratelimit()) dev_err(&pegasus->intf->dev, "%s, status %d\n", __FUNCTION__, ret); goto out; @@ -275,7 +275,7 @@ static int set_register(pegasus_t * pegasus, __u16 indx, __u8 data) if ((ret = usb_submit_urb(pegasus->ctrl_urb, GFP_ATOMIC))) { if (ret == -ENODEV) netif_device_detach(pegasus->net); - if (netif_msg_drv(pegasus)) + if (netif_msg_drv(pegasus) && printk_ratelimit()) dev_err(&pegasus->intf->dev, "%s, status %d\n", __FUNCTION__, ret); goto out; @@ -1209,8 +1209,7 @@ static void pegasus_set_multicast(struct net_device *net) pegasus->eth_regs[EthCtrl2] |= RX_PROMISCUOUS; if (netif_msg_link(pegasus)) pr_info("%s: Promiscuous mode enabled.\n", net->name); - } else if (net->mc_count || - (net->flags & IFF_ALLMULTI)) { + } else if (net->mc_count || (net->flags & IFF_ALLMULTI)) { pegasus->eth_regs[EthCtrl0] |= RX_MULTICAST; pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; if (netif_msg_link(pegasus)) @@ -1220,6 +1219,8 @@ static void pegasus_set_multicast(struct net_device *net) pegasus->eth_regs[EthCtrl2] &= ~RX_PROMISCUOUS; } + pegasus->ctrl_urb->status = 0; + pegasus->flags |= ETH_REGS_CHANGE; ctrl_callback(pegasus->ctrl_urb); } diff --git a/trunk/drivers/net/wireless/ath9k/main.c b/trunk/drivers/net/wireless/ath9k/main.c index 95b337149484..c5107f269f24 100644 --- a/trunk/drivers/net/wireless/ath9k/main.c +++ b/trunk/drivers/net/wireless/ath9k/main.c @@ -1067,8 +1067,16 @@ void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; tx_status->flags &= ~ATH_TX_BAR; } - if (tx_status->flags) - tx_info->status.excessive_retries = 1; + + if (tx_status->flags & (ATH_TX_ERROR | ATH_TX_XRETRY)) { + if (!(tx_info->flags & IEEE80211_TX_CTL_NO_ACK)) { + /* Frame was not ACKed, but an ACK was expected */ + tx_info->status.excessive_retries = 1; + } + } else { + /* Frame was ACKed */ + tx_info->flags |= IEEE80211_TX_STAT_ACK; + } tx_info->status.retry_count = tx_status->retries; diff --git a/trunk/drivers/net/wireless/ath9k/xmit.c b/trunk/drivers/net/wireless/ath9k/xmit.c index 157f830ee6b8..550129f717e2 100644 --- a/trunk/drivers/net/wireless/ath9k/xmit.c +++ b/trunk/drivers/net/wireless/ath9k/xmit.c @@ -357,9 +357,9 @@ static int ath_tx_prepare(struct ath_softc *sc, txctl->flags = ATH9K_TXDESC_CLRDMASK; /* needed for crypto errors */ if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK) - tx_info->flags |= ATH9K_TXDESC_NOACK; + txctl->flags |= ATH9K_TXDESC_NOACK; if (tx_info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) - tx_info->flags |= ATH9K_TXDESC_RTSENA; + txctl->flags |= ATH9K_TXDESC_RTSENA; /* * Setup for rate calculations. diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c index 754fef5b592f..90a2b6dee7c0 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-agn-rs.c @@ -1153,7 +1153,8 @@ static int rs_switch_to_mimo2(struct iwl_priv *priv, !sta->ht_info.ht_supported) return -1; - if (priv->current_ht_config.tx_mimo_ps_mode == IWL_MIMO_PS_STATIC) + if (((sta->ht_info.cap & IEEE80211_HT_CAP_MIMO_PS) >> 2) + == IWL_MIMO_PS_STATIC) return -1; /* Need both Tx chains/antennas to support MIMO */ diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c b/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c index c0b73c4d6f44..e01f048a02dd 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -181,14 +181,14 @@ static int iwl4965_check_rxon_cmd(struct iwl_rxon_cmd *rxon) } /** - * iwl4965_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed + * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed * @priv: staging_rxon is compared to active_rxon * * If the RXON structure is changing enough to require a new tune, * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required. */ -static int iwl4965_full_rxon_required(struct iwl_priv *priv) +static int iwl_full_rxon_required(struct iwl_priv *priv) { /* These items are only settable from the full RXON command */ @@ -207,7 +207,6 @@ static int iwl4965_full_rxon_required(struct iwl_priv *priv) priv->active_rxon.ofdm_ht_single_stream_basic_rates) || (priv->staging_rxon.ofdm_ht_dual_stream_basic_rates != priv->active_rxon.ofdm_ht_dual_stream_basic_rates) || - (priv->staging_rxon.rx_chain != priv->active_rxon.rx_chain) || (priv->staging_rxon.assoc_id != priv->active_rxon.assoc_id)) return 1; @@ -263,7 +262,7 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv) /* If we don't need to send a full RXON, we can use * iwl4965_rxon_assoc_cmd which is used to reconfigure filter * and other flags for the current radio configuration. */ - if (!iwl4965_full_rxon_required(priv)) { + if (!iwl_full_rxon_required(priv)) { ret = iwl_send_rxon_assoc(priv); if (ret) { IWL_ERROR("Error setting RXON_ASSOC (%d)\n", ret); @@ -587,8 +586,6 @@ static void iwl4965_ht_conf(struct iwl_priv *priv, iwl_conf->supported_chan_width = 0; } - iwl_conf->tx_mimo_ps_mode = - (u8)((ht_conf->cap & IEEE80211_HT_CAP_MIMO_PS) >> 2); memcpy(iwl_conf->supp_mcs_set, ht_conf->supp_mcs_set, 16); iwl_conf->control_channel = ht_bss_conf->primary_channel; @@ -2190,7 +2187,10 @@ static void __iwl4965_down(struct iwl_priv *priv) udelay(5); /* FIXME: apm_ops.suspend(priv) */ - priv->cfg->ops->lib->apm_ops.reset(priv); + if (exit_pending || test_bit(STATUS_IN_SUSPEND, &priv->status)) + priv->cfg->ops->lib->apm_ops.stop(priv); + else + priv->cfg->ops->lib->apm_ops.reset(priv); priv->cfg->ops->lib->free_shared_mem(priv); exit: @@ -3588,7 +3588,7 @@ static int iwl4965_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *sk priv->assoc_id = 0; timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp; - priv->timestamp = le64_to_cpu(timestamp) + (priv->beacon_int * 1000); + priv->timestamp = le64_to_cpu(timestamp); IWL_DEBUG_MAC80211("leave\n"); spin_unlock_irqrestore(&priv->lock, flags); @@ -4372,15 +4372,18 @@ static void __devexit iwl4965_pci_remove(struct pci_dev *pdev) iwl_dbgfs_unregister(priv); sysfs_remove_group(&pdev->dev.kobj, &iwl4965_attribute_group); + /* ieee80211_unregister_hw call wil cause iwl4965_mac_stop to + * to be called and iwl4965_down since we are removing the device + * we need to set STATUS_EXIT_PENDING bit. + */ + set_bit(STATUS_EXIT_PENDING, &priv->status); if (priv->mac80211_registered) { ieee80211_unregister_hw(priv->hw); priv->mac80211_registered = 0; + } else { + iwl4965_down(priv); } - set_bit(STATUS_EXIT_PENDING, &priv->status); - - iwl4965_down(priv); - /* make sure we flush any pending irq or * tasklet for the driver */ diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c index c72f72579bea..80f2f84defa8 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-core.c @@ -592,12 +592,11 @@ static void iwlcore_free_geos(struct iwl_priv *priv) clear_bit(STATUS_GEO_CONFIGURED, &priv->status); } -static u8 is_single_rx_stream(struct iwl_priv *priv) +static bool is_single_rx_stream(struct iwl_priv *priv) { return !priv->current_ht_config.is_ht || ((priv->current_ht_config.supp_mcs_set[1] == 0) && - (priv->current_ht_config.supp_mcs_set[2] == 0)) || - priv->ps_mode == IWL_MIMO_PS_STATIC; + (priv->current_ht_config.supp_mcs_set[2] == 0)); } static u8 iwl_is_channel_extension(struct iwl_priv *priv, @@ -704,33 +703,39 @@ EXPORT_SYMBOL(iwl_set_rxon_ht); * MIMO (dual stream) requires at least 2, but works better with 3. * This does not determine *which* chains to use, just how many. */ -static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, - u8 *idle_state, u8 *rx_state) +static int iwl_get_active_rx_chain_count(struct iwl_priv *priv) { - u8 is_single = is_single_rx_stream(priv); - u8 is_cam = test_bit(STATUS_POWER_PMI, &priv->status) ? 0 : 1; + bool is_single = is_single_rx_stream(priv); + bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); /* # of Rx chains to use when expecting MIMO. */ if (is_single || (!is_cam && (priv->ps_mode == IWL_MIMO_PS_STATIC))) - *rx_state = 2; + return 2; else - *rx_state = 3; + return 3; +} +static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) +{ + int idle_cnt; + bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); /* # Rx chains when idling and maybe trying to save power */ switch (priv->ps_mode) { case IWL_MIMO_PS_STATIC: case IWL_MIMO_PS_DYNAMIC: - *idle_state = (is_cam) ? 2 : 1; + idle_cnt = (is_cam) ? 2 : 1; break; case IWL_MIMO_PS_NONE: - *idle_state = (is_cam) ? *rx_state : 1; + idle_cnt = (is_cam) ? active_cnt : 1; break; + case IWL_MIMO_PS_INVALID: default: - *idle_state = 1; + IWL_ERROR("invalide mimo ps mode %d\n", priv->ps_mode); + WARN_ON(1); + idle_cnt = -1; break; } - - return 0; + return idle_cnt; } /** @@ -741,34 +746,44 @@ static int iwlcore_get_rx_chain_counter(struct iwl_priv *priv, */ void iwl_set_rxon_chain(struct iwl_priv *priv) { - u8 is_single = is_single_rx_stream(priv); - u8 idle_state, rx_state; - - priv->staging_rxon.rx_chain = 0; - rx_state = idle_state = 3; + bool is_single = is_single_rx_stream(priv); + bool is_cam = !test_bit(STATUS_POWER_PMI, &priv->status); + u8 idle_rx_cnt, active_rx_cnt; + u16 rx_chain; /* Tell uCode which antennas are actually connected. * Before first association, we assume all antennas are connected. * Just after first association, iwl_chain_noise_calibration() * checks which antennas actually *are* connected. */ - priv->staging_rxon.rx_chain |= - cpu_to_le16(priv->hw_params.valid_rx_ant << - RXON_RX_CHAIN_VALID_POS); + rx_chain = priv->hw_params.valid_rx_ant << RXON_RX_CHAIN_VALID_POS; /* How many receivers should we use? */ - iwlcore_get_rx_chain_counter(priv, &idle_state, &rx_state); - priv->staging_rxon.rx_chain |= - cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS); - priv->staging_rxon.rx_chain |= - cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS); - - if (!is_single && (rx_state >= 2) && - !test_bit(STATUS_POWER_PMI, &priv->status)) + active_rx_cnt = iwl_get_active_rx_chain_count(priv); + idle_rx_cnt = iwl_get_idle_rx_chain_count(priv, active_rx_cnt); + + /* correct rx chain count accoridng hw settings */ + if (priv->hw_params.rx_chains_num < active_rx_cnt) + active_rx_cnt = priv->hw_params.rx_chains_num; + + if (priv->hw_params.rx_chains_num < idle_rx_cnt) + idle_rx_cnt = priv->hw_params.rx_chains_num; + + rx_chain |= active_rx_cnt << RXON_RX_CHAIN_MIMO_CNT_POS; + rx_chain |= idle_rx_cnt << RXON_RX_CHAIN_CNT_POS; + + priv->staging_rxon.rx_chain = cpu_to_le16(rx_chain); + + if (!is_single && (active_rx_cnt >= 2) && is_cam) priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK; else priv->staging_rxon.rx_chain &= ~RXON_RX_CHAIN_MIMO_FORCE_MSK; - IWL_DEBUG_ASSOC("rx chain %X\n", priv->staging_rxon.rx_chain); + IWL_DEBUG_ASSOC("rx_chain=0x%Xi active=%d idle=%d\n", + priv->staging_rxon.rx_chain, + active_rx_cnt, idle_rx_cnt); + + WARN_ON(active_rx_cnt == 0 || idle_rx_cnt == 0 || + active_rx_cnt < idle_rx_cnt); } EXPORT_SYMBOL(iwl_set_rxon_chain); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h b/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h index c19db438306c..cdfb343c7ec6 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-dev.h @@ -412,7 +412,6 @@ struct iwl_ht_info { /* self configuration data */ u8 is_ht; u8 supported_chan_width; - u16 tx_mimo_ps_mode; u8 is_green_field; u8 sgf; /* HT_SHORT_GI_* short guard interval */ u8 max_amsdu_size; diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c index f3f6ea49fdd2..e81bfc42a7cb 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-rx.c @@ -1173,7 +1173,10 @@ void iwl_rx_reply_rx(struct iwl_priv *priv, rx_status.antenna = 0; rx_status.flag = 0; - rx_status.flag |= RX_FLAG_TSFT; + + /* TSF isn't reliable. In order to allow smooth user experience, + * this W/A doesn't propagate it to the mac80211 */ + /*rx_status.flag |= RX_FLAG_TSFT;*/ if ((unlikely(rx_start->cfg_phy_cnt > 20))) { IWL_DEBUG_DROP("dsp size out of range [0,20]: %d/n", diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c b/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c index 9bb6adb28b73..6c8ac3a87d54 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-scan.c @@ -421,7 +421,7 @@ static int iwl_get_channels_for_scan(struct iwl_priv *priv, else scan_ch->type = SCAN_CHANNEL_TYPE_ACTIVE; - if ((scan_ch->type & SCAN_CHANNEL_TYPE_ACTIVE) && n_probes) + if (n_probes) scan_ch->type |= IWL_SCAN_PROBE_MASK(n_probes); scan_ch->active_dwell = cpu_to_le16(active_dwell); diff --git a/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c b/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c index ff879d46624a..78b1a7a4ca40 100644 --- a/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/trunk/drivers/net/wireless/iwlwifi/iwl-tx.c @@ -402,12 +402,11 @@ static int iwl_hw_tx_queue_init(struct iwl_priv *priv, /** * iwl_tx_queue_init - Allocate and initialize one tx/cmd queue */ -static int iwl_tx_queue_init(struct iwl_priv *priv, - struct iwl_tx_queue *txq, +static int iwl_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq, int slots_num, u32 txq_id) { int i, len; - int rc = 0; + int ret; /* * Alloc buffer array for commands (Tx or other types of commands). @@ -428,17 +427,14 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, txq->cmd[i] = kmalloc(len, GFP_KERNEL); if (!txq->cmd[i]) - return -ENOMEM; + goto err; } /* Alloc driver data array and TFD circular buffer */ - rc = iwl_tx_queue_alloc(priv, txq, txq_id); - if (rc) { - for (i = 0; i < slots_num; i++) - kfree(txq->cmd[i]); + ret = iwl_tx_queue_alloc(priv, txq, txq_id); + if (ret) + goto err; - return -ENOMEM; - } txq->need_update = 0; /* TFD_QUEUE_SIZE_MAX must be power-of-two size, otherwise @@ -452,6 +448,17 @@ static int iwl_tx_queue_init(struct iwl_priv *priv, iwl_hw_tx_queue_init(priv, txq); return 0; +err: + for (i = 0; i < slots_num; i++) { + kfree(txq->cmd[i]); + txq->cmd[i] = NULL; + } + + if (txq_id == IWL_CMD_QUEUE_NUM) { + kfree(txq->cmd[slots_num]); + txq->cmd[slots_num] = NULL; + } + return -ENOMEM; } /** * iwl_hw_txq_ctx_free - Free TXQ Context diff --git a/trunk/drivers/pci/Makefile b/trunk/drivers/pci/Makefile index 4b47f4ece5b7..7d63f8ced24b 100644 --- a/trunk/drivers/pci/Makefile +++ b/trunk/drivers/pci/Makefile @@ -26,8 +26,6 @@ obj-$(CONFIG_HT_IRQ) += htirq.o # Build Intel IOMMU support obj-$(CONFIG_DMAR) += dmar.o iova.o intel-iommu.o -obj-$(CONFIG_INTR_REMAP) += dmar.o intr_remapping.o - # # Some architectures use the generic PCI setup functions # diff --git a/trunk/drivers/pci/dma_remapping.h b/trunk/drivers/pci/dma_remapping.h deleted file mode 100644 index bff5c65f81dc..000000000000 --- a/trunk/drivers/pci/dma_remapping.h +++ /dev/null @@ -1,157 +0,0 @@ -#ifndef _DMA_REMAPPING_H -#define _DMA_REMAPPING_H - -/* - * We need a fixed PAGE_SIZE of 4K irrespective of - * arch PAGE_SIZE for IOMMU page tables. - */ -#define PAGE_SHIFT_4K (12) -#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K) -#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K) -#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K) - -#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K) -#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK) -#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK) - - -/* - * 0: Present - * 1-11: Reserved - * 12-63: Context Ptr (12 - (haw-1)) - * 64-127: Reserved - */ -struct root_entry { - u64 val; - u64 rsvd1; -}; -#define ROOT_ENTRY_NR (PAGE_SIZE_4K/sizeof(struct root_entry)) -static inline bool root_present(struct root_entry *root) -{ - return (root->val & 1); -} -static inline void set_root_present(struct root_entry *root) -{ - root->val |= 1; -} -static inline void set_root_value(struct root_entry *root, unsigned long value) -{ - root->val |= value & PAGE_MASK_4K; -} - -struct context_entry; -static inline struct context_entry * -get_context_addr_from_root(struct root_entry *root) -{ - return (struct context_entry *) - (root_present(root)?phys_to_virt( - root->val & PAGE_MASK_4K): - NULL); -} - -/* - * low 64 bits: - * 0: present - * 1: fault processing disable - * 2-3: translation type - * 12-63: address space root - * high 64 bits: - * 0-2: address width - * 3-6: aval - * 8-23: domain id - */ -struct context_entry { - u64 lo; - u64 hi; -}; -#define context_present(c) ((c).lo & 1) -#define context_fault_disable(c) (((c).lo >> 1) & 1) -#define context_translation_type(c) (((c).lo >> 2) & 3) -#define context_address_root(c) ((c).lo & PAGE_MASK_4K) -#define context_address_width(c) ((c).hi & 7) -#define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1)) - -#define context_set_present(c) do {(c).lo |= 1;} while (0) -#define context_set_fault_enable(c) \ - do {(c).lo &= (((u64)-1) << 2) | 1;} while (0) -#define context_set_translation_type(c, val) \ - do { \ - (c).lo &= (((u64)-1) << 4) | 3; \ - (c).lo |= ((val) & 3) << 2; \ - } while (0) -#define CONTEXT_TT_MULTI_LEVEL 0 -#define context_set_address_root(c, val) \ - do {(c).lo |= (val) & PAGE_MASK_4K;} while (0) -#define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0) -#define context_set_domain_id(c, val) \ - do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0) -#define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0) - -/* - * 0: readable - * 1: writable - * 2-6: reserved - * 7: super page - * 8-11: available - * 12-63: Host physcial address - */ -struct dma_pte { - u64 val; -}; -#define dma_clear_pte(p) do {(p).val = 0;} while (0) - -#define DMA_PTE_READ (1) -#define DMA_PTE_WRITE (2) - -#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0) -#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0) -#define dma_set_pte_prot(p, prot) \ - do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0) -#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K) -#define dma_set_pte_addr(p, addr) do {\ - (p).val |= ((addr) & PAGE_MASK_4K); } while (0) -#define dma_pte_present(p) (((p).val & 3) != 0) - -struct intel_iommu; - -struct dmar_domain { - int id; /* domain id */ - struct intel_iommu *iommu; /* back pointer to owning iommu */ - - struct list_head devices; /* all devices' list */ - struct iova_domain iovad; /* iova's that belong to this domain */ - - struct dma_pte *pgd; /* virtual address */ - spinlock_t mapping_lock; /* page table lock */ - int gaw; /* max guest address width */ - - /* adjusted guest address width, 0 is level 2 30-bit */ - int agaw; - -#define DOMAIN_FLAG_MULTIPLE_DEVICES 1 - int flags; -}; - -/* PCI domain-device relationship */ -struct device_domain_info { - struct list_head link; /* link to domain siblings */ - struct list_head global; /* link to global list */ - u8 bus; /* PCI bus numer */ - u8 devfn; /* PCI devfn number */ - struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */ - struct dmar_domain *domain; /* pointer to domain */ -}; - -extern int init_dmars(void); -extern void free_dmar_iommu(struct intel_iommu *iommu); - -extern int dmar_disabled; - -#ifndef CONFIG_DMAR_GFX_WA -static inline void iommu_prepare_gfx_mapping(void) -{ - return; -} -#endif /* !CONFIG_DMAR_GFX_WA */ - -#endif diff --git a/trunk/drivers/pci/dmar.c b/trunk/drivers/pci/dmar.c index bd2c01674f5e..8bf86ae2333f 100644 --- a/trunk/drivers/pci/dmar.c +++ b/trunk/drivers/pci/dmar.c @@ -19,16 +19,13 @@ * Author: Shaohua Li * Author: Anil S Keshavamurthy * - * This file implements early detection/parsing of Remapping Devices + * This file implements early detection/parsing of DMA Remapping Devices * reported to OS through BIOS via DMA remapping reporting (DMAR) ACPI * tables. - * - * These routines are used by both DMA-remapping and Interrupt-remapping */ #include #include -#include #include "iova.h" #include "intel-iommu.h" @@ -40,6 +37,7 @@ * these units are not supported by the architecture. */ LIST_HEAD(dmar_drhd_units); +LIST_HEAD(dmar_rmrr_units); static struct acpi_table_header * __initdata dmar_tbl; @@ -55,6 +53,11 @@ static void __init dmar_register_drhd_unit(struct dmar_drhd_unit *drhd) list_add(&drhd->list, &dmar_drhd_units); } +static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr) +{ + list_add(&rmrr->list, &dmar_rmrr_units); +} + static int __init dmar_parse_one_dev_scope(struct acpi_dmar_device_scope *scope, struct pci_dev **dev, u16 segment) { @@ -169,37 +172,19 @@ dmar_parse_one_drhd(struct acpi_dmar_header *header) struct acpi_dmar_hardware_unit *drhd; struct dmar_drhd_unit *dmaru; int ret = 0; + static int include_all; dmaru = kzalloc(sizeof(*dmaru), GFP_KERNEL); if (!dmaru) return -ENOMEM; - dmaru->hdr = header; drhd = (struct acpi_dmar_hardware_unit *)header; dmaru->reg_base_addr = drhd->address; dmaru->include_all = drhd->flags & 0x1; /* BIT0: INCLUDE_ALL */ - ret = alloc_iommu(dmaru); - if (ret) { - kfree(dmaru); - return ret; - } - dmar_register_drhd_unit(dmaru); - return 0; -} - -static int __init -dmar_parse_dev(struct dmar_drhd_unit *dmaru) -{ - struct acpi_dmar_hardware_unit *drhd; - static int include_all; - int ret; - - drhd = (struct acpi_dmar_hardware_unit *) dmaru->hdr; - if (!dmaru->include_all) ret = dmar_parse_dev_scope((void *)(drhd + 1), - ((void *)drhd) + drhd->header.length, + ((void *)drhd) + header->length, &dmaru->devices_cnt, &dmaru->devices, drhd->segment); else { @@ -212,59 +197,37 @@ dmar_parse_dev(struct dmar_drhd_unit *dmaru) include_all = 1; } - if (ret || (dmaru->devices_cnt == 0 && !dmaru->include_all)) { - list_del(&dmaru->list); + if (ret || (dmaru->devices_cnt == 0 && !dmaru->include_all)) kfree(dmaru); - } + else + dmar_register_drhd_unit(dmaru); return ret; } -#ifdef CONFIG_DMAR -LIST_HEAD(dmar_rmrr_units); - -static void __init dmar_register_rmrr_unit(struct dmar_rmrr_unit *rmrr) -{ - list_add(&rmrr->list, &dmar_rmrr_units); -} - - static int __init dmar_parse_one_rmrr(struct acpi_dmar_header *header) { struct acpi_dmar_reserved_memory *rmrr; struct dmar_rmrr_unit *rmrru; + int ret = 0; rmrru = kzalloc(sizeof(*rmrru), GFP_KERNEL); if (!rmrru) return -ENOMEM; - rmrru->hdr = header; rmrr = (struct acpi_dmar_reserved_memory *)header; rmrru->base_address = rmrr->base_address; rmrru->end_address = rmrr->end_address; - - dmar_register_rmrr_unit(rmrru); - return 0; -} - -static int __init -rmrr_parse_dev(struct dmar_rmrr_unit *rmrru) -{ - struct acpi_dmar_reserved_memory *rmrr; - int ret; - - rmrr = (struct acpi_dmar_reserved_memory *) rmrru->hdr; ret = dmar_parse_dev_scope((void *)(rmrr + 1), - ((void *)rmrr) + rmrr->header.length, + ((void *)rmrr) + header->length, &rmrru->devices_cnt, &rmrru->devices, rmrr->segment); - if (ret || (rmrru->devices_cnt == 0)) { - list_del(&rmrru->list); + if (ret || (rmrru->devices_cnt == 0)) kfree(rmrru); - } + else + dmar_register_rmrr_unit(rmrru); return ret; } -#endif static void __init dmar_table_print_dmar_entry(struct acpi_dmar_header *header) @@ -289,7 +252,6 @@ dmar_table_print_dmar_entry(struct acpi_dmar_header *header) } } - /** * parse_dmar_table - parses the DMA reporting table */ @@ -322,9 +284,7 @@ parse_dmar_table(void) ret = dmar_parse_one_drhd(entry_header); break; case ACPI_DMAR_TYPE_RESERVED_MEMORY: -#ifdef CONFIG_DMAR ret = dmar_parse_one_rmrr(entry_header); -#endif break; default: printk(KERN_WARNING PREFIX @@ -340,77 +300,15 @@ parse_dmar_table(void) return ret; } -int dmar_pci_device_match(struct pci_dev *devices[], int cnt, - struct pci_dev *dev) -{ - int index; - - while (dev) { - for (index = 0; index < cnt; index++) - if (dev == devices[index]) - return 1; - - /* Check our parent */ - dev = dev->bus->self; - } - - return 0; -} - -struct dmar_drhd_unit * -dmar_find_matched_drhd_unit(struct pci_dev *dev) -{ - struct dmar_drhd_unit *drhd = NULL; - - list_for_each_entry(drhd, &dmar_drhd_units, list) { - if (drhd->include_all || dmar_pci_device_match(drhd->devices, - drhd->devices_cnt, dev)) - return drhd; - } - - return NULL; -} - -int __init dmar_dev_scope_init(void) -{ - struct dmar_drhd_unit *drhd; - int ret = -ENODEV; - - for_each_drhd_unit(drhd) { - ret = dmar_parse_dev(drhd); - if (ret) - return ret; - } - -#ifdef CONFIG_DMAR - { - struct dmar_rmrr_unit *rmrr; - for_each_rmrr_units(rmrr) { - ret = rmrr_parse_dev(rmrr); - if (ret) - return ret; - } - } -#endif - - return ret; -} - int __init dmar_table_init(void) { - static int dmar_table_initialized; - int ret; - - if (dmar_table_initialized) - return 0; - dmar_table_initialized = 1; + int ret; ret = parse_dmar_table(); if (ret) { - if (ret != -ENODEV) - printk(KERN_INFO PREFIX "parse DMAR table failure.\n"); + printk(KERN_INFO PREFIX "parse DMAR table failure.\n"); return ret; } @@ -419,14 +317,9 @@ int __init dmar_table_init(void) return -ENODEV; } -#ifdef CONFIG_DMAR if (list_empty(&dmar_rmrr_units)) printk(KERN_INFO PREFIX "No RMRR found\n"); -#endif -#ifdef CONFIG_INTR_REMAP - parse_ioapics_under_ir(); -#endif return 0; } @@ -448,255 +341,3 @@ int __init early_dmar_detect(void) return (ACPI_SUCCESS(status) ? 1 : 0); } - -void __init detect_intel_iommu(void) -{ - int ret; - - ret = early_dmar_detect(); - -#ifdef CONFIG_DMAR - { - struct acpi_table_dmar *dmar; - /* - * for now we will disable dma-remapping when interrupt - * remapping is enabled. - * When support for queued invalidation for IOTLB invalidation - * is added, we will not need this any more. - */ - dmar = (struct acpi_table_dmar *) dmar_tbl; - if (ret && cpu_has_x2apic && dmar->flags & 0x1) { - printk(KERN_INFO - "Queued invalidation will be enabled to support " - "x2apic and Intr-remapping.\n"); - printk(KERN_INFO - "Disabling IOMMU detection, because of missing " - "queued invalidation support for IOTLB " - "invalidation\n"); - printk(KERN_INFO - "Use \"nox2apic\", if you want to use Intel " - " IOMMU for DMA-remapping and don't care about " - " x2apic support\n"); - - dmar_disabled = 1; - return; - } - - if (ret && !no_iommu && !iommu_detected && !swiotlb && - !dmar_disabled) - iommu_detected = 1; - } -#endif -} - - -int alloc_iommu(struct dmar_drhd_unit *drhd) -{ - struct intel_iommu *iommu; - int map_size; - u32 ver; - static int iommu_allocated = 0; - - iommu = kzalloc(sizeof(*iommu), GFP_KERNEL); - if (!iommu) - return -ENOMEM; - - iommu->seq_id = iommu_allocated++; - - iommu->reg = ioremap(drhd->reg_base_addr, PAGE_SIZE_4K); - if (!iommu->reg) { - printk(KERN_ERR "IOMMU: can't map the region\n"); - goto error; - } - iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG); - iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG); - - /* the registers might be more than one page */ - map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), - cap_max_fault_reg_offset(iommu->cap)); - map_size = PAGE_ALIGN_4K(map_size); - if (map_size > PAGE_SIZE_4K) { - iounmap(iommu->reg); - iommu->reg = ioremap(drhd->reg_base_addr, map_size); - if (!iommu->reg) { - printk(KERN_ERR "IOMMU: can't map the region\n"); - goto error; - } - } - - ver = readl(iommu->reg + DMAR_VER_REG); - pr_debug("IOMMU %llx: ver %d:%d cap %llx ecap %llx\n", - drhd->reg_base_addr, DMAR_VER_MAJOR(ver), DMAR_VER_MINOR(ver), - iommu->cap, iommu->ecap); - - spin_lock_init(&iommu->register_lock); - - drhd->iommu = iommu; - return 0; -error: - kfree(iommu); - return -1; -} - -void free_iommu(struct intel_iommu *iommu) -{ - if (!iommu) - return; - -#ifdef CONFIG_DMAR - free_dmar_iommu(iommu); -#endif - - if (iommu->reg) - iounmap(iommu->reg); - kfree(iommu); -} - -/* - * Reclaim all the submitted descriptors which have completed its work. - */ -static inline void reclaim_free_desc(struct q_inval *qi) -{ - while (qi->desc_status[qi->free_tail] == QI_DONE) { - qi->desc_status[qi->free_tail] = QI_FREE; - qi->free_tail = (qi->free_tail + 1) % QI_LENGTH; - qi->free_cnt++; - } -} - -/* - * Submit the queued invalidation descriptor to the remapping - * hardware unit and wait for its completion. - */ -void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu) -{ - struct q_inval *qi = iommu->qi; - struct qi_desc *hw, wait_desc; - int wait_index, index; - unsigned long flags; - - if (!qi) - return; - - hw = qi->desc; - - spin_lock(&qi->q_lock); - while (qi->free_cnt < 3) { - spin_unlock(&qi->q_lock); - cpu_relax(); - spin_lock(&qi->q_lock); - } - - index = qi->free_head; - wait_index = (index + 1) % QI_LENGTH; - - qi->desc_status[index] = qi->desc_status[wait_index] = QI_IN_USE; - - hw[index] = *desc; - - wait_desc.low = QI_IWD_STATUS_DATA(2) | QI_IWD_STATUS_WRITE | QI_IWD_TYPE; - wait_desc.high = virt_to_phys(&qi->desc_status[wait_index]); - - hw[wait_index] = wait_desc; - - __iommu_flush_cache(iommu, &hw[index], sizeof(struct qi_desc)); - __iommu_flush_cache(iommu, &hw[wait_index], sizeof(struct qi_desc)); - - qi->free_head = (qi->free_head + 2) % QI_LENGTH; - qi->free_cnt -= 2; - - spin_lock_irqsave(&iommu->register_lock, flags); - /* - * update the HW tail register indicating the presence of - * new descriptors. - */ - writel(qi->free_head << 4, iommu->reg + DMAR_IQT_REG); - spin_unlock_irqrestore(&iommu->register_lock, flags); - - while (qi->desc_status[wait_index] != QI_DONE) { - spin_unlock(&qi->q_lock); - cpu_relax(); - spin_lock(&qi->q_lock); - } - - qi->desc_status[index] = QI_DONE; - - reclaim_free_desc(qi); - spin_unlock(&qi->q_lock); -} - -/* - * Flush the global interrupt entry cache. - */ -void qi_global_iec(struct intel_iommu *iommu) -{ - struct qi_desc desc; - - desc.low = QI_IEC_TYPE; - desc.high = 0; - - qi_submit_sync(&desc, iommu); -} - -/* - * Enable Queued Invalidation interface. This is a must to support - * interrupt-remapping. Also used by DMA-remapping, which replaces - * register based IOTLB invalidation. - */ -int dmar_enable_qi(struct intel_iommu *iommu) -{ - u32 cmd, sts; - unsigned long flags; - struct q_inval *qi; - - if (!ecap_qis(iommu->ecap)) - return -ENOENT; - - /* - * queued invalidation is already setup and enabled. - */ - if (iommu->qi) - return 0; - - iommu->qi = kmalloc(sizeof(*qi), GFP_KERNEL); - if (!iommu->qi) - return -ENOMEM; - - qi = iommu->qi; - - qi->desc = (void *)(get_zeroed_page(GFP_KERNEL)); - if (!qi->desc) { - kfree(qi); - iommu->qi = 0; - return -ENOMEM; - } - - qi->desc_status = kmalloc(QI_LENGTH * sizeof(int), GFP_KERNEL); - if (!qi->desc_status) { - free_page((unsigned long) qi->desc); - kfree(qi); - iommu->qi = 0; - return -ENOMEM; - } - - qi->free_head = qi->free_tail = 0; - qi->free_cnt = QI_LENGTH; - - spin_lock_init(&qi->q_lock); - - spin_lock_irqsave(&iommu->register_lock, flags); - /* write zero to the tail reg */ - writel(0, iommu->reg + DMAR_IQT_REG); - - dmar_writeq(iommu->reg + DMAR_IQA_REG, virt_to_phys(qi->desc)); - - cmd = iommu->gcmd | DMA_GCMD_QIE; - iommu->gcmd |= DMA_GCMD_QIE; - writel(cmd, iommu->reg + DMAR_GCMD_REG); - - /* Make sure hardware complete it */ - IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, readl, (sts & DMA_GSTS_QIES), sts); - spin_unlock_irqrestore(&iommu->register_lock, flags); - - return 0; -} diff --git a/trunk/drivers/pci/intel-iommu.c b/trunk/drivers/pci/intel-iommu.c index 389fdd6f4a9f..8d0e60ac849c 100644 --- a/trunk/drivers/pci/intel-iommu.c +++ b/trunk/drivers/pci/intel-iommu.c @@ -49,6 +49,8 @@ #define DEFAULT_DOMAIN_ADDRESS_WIDTH 48 +#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */ + #define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1) @@ -56,6 +58,8 @@ static void flush_unmaps_timeout(unsigned long data); DEFINE_TIMER(unmap_timer, flush_unmaps_timeout, 0, 0); +static struct intel_iommu *g_iommus; + #define HIGH_WATER_MARK 250 struct deferred_flush_tables { int next; @@ -76,7 +80,7 @@ static long list_size; static void domain_remove_dev_info(struct dmar_domain *domain); -int dmar_disabled; +static int dmar_disabled; static int __initdata dmar_map_gfx = 1; static int dmar_forcedac; static int intel_iommu_strict; @@ -181,6 +185,13 @@ void free_iova_mem(struct iova *iova) kmem_cache_free(iommu_iova_cache, iova); } +static inline void __iommu_flush_cache( + struct intel_iommu *iommu, void *addr, int size) +{ + if (!ecap_coherent(iommu->ecap)) + clflush_cache_range(addr, size); +} + /* Gets context entry for a given bus and devfn */ static struct context_entry * device_to_context_entry(struct intel_iommu *iommu, u8 bus, u8 devfn) @@ -477,6 +488,19 @@ static int iommu_alloc_root_entry(struct intel_iommu *iommu) return 0; } +#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ +{\ + cycles_t start_time = get_cycles();\ + while (1) {\ + sts = op (iommu->reg + offset);\ + if (cond)\ + break;\ + if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\ + panic("DMAR hardware is malfunctioning\n");\ + cpu_relax();\ + }\ +} + static void iommu_set_root_entry(struct intel_iommu *iommu) { void *addr; @@ -966,8 +990,6 @@ static int iommu_init_domains(struct intel_iommu *iommu) return -ENOMEM; } - spin_lock_init(&iommu->lock); - /* * if Caching mode is set, then invalid translations are tagged * with domainid 0. Hence we need to pre-allocate it. @@ -976,15 +998,62 @@ static int iommu_init_domains(struct intel_iommu *iommu) set_bit(0, iommu->domain_ids); return 0; } +static struct intel_iommu *alloc_iommu(struct intel_iommu *iommu, + struct dmar_drhd_unit *drhd) +{ + int ret; + int map_size; + u32 ver; + iommu->reg = ioremap(drhd->reg_base_addr, PAGE_SIZE_4K); + if (!iommu->reg) { + printk(KERN_ERR "IOMMU: can't map the region\n"); + goto error; + } + iommu->cap = dmar_readq(iommu->reg + DMAR_CAP_REG); + iommu->ecap = dmar_readq(iommu->reg + DMAR_ECAP_REG); + + /* the registers might be more than one page */ + map_size = max_t(int, ecap_max_iotlb_offset(iommu->ecap), + cap_max_fault_reg_offset(iommu->cap)); + map_size = PAGE_ALIGN_4K(map_size); + if (map_size > PAGE_SIZE_4K) { + iounmap(iommu->reg); + iommu->reg = ioremap(drhd->reg_base_addr, map_size); + if (!iommu->reg) { + printk(KERN_ERR "IOMMU: can't map the region\n"); + goto error; + } + } -static void domain_exit(struct dmar_domain *domain); + ver = readl(iommu->reg + DMAR_VER_REG); + pr_debug("IOMMU %llx: ver %d:%d cap %llx ecap %llx\n", + drhd->reg_base_addr, DMAR_VER_MAJOR(ver), DMAR_VER_MINOR(ver), + iommu->cap, iommu->ecap); + ret = iommu_init_domains(iommu); + if (ret) + goto error_unmap; + spin_lock_init(&iommu->lock); + spin_lock_init(&iommu->register_lock); + + drhd->iommu = iommu; + return iommu; +error_unmap: + iounmap(iommu->reg); +error: + kfree(iommu); + return NULL; +} -void free_dmar_iommu(struct intel_iommu *iommu) +static void domain_exit(struct dmar_domain *domain); +static void free_iommu(struct intel_iommu *iommu) { struct dmar_domain *domain; int i; + if (!iommu) + return; + i = find_first_bit(iommu->domain_ids, cap_ndoms(iommu->cap)); for (; i < cap_ndoms(iommu->cap); ) { domain = iommu->domains[i]; @@ -1009,6 +1078,10 @@ void free_dmar_iommu(struct intel_iommu *iommu) /* free context mapping */ free_context_table(iommu); + + if (iommu->reg) + iounmap(iommu->reg); + kfree(iommu); } static struct dmar_domain * iommu_alloc_domain(struct intel_iommu *iommu) @@ -1353,6 +1426,37 @@ find_domain(struct pci_dev *pdev) return NULL; } +static int dmar_pci_device_match(struct pci_dev *devices[], int cnt, + struct pci_dev *dev) +{ + int index; + + while (dev) { + for (index = 0; index < cnt; index++) + if (dev == devices[index]) + return 1; + + /* Check our parent */ + dev = dev->bus->self; + } + + return 0; +} + +static struct dmar_drhd_unit * +dmar_find_matched_drhd_unit(struct pci_dev *dev) +{ + struct dmar_drhd_unit *drhd = NULL; + + list_for_each_entry(drhd, &dmar_drhd_units, list) { + if (drhd->include_all || dmar_pci_device_match(drhd->devices, + drhd->devices_cnt, dev)) + return drhd; + } + + return NULL; +} + /* domain is initialized */ static struct dmar_domain *get_domain_for_dev(struct pci_dev *pdev, int gaw) { @@ -1625,6 +1729,8 @@ int __init init_dmars(void) * endfor */ for_each_drhd_unit(drhd) { + if (drhd->ignored) + continue; g_num_of_iommus++; /* * lock not needed as this is only incremented in the single @@ -1633,6 +1739,12 @@ int __init init_dmars(void) */ } + g_iommus = kzalloc(g_num_of_iommus * sizeof(*iommu), GFP_KERNEL); + if (!g_iommus) { + ret = -ENOMEM; + goto error; + } + deferred_flush = kzalloc(g_num_of_iommus * sizeof(struct deferred_flush_tables), GFP_KERNEL); if (!deferred_flush) { @@ -1640,15 +1752,16 @@ int __init init_dmars(void) goto error; } + i = 0; for_each_drhd_unit(drhd) { if (drhd->ignored) continue; - - iommu = drhd->iommu; - - ret = iommu_init_domains(iommu); - if (ret) + iommu = alloc_iommu(&g_iommus[i], drhd); + i++; + if (!iommu) { + ret = -ENOMEM; goto error; + } /* * TBD: @@ -1732,6 +1845,7 @@ int __init init_dmars(void) iommu = drhd->iommu; free_iommu(iommu); } + kfree(g_iommus); return ret; } @@ -1888,10 +2002,7 @@ static void flush_unmaps(void) /* just flush them all */ for (i = 0; i < g_num_of_iommus; i++) { if (deferred_flush[i].next) { - struct intel_iommu *iommu = - deferred_flush[i].domain[0]->iommu; - - iommu_flush_iotlb_global(iommu, 0); + iommu_flush_iotlb_global(&g_iommus[i], 0); for (j = 0; j < deferred_flush[i].next; j++) { __free_iova(&deferred_flush[i].domain[j]->iovad, deferred_flush[i].iova[j]); @@ -1921,8 +2032,7 @@ static void add_unmap(struct dmar_domain *dom, struct iova *iova) if (list_size == HIGH_WATER_MARK) flush_unmaps(); - iommu_id = dom->iommu->seq_id; - + iommu_id = dom->iommu - g_iommus; next = deferred_flush[iommu_id].next; deferred_flush[iommu_id].domain[next] = dom; deferred_flush[iommu_id].iova[next] = iova; @@ -2238,6 +2348,15 @@ static void __init iommu_exit_mempool(void) } +void __init detect_intel_iommu(void) +{ + if (swiotlb || no_iommu || iommu_detected || dmar_disabled) + return; + if (early_dmar_detect()) { + iommu_detected = 1; + } +} + static void __init init_no_remapping_devices(void) { struct dmar_drhd_unit *drhd; @@ -2284,19 +2403,12 @@ int __init intel_iommu_init(void) { int ret = 0; - if (dmar_table_init()) - return -ENODEV; - - if (dmar_dev_scope_init()) - return -ENODEV; - - /* - * Check the need for DMA-remapping initialization now. - * Above initialization will also be used by Interrupt-remapping. - */ if (no_iommu || swiotlb || dmar_disabled) return -ENODEV; + if (dmar_table_init()) + return -ENODEV; + iommu_init_mempool(); dmar_init_reserved_ranges(); diff --git a/trunk/drivers/pci/intel-iommu.h b/trunk/drivers/pci/intel-iommu.h index 2142c01e0143..afc0ad96122e 100644 --- a/trunk/drivers/pci/intel-iommu.h +++ b/trunk/drivers/pci/intel-iommu.h @@ -27,8 +27,19 @@ #include #include "iova.h" #include -#include -#include "dma_remapping.h" + +/* + * We need a fixed PAGE_SIZE of 4K irrespective of + * arch PAGE_SIZE for IOMMU page tables. + */ +#define PAGE_SHIFT_4K (12) +#define PAGE_SIZE_4K (1UL << PAGE_SHIFT_4K) +#define PAGE_MASK_4K (((u64)-1) << PAGE_SHIFT_4K) +#define PAGE_ALIGN_4K(addr) (((addr) + PAGE_SIZE_4K - 1) & PAGE_MASK_4K) + +#define IOVA_PFN(addr) ((addr) >> PAGE_SHIFT_4K) +#define DMA_32BIT_PFN IOVA_PFN(DMA_32BIT_MASK) +#define DMA_64BIT_PFN IOVA_PFN(DMA_64BIT_MASK) /* * Intel IOMMU register specification per version 1.0 public spec. @@ -52,11 +63,6 @@ #define DMAR_PLMLIMIT_REG 0x6c /* PMRR low limit */ #define DMAR_PHMBASE_REG 0x70 /* pmrr high base addr */ #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ -#define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ -#define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ -#define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ -#define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ -#define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ #define OFFSET_STRIDE (9) /* @@ -120,10 +126,6 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) #define ecap_max_iotlb_offset(e) \ (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) #define ecap_coherent(e) ((e) & 0x1) -#define ecap_qis(e) ((e) & 0x2) -#define ecap_eim_support(e) ((e >> 4) & 0x1) -#define ecap_ir_support(e) ((e >> 3) & 0x1) -#define ecap_max_handle_mask(e) ((e >> 20) & 0xf) /* IOTLB_REG */ @@ -139,17 +141,6 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) #define DMA_TLB_IH_NONLEAF (((u64)1) << 6) #define DMA_TLB_MAX_SIZE (0x3f) -/* INVALID_DESC */ -#define DMA_ID_TLB_GLOBAL_FLUSH (((u64)1) << 3) -#define DMA_ID_TLB_DSI_FLUSH (((u64)2) << 3) -#define DMA_ID_TLB_PSI_FLUSH (((u64)3) << 3) -#define DMA_ID_TLB_READ_DRAIN (((u64)1) << 7) -#define DMA_ID_TLB_WRITE_DRAIN (((u64)1) << 6) -#define DMA_ID_TLB_DID(id) (((u64)((id & 0xffff) << 16))) -#define DMA_ID_TLB_IH_NONLEAF (((u64)1) << 6) -#define DMA_ID_TLB_ADDR(addr) (addr) -#define DMA_ID_TLB_ADDR_MASK(mask) (mask) - /* PMEN_REG */ #define DMA_PMEN_EPM (((u32)1)<<31) #define DMA_PMEN_PRS (((u32)1)<<0) @@ -160,9 +151,6 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) #define DMA_GCMD_SFL (((u32)1) << 29) #define DMA_GCMD_EAFL (((u32)1) << 28) #define DMA_GCMD_WBF (((u32)1) << 27) -#define DMA_GCMD_QIE (((u32)1) << 26) -#define DMA_GCMD_SIRTP (((u32)1) << 24) -#define DMA_GCMD_IRE (((u32) 1) << 25) /* GSTS_REG */ #define DMA_GSTS_TES (((u32)1) << 31) @@ -170,9 +158,6 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) #define DMA_GSTS_FLS (((u32)1) << 29) #define DMA_GSTS_AFLS (((u32)1) << 28) #define DMA_GSTS_WBFS (((u32)1) << 27) -#define DMA_GSTS_QIES (((u32)1) << 26) -#define DMA_GSTS_IRTPS (((u32)1) << 24) -#define DMA_GSTS_IRES (((u32)1) << 25) /* CCMD_REG */ #define DMA_CCMD_ICC (((u64)1) << 63) @@ -202,106 +187,158 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) #define dma_frcd_source_id(c) (c & 0xffff) #define dma_frcd_page_addr(d) (d & (((u64)-1) << 12)) /* low 64 bit */ -#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */ - -#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \ -{\ - cycles_t start_time = get_cycles();\ - while (1) {\ - sts = op (iommu->reg + offset);\ - if (cond)\ - break;\ - if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\ - panic("DMAR hardware is malfunctioning\n");\ - cpu_relax();\ - }\ +/* + * 0: Present + * 1-11: Reserved + * 12-63: Context Ptr (12 - (haw-1)) + * 64-127: Reserved + */ +struct root_entry { + u64 val; + u64 rsvd1; +}; +#define ROOT_ENTRY_NR (PAGE_SIZE_4K/sizeof(struct root_entry)) +static inline bool root_present(struct root_entry *root) +{ + return (root->val & 1); +} +static inline void set_root_present(struct root_entry *root) +{ + root->val |= 1; +} +static inline void set_root_value(struct root_entry *root, unsigned long value) +{ + root->val |= value & PAGE_MASK_4K; } -#define QI_LENGTH 256 /* queue length */ +struct context_entry; +static inline struct context_entry * +get_context_addr_from_root(struct root_entry *root) +{ + return (struct context_entry *) + (root_present(root)?phys_to_virt( + root->val & PAGE_MASK_4K): + NULL); +} + +/* + * low 64 bits: + * 0: present + * 1: fault processing disable + * 2-3: translation type + * 12-63: address space root + * high 64 bits: + * 0-2: address width + * 3-6: aval + * 8-23: domain id + */ +struct context_entry { + u64 lo; + u64 hi; +}; +#define context_present(c) ((c).lo & 1) +#define context_fault_disable(c) (((c).lo >> 1) & 1) +#define context_translation_type(c) (((c).lo >> 2) & 3) +#define context_address_root(c) ((c).lo & PAGE_MASK_4K) +#define context_address_width(c) ((c).hi & 7) +#define context_domain_id(c) (((c).hi >> 8) & ((1 << 16) - 1)) + +#define context_set_present(c) do {(c).lo |= 1;} while (0) +#define context_set_fault_enable(c) \ + do {(c).lo &= (((u64)-1) << 2) | 1;} while (0) +#define context_set_translation_type(c, val) \ + do { \ + (c).lo &= (((u64)-1) << 4) | 3; \ + (c).lo |= ((val) & 3) << 2; \ + } while (0) +#define CONTEXT_TT_MULTI_LEVEL 0 +#define context_set_address_root(c, val) \ + do {(c).lo |= (val) & PAGE_MASK_4K;} while (0) +#define context_set_address_width(c, val) do {(c).hi |= (val) & 7;} while (0) +#define context_set_domain_id(c, val) \ + do {(c).hi |= ((val) & ((1 << 16) - 1)) << 8;} while (0) +#define context_clear_entry(c) do {(c).lo = 0; (c).hi = 0;} while (0) -enum { - QI_FREE, - QI_IN_USE, - QI_DONE +/* + * 0: readable + * 1: writable + * 2-6: reserved + * 7: super page + * 8-11: available + * 12-63: Host physcial address + */ +struct dma_pte { + u64 val; }; +#define dma_clear_pte(p) do {(p).val = 0;} while (0) -#define QI_CC_TYPE 0x1 -#define QI_IOTLB_TYPE 0x2 -#define QI_DIOTLB_TYPE 0x3 -#define QI_IEC_TYPE 0x4 -#define QI_IWD_TYPE 0x5 +#define DMA_PTE_READ (1) +#define DMA_PTE_WRITE (2) -#define QI_IEC_SELECTIVE (((u64)1) << 4) -#define QI_IEC_IIDEX(idx) (((u64)(idx & 0xffff) << 32)) -#define QI_IEC_IM(m) (((u64)(m & 0x1f) << 27)) +#define dma_set_pte_readable(p) do {(p).val |= DMA_PTE_READ;} while (0) +#define dma_set_pte_writable(p) do {(p).val |= DMA_PTE_WRITE;} while (0) +#define dma_set_pte_prot(p, prot) \ + do {(p).val = ((p).val & ~3) | ((prot) & 3); } while (0) +#define dma_pte_addr(p) ((p).val & PAGE_MASK_4K) +#define dma_set_pte_addr(p, addr) do {\ + (p).val |= ((addr) & PAGE_MASK_4K); } while (0) +#define dma_pte_present(p) (((p).val & 3) != 0) -#define QI_IWD_STATUS_DATA(d) (((u64)d) << 32) -#define QI_IWD_STATUS_WRITE (((u64)1) << 5) +struct intel_iommu; -struct qi_desc { - u64 low, high; -}; +struct dmar_domain { + int id; /* domain id */ + struct intel_iommu *iommu; /* back pointer to owning iommu */ -struct q_inval { - spinlock_t q_lock; - struct qi_desc *desc; /* invalidation queue */ - int *desc_status; /* desc status */ - int free_head; /* first free entry */ - int free_tail; /* last free entry */ - int free_cnt; -}; + struct list_head devices; /* all devices' list */ + struct iova_domain iovad; /* iova's that belong to this domain */ -#ifdef CONFIG_INTR_REMAP -/* 1MB - maximum possible interrupt remapping table size */ -#define INTR_REMAP_PAGE_ORDER 8 -#define INTR_REMAP_TABLE_REG_SIZE 0xf + struct dma_pte *pgd; /* virtual address */ + spinlock_t mapping_lock; /* page table lock */ + int gaw; /* max guest address width */ -#define INTR_REMAP_TABLE_ENTRIES 65536 + /* adjusted guest address width, 0 is level 2 30-bit */ + int agaw; -struct ir_table { - struct irte *base; +#define DOMAIN_FLAG_MULTIPLE_DEVICES 1 + int flags; }; -#endif + +/* PCI domain-device relationship */ +struct device_domain_info { + struct list_head link; /* link to domain siblings */ + struct list_head global; /* link to global list */ + u8 bus; /* PCI bus numer */ + u8 devfn; /* PCI devfn number */ + struct pci_dev *dev; /* it's NULL for PCIE-to-PCI bridge */ + struct dmar_domain *domain; /* pointer to domain */ +}; + +extern int init_dmars(void); struct intel_iommu { void __iomem *reg; /* Pointer to hardware regs, virtual addr */ u64 cap; u64 ecap; - int seg; - u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ - spinlock_t register_lock; /* protect register handling */ - int seq_id; /* sequence id of the iommu */ - -#ifdef CONFIG_DMAR unsigned long *domain_ids; /* bitmap of domains */ struct dmar_domain **domains; /* ptr to domains */ + int seg; + u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ spinlock_t lock; /* protect context, domain ids */ + spinlock_t register_lock; /* protect register handling */ struct root_entry *root_entry; /* virtual address */ unsigned int irq; unsigned char name[7]; /* Device Name */ struct msi_msg saved_msg; struct sys_device sysdev; -#endif - struct q_inval *qi; /* Queued invalidation info */ -#ifdef CONFIG_INTR_REMAP - struct ir_table *ir_table; /* Interrupt remapping info */ -#endif }; -static inline void __iommu_flush_cache( - struct intel_iommu *iommu, void *addr, int size) +#ifndef CONFIG_DMAR_GFX_WA +static inline void iommu_prepare_gfx_mapping(void) { - if (!ecap_coherent(iommu->ecap)) - clflush_cache_range(addr, size); + return; } +#endif /* !CONFIG_DMAR_GFX_WA */ -extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); - -extern int alloc_iommu(struct dmar_drhd_unit *drhd); -extern void free_iommu(struct intel_iommu *iommu); -extern int dmar_enable_qi(struct intel_iommu *iommu); -extern void qi_global_iec(struct intel_iommu *iommu); - -extern void qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); #endif diff --git a/trunk/drivers/pci/intr_remapping.c b/trunk/drivers/pci/intr_remapping.c deleted file mode 100644 index bb642cc5e18c..000000000000 --- a/trunk/drivers/pci/intr_remapping.c +++ /dev/null @@ -1,471 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "intel-iommu.h" -#include "intr_remapping.h" - -static struct ioapic_scope ir_ioapic[MAX_IO_APICS]; -static int ir_ioapic_num; -int intr_remapping_enabled; - -static struct { - struct intel_iommu *iommu; - u16 irte_index; - u16 sub_handle; - u8 irte_mask; -} irq_2_iommu[NR_IRQS]; - -static DEFINE_SPINLOCK(irq_2_ir_lock); - -int irq_remapped(int irq) -{ - if (irq > NR_IRQS) - return 0; - - if (!irq_2_iommu[irq].iommu) - return 0; - - return 1; -} - -int get_irte(int irq, struct irte *entry) -{ - int index; - - if (!entry || irq > NR_IRQS) - return -1; - - spin_lock(&irq_2_ir_lock); - if (!irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - index = irq_2_iommu[irq].irte_index + irq_2_iommu[irq].sub_handle; - *entry = *(irq_2_iommu[irq].iommu->ir_table->base + index); - - spin_unlock(&irq_2_ir_lock); - return 0; -} - -int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) -{ - struct ir_table *table = iommu->ir_table; - u16 index, start_index; - unsigned int mask = 0; - int i; - - if (!count) - return -1; - - /* - * start the IRTE search from index 0. - */ - index = start_index = 0; - - if (count > 1) { - count = __roundup_pow_of_two(count); - mask = ilog2(count); - } - - if (mask > ecap_max_handle_mask(iommu->ecap)) { - printk(KERN_ERR - "Requested mask %x exceeds the max invalidation handle" - " mask value %Lx\n", mask, - ecap_max_handle_mask(iommu->ecap)); - return -1; - } - - spin_lock(&irq_2_ir_lock); - do { - for (i = index; i < index + count; i++) - if (table->base[i].present) - break; - /* empty index found */ - if (i == index + count) - break; - - index = (index + count) % INTR_REMAP_TABLE_ENTRIES; - - if (index == start_index) { - spin_unlock(&irq_2_ir_lock); - printk(KERN_ERR "can't allocate an IRTE\n"); - return -1; - } - } while (1); - - for (i = index; i < index + count; i++) - table->base[i].present = 1; - - irq_2_iommu[irq].iommu = iommu; - irq_2_iommu[irq].irte_index = index; - irq_2_iommu[irq].sub_handle = 0; - irq_2_iommu[irq].irte_mask = mask; - - spin_unlock(&irq_2_ir_lock); - - return index; -} - -static void qi_flush_iec(struct intel_iommu *iommu, int index, int mask) -{ - struct qi_desc desc; - - desc.low = QI_IEC_IIDEX(index) | QI_IEC_TYPE | QI_IEC_IM(mask) - | QI_IEC_SELECTIVE; - desc.high = 0; - - qi_submit_sync(&desc, iommu); -} - -int map_irq_to_irte_handle(int irq, u16 *sub_handle) -{ - int index; - - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - *sub_handle = irq_2_iommu[irq].sub_handle; - index = irq_2_iommu[irq].irte_index; - spin_unlock(&irq_2_ir_lock); - return index; -} - -int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, u16 subhandle) -{ - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - irq_2_iommu[irq].iommu = iommu; - irq_2_iommu[irq].irte_index = index; - irq_2_iommu[irq].sub_handle = subhandle; - irq_2_iommu[irq].irte_mask = 0; - - spin_unlock(&irq_2_ir_lock); - - return 0; -} - -int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index) -{ - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - irq_2_iommu[irq].iommu = NULL; - irq_2_iommu[irq].irte_index = 0; - irq_2_iommu[irq].sub_handle = 0; - irq_2_iommu[irq].irte_mask = 0; - - spin_unlock(&irq_2_ir_lock); - - return 0; -} - -int modify_irte(int irq, struct irte *irte_modified) -{ - int index; - struct irte *irte; - struct intel_iommu *iommu; - - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - iommu = irq_2_iommu[irq].iommu; - - index = irq_2_iommu[irq].irte_index + irq_2_iommu[irq].sub_handle; - irte = &iommu->ir_table->base[index]; - - set_64bit((unsigned long *)irte, irte_modified->low | (1 << 1)); - __iommu_flush_cache(iommu, irte, sizeof(*irte)); - - qi_flush_iec(iommu, index, 0); - - spin_unlock(&irq_2_ir_lock); - return 0; -} - -int flush_irte(int irq) -{ - int index; - struct intel_iommu *iommu; - - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - iommu = irq_2_iommu[irq].iommu; - - index = irq_2_iommu[irq].irte_index + irq_2_iommu[irq].sub_handle; - - qi_flush_iec(iommu, index, irq_2_iommu[irq].irte_mask); - spin_unlock(&irq_2_ir_lock); - - return 0; -} - -struct intel_iommu *map_ioapic_to_ir(int apic) -{ - int i; - - for (i = 0; i < MAX_IO_APICS; i++) - if (ir_ioapic[i].id == apic) - return ir_ioapic[i].iommu; - return NULL; -} - -struct intel_iommu *map_dev_to_ir(struct pci_dev *dev) -{ - struct dmar_drhd_unit *drhd; - - drhd = dmar_find_matched_drhd_unit(dev); - if (!drhd) - return NULL; - - return drhd->iommu; -} - -int free_irte(int irq) -{ - int index, i; - struct irte *irte; - struct intel_iommu *iommu; - - spin_lock(&irq_2_ir_lock); - if (irq >= NR_IRQS || !irq_2_iommu[irq].iommu) { - spin_unlock(&irq_2_ir_lock); - return -1; - } - - iommu = irq_2_iommu[irq].iommu; - - index = irq_2_iommu[irq].irte_index + irq_2_iommu[irq].sub_handle; - irte = &iommu->ir_table->base[index]; - - if (!irq_2_iommu[irq].sub_handle) { - for (i = 0; i < (1 << irq_2_iommu[irq].irte_mask); i++) - set_64bit((unsigned long *)irte, 0); - qi_flush_iec(iommu, index, irq_2_iommu[irq].irte_mask); - } - - irq_2_iommu[irq].iommu = NULL; - irq_2_iommu[irq].irte_index = 0; - irq_2_iommu[irq].sub_handle = 0; - irq_2_iommu[irq].irte_mask = 0; - - spin_unlock(&irq_2_ir_lock); - - return 0; -} - -static void iommu_set_intr_remapping(struct intel_iommu *iommu, int mode) -{ - u64 addr; - u32 cmd, sts; - unsigned long flags; - - addr = virt_to_phys((void *)iommu->ir_table->base); - - spin_lock_irqsave(&iommu->register_lock, flags); - - dmar_writeq(iommu->reg + DMAR_IRTA_REG, - (addr) | IR_X2APIC_MODE(mode) | INTR_REMAP_TABLE_REG_SIZE); - - /* Set interrupt-remapping table pointer */ - cmd = iommu->gcmd | DMA_GCMD_SIRTP; - writel(cmd, iommu->reg + DMAR_GCMD_REG); - - IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, - readl, (sts & DMA_GSTS_IRTPS), sts); - spin_unlock_irqrestore(&iommu->register_lock, flags); - - /* - * global invalidation of interrupt entry cache before enabling - * interrupt-remapping. - */ - qi_global_iec(iommu); - - spin_lock_irqsave(&iommu->register_lock, flags); - - /* Enable interrupt-remapping */ - cmd = iommu->gcmd | DMA_GCMD_IRE; - iommu->gcmd |= DMA_GCMD_IRE; - writel(cmd, iommu->reg + DMAR_GCMD_REG); - - IOMMU_WAIT_OP(iommu, DMAR_GSTS_REG, - readl, (sts & DMA_GSTS_IRES), sts); - - spin_unlock_irqrestore(&iommu->register_lock, flags); -} - - -static int setup_intr_remapping(struct intel_iommu *iommu, int mode) -{ - struct ir_table *ir_table; - struct page *pages; - - ir_table = iommu->ir_table = kzalloc(sizeof(struct ir_table), - GFP_KERNEL); - - if (!iommu->ir_table) - return -ENOMEM; - - pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, INTR_REMAP_PAGE_ORDER); - - if (!pages) { - printk(KERN_ERR "failed to allocate pages of order %d\n", - INTR_REMAP_PAGE_ORDER); - kfree(iommu->ir_table); - return -ENOMEM; - } - - ir_table->base = page_address(pages); - - iommu_set_intr_remapping(iommu, mode); - return 0; -} - -int __init enable_intr_remapping(int eim) -{ - struct dmar_drhd_unit *drhd; - int setup = 0; - - /* - * check for the Interrupt-remapping support - */ - for_each_drhd_unit(drhd) { - struct intel_iommu *iommu = drhd->iommu; - - if (!ecap_ir_support(iommu->ecap)) - continue; - - if (eim && !ecap_eim_support(iommu->ecap)) { - printk(KERN_INFO "DRHD %Lx: EIM not supported by DRHD, " - " ecap %Lx\n", drhd->reg_base_addr, iommu->ecap); - return -1; - } - } - - /* - * Enable queued invalidation for all the DRHD's. - */ - for_each_drhd_unit(drhd) { - int ret; - struct intel_iommu *iommu = drhd->iommu; - ret = dmar_enable_qi(iommu); - - if (ret) { - printk(KERN_ERR "DRHD %Lx: failed to enable queued, " - " invalidation, ecap %Lx, ret %d\n", - drhd->reg_base_addr, iommu->ecap, ret); - return -1; - } - } - - /* - * Setup Interrupt-remapping for all the DRHD's now. - */ - for_each_drhd_unit(drhd) { - struct intel_iommu *iommu = drhd->iommu; - - if (!ecap_ir_support(iommu->ecap)) - continue; - - if (setup_intr_remapping(iommu, eim)) - goto error; - - setup = 1; - } - - if (!setup) - goto error; - - intr_remapping_enabled = 1; - - return 0; - -error: - /* - * handle error condition gracefully here! - */ - return -1; -} - -static int ir_parse_ioapic_scope(struct acpi_dmar_header *header, - struct intel_iommu *iommu) -{ - struct acpi_dmar_hardware_unit *drhd; - struct acpi_dmar_device_scope *scope; - void *start, *end; - - drhd = (struct acpi_dmar_hardware_unit *)header; - - start = (void *)(drhd + 1); - end = ((void *)drhd) + header->length; - - while (start < end) { - scope = start; - if (scope->entry_type == ACPI_DMAR_SCOPE_TYPE_IOAPIC) { - if (ir_ioapic_num == MAX_IO_APICS) { - printk(KERN_WARNING "Exceeded Max IO APICS\n"); - return -1; - } - - printk(KERN_INFO "IOAPIC id %d under DRHD base" - " 0x%Lx\n", scope->enumeration_id, - drhd->address); - - ir_ioapic[ir_ioapic_num].iommu = iommu; - ir_ioapic[ir_ioapic_num].id = scope->enumeration_id; - ir_ioapic_num++; - } - start += scope->length; - } - - return 0; -} - -/* - * Finds the assocaition between IOAPIC's and its Interrupt-remapping - * hardware unit. - */ -int __init parse_ioapics_under_ir(void) -{ - struct dmar_drhd_unit *drhd; - int ir_supported = 0; - - for_each_drhd_unit(drhd) { - struct intel_iommu *iommu = drhd->iommu; - - if (ecap_ir_support(iommu->ecap)) { - if (ir_parse_ioapic_scope(drhd->hdr, iommu)) - return -1; - - ir_supported = 1; - } - } - - if (ir_supported && ir_ioapic_num != nr_ioapics) { - printk(KERN_WARNING - "Not all IO-APIC's listed under remapping hardware\n"); - return -1; - } - - return ir_supported; -} diff --git a/trunk/drivers/pci/intr_remapping.h b/trunk/drivers/pci/intr_remapping.h deleted file mode 100644 index 05f2635bbe4e..000000000000 --- a/trunk/drivers/pci/intr_remapping.h +++ /dev/null @@ -1,8 +0,0 @@ -#include "intel-iommu.h" - -struct ioapic_scope { - struct intel_iommu *iommu; - unsigned int id; -}; - -#define IR_X2APIC_MODE(mode) (mode ? (1 << 11) : 0) diff --git a/trunk/include/asm-x86/a.out-core.h b/trunk/include/asm-x86/a.out-core.h index f5705761a37b..714207a1c387 100644 --- a/trunk/include/asm-x86/a.out-core.h +++ b/trunk/include/asm-x86/a.out-core.h @@ -9,8 +9,8 @@ * 2 of the Licence, or (at your option) any later version. */ -#ifndef ASM_X86__A_OUT_CORE_H -#define ASM_X86__A_OUT_CORE_H +#ifndef _ASM_A_OUT_CORE_H +#define _ASM_A_OUT_CORE_H #ifdef __KERNEL__ #ifdef CONFIG_X86_32 @@ -70,4 +70,4 @@ static inline void aout_dump_thread(struct pt_regs *regs, struct user *dump) #endif /* CONFIG_X86_32 */ #endif /* __KERNEL__ */ -#endif /* ASM_X86__A_OUT_CORE_H */ +#endif /* _ASM_A_OUT_CORE_H */ diff --git a/trunk/include/asm-x86/a.out.h b/trunk/include/asm-x86/a.out.h index 0948748bc69c..4684f97a5bbd 100644 --- a/trunk/include/asm-x86/a.out.h +++ b/trunk/include/asm-x86/a.out.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__A_OUT_H -#define ASM_X86__A_OUT_H +#ifndef _ASM_X86_A_OUT_H +#define _ASM_X86_A_OUT_H struct exec { @@ -17,4 +17,4 @@ struct exec #define N_DRSIZE(a) ((a).a_drsize) #define N_SYMSIZE(a) ((a).a_syms) -#endif /* ASM_X86__A_OUT_H */ +#endif /* _ASM_X86_A_OUT_H */ diff --git a/trunk/include/asm-x86/acpi.h b/trunk/include/asm-x86/acpi.h index bd76299586b3..635d764dc13e 100644 --- a/trunk/include/asm-x86/acpi.h +++ b/trunk/include/asm-x86/acpi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ACPI_H -#define ASM_X86__ACPI_H +#ifndef _ASM_X86_ACPI_H +#define _ASM_X86_ACPI_H /* * Copyright (C) 2001 Paul Diefenbaugh @@ -173,4 +173,4 @@ static inline void acpi_fake_nodes(const struct bootnode *fake_nodes, #define acpi_unlazy_tlb(x) leave_mm(x) -#endif /* ASM_X86__ACPI_H */ +#endif /*__X86_ASM_ACPI_H*/ diff --git a/trunk/include/asm-x86/agp.h b/trunk/include/asm-x86/agp.h index 3617fd4fcdf9..e4004a9f6a9a 100644 --- a/trunk/include/asm-x86/agp.h +++ b/trunk/include/asm-x86/agp.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__AGP_H -#define ASM_X86__AGP_H +#ifndef _ASM_X86_AGP_H +#define _ASM_X86_AGP_H #include #include @@ -32,4 +32,4 @@ #define free_gatt_pages(table, order) \ free_pages((unsigned long)(table), (order)) -#endif /* ASM_X86__AGP_H */ +#endif diff --git a/trunk/include/asm-x86/alternative.h b/trunk/include/asm-x86/alternative.h index 22d3c9862bf3..f6aa18eadf71 100644 --- a/trunk/include/asm-x86/alternative.h +++ b/trunk/include/asm-x86/alternative.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ALTERNATIVE_H -#define ASM_X86__ALTERNATIVE_H +#ifndef _ASM_X86_ALTERNATIVE_H +#define _ASM_X86_ALTERNATIVE_H #include #include @@ -180,4 +180,4 @@ extern void add_nops(void *insns, unsigned int len); extern void *text_poke(void *addr, const void *opcode, size_t len); extern void *text_poke_early(void *addr, const void *opcode, size_t len); -#endif /* ASM_X86__ALTERNATIVE_H */ +#endif /* _ASM_X86_ALTERNATIVE_H */ diff --git a/trunk/include/asm-x86/amd_iommu.h b/trunk/include/asm-x86/amd_iommu.h index 783f43e58052..30a12049353b 100644 --- a/trunk/include/asm-x86/amd_iommu.h +++ b/trunk/include/asm-x86/amd_iommu.h @@ -17,8 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef ASM_X86__AMD_IOMMU_H -#define ASM_X86__AMD_IOMMU_H +#ifndef _ASM_X86_AMD_IOMMU_H +#define _ASM_X86_AMD_IOMMU_H #ifdef CONFIG_AMD_IOMMU extern int amd_iommu_init(void); @@ -29,4 +29,4 @@ static inline int amd_iommu_init(void) { return -ENODEV; } static inline void amd_iommu_detect(void) { } #endif -#endif /* ASM_X86__AMD_IOMMU_H */ +#endif diff --git a/trunk/include/asm-x86/amd_iommu_types.h b/trunk/include/asm-x86/amd_iommu_types.h index 1ffa4e53c989..dcc812067394 100644 --- a/trunk/include/asm-x86/amd_iommu_types.h +++ b/trunk/include/asm-x86/amd_iommu_types.h @@ -17,8 +17,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef ASM_X86__AMD_IOMMU_TYPES_H -#define ASM_X86__AMD_IOMMU_TYPES_H +#ifndef __AMD_IOMMU_TYPES_H__ +#define __AMD_IOMMU_TYPES_H__ #include #include @@ -341,4 +341,4 @@ static inline u16 calc_devid(u8 bus, u8 devfn) return (((u16)bus) << 8) | devfn; } -#endif /* ASM_X86__AMD_IOMMU_TYPES_H */ +#endif diff --git a/trunk/include/asm-x86/apic.h b/trunk/include/asm-x86/apic.h index 1311c82b165b..133c998161ca 100644 --- a/trunk/include/asm-x86/apic.h +++ b/trunk/include/asm-x86/apic.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__APIC_H -#define ASM_X86__APIC_H +#ifndef _ASM_X86_APIC_H +#define _ASM_X86_APIC_H #include #include @@ -9,8 +9,6 @@ #include #include #include -#include -#include #define ARCH_APICTIMER_STOPS_ON_C3 1 @@ -49,18 +47,15 @@ extern int disable_apic; #ifdef CONFIG_PARAVIRT #include #else +#define apic_write native_apic_write +#define apic_read native_apic_read #define setup_boot_clock setup_boot_APIC_clock #define setup_secondary_clock setup_secondary_APIC_clock #endif extern int is_vsmp_box(void); -extern void xapic_wait_icr_idle(void); -extern u32 safe_xapic_wait_icr_idle(void); -extern u64 xapic_icr_read(void); -extern void xapic_icr_write(u32, u32); -extern int setup_profiling_timer(unsigned int); -static inline void native_apic_mem_write(u32 reg, u32 v) +static inline void native_apic_write(unsigned long reg, u32 v) { volatile u32 *addr = (volatile u32 *)(APIC_BASE + reg); @@ -69,68 +64,15 @@ static inline void native_apic_mem_write(u32 reg, u32 v) ASM_OUTPUT2("0" (v), "m" (*addr))); } -static inline u32 native_apic_mem_read(u32 reg) +static inline u32 native_apic_read(unsigned long reg) { return *((volatile u32 *)(APIC_BASE + reg)); } -static inline void native_apic_msr_write(u32 reg, u32 v) -{ - if (reg == APIC_DFR || reg == APIC_ID || reg == APIC_LDR || - reg == APIC_LVR) - return; - - wrmsr(APIC_BASE_MSR + (reg >> 4), v, 0); -} - -static inline u32 native_apic_msr_read(u32 reg) -{ - u32 low, high; - - if (reg == APIC_DFR) - return -1; - - rdmsr(APIC_BASE_MSR + (reg >> 4), low, high); - return low; -} - -#ifndef CONFIG_X86_32 -extern int x2apic, x2apic_preenabled; -extern void check_x2apic(void); -extern void enable_x2apic(void); -extern void enable_IR_x2apic(void); -extern void x2apic_icr_write(u32 low, u32 id); -#endif - -struct apic_ops { - u32 (*read)(u32 reg); - void (*write)(u32 reg, u32 v); - u64 (*icr_read)(void); - void (*icr_write)(u32 low, u32 high); - void (*wait_icr_idle)(void); - u32 (*safe_wait_icr_idle)(void); -}; - -extern struct apic_ops *apic_ops; - -#define apic_read (apic_ops->read) -#define apic_write (apic_ops->write) -#define apic_icr_read (apic_ops->icr_read) -#define apic_icr_write (apic_ops->icr_write) -#define apic_wait_icr_idle (apic_ops->wait_icr_idle) -#define safe_apic_wait_icr_idle (apic_ops->safe_wait_icr_idle) - +extern void apic_wait_icr_idle(void); +extern u32 safe_apic_wait_icr_idle(void); extern int get_physical_broadcast(void); -#ifdef CONFIG_X86_64 -static inline void ack_x2APIC_irq(void) -{ - /* Docs say use 0 for future compatibility */ - native_apic_msr_write(APIC_EOI, 0); -} -#endif - - static inline void ack_APIC_irq(void) { /* @@ -186,4 +128,4 @@ static inline void init_apic_mappings(void) { } #endif /* !CONFIG_X86_LOCAL_APIC */ -#endif /* ASM_X86__APIC_H */ +#endif /* __ASM_APIC_H */ diff --git a/trunk/include/asm-x86/apicdef.h b/trunk/include/asm-x86/apicdef.h index b922c85ac91d..6b9008c78731 100644 --- a/trunk/include/asm-x86/apicdef.h +++ b/trunk/include/asm-x86/apicdef.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__APICDEF_H -#define ASM_X86__APICDEF_H +#ifndef _ASM_X86_APICDEF_H +#define _ASM_X86_APICDEF_H /* * Constants for various Intel APICs. (local APIC, IOAPIC, etc.) @@ -105,7 +105,6 @@ #define APIC_TMICT 0x380 #define APIC_TMCCT 0x390 #define APIC_TDCR 0x3E0 -#define APIC_SELF_IPI 0x3F0 #define APIC_TDR_DIV_TMBASE (1 << 2) #define APIC_TDR_DIV_1 0xB #define APIC_TDR_DIV_2 0x0 @@ -129,8 +128,6 @@ #define APIC_EILVT3 0x530 #define APIC_BASE (fix_to_virt(FIX_APIC_BASE)) -#define APIC_BASE_MSR 0x800 -#define X2APIC_ENABLE (1UL << 10) #ifdef CONFIG_X86_32 # define MAX_IO_APICS 64 @@ -414,4 +411,4 @@ struct local_apic { #else #define BAD_APICID 0xFFFFu #endif -#endif /* ASM_X86__APICDEF_H */ +#endif diff --git a/trunk/include/asm-x86/arch_hooks.h b/trunk/include/asm-x86/arch_hooks.h index de4596b24c23..8411750ceb63 100644 --- a/trunk/include/asm-x86/arch_hooks.h +++ b/trunk/include/asm-x86/arch_hooks.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ARCH_HOOKS_H -#define ASM_X86__ARCH_HOOKS_H +#ifndef _ASM_ARCH_HOOKS_H +#define _ASM_ARCH_HOOKS_H #include @@ -12,6 +12,8 @@ /* these aren't arch hooks, they are generic routines * that can be used by the hooks */ extern void init_ISA_irqs(void); +extern void apic_intr_init(void); +extern void smp_intr_init(void); extern irqreturn_t timer_interrupt(int irq, void *dev_id); /* these are the defined hooks */ @@ -23,4 +25,4 @@ extern void pre_time_init_hook(void); extern void time_init_hook(void); extern void mca_nmi_hook(void); -#endif /* ASM_X86__ARCH_HOOKS_H */ +#endif diff --git a/trunk/include/asm-x86/asm.h b/trunk/include/asm-x86/asm.h index 2439ae49e8ac..97220321f39d 100644 --- a/trunk/include/asm-x86/asm.h +++ b/trunk/include/asm-x86/asm.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ASM_H -#define ASM_X86__ASM_H +#ifndef _ASM_X86_ASM_H +#define _ASM_X86_ASM_H #ifdef __ASSEMBLY__ # define __ASM_FORM(x) x @@ -39,4 +39,4 @@ _ASM_PTR #from "," #to "\n" \ " .previous\n" -#endif /* ASM_X86__ASM_H */ +#endif /* _ASM_X86_ASM_H */ diff --git a/trunk/include/asm-x86/atomic_32.h b/trunk/include/asm-x86/atomic_32.h index 14d3f0beb889..21a4825148c0 100644 --- a/trunk/include/asm-x86/atomic_32.h +++ b/trunk/include/asm-x86/atomic_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ATOMIC_32_H -#define ASM_X86__ATOMIC_32_H +#ifndef __ARCH_I386_ATOMIC__ +#define __ARCH_I386_ATOMIC__ #include #include @@ -256,4 +256,4 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u) #define smp_mb__after_atomic_inc() barrier() #include -#endif /* ASM_X86__ATOMIC_32_H */ +#endif diff --git a/trunk/include/asm-x86/atomic_64.h b/trunk/include/asm-x86/atomic_64.h index 2cb218c4a356..91c7d03e65bc 100644 --- a/trunk/include/asm-x86/atomic_64.h +++ b/trunk/include/asm-x86/atomic_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ATOMIC_64_H -#define ASM_X86__ATOMIC_64_H +#ifndef __ARCH_X86_64_ATOMIC__ +#define __ARCH_X86_64_ATOMIC__ #include #include @@ -470,4 +470,4 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2) #define smp_mb__after_atomic_inc() barrier() #include -#endif /* ASM_X86__ATOMIC_64_H */ +#endif diff --git a/trunk/include/asm-x86/auxvec.h b/trunk/include/asm-x86/auxvec.h index 12c7cac74202..87f5e6d5a020 100644 --- a/trunk/include/asm-x86/auxvec.h +++ b/trunk/include/asm-x86/auxvec.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__AUXVEC_H -#define ASM_X86__AUXVEC_H +#ifndef _ASM_X86_AUXVEC_H +#define _ASM_X86_AUXVEC_H /* * Architecture-neutral AT_ values in 0-17, leave some room * for more of them, start the x86-specific ones at 32. @@ -9,4 +9,4 @@ #endif #define AT_SYSINFO_EHDR 33 -#endif /* ASM_X86__AUXVEC_H */ +#endif diff --git a/trunk/include/asm-x86/bios_ebda.h b/trunk/include/asm-x86/bios_ebda.h index ec42ed874591..0033e50c13b2 100644 --- a/trunk/include/asm-x86/bios_ebda.h +++ b/trunk/include/asm-x86/bios_ebda.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BIOS_EBDA_H -#define ASM_X86__BIOS_EBDA_H +#ifndef _MACH_BIOS_EBDA_H +#define _MACH_BIOS_EBDA_H #include @@ -16,4 +16,4 @@ static inline unsigned int get_bios_ebda(void) void reserve_ebda_region(void); -#endif /* ASM_X86__BIOS_EBDA_H */ +#endif /* _MACH_BIOS_EBDA_H */ diff --git a/trunk/include/asm-x86/bitops.h b/trunk/include/asm-x86/bitops.h index 61989b93b475..cfb2b64f76e7 100644 --- a/trunk/include/asm-x86/bitops.h +++ b/trunk/include/asm-x86/bitops.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BITOPS_H -#define ASM_X86__BITOPS_H +#ifndef _ASM_X86_BITOPS_H +#define _ASM_X86_BITOPS_H /* * Copyright 1992, Linus Torvalds. @@ -458,4 +458,4 @@ static inline void set_bit_string(unsigned long *bitmap, #include #endif /* __KERNEL__ */ -#endif /* ASM_X86__BITOPS_H */ +#endif /* _ASM_X86_BITOPS_H */ diff --git a/trunk/include/asm-x86/boot.h b/trunk/include/asm-x86/boot.h index 825de5dc867c..2faed7ecb092 100644 --- a/trunk/include/asm-x86/boot.h +++ b/trunk/include/asm-x86/boot.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BOOT_H -#define ASM_X86__BOOT_H +#ifndef _ASM_BOOT_H +#define _ASM_BOOT_H /* Don't touch these, unless you really know what you're doing. */ #define DEF_INITSEG 0x9000 @@ -25,4 +25,4 @@ #define BOOT_STACK_SIZE 0x1000 #endif -#endif /* ASM_X86__BOOT_H */ +#endif /* _ASM_BOOT_H */ diff --git a/trunk/include/asm-x86/bootparam.h b/trunk/include/asm-x86/bootparam.h index ccf027e2d97d..ae22bdf0ab14 100644 --- a/trunk/include/asm-x86/bootparam.h +++ b/trunk/include/asm-x86/bootparam.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BOOTPARAM_H -#define ASM_X86__BOOTPARAM_H +#ifndef _ASM_BOOTPARAM_H +#define _ASM_BOOTPARAM_H #include #include @@ -108,4 +108,4 @@ struct boot_params { __u8 _pad9[276]; /* 0xeec */ } __attribute__((packed)); -#endif /* ASM_X86__BOOTPARAM_H */ +#endif /* _ASM_BOOTPARAM_H */ diff --git a/trunk/include/asm-x86/bug.h b/trunk/include/asm-x86/bug.h index 91ad43a54c47..b69aa64b82a4 100644 --- a/trunk/include/asm-x86/bug.h +++ b/trunk/include/asm-x86/bug.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BUG_H -#define ASM_X86__BUG_H +#ifndef _ASM_X86_BUG_H +#define _ASM_X86_BUG_H #ifdef CONFIG_BUG #define HAVE_ARCH_BUG @@ -36,4 +36,4 @@ do { \ #endif /* !CONFIG_BUG */ #include -#endif /* ASM_X86__BUG_H */ +#endif diff --git a/trunk/include/asm-x86/bugs.h b/trunk/include/asm-x86/bugs.h index ae514c76a96f..021cbdd5f258 100644 --- a/trunk/include/asm-x86/bugs.h +++ b/trunk/include/asm-x86/bugs.h @@ -1,12 +1,7 @@ -#ifndef ASM_X86__BUGS_H -#define ASM_X86__BUGS_H +#ifndef _ASM_X86_BUGS_H +#define _ASM_X86_BUGS_H extern void check_bugs(void); - -#ifdef CONFIG_CPU_SUP_INTEL_32 int ppro_with_ram_bug(void); -#else -static inline int ppro_with_ram_bug(void) { return 0; } -#endif -#endif /* ASM_X86__BUGS_H */ +#endif /* _ASM_X86_BUGS_H */ diff --git a/trunk/include/asm-x86/byteorder.h b/trunk/include/asm-x86/byteorder.h index 722f27d68105..e02ae2d89acf 100644 --- a/trunk/include/asm-x86/byteorder.h +++ b/trunk/include/asm-x86/byteorder.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__BYTEORDER_H -#define ASM_X86__BYTEORDER_H +#ifndef _ASM_X86_BYTEORDER_H +#define _ASM_X86_BYTEORDER_H #include #include @@ -78,4 +78,4 @@ static inline __attribute_const__ __u32 ___arch__swab32(__u32 x) #include -#endif /* ASM_X86__BYTEORDER_H */ +#endif /* _ASM_X86_BYTEORDER_H */ diff --git a/trunk/include/asm-x86/cache.h b/trunk/include/asm-x86/cache.h index ea3f1cc06a97..1e0bac86f38f 100644 --- a/trunk/include/asm-x86/cache.h +++ b/trunk/include/asm-x86/cache.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CACHE_H -#define ASM_X86__CACHE_H +#ifndef _ARCH_X86_CACHE_H +#define _ARCH_X86_CACHE_H /* L1 cache line size */ #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT) @@ -17,4 +17,4 @@ #endif #endif -#endif /* ASM_X86__CACHE_H */ +#endif diff --git a/trunk/include/asm-x86/cacheflush.h b/trunk/include/asm-x86/cacheflush.h index 59859cb28a36..f4c0ab50d2c2 100644 --- a/trunk/include/asm-x86/cacheflush.h +++ b/trunk/include/asm-x86/cacheflush.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CACHEFLUSH_H -#define ASM_X86__CACHEFLUSH_H +#ifndef _ASM_X86_CACHEFLUSH_H +#define _ASM_X86_CACHEFLUSH_H /* Keep includes the same across arches. */ #include @@ -112,4 +112,4 @@ static inline int rodata_test(void) } #endif -#endif /* ASM_X86__CACHEFLUSH_H */ +#endif diff --git a/trunk/include/asm-x86/calgary.h b/trunk/include/asm-x86/calgary.h index 933fd272f826..67f60406e2d8 100644 --- a/trunk/include/asm-x86/calgary.h +++ b/trunk/include/asm-x86/calgary.h @@ -21,8 +21,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef ASM_X86__CALGARY_H -#define ASM_X86__CALGARY_H +#ifndef _ASM_X86_64_CALGARY_H +#define _ASM_X86_64_CALGARY_H #include #include @@ -69,4 +69,4 @@ static inline int calgary_iommu_init(void) { return 1; } static inline void detect_calgary(void) { return; } #endif -#endif /* ASM_X86__CALGARY_H */ +#endif /* _ASM_X86_64_CALGARY_H */ diff --git a/trunk/include/asm-x86/checksum_32.h b/trunk/include/asm-x86/checksum_32.h index d041e8cda227..52bbb0d8c4c1 100644 --- a/trunk/include/asm-x86/checksum_32.h +++ b/trunk/include/asm-x86/checksum_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CHECKSUM_32_H -#define ASM_X86__CHECKSUM_32_H +#ifndef _I386_CHECKSUM_H +#define _I386_CHECKSUM_H #include @@ -186,4 +186,4 @@ static inline __wsum csum_and_copy_to_user(const void *src, return (__force __wsum)-1; /* invalid checksum */ } -#endif /* ASM_X86__CHECKSUM_32_H */ +#endif diff --git a/trunk/include/asm-x86/checksum_64.h b/trunk/include/asm-x86/checksum_64.h index 110f403beb89..8bd861cc5267 100644 --- a/trunk/include/asm-x86/checksum_64.h +++ b/trunk/include/asm-x86/checksum_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CHECKSUM_64_H -#define ASM_X86__CHECKSUM_64_H +#ifndef _X86_64_CHECKSUM_H +#define _X86_64_CHECKSUM_H /* * Checksums for x86-64 @@ -188,4 +188,4 @@ static inline unsigned add32_with_carry(unsigned a, unsigned b) return a; } -#endif /* ASM_X86__CHECKSUM_64_H */ +#endif diff --git a/trunk/include/asm-x86/cmpxchg_32.h b/trunk/include/asm-x86/cmpxchg_32.h index 0622e45cdf7c..bf5a69d1329e 100644 --- a/trunk/include/asm-x86/cmpxchg_32.h +++ b/trunk/include/asm-x86/cmpxchg_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CMPXCHG_32_H -#define ASM_X86__CMPXCHG_32_H +#ifndef __ASM_CMPXCHG_H +#define __ASM_CMPXCHG_H #include /* for LOCK_PREFIX */ @@ -341,4 +341,4 @@ extern unsigned long long cmpxchg_486_u64(volatile void *, u64, u64); #endif -#endif /* ASM_X86__CMPXCHG_32_H */ +#endif diff --git a/trunk/include/asm-x86/cmpxchg_64.h b/trunk/include/asm-x86/cmpxchg_64.h index 63c1a5e61b99..17463ccf8166 100644 --- a/trunk/include/asm-x86/cmpxchg_64.h +++ b/trunk/include/asm-x86/cmpxchg_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CMPXCHG_64_H -#define ASM_X86__CMPXCHG_64_H +#ifndef __ASM_CMPXCHG_H +#define __ASM_CMPXCHG_H #include /* Provides LOCK_PREFIX */ @@ -182,4 +182,4 @@ static inline unsigned long __cmpxchg_local(volatile void *ptr, cmpxchg_local((ptr), (o), (n)); \ }) -#endif /* ASM_X86__CMPXCHG_64_H */ +#endif diff --git a/trunk/include/asm-x86/compat.h b/trunk/include/asm-x86/compat.h index 6732b150949e..1793ac317a30 100644 --- a/trunk/include/asm-x86/compat.h +++ b/trunk/include/asm-x86/compat.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__COMPAT_H -#define ASM_X86__COMPAT_H +#ifndef _ASM_X86_64_COMPAT_H +#define _ASM_X86_64_COMPAT_H /* * Architecture specific compatibility types @@ -215,4 +215,4 @@ static inline int is_compat_task(void) return current_thread_info()->status & TS_COMPAT; } -#endif /* ASM_X86__COMPAT_H */ +#endif /* _ASM_X86_64_COMPAT_H */ diff --git a/trunk/include/asm-x86/cpu.h b/trunk/include/asm-x86/cpu.h index 83a115083f0d..73f2ea84fd74 100644 --- a/trunk/include/asm-x86/cpu.h +++ b/trunk/include/asm-x86/cpu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CPU_H -#define ASM_X86__CPU_H +#ifndef _ASM_I386_CPU_H_ +#define _ASM_I386_CPU_H_ #include #include @@ -17,4 +17,4 @@ extern void arch_unregister_cpu(int); #endif DECLARE_PER_CPU(int, cpu_state); -#endif /* ASM_X86__CPU_H */ +#endif /* _ASM_I386_CPU_H_ */ diff --git a/trunk/include/asm-x86/cpufeature.h b/trunk/include/asm-x86/cpufeature.h index 6dfa2b3f18c7..762f6a6bc707 100644 --- a/trunk/include/asm-x86/cpufeature.h +++ b/trunk/include/asm-x86/cpufeature.h @@ -1,26 +1,20 @@ /* * Defines x86 CPU feature bits */ -#ifndef ASM_X86__CPUFEATURE_H -#define ASM_X86__CPUFEATURE_H +#ifndef _ASM_X86_CPUFEATURE_H +#define _ASM_X86_CPUFEATURE_H #include #define NCAPINTS 8 /* N 32-bit words worth of info */ -/* - * Note: If the comment begins with a quoted string, that string is used - * in /proc/cpuinfo instead of the macro name. If the string is "", - * this feature bit is not displayed in /proc/cpuinfo at all. - */ - /* Intel-defined CPU features, CPUID level 0x00000001 (edx), word 0 */ #define X86_FEATURE_FPU (0*32+ 0) /* Onboard FPU */ #define X86_FEATURE_VME (0*32+ 1) /* Virtual Mode Extensions */ #define X86_FEATURE_DE (0*32+ 2) /* Debugging Extensions */ #define X86_FEATURE_PSE (0*32+ 3) /* Page Size Extensions */ #define X86_FEATURE_TSC (0*32+ 4) /* Time Stamp Counter */ -#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers */ +#define X86_FEATURE_MSR (0*32+ 5) /* Model-Specific Registers, RDMSR, WRMSR */ #define X86_FEATURE_PAE (0*32+ 6) /* Physical Address Extensions */ #define X86_FEATURE_MCE (0*32+ 7) /* Machine Check Architecture */ #define X86_FEATURE_CX8 (0*32+ 8) /* CMPXCHG8 instruction */ @@ -29,23 +23,22 @@ #define X86_FEATURE_MTRR (0*32+12) /* Memory Type Range Registers */ #define X86_FEATURE_PGE (0*32+13) /* Page Global Enable */ #define X86_FEATURE_MCA (0*32+14) /* Machine Check Architecture */ -#define X86_FEATURE_CMOV (0*32+15) /* CMOV instructions */ - /* (plus FCMOVcc, FCOMI with FPU) */ +#define X86_FEATURE_CMOV (0*32+15) /* CMOV instruction (FCMOVCC and FCOMI too if FPU present) */ #define X86_FEATURE_PAT (0*32+16) /* Page Attribute Table */ #define X86_FEATURE_PSE36 (0*32+17) /* 36-bit PSEs */ #define X86_FEATURE_PN (0*32+18) /* Processor serial number */ -#define X86_FEATURE_CLFLSH (0*32+19) /* "clflush" CLFLUSH instruction */ -#define X86_FEATURE_DS (0*32+21) /* "dts" Debug Store */ +#define X86_FEATURE_CLFLSH (0*32+19) /* Supports the CLFLUSH instruction */ +#define X86_FEATURE_DS (0*32+21) /* Debug Store */ #define X86_FEATURE_ACPI (0*32+22) /* ACPI via MSR */ #define X86_FEATURE_MMX (0*32+23) /* Multimedia Extensions */ -#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE/FXRSTOR, CR4.OSFXSR */ -#define X86_FEATURE_XMM (0*32+25) /* "sse" */ -#define X86_FEATURE_XMM2 (0*32+26) /* "sse2" */ -#define X86_FEATURE_SELFSNOOP (0*32+27) /* "ss" CPU self snoop */ +#define X86_FEATURE_FXSR (0*32+24) /* FXSAVE and FXRSTOR instructions (fast save and restore */ + /* of FPU context), and CR4.OSFXSR available */ +#define X86_FEATURE_XMM (0*32+25) /* Streaming SIMD Extensions */ +#define X86_FEATURE_XMM2 (0*32+26) /* Streaming SIMD Extensions-2 */ +#define X86_FEATURE_SELFSNOOP (0*32+27) /* CPU self snoop */ #define X86_FEATURE_HT (0*32+28) /* Hyper-Threading */ -#define X86_FEATURE_ACC (0*32+29) /* "tm" Automatic clock control */ +#define X86_FEATURE_ACC (0*32+29) /* Automatic clock control */ #define X86_FEATURE_IA64 (0*32+30) /* IA-64 processor */ -#define X86_FEATURE_PBE (0*32+31) /* Pending Break Enable */ /* AMD-defined CPU features, CPUID level 0x80000001, word 1 */ /* Don't duplicate feature flags which are redundant with Intel! */ @@ -53,8 +46,7 @@ #define X86_FEATURE_MP (1*32+19) /* MP Capable. */ #define X86_FEATURE_NX (1*32+20) /* Execute Disable */ #define X86_FEATURE_MMXEXT (1*32+22) /* AMD MMX extensions */ -#define X86_FEATURE_FXSR_OPT (1*32+25) /* FXSAVE/FXRSTOR optimizations */ -#define X86_FEATURE_GBPAGES (1*32+26) /* "pdpe1gb" GB pages */ +#define X86_FEATURE_GBPAGES (1*32+26) /* GB pages */ #define X86_FEATURE_RDTSCP (1*32+27) /* RDTSCP */ #define X86_FEATURE_LM (1*32+29) /* Long Mode (x86-64) */ #define X86_FEATURE_3DNOWEXT (1*32+30) /* AMD 3DNow! extensions */ @@ -72,76 +64,51 @@ #define X86_FEATURE_CYRIX_ARR (3*32+ 2) /* Cyrix ARRs (= MTRRs) */ #define X86_FEATURE_CENTAUR_MCR (3*32+ 3) /* Centaur MCRs (= MTRRs) */ /* cpu types for specific tunings: */ -#define X86_FEATURE_K8 (3*32+ 4) /* "" Opteron, Athlon64 */ -#define X86_FEATURE_K7 (3*32+ 5) /* "" Athlon */ -#define X86_FEATURE_P3 (3*32+ 6) /* "" P3 */ -#define X86_FEATURE_P4 (3*32+ 7) /* "" P4 */ +#define X86_FEATURE_K8 (3*32+ 4) /* Opteron, Athlon64 */ +#define X86_FEATURE_K7 (3*32+ 5) /* Athlon */ +#define X86_FEATURE_P3 (3*32+ 6) /* P3 */ +#define X86_FEATURE_P4 (3*32+ 7) /* P4 */ #define X86_FEATURE_CONSTANT_TSC (3*32+ 8) /* TSC ticks at a constant rate */ #define X86_FEATURE_UP (3*32+ 9) /* smp kernel running on up */ -#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* "" FXSAVE leaks FOP/FIP/FOP */ +#define X86_FEATURE_FXSAVE_LEAK (3*32+10) /* FXSAVE leaks FOP/FIP/FOP */ #define X86_FEATURE_ARCH_PERFMON (3*32+11) /* Intel Architectural PerfMon */ -#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ -#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ -#define X86_FEATURE_SYSCALL32 (3*32+14) /* "" syscall in ia32 userspace */ -#define X86_FEATURE_SYSENTER32 (3*32+15) /* "" sysenter in ia32 userspace */ -#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well */ -#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* "" Mfence synchronizes RDTSC */ -#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* "" Lfence synchronizes RDTSC */ -#define X86_FEATURE_11AP (3*32+19) /* "" Bad local APIC aka 11AP */ -#define X86_FEATURE_NOPL (3*32+20) /* The NOPL (0F 1F) instructions */ +#define X86_FEATURE_PEBS (3*32+12) /* Precise-Event Based Sampling */ +#define X86_FEATURE_BTS (3*32+13) /* Branch Trace Store */ +#define X86_FEATURE_SYSCALL32 (3*32+14) /* syscall in ia32 userspace */ +#define X86_FEATURE_SYSENTER32 (3*32+15) /* sysenter in ia32 userspace */ +#define X86_FEATURE_REP_GOOD (3*32+16) /* rep microcode works well on this CPU */ +#define X86_FEATURE_MFENCE_RDTSC (3*32+17) /* Mfence synchronizes RDTSC */ +#define X86_FEATURE_LFENCE_RDTSC (3*32+18) /* Lfence synchronizes RDTSC */ +#define X86_FEATURE_11AP (3*32+19) /* Bad local APIC aka 11AP */ /* Intel-defined CPU features, CPUID level 0x00000001 (ecx), word 4 */ -#define X86_FEATURE_XMM3 (4*32+ 0) /* "pni" SSE-3 */ -#define X86_FEATURE_PCLMULQDQ (4*32+ 1) /* PCLMULQDQ instruction */ -#define X86_FEATURE_DTES64 (4*32+ 2) /* 64-bit Debug Store */ -#define X86_FEATURE_MWAIT (4*32+ 3) /* "monitor" Monitor/Mwait support */ -#define X86_FEATURE_DSCPL (4*32+ 4) /* "ds_cpl" CPL Qual. Debug Store */ -#define X86_FEATURE_VMX (4*32+ 5) /* Hardware virtualization */ -#define X86_FEATURE_SMX (4*32+ 6) /* Safer mode */ +#define X86_FEATURE_XMM3 (4*32+ 0) /* Streaming SIMD Extensions-3 */ +#define X86_FEATURE_MWAIT (4*32+ 3) /* Monitor/Mwait support */ +#define X86_FEATURE_DSCPL (4*32+ 4) /* CPL Qualified Debug Store */ #define X86_FEATURE_EST (4*32+ 7) /* Enhanced SpeedStep */ #define X86_FEATURE_TM2 (4*32+ 8) /* Thermal Monitor 2 */ -#define X86_FEATURE_SSSE3 (4*32+ 9) /* Supplemental SSE-3 */ #define X86_FEATURE_CID (4*32+10) /* Context ID */ -#define X86_FEATURE_FMA (4*32+12) /* Fused multiply-add */ #define X86_FEATURE_CX16 (4*32+13) /* CMPXCHG16B */ #define X86_FEATURE_XTPR (4*32+14) /* Send Task Priority Messages */ -#define X86_FEATURE_PDCM (4*32+15) /* Performance Capabilities */ #define X86_FEATURE_DCA (4*32+18) /* Direct Cache Access */ -#define X86_FEATURE_XMM4_1 (4*32+19) /* "sse4_1" SSE-4.1 */ -#define X86_FEATURE_XMM4_2 (4*32+20) /* "sse4_2" SSE-4.2 */ -#define X86_FEATURE_X2APIC (4*32+21) /* x2APIC */ -#define X86_FEATURE_AES (4*32+25) /* AES instructions */ -#define X86_FEATURE_XSAVE (4*32+26) /* XSAVE/XRSTOR/XSETBV/XGETBV */ -#define X86_FEATURE_OSXSAVE (4*32+27) /* "" XSAVE enabled in the OS */ -#define X86_FEATURE_AVX (4*32+28) /* Advanced Vector Extensions */ +#define X86_FEATURE_XMM4_2 (4*32+20) /* Streaming SIMD Extensions-4.2 */ /* VIA/Cyrix/Centaur-defined CPU features, CPUID level 0xC0000001, word 5 */ -#define X86_FEATURE_XSTORE (5*32+ 2) /* "rng" RNG present (xstore) */ -#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* "rng_en" RNG enabled */ -#define X86_FEATURE_XCRYPT (5*32+ 6) /* "ace" on-CPU crypto (xcrypt) */ -#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* "ace_en" on-CPU crypto enabled */ +#define X86_FEATURE_XSTORE (5*32+ 2) /* on-CPU RNG present (xstore insn) */ +#define X86_FEATURE_XSTORE_EN (5*32+ 3) /* on-CPU RNG enabled */ +#define X86_FEATURE_XCRYPT (5*32+ 6) /* on-CPU crypto (xcrypt insn) */ +#define X86_FEATURE_XCRYPT_EN (5*32+ 7) /* on-CPU crypto enabled */ #define X86_FEATURE_ACE2 (5*32+ 8) /* Advanced Cryptography Engine v2 */ #define X86_FEATURE_ACE2_EN (5*32+ 9) /* ACE v2 enabled */ -#define X86_FEATURE_PHE (5*32+10) /* PadLock Hash Engine */ -#define X86_FEATURE_PHE_EN (5*32+11) /* PHE enabled */ -#define X86_FEATURE_PMM (5*32+12) /* PadLock Montgomery Multiplier */ -#define X86_FEATURE_PMM_EN (5*32+13) /* PMM enabled */ +#define X86_FEATURE_PHE (5*32+ 10) /* PadLock Hash Engine */ +#define X86_FEATURE_PHE_EN (5*32+ 11) /* PHE enabled */ +#define X86_FEATURE_PMM (5*32+ 12) /* PadLock Montgomery Multiplier */ +#define X86_FEATURE_PMM_EN (5*32+ 13) /* PMM enabled */ /* More extended AMD flags: CPUID level 0x80000001, ecx, word 6 */ #define X86_FEATURE_LAHF_LM (6*32+ 0) /* LAHF/SAHF in long mode */ #define X86_FEATURE_CMP_LEGACY (6*32+ 1) /* If yes HyperThreading not valid */ -#define X86_FEATURE_SVM (6*32+ 2) /* Secure virtual machine */ -#define X86_FEATURE_EXTAPIC (6*32+ 3) /* Extended APIC space */ -#define X86_FEATURE_CR8_LEGACY (6*32+ 4) /* CR8 in 32-bit mode */ -#define X86_FEATURE_ABM (6*32+ 5) /* Advanced bit manipulation */ -#define X86_FEATURE_SSE4A (6*32+ 6) /* SSE-4A */ -#define X86_FEATURE_MISALIGNSSE (6*32+ 7) /* Misaligned SSE mode */ -#define X86_FEATURE_3DNOWPREFETCH (6*32+ 8) /* 3DNow prefetch instructions */ -#define X86_FEATURE_OSVW (6*32+ 9) /* OS Visible Workaround */ -#define X86_FEATURE_IBS (6*32+10) /* Instruction Based Sampling */ -#define X86_FEATURE_SSE5 (6*32+11) /* SSE-5 */ -#define X86_FEATURE_SKINIT (6*32+12) /* SKINIT/STGI instructions */ -#define X86_FEATURE_WDT (6*32+13) /* Watchdog timer */ +#define X86_FEATURE_IBS (6*32+ 10) /* Instruction Based Sampling */ /* * Auxiliary flags: Linux defined - For features scattered in various @@ -182,7 +149,7 @@ extern const char * const x86_power_flags[32]; } while (0) #define setup_force_cpu_cap(bit) do { \ set_cpu_cap(&boot_cpu_data, bit); \ - clear_bit(bit, (unsigned long *)cleared_cpu_caps); \ + clear_bit(bit, (unsigned long *)cleared_cpu_caps); \ } while (0) #define cpu_has_fpu boot_cpu_has(X86_FEATURE_FPU) @@ -223,10 +190,7 @@ extern const char * const x86_power_flags[32]; #define cpu_has_gbpages boot_cpu_has(X86_FEATURE_GBPAGES) #define cpu_has_arch_perfmon boot_cpu_has(X86_FEATURE_ARCH_PERFMON) #define cpu_has_pat boot_cpu_has(X86_FEATURE_PAT) -#define cpu_has_xmm4_1 boot_cpu_has(X86_FEATURE_XMM4_1) #define cpu_has_xmm4_2 boot_cpu_has(X86_FEATURE_XMM4_2) -#define cpu_has_x2apic boot_cpu_has(X86_FEATURE_X2APIC) -#define cpu_has_xsave boot_cpu_has(X86_FEATURE_XSAVE) #if defined(CONFIG_X86_INVLPG) || defined(CONFIG_X86_64) # define cpu_has_invlpg 1 @@ -258,4 +222,4 @@ extern const char * const x86_power_flags[32]; #endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */ -#endif /* ASM_X86__CPUFEATURE_H */ +#endif /* _ASM_X86_CPUFEATURE_H */ diff --git a/trunk/include/asm-x86/current.h b/trunk/include/asm-x86/current.h index a863ead856f3..7515c19d4988 100644 --- a/trunk/include/asm-x86/current.h +++ b/trunk/include/asm-x86/current.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__CURRENT_H -#define ASM_X86__CURRENT_H +#ifndef _X86_CURRENT_H +#define _X86_CURRENT_H #ifdef CONFIG_X86_32 #include @@ -36,4 +36,4 @@ static __always_inline struct task_struct *get_current(void) #define current get_current() -#endif /* ASM_X86__CURRENT_H */ +#endif /* X86_CURRENT_H */ diff --git a/trunk/include/asm-x86/debugreg.h b/trunk/include/asm-x86/debugreg.h index ecb6907c3ea4..c6344d572b03 100644 --- a/trunk/include/asm-x86/debugreg.h +++ b/trunk/include/asm-x86/debugreg.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DEBUGREG_H -#define ASM_X86__DEBUGREG_H +#ifndef _ASM_X86_DEBUGREG_H +#define _ASM_X86_DEBUGREG_H /* Indicate the register numbers for a number of the specific @@ -67,4 +67,4 @@ #define DR_LOCAL_SLOWDOWN (0x100) /* Local slow the pipeline */ #define DR_GLOBAL_SLOWDOWN (0x200) /* Global slow the pipeline */ -#endif /* ASM_X86__DEBUGREG_H */ +#endif diff --git a/trunk/include/asm-x86/delay.h b/trunk/include/asm-x86/delay.h index 8a0da95b4fc5..409a649204aa 100644 --- a/trunk/include/asm-x86/delay.h +++ b/trunk/include/asm-x86/delay.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DELAY_H -#define ASM_X86__DELAY_H +#ifndef _ASM_X86_DELAY_H +#define _ASM_X86_DELAY_H /* * Copyright (C) 1993 Linus Torvalds @@ -28,4 +28,4 @@ extern void __delay(unsigned long loops); void use_tsc_delay(void); -#endif /* ASM_X86__DELAY_H */ +#endif /* _ASM_X86_DELAY_H */ diff --git a/trunk/include/asm-x86/desc.h b/trunk/include/asm-x86/desc.h index b73fea54def2..a44c4dc70590 100644 --- a/trunk/include/asm-x86/desc.h +++ b/trunk/include/asm-x86/desc.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DESC_H -#define ASM_X86__DESC_H +#ifndef _ASM_DESC_H_ +#define _ASM_DESC_H_ #ifndef __ASSEMBLY__ #include @@ -397,4 +397,4 @@ static inline void set_system_gate_ist(int n, void *addr, unsigned ist) #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__DESC_H */ +#endif diff --git a/trunk/include/asm-x86/desc_defs.h b/trunk/include/asm-x86/desc_defs.h index b881db664b46..f7bacf357dac 100644 --- a/trunk/include/asm-x86/desc_defs.h +++ b/trunk/include/asm-x86/desc_defs.h @@ -1,6 +1,6 @@ /* Written 2000 by Andi Kleen */ -#ifndef ASM_X86__DESC_DEFS_H -#define ASM_X86__DESC_DEFS_H +#ifndef __ARCH_DESC_DEFS_H +#define __ARCH_DESC_DEFS_H /* * Segment descriptor structure definitions, usable from both x86_64 and i386 @@ -92,4 +92,4 @@ struct desc_ptr { #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__DESC_DEFS_H */ +#endif diff --git a/trunk/include/asm-x86/device.h b/trunk/include/asm-x86/device.h index 1bece04c7d9d..3c034f48fdb0 100644 --- a/trunk/include/asm-x86/device.h +++ b/trunk/include/asm-x86/device.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DEVICE_H -#define ASM_X86__DEVICE_H +#ifndef _ASM_X86_DEVICE_H +#define _ASM_X86_DEVICE_H struct dev_archdata { #ifdef CONFIG_ACPI @@ -13,4 +13,4 @@ struct dma_mapping_ops *dma_ops; #endif }; -#endif /* ASM_X86__DEVICE_H */ +#endif /* _ASM_X86_DEVICE_H */ diff --git a/trunk/include/asm-x86/div64.h b/trunk/include/asm-x86/div64.h index f9530f23f1d6..9a2d644c08ef 100644 --- a/trunk/include/asm-x86/div64.h +++ b/trunk/include/asm-x86/div64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DIV64_H -#define ASM_X86__DIV64_H +#ifndef _ASM_X86_DIV64_H +#define _ASM_X86_DIV64_H #ifdef CONFIG_X86_32 @@ -57,4 +57,4 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) # include #endif /* CONFIG_X86_32 */ -#endif /* ASM_X86__DIV64_H */ +#endif /* _ASM_X86_DIV64_H */ diff --git a/trunk/include/asm-x86/dma-mapping.h b/trunk/include/asm-x86/dma-mapping.h index 5d200e78bd81..ad9cd6d49bfc 100644 --- a/trunk/include/asm-x86/dma-mapping.h +++ b/trunk/include/asm-x86/dma-mapping.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DMA_MAPPING_H -#define ASM_X86__DMA_MAPPING_H +#ifndef _ASM_DMA_MAPPING_H_ +#define _ASM_DMA_MAPPING_H_ /* * IOMMU interface. See Documentation/DMA-mapping.txt and DMA-API.txt for @@ -250,4 +250,4 @@ static inline int dma_get_cache_alignment(void) #define dma_is_consistent(d, h) (1) #include -#endif /* ASM_X86__DMA_MAPPING_H */ +#endif diff --git a/trunk/include/asm-x86/dma.h b/trunk/include/asm-x86/dma.h index c9f7a4eec555..ca1098a7e580 100644 --- a/trunk/include/asm-x86/dma.h +++ b/trunk/include/asm-x86/dma.h @@ -5,8 +5,8 @@ * and John Boyd, Nov. 1992. */ -#ifndef ASM_X86__DMA_H -#define ASM_X86__DMA_H +#ifndef _ASM_X86_DMA_H +#define _ASM_X86_DMA_H #include /* And spinlocks */ #include /* need byte IO */ @@ -315,4 +315,4 @@ extern int isa_dma_bridge_buggy; #define isa_dma_bridge_buggy (0) #endif -#endif /* ASM_X86__DMA_H */ +#endif /* _ASM_X86_DMA_H */ diff --git a/trunk/include/asm-x86/dmi.h b/trunk/include/asm-x86/dmi.h index 1cff6fe81fa5..58a86571fe0f 100644 --- a/trunk/include/asm-x86/dmi.h +++ b/trunk/include/asm-x86/dmi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DMI_H -#define ASM_X86__DMI_H +#ifndef _ASM_X86_DMI_H +#define _ASM_X86_DMI_H #include @@ -23,4 +23,4 @@ static inline void *dmi_alloc(unsigned len) #define dmi_ioremap early_ioremap #define dmi_iounmap early_iounmap -#endif /* ASM_X86__DMI_H */ +#endif diff --git a/trunk/include/asm-x86/ds.h b/trunk/include/asm-x86/ds.h index 6b27c686fa10..7881368142fa 100644 --- a/trunk/include/asm-x86/ds.h +++ b/trunk/include/asm-x86/ds.h @@ -17,8 +17,8 @@ * Markus Metzger , Dec 2007 */ -#ifndef ASM_X86__DS_H -#define ASM_X86__DS_H +#ifndef _ASM_X86_DS_H +#define _ASM_X86_DS_H #include #include @@ -69,4 +69,4 @@ extern int ds_write_bts(void *, const struct bts_struct *); extern unsigned long ds_debugctl_mask(void); extern void __cpuinit ds_init_intel(struct cpuinfo_x86 *c); -#endif /* ASM_X86__DS_H */ +#endif /* _ASM_X86_DS_H */ diff --git a/trunk/include/asm-x86/dwarf2.h b/trunk/include/asm-x86/dwarf2.h index 21d1bc32ad7c..738bb9fb3e53 100644 --- a/trunk/include/asm-x86/dwarf2.h +++ b/trunk/include/asm-x86/dwarf2.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__DWARF2_H -#define ASM_X86__DWARF2_H +#ifndef _DWARF2_H +#define _DWARF2_H #ifndef __ASSEMBLY__ #warning "asm/dwarf2.h should be only included in pure assembly files" @@ -58,4 +58,4 @@ #endif -#endif /* ASM_X86__DWARF2_H */ +#endif diff --git a/trunk/include/asm-x86/e820.h b/trunk/include/asm-x86/e820.h index 5abbdec06bd2..16a31e2c7c57 100644 --- a/trunk/include/asm-x86/e820.h +++ b/trunk/include/asm-x86/e820.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__E820_H -#define ASM_X86__E820_H +#ifndef __ASM_E820_H +#define __ASM_E820_H #define E820MAP 0x2d0 /* our map */ #define E820MAX 128 /* number of entries in E820MAP */ @@ -43,7 +43,6 @@ #define E820_RESERVED 2 #define E820_ACPI 3 #define E820_NVS 4 -#define E820_UNUSABLE 5 /* reserved RAM used by kernel itself */ #define E820_RESERVED_KERN 128 @@ -65,7 +64,6 @@ struct e820map { extern struct e820map e820; extern struct e820map e820_saved; -extern unsigned long pci_mem_start; extern int e820_any_mapped(u64 start, u64 end, unsigned type); extern int e820_all_mapped(u64 start, u64 end, unsigned type); extern void e820_add_region(u64 start, u64 size, int type); @@ -122,7 +120,6 @@ extern void e820_register_active_regions(int nid, unsigned long start_pfn, extern u64 e820_hole_size(u64 start, u64 end); extern void finish_e820_parsing(void); extern void e820_reserve_resources(void); -extern void e820_reserve_resources_late(void); extern void setup_memory_map(void); extern char *default_machine_specific_memory_setup(void); extern char *machine_specific_memory_setup(void); @@ -143,4 +140,4 @@ extern char *memory_setup(void); #define HIGH_MEMORY (1024*1024) #endif /* __KERNEL__ */ -#endif /* ASM_X86__E820_H */ +#endif /* __ASM_E820_H */ diff --git a/trunk/include/asm-x86/edac.h b/trunk/include/asm-x86/edac.h index 9493c5b27bbd..a8088f63a30e 100644 --- a/trunk/include/asm-x86/edac.h +++ b/trunk/include/asm-x86/edac.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__EDAC_H -#define ASM_X86__EDAC_H +#ifndef _ASM_X86_EDAC_H +#define _ASM_X86_EDAC_H /* ECC atomic, DMA, SMP and interrupt safe scrub function */ @@ -15,4 +15,4 @@ static inline void atomic_scrub(void *va, u32 size) asm volatile("lock; addl $0, %0"::"m" (*virt_addr)); } -#endif /* ASM_X86__EDAC_H */ +#endif diff --git a/trunk/include/asm-x86/efi.h b/trunk/include/asm-x86/efi.h index ed2de22e8705..d4f2b0abe929 100644 --- a/trunk/include/asm-x86/efi.h +++ b/trunk/include/asm-x86/efi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__EFI_H -#define ASM_X86__EFI_H +#ifndef _ASM_X86_EFI_H +#define _ASM_X86_EFI_H #ifdef CONFIG_X86_32 @@ -94,4 +94,4 @@ extern void efi_reserve_early(void); extern void efi_call_phys_prelog(void); extern void efi_call_phys_epilog(void); -#endif /* ASM_X86__EFI_H */ +#endif diff --git a/trunk/include/asm-x86/elf.h b/trunk/include/asm-x86/elf.h index cd678b2d6a74..7be4733c793e 100644 --- a/trunk/include/asm-x86/elf.h +++ b/trunk/include/asm-x86/elf.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__ELF_H -#define ASM_X86__ELF_H +#ifndef _ASM_X86_ELF_H +#define _ASM_X86_ELF_H /* * ELF register definitions.. @@ -332,4 +332,4 @@ extern int syscall32_setup_pages(struct linux_binprm *, int exstack); extern unsigned long arch_randomize_brk(struct mm_struct *mm); #define arch_randomize_brk arch_randomize_brk -#endif /* ASM_X86__ELF_H */ +#endif diff --git a/trunk/include/asm-x86/emergency-restart.h b/trunk/include/asm-x86/emergency-restart.h index 190d0d8b71e3..8e6aef19f8f0 100644 --- a/trunk/include/asm-x86/emergency-restart.h +++ b/trunk/include/asm-x86/emergency-restart.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__EMERGENCY_RESTART_H -#define ASM_X86__EMERGENCY_RESTART_H +#ifndef _ASM_EMERGENCY_RESTART_H +#define _ASM_EMERGENCY_RESTART_H enum reboot_type { BOOT_TRIPLE = 't', @@ -15,4 +15,4 @@ extern enum reboot_type reboot_type; extern void machine_emergency_restart(void); -#endif /* ASM_X86__EMERGENCY_RESTART_H */ +#endif /* _ASM_EMERGENCY_RESTART_H */ diff --git a/trunk/include/asm-x86/es7000/apicdef.h b/trunk/include/asm-x86/es7000/apicdef.h deleted file mode 100644 index 8b234a3cb851..000000000000 --- a/trunk/include/asm-x86/es7000/apicdef.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ASM_ES7000_APICDEF_H -#define __ASM_ES7000_APICDEF_H - -#define APIC_ID_MASK (0xFF<<24) - -static inline unsigned get_apic_id(unsigned long x) -{ - return (((x)>>24)&0xFF); -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/trunk/include/asm-x86/fb.h b/trunk/include/asm-x86/fb.h index aca38dbd9a64..53018464aea6 100644 --- a/trunk/include/asm-x86/fb.h +++ b/trunk/include/asm-x86/fb.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__FB_H -#define ASM_X86__FB_H +#ifndef _ASM_X86_FB_H +#define _ASM_X86_FB_H #include #include @@ -18,4 +18,4 @@ extern int fb_is_primary_device(struct fb_info *info); static inline int fb_is_primary_device(struct fb_info *info) { return 0; } #endif -#endif /* ASM_X86__FB_H */ +#endif /* _ASM_X86_FB_H */ diff --git a/trunk/include/asm-x86/fixmap.h b/trunk/include/asm-x86/fixmap.h index 78e33a1bc591..44d4f8217349 100644 --- a/trunk/include/asm-x86/fixmap.h +++ b/trunk/include/asm-x86/fixmap.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__FIXMAP_H -#define ASM_X86__FIXMAP_H +#ifndef _ASM_FIXMAP_H +#define _ASM_FIXMAP_H #ifdef CONFIG_X86_32 # include "fixmap_32.h" @@ -65,4 +65,4 @@ static inline unsigned long virt_to_fix(const unsigned long vaddr) BUG_ON(vaddr >= FIXADDR_TOP || vaddr < FIXADDR_START); return __virt_to_fix(vaddr); } -#endif /* ASM_X86__FIXMAP_H */ +#endif diff --git a/trunk/include/asm-x86/fixmap_32.h b/trunk/include/asm-x86/fixmap_32.h index 784e3e759866..f1ac2b2167d7 100644 --- a/trunk/include/asm-x86/fixmap_32.h +++ b/trunk/include/asm-x86/fixmap_32.h @@ -10,8 +10,8 @@ * Support of BIGMEM added by Gerhard Wichert, Siemens AG, July 1999 */ -#ifndef ASM_X86__FIXMAP_32_H -#define ASM_X86__FIXMAP_32_H +#ifndef _ASM_FIXMAP_32_H +#define _ASM_FIXMAP_32_H /* used by vmalloc.c, vsyscall.lds.S. @@ -120,4 +120,4 @@ extern void reserve_top_address(unsigned long reserve); #define FIXADDR_BOOT_START (FIXADDR_TOP - __FIXADDR_BOOT_SIZE) #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__FIXMAP_32_H */ +#endif diff --git a/trunk/include/asm-x86/fixmap_64.h b/trunk/include/asm-x86/fixmap_64.h index dafb24bc0424..00f3d74a0524 100644 --- a/trunk/include/asm-x86/fixmap_64.h +++ b/trunk/include/asm-x86/fixmap_64.h @@ -8,8 +8,8 @@ * Copyright (C) 1998 Ingo Molnar */ -#ifndef ASM_X86__FIXMAP_64_H -#define ASM_X86__FIXMAP_64_H +#ifndef _ASM_FIXMAP_64_H +#define _ASM_FIXMAP_64_H #include #include @@ -80,4 +80,4 @@ enum fixed_addresses { #define FIXADDR_USER_START ((unsigned long)VSYSCALL32_VSYSCALL) #define FIXADDR_USER_END (FIXADDR_USER_START + PAGE_SIZE) -#endif /* ASM_X86__FIXMAP_64_H */ +#endif diff --git a/trunk/include/asm-x86/floppy.h b/trunk/include/asm-x86/floppy.h index 7d83a3a83e37..dbe82a5c5eac 100644 --- a/trunk/include/asm-x86/floppy.h +++ b/trunk/include/asm-x86/floppy.h @@ -7,8 +7,8 @@ * * Copyright (C) 1995 */ -#ifndef ASM_X86__FLOPPY_H -#define ASM_X86__FLOPPY_H +#ifndef _ASM_X86_FLOPPY_H +#define _ASM_X86_FLOPPY_H #include @@ -278,4 +278,4 @@ static int FDC2 = -1; #define EXTRA_FLOPPY_PARAMS -#endif /* ASM_X86__FLOPPY_H */ +#endif /* _ASM_X86_FLOPPY_H */ diff --git a/trunk/include/asm-x86/ftrace.h b/trunk/include/asm-x86/ftrace.h index be0e004ad148..5c68b32ee1c8 100644 --- a/trunk/include/asm-x86/ftrace.h +++ b/trunk/include/asm-x86/ftrace.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__FTRACE_H -#define ASM_X86__FTRACE_H +#ifndef _ASM_X86_FTRACE +#define _ASM_X86_FTRACE #ifdef CONFIG_FTRACE #define MCOUNT_ADDR ((long)(mcount)) @@ -11,4 +11,4 @@ extern void mcount(void); #endif /* CONFIG_FTRACE */ -#endif /* ASM_X86__FTRACE_H */ +#endif /* _ASM_X86_FTRACE */ diff --git a/trunk/include/asm-x86/futex.h b/trunk/include/asm-x86/futex.h index 45dc24d84186..e7a76b37b333 100644 --- a/trunk/include/asm-x86/futex.h +++ b/trunk/include/asm-x86/futex.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__FUTEX_H -#define ASM_X86__FUTEX_H +#ifndef _ASM_X86_FUTEX_H +#define _ASM_X86_FUTEX_H #ifdef __KERNEL__ @@ -137,4 +137,4 @@ static inline int futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, } #endif -#endif /* ASM_X86__FUTEX_H */ +#endif diff --git a/trunk/include/asm-x86/gart.h b/trunk/include/asm-x86/gart.h index 07f445844146..3f62a83887f3 100644 --- a/trunk/include/asm-x86/gart.h +++ b/trunk/include/asm-x86/gart.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__GART_H -#define ASM_X86__GART_H +#ifndef _ASM_X8664_GART_H +#define _ASM_X8664_GART_H 1 #include @@ -68,4 +68,4 @@ static inline int aperture_valid(u64 aper_base, u32 aper_size, u32 min_size) return 1; } -#endif /* ASM_X86__GART_H */ +#endif diff --git a/trunk/include/asm-x86/genapic_32.h b/trunk/include/asm-x86/genapic_32.h index 34280f027664..754d635f90ff 100644 --- a/trunk/include/asm-x86/genapic_32.h +++ b/trunk/include/asm-x86/genapic_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__GENAPIC_32_H -#define ASM_X86__GENAPIC_32_H +#ifndef _ASM_GENAPIC_H +#define _ASM_GENAPIC_H 1 #include @@ -121,4 +121,4 @@ enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; #define uv_system_init() do {} while (0) -#endif /* ASM_X86__GENAPIC_32_H */ +#endif diff --git a/trunk/include/asm-x86/genapic_64.h b/trunk/include/asm-x86/genapic_64.h index ed6a4886c082..a47d63129135 100644 --- a/trunk/include/asm-x86/genapic_64.h +++ b/trunk/include/asm-x86/genapic_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__GENAPIC_64_H -#define ASM_X86__GENAPIC_64_H +#ifndef _ASM_GENAPIC_H +#define _ASM_GENAPIC_H 1 /* * Copyright 2004 James Cleverdon, IBM. @@ -14,7 +14,6 @@ struct genapic { char *name; - int (*acpi_madt_oem_check)(char *oem_id, char *oem_table_id); u32 int_delivery_mode; u32 int_dest_mode; int (*apic_id_registered)(void); @@ -25,24 +24,17 @@ struct genapic { void (*send_IPI_mask)(cpumask_t mask, int vector); void (*send_IPI_allbutself)(int vector); void (*send_IPI_all)(int vector); - void (*send_IPI_self)(int vector); /* */ unsigned int (*cpu_mask_to_apicid)(cpumask_t cpumask); unsigned int (*phys_pkg_id)(int index_msb); - unsigned int (*get_apic_id)(unsigned long x); - unsigned long (*set_apic_id)(unsigned int id); - unsigned long apic_id_mask; }; extern struct genapic *genapic; extern struct genapic apic_flat; extern struct genapic apic_physflat; -extern struct genapic apic_x2apic_cluster; -extern struct genapic apic_x2apic_phys; extern int acpi_madt_oem_check(char *, char *); -extern void apic_send_IPI_self(int vector); enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; extern enum uv_system_type get_uv_system_type(void); extern int is_uv_system(void); @@ -55,4 +47,4 @@ extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); extern void setup_apic_routing(void); -#endif /* ASM_X86__GENAPIC_64_H */ +#endif diff --git a/trunk/include/asm-x86/geode.h b/trunk/include/asm-x86/geode.h index 3f3444be2638..2c1cda0b8a86 100644 --- a/trunk/include/asm-x86/geode.h +++ b/trunk/include/asm-x86/geode.h @@ -7,8 +7,8 @@ * as published by the Free Software Foundation. */ -#ifndef ASM_X86__GEODE_H -#define ASM_X86__GEODE_H +#ifndef _ASM_GEODE_H_ +#define _ASM_GEODE_H_ #include #include @@ -250,4 +250,4 @@ extern int __init mfgpt_timer_setup(void); static inline int mfgpt_timer_setup(void) { return 0; } #endif -#endif /* ASM_X86__GEODE_H */ +#endif diff --git a/trunk/include/asm-x86/gpio.h b/trunk/include/asm-x86/gpio.h index 497fb980d962..c4c91b37c104 100644 --- a/trunk/include/asm-x86/gpio.h +++ b/trunk/include/asm-x86/gpio.h @@ -53,4 +53,4 @@ static inline int irq_to_gpio(unsigned int irq) #endif /* CONFIG_GPIOLIB */ -#endif /* ASM_X86__GPIO_H */ +#endif /* _ASM_I386_GPIO_H */ diff --git a/trunk/include/asm-x86/hardirq_32.h b/trunk/include/asm-x86/hardirq_32.h index 700fe230d919..4f85f0f4b563 100644 --- a/trunk/include/asm-x86/hardirq_32.h +++ b/trunk/include/asm-x86/hardirq_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HARDIRQ_32_H -#define ASM_X86__HARDIRQ_32_H +#ifndef __ASM_HARDIRQ_H +#define __ASM_HARDIRQ_H #include #include @@ -25,4 +25,4 @@ DECLARE_PER_CPU(irq_cpustat_t, irq_stat); void ack_bad_irq(unsigned int irq); #include -#endif /* ASM_X86__HARDIRQ_32_H */ +#endif /* __ASM_HARDIRQ_H */ diff --git a/trunk/include/asm-x86/hardirq_64.h b/trunk/include/asm-x86/hardirq_64.h index f8bd2919a8ce..95d5e090ed89 100644 --- a/trunk/include/asm-x86/hardirq_64.h +++ b/trunk/include/asm-x86/hardirq_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HARDIRQ_64_H -#define ASM_X86__HARDIRQ_64_H +#ifndef __ASM_HARDIRQ_H +#define __ASM_HARDIRQ_H #include #include @@ -20,4 +20,4 @@ extern void ack_bad_irq(unsigned int irq); -#endif /* ASM_X86__HARDIRQ_64_H */ +#endif /* __ASM_HARDIRQ_H */ diff --git a/trunk/include/asm-x86/highmem.h b/trunk/include/asm-x86/highmem.h index bc3f6a280316..4514b16cc723 100644 --- a/trunk/include/asm-x86/highmem.h +++ b/trunk/include/asm-x86/highmem.h @@ -15,8 +15,8 @@ * Copyright (C) 1999 Ingo Molnar */ -#ifndef ASM_X86__HIGHMEM_H -#define ASM_X86__HIGHMEM_H +#ifndef _ASM_HIGHMEM_H +#define _ASM_HIGHMEM_H #ifdef __KERNEL__ @@ -79,4 +79,4 @@ extern void add_highpages_with_active_regions(int nid, unsigned long start_pfn, #endif /* __KERNEL__ */ -#endif /* ASM_X86__HIGHMEM_H */ +#endif /* _ASM_HIGHMEM_H */ diff --git a/trunk/include/asm-x86/hpet.h b/trunk/include/asm-x86/hpet.h index cbbbb6d4dd32..82f1ac641bd7 100644 --- a/trunk/include/asm-x86/hpet.h +++ b/trunk/include/asm-x86/hpet.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HPET_H -#define ASM_X86__HPET_H +#ifndef ASM_X86_HPET_H +#define ASM_X86_HPET_H #ifdef CONFIG_HPET_TIMER @@ -90,4 +90,4 @@ static inline int is_hpet_enabled(void) { return 0; } #define hpet_readl(a) 0 #endif -#endif /* ASM_X86__HPET_H */ +#endif /* ASM_X86_HPET_H */ diff --git a/trunk/include/asm-x86/hugetlb.h b/trunk/include/asm-x86/hugetlb.h index 0b7ec5dc0884..439a9acc132d 100644 --- a/trunk/include/asm-x86/hugetlb.h +++ b/trunk/include/asm-x86/hugetlb.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HUGETLB_H -#define ASM_X86__HUGETLB_H +#ifndef _ASM_X86_HUGETLB_H +#define _ASM_X86_HUGETLB_H #include @@ -90,4 +90,4 @@ static inline void arch_release_hugepage(struct page *page) { } -#endif /* ASM_X86__HUGETLB_H */ +#endif /* _ASM_X86_HUGETLB_H */ diff --git a/trunk/include/asm-x86/hw_irq.h b/trunk/include/asm-x86/hw_irq.h index 50f6e0316b50..edd0b95f14d0 100644 --- a/trunk/include/asm-x86/hw_irq.h +++ b/trunk/include/asm-x86/hw_irq.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HW_IRQ_H -#define ASM_X86__HW_IRQ_H +#ifndef _ASM_HW_IRQ_H +#define _ASM_HW_IRQ_H /* * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar @@ -64,6 +64,7 @@ extern unsigned long io_apic_irqs; extern void init_VISWS_APIC_irqs(void); extern void setup_IO_APIC(void); extern void disable_IO_APIC(void); +extern void print_IO_APIC(void); extern int IO_APIC_get_PCI_irq_vector(int bus, int slot, int fn); extern void setup_ioapic_dest(void); @@ -72,9 +73,7 @@ extern void enable_IO_APIC(void); #endif /* IPI functions */ -#ifdef CONFIG_X86_32 extern void send_IPI_self(int vector); -#endif extern void send_IPI(int dest, int vector); /* Statistics */ @@ -94,26 +93,6 @@ extern asmlinkage void qic_reschedule_interrupt(void); extern asmlinkage void qic_enable_irq_interrupt(void); extern asmlinkage void qic_call_function_interrupt(void); -/* SMP */ -extern void smp_apic_timer_interrupt(struct pt_regs *); -#ifdef CONFIG_X86_32 -extern void smp_spurious_interrupt(struct pt_regs *); -extern void smp_error_interrupt(struct pt_regs *); -#else -extern asmlinkage void smp_spurious_interrupt(void); -extern asmlinkage void smp_error_interrupt(void); -#endif -#ifdef CONFIG_X86_SMP -extern void smp_reschedule_interrupt(struct pt_regs *); -extern void smp_call_function_interrupt(struct pt_regs *); -extern void smp_call_function_single_interrupt(struct pt_regs *); -#ifdef CONFIG_X86_32 -extern void smp_invalidate_interrupt(struct pt_regs *); -#else -extern asmlinkage void smp_invalidate_interrupt(struct pt_regs *); -#endif -#endif - #ifdef CONFIG_X86_32 extern void (*const interrupt[NR_IRQS])(void); #else @@ -133,4 +112,4 @@ static inline void __setup_vector_irq(int cpu) {} #endif /* !ASSEMBLY_ */ -#endif /* ASM_X86__HW_IRQ_H */ +#endif diff --git a/trunk/include/asm-x86/hypertransport.h b/trunk/include/asm-x86/hypertransport.h index cc011a3bc1c2..d2bbd238b3e1 100644 --- a/trunk/include/asm-x86/hypertransport.h +++ b/trunk/include/asm-x86/hypertransport.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__HYPERTRANSPORT_H -#define ASM_X86__HYPERTRANSPORT_H +#ifndef ASM_HYPERTRANSPORT_H +#define ASM_HYPERTRANSPORT_H /* * Constants for x86 Hypertransport Interrupts. @@ -42,4 +42,4 @@ #define HT_IRQ_HIGH_DEST_ID(v) \ ((((v) >> 8) << HT_IRQ_HIGH_DEST_ID_SHIFT) & HT_IRQ_HIGH_DEST_ID_MASK) -#endif /* ASM_X86__HYPERTRANSPORT_H */ +#endif /* ASM_HYPERTRANSPORT_H */ diff --git a/trunk/include/asm-x86/i387.h b/trunk/include/asm-x86/i387.h index 1ecdc3ed96e4..56d00e31aec0 100644 --- a/trunk/include/asm-x86/i387.h +++ b/trunk/include/asm-x86/i387.h @@ -7,8 +7,8 @@ * x86-64 work by Andi Kleen 2002 */ -#ifndef ASM_X86__I387_H -#define ASM_X86__I387_H +#ifndef _ASM_X86_I387_H +#define _ASM_X86_I387_H #include #include @@ -25,7 +25,6 @@ extern void mxcsr_feature_mask_init(void); extern int init_fpu(struct task_struct *child); extern asmlinkage void math_state_restore(void); extern void init_thread_xstate(void); -extern int dump_fpu(struct pt_regs *, struct user_i387_struct *); extern user_regset_active_fn fpregs_active, xfpregs_active; extern user_regset_get_fn fpregs_get, xfpregs_get, fpregs_soft_get; @@ -337,4 +336,4 @@ static inline unsigned short get_fpu_mxcsr(struct task_struct *tsk) } } -#endif /* ASM_X86__I387_H */ +#endif /* _ASM_X86_I387_H */ diff --git a/trunk/include/asm-x86/i8253.h b/trunk/include/asm-x86/i8253.h index 15a5b530044e..b51c0487fc41 100644 --- a/trunk/include/asm-x86/i8253.h +++ b/trunk/include/asm-x86/i8253.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__I8253_H -#define ASM_X86__I8253_H +#ifndef __ASM_I8253_H__ +#define __ASM_I8253_H__ /* i8253A PIT registers */ #define PIT_MODE 0x43 @@ -15,4 +15,4 @@ extern void setup_pit_timer(void); #define inb_pit inb_p #define outb_pit outb_p -#endif /* ASM_X86__I8253_H */ +#endif /* __ASM_I8253_H__ */ diff --git a/trunk/include/asm-x86/i8259.h b/trunk/include/asm-x86/i8259.h index 23c1b3baaecd..2f98df91f1f2 100644 --- a/trunk/include/asm-x86/i8259.h +++ b/trunk/include/asm-x86/i8259.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__I8259_H -#define ASM_X86__I8259_H +#ifndef __ASM_I8259_H__ +#define __ASM_I8259_H__ #include @@ -57,7 +57,4 @@ static inline void outb_pic(unsigned char value, unsigned int port) extern struct irq_chip i8259A_chip; -extern void mask_8259A(void); -extern void unmask_8259A(void); - -#endif /* ASM_X86__I8259_H */ +#endif /* __ASM_I8259_H__ */ diff --git a/trunk/include/asm-x86/ia32.h b/trunk/include/asm-x86/ia32.h index f932f7ad51dd..55d3abe5276f 100644 --- a/trunk/include/asm-x86/ia32.h +++ b/trunk/include/asm-x86/ia32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IA32_H -#define ASM_X86__IA32_H +#ifndef _ASM_X86_64_IA32_H +#define _ASM_X86_64_IA32_H #ifdef CONFIG_IA32_EMULATION @@ -167,4 +167,4 @@ extern void ia32_pick_mmap_layout(struct mm_struct *mm); #endif /* !CONFIG_IA32_SUPPORT */ -#endif /* ASM_X86__IA32_H */ +#endif diff --git a/trunk/include/asm-x86/ia32_unistd.h b/trunk/include/asm-x86/ia32_unistd.h index dbd887d8a5a5..61cea9e7c5c1 100644 --- a/trunk/include/asm-x86/ia32_unistd.h +++ b/trunk/include/asm-x86/ia32_unistd.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IA32_UNISTD_H -#define ASM_X86__IA32_UNISTD_H +#ifndef _ASM_X86_64_IA32_UNISTD_H_ +#define _ASM_X86_64_IA32_UNISTD_H_ /* * This file contains the system call numbers of the ia32 port, @@ -15,4 +15,4 @@ #define __NR_ia32_sigreturn 119 #define __NR_ia32_rt_sigreturn 173 -#endif /* ASM_X86__IA32_UNISTD_H */ +#endif /* _ASM_X86_64_IA32_UNISTD_H_ */ diff --git a/trunk/include/asm-x86/idle.h b/trunk/include/asm-x86/idle.h index dc9c7944847b..d240e5b30a45 100644 --- a/trunk/include/asm-x86/idle.h +++ b/trunk/include/asm-x86/idle.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IDLE_H -#define ASM_X86__IDLE_H +#ifndef _ASM_X86_64_IDLE_H +#define _ASM_X86_64_IDLE_H 1 #define IDLE_START 1 #define IDLE_END 2 @@ -10,4 +10,4 @@ void idle_notifier_register(struct notifier_block *n); void enter_idle(void); void exit_idle(void); -#endif /* ASM_X86__IDLE_H */ +#endif diff --git a/trunk/include/asm-x86/intel_arch_perfmon.h b/trunk/include/asm-x86/intel_arch_perfmon.h index 07c03c6c9a16..fa0fd068bc2e 100644 --- a/trunk/include/asm-x86/intel_arch_perfmon.h +++ b/trunk/include/asm-x86/intel_arch_perfmon.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__INTEL_ARCH_PERFMON_H -#define ASM_X86__INTEL_ARCH_PERFMON_H +#ifndef _ASM_X86_INTEL_ARCH_PERFMON_H +#define _ASM_X86_INTEL_ARCH_PERFMON_H #define MSR_ARCH_PERFMON_PERFCTR0 0xc1 #define MSR_ARCH_PERFMON_PERFCTR1 0xc2 @@ -28,4 +28,4 @@ union cpuid10_eax { unsigned int full; }; -#endif /* ASM_X86__INTEL_ARCH_PERFMON_H */ +#endif /* _ASM_X86_INTEL_ARCH_PERFMON_H */ diff --git a/trunk/include/asm-x86/io.h b/trunk/include/asm-x86/io.h index 72b7719523bf..0f954dc89cb3 100644 --- a/trunk/include/asm-x86/io.h +++ b/trunk/include/asm-x86/io.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IO_H -#define ASM_X86__IO_H +#ifndef _ASM_X86_IO_H +#define _ASM_X86_IO_H #define ARCH_HAS_IOREMAP_WC @@ -73,8 +73,6 @@ build_mmio_write(__writeq, "q", unsigned long, "r", ) #define writeq writeq #endif -extern int iommu_bio_merge; - #ifdef CONFIG_X86_32 # include "io_32.h" #else @@ -101,4 +99,4 @@ extern void early_iounmap(void *addr, unsigned long size); extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); -#endif /* ASM_X86__IO_H */ +#endif /* _ASM_X86_IO_H */ diff --git a/trunk/include/asm-x86/io_32.h b/trunk/include/asm-x86/io_32.h index 4f7d878bda18..e876d89ac156 100644 --- a/trunk/include/asm-x86/io_32.h +++ b/trunk/include/asm-x86/io_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IO_32_H -#define ASM_X86__IO_32_H +#ifndef _ASM_IO_H +#define _ASM_IO_H #include #include @@ -281,4 +281,4 @@ BUILDIO(b, b, char) BUILDIO(w, w, short) BUILDIO(l, , int) -#endif /* ASM_X86__IO_32_H */ +#endif diff --git a/trunk/include/asm-x86/io_64.h b/trunk/include/asm-x86/io_64.h index 64429e9431a8..22995c5c5adc 100644 --- a/trunk/include/asm-x86/io_64.h +++ b/trunk/include/asm-x86/io_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IO_64_H -#define ASM_X86__IO_64_H +#ifndef _ASM_IO_H +#define _ASM_IO_H /* @@ -235,6 +235,7 @@ void memset_io(volatile void __iomem *a, int b, size_t c); #define flush_write_buffers() +extern int iommu_bio_merge; #define BIO_VMERGE_BOUNDARY iommu_bio_merge /* @@ -244,4 +245,4 @@ void memset_io(volatile void __iomem *a, int b, size_t c); #endif /* __KERNEL__ */ -#endif /* ASM_X86__IO_64_H */ +#endif diff --git a/trunk/include/asm-x86/io_apic.h b/trunk/include/asm-x86/io_apic.h index 8ec68a50cf10..14f82bbcb5fd 100644 --- a/trunk/include/asm-x86/io_apic.h +++ b/trunk/include/asm-x86/io_apic.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IO_APIC_H -#define ASM_X86__IO_APIC_H +#ifndef __ASM_IO_APIC_H +#define __ASM_IO_APIC_H #include #include @@ -107,20 +107,6 @@ struct IO_APIC_route_entry { } __attribute__ ((packed)); -struct IR_IO_APIC_route_entry { - __u64 vector : 8, - zero : 3, - index2 : 1, - delivery_status : 1, - polarity : 1, - irr : 1, - trigger : 1, - mask : 1, - reserved : 31, - format : 1, - index : 15; -} __attribute__ ((packed)); - #ifdef CONFIG_X86_IO_APIC /* @@ -197,16 +183,10 @@ extern int io_apic_set_pci_routing(int ioapic, int pin, int irq, extern int (*ioapic_renumber_irq)(int ioapic, int irq); extern void ioapic_init_mappings(void); -#ifdef CONFIG_X86_64 -extern int save_mask_IO_APIC_setup(void); -extern void restore_IO_APIC_setup(void); -extern void reinit_intr_remapped_IO_APIC(int); -#endif - #else /* !CONFIG_X86_IO_APIC */ #define io_apic_assign_pci_irqs 0 static const int timer_through_8259 = 0; static inline void ioapic_init_mappings(void) { } #endif -#endif /* ASM_X86__IO_APIC_H */ +#endif diff --git a/trunk/include/asm-x86/ioctls.h b/trunk/include/asm-x86/ioctls.h index 336603512399..c0c338bd4068 100644 --- a/trunk/include/asm-x86/ioctls.h +++ b/trunk/include/asm-x86/ioctls.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IOCTLS_H -#define ASM_X86__IOCTLS_H +#ifndef _ASM_X86_IOCTLS_H +#define _ASM_X86_IOCTLS_H #include @@ -85,4 +85,4 @@ #define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ -#endif /* ASM_X86__IOCTLS_H */ +#endif diff --git a/trunk/include/asm-x86/iommu.h b/trunk/include/asm-x86/iommu.h index e86f44148c66..5f888cc5be49 100644 --- a/trunk/include/asm-x86/iommu.h +++ b/trunk/include/asm-x86/iommu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IOMMU_H -#define ASM_X86__IOMMU_H +#ifndef _ASM_X8664_IOMMU_H +#define _ASM_X8664_IOMMU_H 1 extern void pci_iommu_shutdown(void); extern void no_iommu_init(void); @@ -42,4 +42,4 @@ static inline void gart_iommu_hole_init(void) } #endif -#endif /* ASM_X86__IOMMU_H */ +#endif diff --git a/trunk/include/asm-x86/ipcbuf.h b/trunk/include/asm-x86/ipcbuf.h index 910304fbdc8f..ee678fd51594 100644 --- a/trunk/include/asm-x86/ipcbuf.h +++ b/trunk/include/asm-x86/ipcbuf.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IPCBUF_H -#define ASM_X86__IPCBUF_H +#ifndef _ASM_X86_IPCBUF_H +#define _ASM_X86_IPCBUF_H /* * The ipc64_perm structure for x86 architecture. @@ -25,4 +25,4 @@ struct ipc64_perm { unsigned long __unused2; }; -#endif /* ASM_X86__IPCBUF_H */ +#endif /* _ASM_X86_IPCBUF_H */ diff --git a/trunk/include/asm-x86/ipi.h b/trunk/include/asm-x86/ipi.h index 30a692cfaff8..bb1c09f7a76c 100644 --- a/trunk/include/asm-x86/ipi.h +++ b/trunk/include/asm-x86/ipi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IPI_H -#define ASM_X86__IPI_H +#ifndef __ASM_IPI_H +#define __ASM_IPI_H /* * Copyright 2004 James Cleverdon, IBM. @@ -49,12 +49,6 @@ static inline int __prepare_ICR2(unsigned int mask) return SET_APIC_DEST_FIELD(mask); } -static inline void __xapic_wait_icr_idle(void) -{ - while (native_apic_mem_read(APIC_ICR) & APIC_ICR_BUSY) - cpu_relax(); -} - static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, unsigned int dest) { @@ -70,7 +64,7 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, /* * Wait for idle. */ - __xapic_wait_icr_idle(); + apic_wait_icr_idle(); /* * No need to touch the target chip field @@ -80,7 +74,7 @@ static inline void __send_IPI_shortcut(unsigned int shortcut, int vector, /* * Send the IPI. The write to APIC_ICR fires this off. */ - native_apic_mem_write(APIC_ICR, cfg); + apic_write(APIC_ICR, cfg); } /* @@ -98,13 +92,13 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector, if (unlikely(vector == NMI_VECTOR)) safe_apic_wait_icr_idle(); else - __xapic_wait_icr_idle(); + apic_wait_icr_idle(); /* * prepare target chip field */ cfg = __prepare_ICR2(mask); - native_apic_mem_write(APIC_ICR2, cfg); + apic_write(APIC_ICR2, cfg); /* * program the ICR @@ -114,7 +108,7 @@ static inline void __send_IPI_dest_field(unsigned int mask, int vector, /* * Send the IPI. The write to APIC_ICR fires this off. */ - native_apic_mem_write(APIC_ICR, cfg); + apic_write(APIC_ICR, cfg); } static inline void send_IPI_mask_sequence(cpumask_t mask, int vector) @@ -135,4 +129,4 @@ static inline void send_IPI_mask_sequence(cpumask_t mask, int vector) local_irq_restore(flags); } -#endif /* ASM_X86__IPI_H */ +#endif /* __ASM_IPI_H */ diff --git a/trunk/include/asm-x86/irq.h b/trunk/include/asm-x86/irq.h index 1e5f2909c1db..1a2925757317 100644 --- a/trunk/include/asm-x86/irq.h +++ b/trunk/include/asm-x86/irq.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IRQ_H -#define ASM_X86__IRQ_H +#ifndef _ASM_IRQ_H +#define _ASM_IRQ_H /* * (C) 1992, 1993 Linus Torvalds, (C) 1997 Ingo Molnar * @@ -47,4 +47,4 @@ extern void native_init_IRQ(void); /* Interrupt vector management */ extern DECLARE_BITMAP(used_vectors, NR_VECTORS); -#endif /* ASM_X86__IRQ_H */ +#endif /* _ASM_IRQ_H */ diff --git a/trunk/include/asm-x86/irq_regs_32.h b/trunk/include/asm-x86/irq_regs_32.h index 316a3b258871..3368b20c0b48 100644 --- a/trunk/include/asm-x86/irq_regs_32.h +++ b/trunk/include/asm-x86/irq_regs_32.h @@ -4,8 +4,8 @@ * * Jeremy Fitzhardinge */ -#ifndef ASM_X86__IRQ_REGS_32_H -#define ASM_X86__IRQ_REGS_32_H +#ifndef _ASM_I386_IRQ_REGS_H +#define _ASM_I386_IRQ_REGS_H #include @@ -26,4 +26,4 @@ static inline struct pt_regs *set_irq_regs(struct pt_regs *new_regs) return old_regs; } -#endif /* ASM_X86__IRQ_REGS_32_H */ +#endif /* _ASM_I386_IRQ_REGS_H */ diff --git a/trunk/include/asm-x86/irq_remapping.h b/trunk/include/asm-x86/irq_remapping.h deleted file mode 100644 index 78242c6ffa58..000000000000 --- a/trunk/include/asm-x86/irq_remapping.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _ASM_IRQ_REMAPPING_H -#define _ASM_IRQ_REMAPPING_H - -extern int x2apic; - -#define IRTE_DEST(dest) ((x2apic) ? dest : dest << 8) - -#endif diff --git a/trunk/include/asm-x86/irq_vectors.h b/trunk/include/asm-x86/irq_vectors.h index c5d2d767a1f3..a48c7f2dbdc0 100644 --- a/trunk/include/asm-x86/irq_vectors.h +++ b/trunk/include/asm-x86/irq_vectors.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IRQ_VECTORS_H -#define ASM_X86__IRQ_VECTORS_H +#ifndef _ASM_IRQ_VECTORS_H +#define _ASM_IRQ_VECTORS_H #include @@ -179,4 +179,4 @@ #define VIC_CPU_BOOT_ERRATA_CPI (VIC_CPI_LEVEL0 + 8) -#endif /* ASM_X86__IRQ_VECTORS_H */ +#endif /* _ASM_IRQ_VECTORS_H */ diff --git a/trunk/include/asm-x86/ist.h b/trunk/include/asm-x86/ist.h index 35a2fe9bc921..6ec6ceed95a7 100644 --- a/trunk/include/asm-x86/ist.h +++ b/trunk/include/asm-x86/ist.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__IST_H -#define ASM_X86__IST_H +#ifndef _ASM_IST_H +#define _ASM_IST_H /* * Include file for the interface to IST BIOS @@ -31,4 +31,4 @@ struct ist_info { extern struct ist_info ist_info; #endif /* __KERNEL__ */ -#endif /* ASM_X86__IST_H */ +#endif /* _ASM_IST_H */ diff --git a/trunk/include/asm-x86/k8.h b/trunk/include/asm-x86/k8.h index 2bbaf4370a55..452e2b696ff4 100644 --- a/trunk/include/asm-x86/k8.h +++ b/trunk/include/asm-x86/k8.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__K8_H -#define ASM_X86__K8_H +#ifndef _ASM_K8_H +#define _ASM_K8_H 1 #include @@ -12,4 +12,4 @@ extern int cache_k8_northbridges(void); extern void k8_flush_garts(void); extern int k8_scan_nodes(unsigned long start, unsigned long end); -#endif /* ASM_X86__K8_H */ +#endif diff --git a/trunk/include/asm-x86/kdebug.h b/trunk/include/asm-x86/kdebug.h index 5ec3ad3e825c..96651bb59ba1 100644 --- a/trunk/include/asm-x86/kdebug.h +++ b/trunk/include/asm-x86/kdebug.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KDEBUG_H -#define ASM_X86__KDEBUG_H +#ifndef _ASM_X86_KDEBUG_H +#define _ASM_X86_KDEBUG_H #include @@ -35,4 +35,4 @@ extern void show_regs(struct pt_regs *regs); extern unsigned long oops_begin(void); extern void oops_end(unsigned long, struct pt_regs *, int signr); -#endif /* ASM_X86__KDEBUG_H */ +#endif diff --git a/trunk/include/asm-x86/kexec.h b/trunk/include/asm-x86/kexec.h index ea09600d6129..4246ab7dc988 100644 --- a/trunk/include/asm-x86/kexec.h +++ b/trunk/include/asm-x86/kexec.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KEXEC_H -#define ASM_X86__KEXEC_H +#ifndef _KEXEC_H +#define _KEXEC_H #ifdef CONFIG_X86_32 # define PA_CONTROL_PAGE 0 @@ -172,4 +172,4 @@ relocate_kernel(unsigned long indirection_page, #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__KEXEC_H */ +#endif /* _KEXEC_H */ diff --git a/trunk/include/asm-x86/kgdb.h b/trunk/include/asm-x86/kgdb.h index 83a7ee228ab1..484c47554f3b 100644 --- a/trunk/include/asm-x86/kgdb.h +++ b/trunk/include/asm-x86/kgdb.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KGDB_H -#define ASM_X86__KGDB_H +#ifndef _ASM_KGDB_H_ +#define _ASM_KGDB_H_ /* * Copyright (C) 2001-2004 Amit S. Kale @@ -78,4 +78,4 @@ static inline void arch_kgdb_breakpoint(void) #define BREAK_INSTR_SIZE 1 #define CACHE_FLUSH_IS_SAFE 1 -#endif /* ASM_X86__KGDB_H */ +#endif /* _ASM_KGDB_H_ */ diff --git a/trunk/include/asm-x86/kmap_types.h b/trunk/include/asm-x86/kmap_types.h index 89f44493e643..5f4174132a22 100644 --- a/trunk/include/asm-x86/kmap_types.h +++ b/trunk/include/asm-x86/kmap_types.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KMAP_TYPES_H -#define ASM_X86__KMAP_TYPES_H +#ifndef _ASM_X86_KMAP_TYPES_H +#define _ASM_X86_KMAP_TYPES_H #if defined(CONFIG_X86_32) && defined(CONFIG_DEBUG_HIGHMEM) # define D(n) __KM_FENCE_##n , @@ -26,4 +26,4 @@ D(13) KM_TYPE_NR #undef D -#endif /* ASM_X86__KMAP_TYPES_H */ +#endif diff --git a/trunk/include/asm-x86/kprobes.h b/trunk/include/asm-x86/kprobes.h index bd8407863c13..54980b0b3892 100644 --- a/trunk/include/asm-x86/kprobes.h +++ b/trunk/include/asm-x86/kprobes.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KPROBES_H -#define ASM_X86__KPROBES_H +#ifndef _ASM_KPROBES_H +#define _ASM_KPROBES_H /* * Kernel Probes (KProbes) * @@ -94,4 +94,4 @@ static inline void restore_interrupts(struct pt_regs *regs) extern int kprobe_fault_handler(struct pt_regs *regs, int trapnr); extern int kprobe_exceptions_notify(struct notifier_block *self, unsigned long val, void *data); -#endif /* ASM_X86__KPROBES_H */ +#endif /* _ASM_KPROBES_H */ diff --git a/trunk/include/asm-x86/kvm.h b/trunk/include/asm-x86/kvm.h index 78e954db1e7f..6f1840812e59 100644 --- a/trunk/include/asm-x86/kvm.h +++ b/trunk/include/asm-x86/kvm.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KVM_H -#define ASM_X86__KVM_H +#ifndef __LINUX_KVM_X86_H +#define __LINUX_KVM_X86_H /* * KVM x86 specific structures and definitions @@ -230,4 +230,4 @@ struct kvm_pit_state { #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) #define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) -#endif /* ASM_X86__KVM_H */ +#endif diff --git a/trunk/include/asm-x86/kvm_host.h b/trunk/include/asm-x86/kvm_host.h index 69794547f514..c2e34c275900 100644 --- a/trunk/include/asm-x86/kvm_host.h +++ b/trunk/include/asm-x86/kvm_host.h @@ -1,4 +1,4 @@ -/* +#/* * Kernel-based Virtual Machine driver for Linux * * This header defines architecture specific interfaces, x86 version @@ -8,8 +8,8 @@ * */ -#ifndef ASM_X86__KVM_HOST_H -#define ASM_X86__KVM_HOST_H +#ifndef ASM_KVM_HOST_H +#define ASM_KVM_HOST_H #include #include @@ -735,4 +735,4 @@ asmlinkage void kvm_handle_fault_on_reboot(void); int kvm_unmap_hva(struct kvm *kvm, unsigned long hva); int kvm_age_hva(struct kvm *kvm, unsigned long hva); -#endif /* ASM_X86__KVM_HOST_H */ +#endif diff --git a/trunk/include/asm-x86/kvm_para.h b/trunk/include/asm-x86/kvm_para.h index 30054fded4fb..76f392146daa 100644 --- a/trunk/include/asm-x86/kvm_para.h +++ b/trunk/include/asm-x86/kvm_para.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__KVM_PARA_H -#define ASM_X86__KVM_PARA_H +#ifndef __X86_KVM_PARA_H +#define __X86_KVM_PARA_H /* This CPUID returns the signature 'KVMKVMKVM' in ebx, ecx, and edx. It * should be used to determine that a VM is running under KVM. @@ -144,4 +144,4 @@ static inline unsigned int kvm_arch_para_features(void) #endif -#endif /* ASM_X86__KVM_PARA_H */ +#endif diff --git a/trunk/include/asm-x86/kvm_x86_emulate.h b/trunk/include/asm-x86/kvm_x86_emulate.h index e2d9b030c1ac..4e8c1e48d91d 100644 --- a/trunk/include/asm-x86/kvm_x86_emulate.h +++ b/trunk/include/asm-x86/kvm_x86_emulate.h @@ -8,8 +8,8 @@ * From: xen-unstable 10676:af9809f51f81a3c43f276f00c81a52ef558afda4 */ -#ifndef ASM_X86__KVM_X86_EMULATE_H -#define ASM_X86__KVM_X86_EMULATE_H +#ifndef __X86_EMULATE_H__ +#define __X86_EMULATE_H__ struct x86_emulate_ctxt; @@ -181,4 +181,4 @@ int x86_decode_insn(struct x86_emulate_ctxt *ctxt, int x86_emulate_insn(struct x86_emulate_ctxt *ctxt, struct x86_emulate_ops *ops); -#endif /* ASM_X86__KVM_X86_EMULATE_H */ +#endif /* __X86_EMULATE_H__ */ diff --git a/trunk/include/asm-x86/ldt.h b/trunk/include/asm-x86/ldt.h index a5228504d867..20c597242b53 100644 --- a/trunk/include/asm-x86/ldt.h +++ b/trunk/include/asm-x86/ldt.h @@ -3,8 +3,8 @@ * * Definitions of structures used with the modify_ldt system call. */ -#ifndef ASM_X86__LDT_H -#define ASM_X86__LDT_H +#ifndef _ASM_X86_LDT_H +#define _ASM_X86_LDT_H /* Maximum number of LDT entries supported. */ #define LDT_ENTRIES 8192 @@ -37,4 +37,4 @@ struct user_desc { #define MODIFY_LDT_CONTENTS_CODE 2 #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__LDT_H */ +#endif diff --git a/trunk/include/asm-x86/lguest.h b/trunk/include/asm-x86/lguest.h index 7505e947ed27..be4a7247fa2b 100644 --- a/trunk/include/asm-x86/lguest.h +++ b/trunk/include/asm-x86/lguest.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__LGUEST_H -#define ASM_X86__LGUEST_H +#ifndef _X86_LGUEST_H +#define _X86_LGUEST_H #define GDT_ENTRY_LGUEST_CS 10 #define GDT_ENTRY_LGUEST_DS 11 @@ -91,4 +91,4 @@ static inline void lguest_set_ts(void) #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__LGUEST_H */ +#endif diff --git a/trunk/include/asm-x86/lguest_hcall.h b/trunk/include/asm-x86/lguest_hcall.h index 8f034ba4b53e..a3241f28e34a 100644 --- a/trunk/include/asm-x86/lguest_hcall.h +++ b/trunk/include/asm-x86/lguest_hcall.h @@ -1,6 +1,6 @@ /* Architecture specific portion of the lguest hypercalls */ -#ifndef ASM_X86__LGUEST_HCALL_H -#define ASM_X86__LGUEST_HCALL_H +#ifndef _X86_LGUEST_HCALL_H +#define _X86_LGUEST_HCALL_H #define LHCALL_FLUSH_ASYNC 0 #define LHCALL_LGUEST_INIT 1 @@ -68,4 +68,4 @@ struct hcall_args { }; #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__LGUEST_HCALL_H */ +#endif /* _I386_LGUEST_HCALL_H */ diff --git a/trunk/include/asm-x86/linkage.h b/trunk/include/asm-x86/linkage.h index 42d8b62ee8ab..64e444f8e85b 100644 --- a/trunk/include/asm-x86/linkage.h +++ b/trunk/include/asm-x86/linkage.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__LINKAGE_H -#define ASM_X86__LINKAGE_H +#ifndef __ASM_LINKAGE_H +#define __ASM_LINKAGE_H #undef notrace #define notrace __attribute__((no_instrument_function)) @@ -57,5 +57,5 @@ #define __ALIGN_STR ".align 16,0x90" #endif -#endif /* ASM_X86__LINKAGE_H */ +#endif diff --git a/trunk/include/asm-x86/local.h b/trunk/include/asm-x86/local.h index ae91994fd6c9..330a72496abd 100644 --- a/trunk/include/asm-x86/local.h +++ b/trunk/include/asm-x86/local.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__LOCAL_H -#define ASM_X86__LOCAL_H +#ifndef _ARCH_LOCAL_H +#define _ARCH_LOCAL_H #include @@ -232,4 +232,4 @@ static inline long local_sub_return(long i, local_t *l) #define __cpu_local_add(i, l) cpu_local_add((i), (l)) #define __cpu_local_sub(i, l) cpu_local_sub((i), (l)) -#endif /* ASM_X86__LOCAL_H */ +#endif /* _ARCH_LOCAL_H */ diff --git a/trunk/include/asm-x86/bigsmp/apic.h b/trunk/include/asm-x86/mach-bigsmp/mach_apic.h similarity index 98% rename from trunk/include/asm-x86/bigsmp/apic.h rename to trunk/include/asm-x86/mach-bigsmp/mach_apic.h index 0a9cd7c5ca0c..c3b9dc6970c9 100644 --- a/trunk/include/asm-x86/bigsmp/apic.h +++ b/trunk/include/asm-x86/mach-bigsmp/mach_apic.h @@ -11,7 +11,7 @@ static inline int apic_id_registered(void) /* Round robin the irqs amoung the online cpus */ static inline cpumask_t target_cpus(void) -{ +{ static unsigned long cpu = NR_CPUS; do { if (cpu >= NR_CPUS) @@ -23,7 +23,7 @@ static inline cpumask_t target_cpus(void) } #undef APIC_DEST_LOGICAL -#define APIC_DEST_LOGICAL 0 +#define APIC_DEST_LOGICAL 0 #define TARGET_CPUS (target_cpus()) #define APIC_DFR_VALUE (APIC_DFR_FLAT) #define INT_DELIVERY_MODE (dest_Fixed) diff --git a/trunk/include/asm-x86/bigsmp/apicdef.h b/trunk/include/asm-x86/mach-bigsmp/mach_apicdef.h similarity index 74% rename from trunk/include/asm-x86/bigsmp/apicdef.h rename to trunk/include/asm-x86/mach-bigsmp/mach_apicdef.h index 392c3f5ef2fe..a58ab5a75c8c 100644 --- a/trunk/include/asm-x86/bigsmp/apicdef.h +++ b/trunk/include/asm-x86/mach-bigsmp/mach_apicdef.h @@ -3,10 +3,10 @@ #define APIC_ID_MASK (0xFF<<24) -static inline unsigned get_apic_id(unsigned long x) -{ +static inline unsigned get_apic_id(unsigned long x) +{ return (((x)>>24)&0xFF); -} +} #define GET_APIC_ID(x) get_apic_id(x) diff --git a/trunk/include/asm-x86/bigsmp/ipi.h b/trunk/include/asm-x86/mach-bigsmp/mach_ipi.h similarity index 100% rename from trunk/include/asm-x86/bigsmp/ipi.h rename to trunk/include/asm-x86/mach-bigsmp/mach_ipi.h diff --git a/trunk/include/asm-x86/mach-default/apm.h b/trunk/include/asm-x86/mach-default/apm.h index 2aa61b54fbd5..989f34c37d32 100644 --- a/trunk/include/asm-x86/mach-default/apm.h +++ b/trunk/include/asm-x86/mach-default/apm.h @@ -3,8 +3,8 @@ * Split out from apm.c by Osamu Tomita */ -#ifndef ASM_X86__MACH_DEFAULT__APM_H -#define ASM_X86__MACH_DEFAULT__APM_H +#ifndef _ASM_APM_H +#define _ASM_APM_H #ifdef APM_ZERO_SEGS # define APM_DO_ZERO_SEGS \ @@ -70,4 +70,4 @@ static inline u8 apm_bios_call_simple_asm(u32 func, u32 ebx_in, return error; } -#endif /* ASM_X86__MACH_DEFAULT__APM_H */ +#endif /* _ASM_APM_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_apic.h b/trunk/include/asm-x86/mach-default/mach_apic.h index 2a330a41b3dd..f3226b9a6b82 100644 --- a/trunk/include/asm-x86/mach-default/mach_apic.h +++ b/trunk/include/asm-x86/mach-default/mach_apic.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_APIC_H -#define ASM_X86__MACH_DEFAULT__MACH_APIC_H +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H #ifdef CONFIG_X86_LOCAL_APIC @@ -30,8 +30,6 @@ static inline cpumask_t target_cpus(void) #define cpu_mask_to_apicid (genapic->cpu_mask_to_apicid) #define phys_pkg_id (genapic->phys_pkg_id) #define vector_allocation_domain (genapic->vector_allocation_domain) -#define read_apic_id() (GET_APIC_ID(apic_read(APIC_ID))) -#define send_IPI_self (genapic->send_IPI_self) extern void setup_apic_routing(void); #else #define INT_DELIVERY_MODE dest_LowestPrio @@ -56,7 +54,7 @@ static inline void init_apic_ldr(void) static inline int apic_id_registered(void) { - return physid_isset(read_apic_id(), phys_cpu_present_map); + return physid_isset(GET_APIC_ID(read_apic_id()), phys_cpu_present_map); } static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) @@ -140,4 +138,4 @@ static inline void enable_apic_mode(void) } #endif /* CONFIG_X86_LOCAL_APIC */ -#endif /* ASM_X86__MACH_DEFAULT__MACH_APIC_H */ +#endif /* __ASM_MACH_APIC_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_apicdef.h b/trunk/include/asm-x86/mach-default/mach_apicdef.h index 0c2d41c41b20..e4b29ba37de6 100644 --- a/trunk/include/asm-x86/mach-default/mach_apicdef.h +++ b/trunk/include/asm-x86/mach-default/mach_apicdef.h @@ -1,12 +1,12 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_APICDEF_H -#define ASM_X86__MACH_DEFAULT__MACH_APICDEF_H +#ifndef __ASM_MACH_APICDEF_H +#define __ASM_MACH_APICDEF_H #include #ifdef CONFIG_X86_64 -#define APIC_ID_MASK (genapic->apic_id_mask) -#define GET_APIC_ID(x) (genapic->get_apic_id(x)) -#define SET_APIC_ID(x) (genapic->set_apic_id(x)) +#define APIC_ID_MASK (0xFFu<<24) +#define GET_APIC_ID(x) (((x)>>24)&0xFFu) +#define SET_APIC_ID(x) (((x)<<24)) #else #define APIC_ID_MASK (0xF<<24) static inline unsigned get_apic_id(unsigned long x) @@ -21,4 +21,4 @@ static inline unsigned get_apic_id(unsigned long x) #define GET_APIC_ID(x) get_apic_id(x) #endif -#endif /* ASM_X86__MACH_DEFAULT__MACH_APICDEF_H */ +#endif diff --git a/trunk/include/asm-x86/mach-default/mach_ipi.h b/trunk/include/asm-x86/mach-default/mach_ipi.h index 674bc7e50c35..be323364e68f 100644 --- a/trunk/include/asm-x86/mach-default/mach_ipi.h +++ b/trunk/include/asm-x86/mach-default/mach_ipi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_IPI_H -#define ASM_X86__MACH_DEFAULT__MACH_IPI_H +#ifndef __ASM_MACH_IPI_H +#define __ASM_MACH_IPI_H /* Avoid include hell */ #define NMI_VECTOR 0x02 @@ -61,4 +61,4 @@ static inline void send_IPI_all(int vector) } #endif -#endif /* ASM_X86__MACH_DEFAULT__MACH_IPI_H */ +#endif /* __ASM_MACH_IPI_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_mpparse.h b/trunk/include/asm-x86/mach-default/mach_mpparse.h index 9c381f2815ac..d14108505bb8 100644 --- a/trunk/include/asm-x86/mach-default/mach_mpparse.h +++ b/trunk/include/asm-x86/mach-default/mach_mpparse.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H -#define ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) @@ -14,4 +14,4 @@ static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) } -#endif /* ASM_X86__MACH_DEFAULT__MACH_MPPARSE_H */ +#endif /* __ASM_MACH_MPPARSE_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_mpspec.h b/trunk/include/asm-x86/mach-default/mach_mpspec.h index d77646f011f1..51c9a9775932 100644 --- a/trunk/include/asm-x86/mach-default/mach_mpspec.h +++ b/trunk/include/asm-x86/mach-default/mach_mpspec.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H -#define ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H +#ifndef __ASM_MACH_MPSPEC_H +#define __ASM_MACH_MPSPEC_H #define MAX_IRQ_SOURCES 256 @@ -9,4 +9,4 @@ #define MAX_MP_BUSSES 32 #endif -#endif /* ASM_X86__MACH_DEFAULT__MACH_MPSPEC_H */ +#endif /* __ASM_MACH_MPSPEC_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_timer.h b/trunk/include/asm-x86/mach-default/mach_timer.h index 990b15833834..4b76e536cd98 100644 --- a/trunk/include/asm-x86/mach-default/mach_timer.h +++ b/trunk/include/asm-x86/mach-default/mach_timer.h @@ -10,8 +10,8 @@ * directly because of the awkward 8-bit access mechanism of the 82C54 * device. */ -#ifndef ASM_X86__MACH_DEFAULT__MACH_TIMER_H -#define ASM_X86__MACH_DEFAULT__MACH_TIMER_H +#ifndef _MACH_TIMER_H +#define _MACH_TIMER_H #define CALIBRATE_TIME_MSEC 30 /* 30 msecs */ #define CALIBRATE_LATCH \ @@ -45,4 +45,4 @@ static inline void mach_countup(unsigned long *count_p) *count_p = count; } -#endif /* ASM_X86__MACH_DEFAULT__MACH_TIMER_H */ +#endif /* !_MACH_TIMER_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_traps.h b/trunk/include/asm-x86/mach-default/mach_traps.h index de9ac3f5c4ce..2fe7705c0484 100644 --- a/trunk/include/asm-x86/mach-default/mach_traps.h +++ b/trunk/include/asm-x86/mach-default/mach_traps.h @@ -2,8 +2,8 @@ * Machine specific NMI handling for generic. * Split out from traps.c by Osamu Tomita */ -#ifndef ASM_X86__MACH_DEFAULT__MACH_TRAPS_H -#define ASM_X86__MACH_DEFAULT__MACH_TRAPS_H +#ifndef _MACH_TRAPS_H +#define _MACH_TRAPS_H #include @@ -36,4 +36,4 @@ static inline void reassert_nmi(void) unlock_cmos(); } -#endif /* ASM_X86__MACH_DEFAULT__MACH_TRAPS_H */ +#endif /* !_MACH_TRAPS_H */ diff --git a/trunk/include/asm-x86/mach-default/mach_wakecpu.h b/trunk/include/asm-x86/mach-default/mach_wakecpu.h index 361b810f5160..3ebb17893aa5 100644 --- a/trunk/include/asm-x86/mach-default/mach_wakecpu.h +++ b/trunk/include/asm-x86/mach-default/mach_wakecpu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H -#define ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H +#ifndef __ASM_MACH_WAKECPU_H +#define __ASM_MACH_WAKECPU_H /* * This file copes with machines that wakeup secondary CPUs by the @@ -39,4 +39,4 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) #define inquire_remote_apic(apicid) {} #endif -#endif /* ASM_X86__MACH_DEFAULT__MACH_WAKECPU_H */ +#endif /* __ASM_MACH_WAKECPU_H */ diff --git a/trunk/include/asm-x86/es7000/apic.h b/trunk/include/asm-x86/mach-es7000/mach_apic.h similarity index 92% rename from trunk/include/asm-x86/es7000/apic.h rename to trunk/include/asm-x86/mach-es7000/mach_apic.h index bd2c44d1f7ac..0a3fdf930672 100644 --- a/trunk/include/asm-x86/es7000/apic.h +++ b/trunk/include/asm-x86/mach-es7000/mach_apic.h @@ -1,5 +1,5 @@ -#ifndef __ASM_ES7000_APIC_H -#define __ASM_ES7000_APIC_H +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H #define xapic_phys_to_log_apicid(cpu) per_cpu(x86_bios_cpu_apicid, cpu) #define esr_disable (1) @@ -10,7 +10,7 @@ static inline int apic_id_registered(void) } static inline cpumask_t target_cpus(void) -{ +{ #if defined CONFIG_ES7000_CLUSTERED_APIC return CPU_MASK_ALL; #else @@ -23,24 +23,24 @@ static inline cpumask_t target_cpus(void) #define APIC_DFR_VALUE (APIC_DFR_CLUSTER) #define INT_DELIVERY_MODE (dest_LowestPrio) #define INT_DEST_MODE (1) /* logical delivery broadcast to all procs */ -#define NO_BALANCE_IRQ (1) +#define NO_BALANCE_IRQ (1) #undef WAKE_SECONDARY_VIA_INIT #define WAKE_SECONDARY_VIA_MIP #else #define APIC_DFR_VALUE (APIC_DFR_FLAT) #define INT_DELIVERY_MODE (dest_Fixed) #define INT_DEST_MODE (0) /* phys delivery to target procs */ -#define NO_BALANCE_IRQ (0) +#define NO_BALANCE_IRQ (0) #undef APIC_DEST_LOGICAL #define APIC_DEST_LOGICAL 0x0 #define WAKE_SECONDARY_VIA_INIT #endif static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) -{ +{ return 0; -} -static inline unsigned long check_apicid_present(int bit) +} +static inline unsigned long check_apicid_present(int bit) { return physid_isset(bit, phys_cpu_present_map); } @@ -80,7 +80,7 @@ static inline void setup_apic_routing(void) { int apic = per_cpu(x86_bios_cpu_apicid, smp_processor_id()); printk("Enabling APIC mode: %s. Using %d I/O APICs, target cpus %lx\n", - (apic_version[apic] == 0x14) ? + (apic_version[apic] == 0x14) ? "Physical Cluster" : "Logical Cluster", nr_ioapics, cpus_addr(TARGET_CPUS)[0]); } @@ -141,7 +141,7 @@ static inline void setup_portio_remap(void) extern unsigned int boot_cpu_physical_apicid; static inline int check_phys_apicid_present(int cpu_physical_apicid) { - boot_cpu_physical_apicid = read_apic_id(); + boot_cpu_physical_apicid = GET_APIC_ID(read_apic_id()); return (1); } @@ -150,7 +150,7 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) int num_bits_set; int cpus_found = 0; int cpu; - int apicid; + int apicid; num_bits_set = cpus_weight(cpumask); /* Return id to all */ @@ -160,16 +160,16 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) #else return cpu_to_logical_apicid(0); #endif - /* - * The cpus in the mask must all be on the apic cluster. If are not - * on the same apicid cluster return default value of TARGET_CPUS. + /* + * The cpus in the mask must all be on the apic cluster. If are not + * on the same apicid cluster return default value of TARGET_CPUS. */ cpu = first_cpu(cpumask); apicid = cpu_to_logical_apicid(cpu); while (cpus_found < num_bits_set) { if (cpu_isset(cpu, cpumask)) { int new_apicid = cpu_to_logical_apicid(cpu); - if (apicid_cluster(apicid) != + if (apicid_cluster(apicid) != apicid_cluster(new_apicid)){ printk ("%s: Not a valid mask!\n",__FUNCTION__); #if defined CONFIG_ES7000_CLUSTERED_APIC @@ -191,4 +191,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) return cpuid_apic >> index_msb; } -#endif /* __ASM_ES7000_APIC_H */ +#endif /* __ASM_MACH_APIC_H */ diff --git a/trunk/include/asm-x86/mach-es7000/mach_apicdef.h b/trunk/include/asm-x86/mach-es7000/mach_apicdef.h new file mode 100644 index 000000000000..a58ab5a75c8c --- /dev/null +++ b/trunk/include/asm-x86/mach-es7000/mach_apicdef.h @@ -0,0 +1,13 @@ +#ifndef __ASM_MACH_APICDEF_H +#define __ASM_MACH_APICDEF_H + +#define APIC_ID_MASK (0xFF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0xFF); +} + +#define GET_APIC_ID(x) get_apic_id(x) + +#endif diff --git a/trunk/include/asm-x86/es7000/ipi.h b/trunk/include/asm-x86/mach-es7000/mach_ipi.h similarity index 83% rename from trunk/include/asm-x86/es7000/ipi.h rename to trunk/include/asm-x86/mach-es7000/mach_ipi.h index 632a955fcc0a..5e61bd220b06 100644 --- a/trunk/include/asm-x86/es7000/ipi.h +++ b/trunk/include/asm-x86/mach-es7000/mach_ipi.h @@ -1,5 +1,5 @@ -#ifndef __ASM_ES7000_IPI_H -#define __ASM_ES7000_IPI_H +#ifndef __ASM_MACH_IPI_H +#define __ASM_MACH_IPI_H void send_IPI_mask_sequence(cpumask_t mask, int vector); @@ -21,4 +21,4 @@ static inline void send_IPI_all(int vector) send_IPI_mask(cpu_online_map, vector); } -#endif /* __ASM_ES7000_IPI_H */ +#endif /* __ASM_MACH_IPI_H */ diff --git a/trunk/include/asm-x86/es7000/mpparse.h b/trunk/include/asm-x86/mach-es7000/mach_mpparse.h similarity index 91% rename from trunk/include/asm-x86/es7000/mpparse.h rename to trunk/include/asm-x86/mach-es7000/mach_mpparse.h index 7b5c889d8e7d..ef26d3523625 100644 --- a/trunk/include/asm-x86/es7000/mpparse.h +++ b/trunk/include/asm-x86/mach-es7000/mach_mpparse.h @@ -1,5 +1,5 @@ -#ifndef __ASM_ES7000_MPPARSE_H -#define __ASM_ES7000_MPPARSE_H +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H #include diff --git a/trunk/include/asm-x86/es7000/wakecpu.h b/trunk/include/asm-x86/mach-es7000/mach_wakecpu.h similarity index 95% rename from trunk/include/asm-x86/es7000/wakecpu.h rename to trunk/include/asm-x86/mach-es7000/mach_wakecpu.h index 3ffc5a7bf667..84ff58314501 100644 --- a/trunk/include/asm-x86/es7000/wakecpu.h +++ b/trunk/include/asm-x86/mach-es7000/mach_wakecpu.h @@ -1,7 +1,7 @@ -#ifndef __ASM_ES7000_WAKECPU_H -#define __ASM_ES7000_WAKECPU_H +#ifndef __ASM_MACH_WAKECPU_H +#define __ASM_MACH_WAKECPU_H -/* +/* * This file copes with machines that wakeup secondary CPUs by the * INIT, INIT, STARTUP sequence. */ diff --git a/trunk/include/asm-x86/mach-generic/gpio.h b/trunk/include/asm-x86/mach-generic/gpio.h index 6ce0f7786ef8..5305dcb96df2 100644 --- a/trunk/include/asm-x86/mach-generic/gpio.h +++ b/trunk/include/asm-x86/mach-generic/gpio.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__GPIO_H -#define ASM_X86__MACH_GENERIC__GPIO_H +#ifndef __ASM_MACH_GENERIC_GPIO_H +#define __ASM_MACH_GENERIC_GPIO_H int gpio_request(unsigned gpio, const char *label); void gpio_free(unsigned gpio); @@ -12,4 +12,4 @@ int irq_to_gpio(unsigned irq); #include /* cansleep wrappers */ -#endif /* ASM_X86__MACH_GENERIC__GPIO_H */ +#endif /* __ASM_MACH_GENERIC_GPIO_H */ diff --git a/trunk/include/asm-x86/mach-generic/irq_vectors_limits.h b/trunk/include/asm-x86/mach-generic/irq_vectors_limits.h index f7870e1a220d..890ce3f5e09a 100644 --- a/trunk/include/asm-x86/mach-generic/irq_vectors_limits.h +++ b/trunk/include/asm-x86/mach-generic/irq_vectors_limits.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H -#define ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H +#ifndef _ASM_IRQ_VECTORS_LIMITS_H +#define _ASM_IRQ_VECTORS_LIMITS_H /* * For Summit or generic (i.e. installer) kernels, we have lots of I/O APICs, @@ -11,4 +11,4 @@ #define NR_IRQS 224 #define NR_IRQ_VECTORS 1024 -#endif /* ASM_X86__MACH_GENERIC__IRQ_VECTORS_LIMITS_H */ +#endif /* _ASM_IRQ_VECTORS_LIMITS_H */ diff --git a/trunk/include/asm-x86/mach-generic/mach_apic.h b/trunk/include/asm-x86/mach-generic/mach_apic.h index 5d010c6881dd..6eff343e1233 100644 --- a/trunk/include/asm-x86/mach-generic/mach_apic.h +++ b/trunk/include/asm-x86/mach-generic/mach_apic.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__MACH_APIC_H -#define ASM_X86__MACH_GENERIC__MACH_APIC_H +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H #include @@ -29,4 +29,4 @@ extern void generic_bigsmp_probe(void); -#endif /* ASM_X86__MACH_GENERIC__MACH_APIC_H */ +#endif /* __ASM_MACH_APIC_H */ diff --git a/trunk/include/asm-x86/mach-generic/mach_apicdef.h b/trunk/include/asm-x86/mach-generic/mach_apicdef.h index 1657f38b8f27..28ed98972ca8 100644 --- a/trunk/include/asm-x86/mach-generic/mach_apicdef.h +++ b/trunk/include/asm-x86/mach-generic/mach_apicdef.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__MACH_APICDEF_H -#define ASM_X86__MACH_GENERIC__MACH_APICDEF_H +#ifndef _GENAPIC_MACH_APICDEF_H +#define _GENAPIC_MACH_APICDEF_H 1 #ifndef APIC_DEFINITION #include @@ -8,4 +8,4 @@ #define APIC_ID_MASK (genapic->apic_id_mask) #endif -#endif /* ASM_X86__MACH_GENERIC__MACH_APICDEF_H */ +#endif diff --git a/trunk/include/asm-x86/mach-generic/mach_ipi.h b/trunk/include/asm-x86/mach-generic/mach_ipi.h index f67433dbd65f..441b0fe3ed1d 100644 --- a/trunk/include/asm-x86/mach-generic/mach_ipi.h +++ b/trunk/include/asm-x86/mach-generic/mach_ipi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__MACH_IPI_H -#define ASM_X86__MACH_GENERIC__MACH_IPI_H +#ifndef _MACH_IPI_H +#define _MACH_IPI_H 1 #include @@ -7,4 +7,4 @@ #define send_IPI_allbutself (genapic->send_IPI_allbutself) #define send_IPI_all (genapic->send_IPI_all) -#endif /* ASM_X86__MACH_GENERIC__MACH_IPI_H */ +#endif diff --git a/trunk/include/asm-x86/mach-generic/mach_mpparse.h b/trunk/include/asm-x86/mach-generic/mach_mpparse.h index 3115564e557c..586cadbf3787 100644 --- a/trunk/include/asm-x86/mach-generic/mach_mpparse.h +++ b/trunk/include/asm-x86/mach-generic/mach_mpparse.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__MACH_MPPARSE_H -#define ASM_X86__MACH_GENERIC__MACH_MPPARSE_H +#ifndef _MACH_MPPARSE_H +#define _MACH_MPPARSE_H 1 extern int mps_oem_check(struct mp_config_table *mpc, char *oem, @@ -7,4 +7,4 @@ extern int mps_oem_check(struct mp_config_table *mpc, char *oem, extern int acpi_madt_oem_check(char *oem_id, char *oem_table_id); -#endif /* ASM_X86__MACH_GENERIC__MACH_MPPARSE_H */ +#endif diff --git a/trunk/include/asm-x86/mach-generic/mach_mpspec.h b/trunk/include/asm-x86/mach-generic/mach_mpspec.h index 6061b153613e..c83c120be538 100644 --- a/trunk/include/asm-x86/mach-generic/mach_mpspec.h +++ b/trunk/include/asm-x86/mach-generic/mach_mpspec.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_GENERIC__MACH_MPSPEC_H -#define ASM_X86__MACH_GENERIC__MACH_MPSPEC_H +#ifndef __ASM_MACH_MPSPEC_H +#define __ASM_MACH_MPSPEC_H #define MAX_IRQ_SOURCES 256 @@ -9,4 +9,4 @@ extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid); -#endif /* ASM_X86__MACH_GENERIC__MACH_MPSPEC_H */ +#endif /* __ASM_MACH_MPSPEC_H */ diff --git a/trunk/include/asm-x86/numaq/apic.h b/trunk/include/asm-x86/mach-numaq/mach_apic.h similarity index 97% rename from trunk/include/asm-x86/numaq/apic.h rename to trunk/include/asm-x86/mach-numaq/mach_apic.h index a8344ba6ea15..d802465e026a 100644 --- a/trunk/include/asm-x86/numaq/apic.h +++ b/trunk/include/asm-x86/mach-numaq/mach_apic.h @@ -1,5 +1,5 @@ -#ifndef __ASM_NUMAQ_APIC_H -#define __ASM_NUMAQ_APIC_H +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H #include #include @@ -135,4 +135,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) return cpuid_apic >> index_msb; } -#endif /* __ASM_NUMAQ_APIC_H */ +#endif /* __ASM_MACH_APIC_H */ diff --git a/trunk/include/asm-x86/numaq/apicdef.h b/trunk/include/asm-x86/mach-numaq/mach_apicdef.h similarity index 75% rename from trunk/include/asm-x86/numaq/apicdef.h rename to trunk/include/asm-x86/mach-numaq/mach_apicdef.h index e012a46cc22a..bf439d0690f5 100644 --- a/trunk/include/asm-x86/numaq/apicdef.h +++ b/trunk/include/asm-x86/mach-numaq/mach_apicdef.h @@ -1,5 +1,5 @@ -#ifndef __ASM_NUMAQ_APICDEF_H -#define __ASM_NUMAQ_APICDEF_H +#ifndef __ASM_MACH_APICDEF_H +#define __ASM_MACH_APICDEF_H #define APIC_ID_MASK (0xF<<24) diff --git a/trunk/include/asm-x86/numaq/ipi.h b/trunk/include/asm-x86/mach-numaq/mach_ipi.h similarity index 83% rename from trunk/include/asm-x86/numaq/ipi.h rename to trunk/include/asm-x86/mach-numaq/mach_ipi.h index 935588d286cf..c6044488e9e6 100644 --- a/trunk/include/asm-x86/numaq/ipi.h +++ b/trunk/include/asm-x86/mach-numaq/mach_ipi.h @@ -1,5 +1,5 @@ -#ifndef __ASM_NUMAQ_IPI_H -#define __ASM_NUMAQ_IPI_H +#ifndef __ASM_MACH_IPI_H +#define __ASM_MACH_IPI_H void send_IPI_mask_sequence(cpumask_t, int vector); @@ -22,4 +22,4 @@ static inline void send_IPI_all(int vector) send_IPI_mask(cpu_online_map, vector); } -#endif /* __ASM_NUMAQ_IPI_H */ +#endif /* __ASM_MACH_IPI_H */ diff --git a/trunk/include/asm-x86/numaq/mpparse.h b/trunk/include/asm-x86/mach-numaq/mach_mpparse.h similarity index 50% rename from trunk/include/asm-x86/numaq/mpparse.h rename to trunk/include/asm-x86/mach-numaq/mach_mpparse.h index 252292e077b6..626aef6b155f 100644 --- a/trunk/include/asm-x86/numaq/mpparse.h +++ b/trunk/include/asm-x86/mach-numaq/mach_mpparse.h @@ -1,7 +1,7 @@ -#ifndef __ASM_NUMAQ_MPPARSE_H -#define __ASM_NUMAQ_MPPARSE_H +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H extern void numaq_mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid); -#endif /* __ASM_NUMAQ_MPPARSE_H */ +#endif /* __ASM_MACH_MPPARSE_H */ diff --git a/trunk/include/asm-x86/numaq/wakecpu.h b/trunk/include/asm-x86/mach-numaq/mach_wakecpu.h similarity index 91% rename from trunk/include/asm-x86/numaq/wakecpu.h rename to trunk/include/asm-x86/mach-numaq/mach_wakecpu.h index c577bda5b1c5..00530041a991 100644 --- a/trunk/include/asm-x86/numaq/wakecpu.h +++ b/trunk/include/asm-x86/mach-numaq/mach_wakecpu.h @@ -1,5 +1,5 @@ -#ifndef __ASM_NUMAQ_WAKECPU_H -#define __ASM_NUMAQ_WAKECPU_H +#ifndef __ASM_MACH_WAKECPU_H +#define __ASM_MACH_WAKECPU_H /* This file copes with machines that wakeup secondary CPUs by NMIs */ @@ -40,4 +40,4 @@ static inline void restore_NMI_vector(unsigned short *high, unsigned short *low) #define inquire_remote_apic(apicid) {} -#endif /* __ASM_NUMAQ_WAKECPU_H */ +#endif /* __ASM_MACH_WAKECPU_H */ diff --git a/trunk/include/asm-x86/mach-rdc321x/gpio.h b/trunk/include/asm-x86/mach-rdc321x/gpio.h index 6184561980f2..acce0b7d397b 100644 --- a/trunk/include/asm-x86/mach-rdc321x/gpio.h +++ b/trunk/include/asm-x86/mach-rdc321x/gpio.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MACH_RDC321X__GPIO_H -#define ASM_X86__MACH_RDC321X__GPIO_H +#ifndef _RDC321X_GPIO_H +#define _RDC321X_GPIO_H extern int rdc_gpio_get_value(unsigned gpio); extern void rdc_gpio_set_value(unsigned gpio, int value); @@ -54,4 +54,4 @@ static inline int irq_to_gpio(unsigned irq) /* For cansleep */ #include -#endif /* ASM_X86__MACH_RDC321X__GPIO_H */ +#endif /* _RDC321X_GPIO_H_ */ diff --git a/trunk/include/asm-x86/summit/irq_vectors_limits.h b/trunk/include/asm-x86/mach-summit/irq_vectors_limits.h similarity index 100% rename from trunk/include/asm-x86/summit/irq_vectors_limits.h rename to trunk/include/asm-x86/mach-summit/irq_vectors_limits.h diff --git a/trunk/include/asm-x86/summit/apic.h b/trunk/include/asm-x86/mach-summit/mach_apic.h similarity index 94% rename from trunk/include/asm-x86/summit/apic.h rename to trunk/include/asm-x86/mach-summit/mach_apic.h index c5b2e4b10358..c47e2ab5c5ca 100644 --- a/trunk/include/asm-x86/summit/apic.h +++ b/trunk/include/asm-x86/mach-summit/mach_apic.h @@ -1,5 +1,5 @@ -#ifndef __ASM_SUMMIT_APIC_H -#define __ASM_SUMMIT_APIC_H +#ifndef __ASM_MACH_APIC_H +#define __ASM_MACH_APIC_H #include @@ -21,7 +21,7 @@ static inline cpumask_t target_cpus(void) * Just start on cpu 0. IRQ balancing will spread load */ return cpumask_of_cpu(0); -} +} #define TARGET_CPUS (target_cpus()) #define INT_DELIVERY_MODE (dest_LowestPrio) @@ -30,10 +30,10 @@ static inline cpumask_t target_cpus(void) static inline unsigned long check_apicid_used(physid_mask_t bitmap, int apicid) { return 0; -} +} /* we don't use the phys_cpu_present_map to indicate apicid presence */ -static inline unsigned long check_apicid_present(int bit) +static inline unsigned long check_apicid_present(int bit) { return 1; } @@ -122,7 +122,7 @@ static inline physid_mask_t ioapic_phys_id_map(physid_mask_t phys_id_map) static inline physid_mask_t apicid_to_cpu_present(int apicid) { - return physid_mask_of_physid(0); + return physid_mask_of_physid(apicid); } static inline void setup_portio_remap(void) @@ -143,22 +143,22 @@ static inline unsigned int cpu_mask_to_apicid(cpumask_t cpumask) int num_bits_set; int cpus_found = 0; int cpu; - int apicid; + int apicid; num_bits_set = cpus_weight(cpumask); /* Return id to all */ if (num_bits_set == NR_CPUS) return (int) 0xFF; - /* - * The cpus in the mask must all be on the apic cluster. If are not - * on the same apicid cluster return default value of TARGET_CPUS. + /* + * The cpus in the mask must all be on the apic cluster. If are not + * on the same apicid cluster return default value of TARGET_CPUS. */ cpu = first_cpu(cpumask); apicid = cpu_to_logical_apicid(cpu); while (cpus_found < num_bits_set) { if (cpu_isset(cpu, cpumask)) { int new_apicid = cpu_to_logical_apicid(cpu); - if (apicid_cluster(apicid) != + if (apicid_cluster(apicid) != apicid_cluster(new_apicid)){ printk ("%s: Not a valid mask!\n",__FUNCTION__); return 0xFF; @@ -182,4 +182,4 @@ static inline u32 phys_pkg_id(u32 cpuid_apic, int index_msb) return hard_smp_processor_id() >> index_msb; } -#endif /* __ASM_SUMMIT_APIC_H */ +#endif /* __ASM_MACH_APIC_H */ diff --git a/trunk/include/asm-x86/mach-summit/mach_apicdef.h b/trunk/include/asm-x86/mach-summit/mach_apicdef.h new file mode 100644 index 000000000000..a58ab5a75c8c --- /dev/null +++ b/trunk/include/asm-x86/mach-summit/mach_apicdef.h @@ -0,0 +1,13 @@ +#ifndef __ASM_MACH_APICDEF_H +#define __ASM_MACH_APICDEF_H + +#define APIC_ID_MASK (0xFF<<24) + +static inline unsigned get_apic_id(unsigned long x) +{ + return (((x)>>24)&0xFF); +} + +#define GET_APIC_ID(x) get_apic_id(x) + +#endif diff --git a/trunk/include/asm-x86/summit/ipi.h b/trunk/include/asm-x86/mach-summit/mach_ipi.h similarity index 83% rename from trunk/include/asm-x86/summit/ipi.h rename to trunk/include/asm-x86/mach-summit/mach_ipi.h index 53bd1e7bd7b4..9404c535b7ec 100644 --- a/trunk/include/asm-x86/summit/ipi.h +++ b/trunk/include/asm-x86/mach-summit/mach_ipi.h @@ -1,5 +1,5 @@ -#ifndef __ASM_SUMMIT_IPI_H -#define __ASM_SUMMIT_IPI_H +#ifndef __ASM_MACH_IPI_H +#define __ASM_MACH_IPI_H void send_IPI_mask_sequence(cpumask_t mask, int vector); @@ -22,4 +22,4 @@ static inline void send_IPI_all(int vector) send_IPI_mask(cpu_online_map, vector); } -#endif /* __ASM_SUMMIT_IPI_H */ +#endif /* __ASM_MACH_IPI_H */ diff --git a/trunk/include/asm-x86/summit/mpparse.h b/trunk/include/asm-x86/mach-summit/mach_mpparse.h similarity index 96% rename from trunk/include/asm-x86/summit/mpparse.h rename to trunk/include/asm-x86/mach-summit/mach_mpparse.h index 013ce6fab2d5..fdf591701339 100644 --- a/trunk/include/asm-x86/summit/mpparse.h +++ b/trunk/include/asm-x86/mach-summit/mach_mpparse.h @@ -1,6 +1,7 @@ -#ifndef __ASM_SUMMIT_MPPARSE_H -#define __ASM_SUMMIT_MPPARSE_H +#ifndef __ASM_MACH_MPPARSE_H +#define __ASM_MACH_MPPARSE_H +#include #include extern int use_cyclone; @@ -11,11 +12,11 @@ extern void setup_summit(void); #define setup_summit() {} #endif -static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, +static inline int mps_oem_check(struct mp_config_table *mpc, char *oem, char *productid) { - if (!strncmp(oem, "IBM ENSW", 8) && - (!strncmp(productid, "VIGIL SMP", 9) + if (!strncmp(oem, "IBM ENSW", 8) && + (!strncmp(productid, "VIGIL SMP", 9) || !strncmp(productid, "EXA", 3) || !strncmp(productid, "RUTHLESS SMP", 12))){ mark_tsc_unstable("Summit based system"); @@ -106,4 +107,4 @@ static inline int is_WPEG(struct rio_detail *rio){ rio->type == LookOutAWPEG || rio->type == LookOutBWPEG); } -#endif /* __ASM_SUMMIT_MPPARSE_H */ +#endif /* __ASM_MACH_MPPARSE_H */ diff --git a/trunk/include/asm-x86/math_emu.h b/trunk/include/asm-x86/math_emu.h index 5768d8e95c8c..9bf4ae93ab10 100644 --- a/trunk/include/asm-x86/math_emu.h +++ b/trunk/include/asm-x86/math_emu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MATH_EMU_H -#define ASM_X86__MATH_EMU_H +#ifndef _I386_MATH_EMU_H +#define _I386_MATH_EMU_H /* This structure matches the layout of the data saved to the stack following a device-not-present interrupt, part of it saved @@ -28,4 +28,4 @@ struct info { long ___vm86_fs; long ___vm86_gs; }; -#endif /* ASM_X86__MATH_EMU_H */ +#endif diff --git a/trunk/include/asm-x86/mc146818rtc.h b/trunk/include/asm-x86/mc146818rtc.h index a995f33176cd..daf1ccde77af 100644 --- a/trunk/include/asm-x86/mc146818rtc.h +++ b/trunk/include/asm-x86/mc146818rtc.h @@ -1,8 +1,8 @@ /* * Machine dependent access functions for RTC registers. */ -#ifndef ASM_X86__MC146818RTC_H -#define ASM_X86__MC146818RTC_H +#ifndef _ASM_MC146818RTC_H +#define _ASM_MC146818RTC_H #include #include @@ -101,4 +101,4 @@ extern unsigned long mach_get_cmos_time(void); #define RTC_IRQ 8 -#endif /* ASM_X86__MC146818RTC_H */ +#endif /* _ASM_MC146818RTC_H */ diff --git a/trunk/include/asm-x86/mca.h b/trunk/include/asm-x86/mca.h index 60d1ed287b13..09adf2eac4dc 100644 --- a/trunk/include/asm-x86/mca.h +++ b/trunk/include/asm-x86/mca.h @@ -1,8 +1,8 @@ /* -*- mode: c; c-basic-offset: 8 -*- */ /* Platform specific MCA defines */ -#ifndef ASM_X86__MCA_H -#define ASM_X86__MCA_H +#ifndef _ASM_MCA_H +#define _ASM_MCA_H /* Maximal number of MCA slots - actually, some machines have less, but * they all have sufficient number of POS registers to cover 8. @@ -40,4 +40,4 @@ */ #define MCA_NUMADAPTERS (MCA_MAX_SLOT_NR+3) -#endif /* ASM_X86__MCA_H */ +#endif diff --git a/trunk/include/asm-x86/mca_dma.h b/trunk/include/asm-x86/mca_dma.h index 49f22be237d2..c3dca6edc6b1 100644 --- a/trunk/include/asm-x86/mca_dma.h +++ b/trunk/include/asm-x86/mca_dma.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MCA_DMA_H -#define ASM_X86__MCA_DMA_H +#ifndef MCA_DMA_H +#define MCA_DMA_H #include #include @@ -198,4 +198,4 @@ static inline void mca_set_dma_mode(unsigned int dmanr, unsigned int mode) outb(mode, MCA_DMA_REG_EXE); } -#endif /* ASM_X86__MCA_DMA_H */ +#endif /* MCA_DMA_H */ diff --git a/trunk/include/asm-x86/mce.h b/trunk/include/asm-x86/mce.h index 036133eaf744..531eaa587455 100644 --- a/trunk/include/asm-x86/mce.h +++ b/trunk/include/asm-x86/mce.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MCE_H -#define ASM_X86__MCE_H +#ifndef _ASM_X86_MCE_H +#define _ASM_X86_MCE_H #ifdef __x86_64__ @@ -127,4 +127,4 @@ extern void restart_mce(void); #endif /* __KERNEL__ */ -#endif /* ASM_X86__MCE_H */ +#endif diff --git a/trunk/include/asm-x86/mman.h b/trunk/include/asm-x86/mman.h index 4ef28e6de383..90bc4108a4fd 100644 --- a/trunk/include/asm-x86/mman.h +++ b/trunk/include/asm-x86/mman.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMAN_H -#define ASM_X86__MMAN_H +#ifndef _ASM_X86_MMAN_H +#define _ASM_X86_MMAN_H #include @@ -17,4 +17,4 @@ #define MCL_CURRENT 1 /* lock all current mappings */ #define MCL_FUTURE 2 /* lock all future mappings */ -#endif /* ASM_X86__MMAN_H */ +#endif /* _ASM_X86_MMAN_H */ diff --git a/trunk/include/asm-x86/mmconfig.h b/trunk/include/asm-x86/mmconfig.h index fb79b1cf5d07..e293ab81e850 100644 --- a/trunk/include/asm-x86/mmconfig.h +++ b/trunk/include/asm-x86/mmconfig.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMCONFIG_H -#define ASM_X86__MMCONFIG_H +#ifndef _ASM_MMCONFIG_H +#define _ASM_MMCONFIG_H #ifdef CONFIG_PCI_MMCONFIG extern void __cpuinit fam10h_check_enable_mmcfg(void); @@ -9,4 +9,4 @@ static inline void fam10h_check_enable_mmcfg(void) { } static inline void check_enable_amd_mmconf_dmi(void) { } #endif -#endif /* ASM_X86__MMCONFIG_H */ +#endif diff --git a/trunk/include/asm-x86/mmu.h b/trunk/include/asm-x86/mmu.h index a30d7a9c8297..00e88679e11f 100644 --- a/trunk/include/asm-x86/mmu.h +++ b/trunk/include/asm-x86/mmu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMU_H -#define ASM_X86__MMU_H +#ifndef _ASM_X86_MMU_H +#define _ASM_X86_MMU_H #include #include @@ -28,4 +28,4 @@ static inline void leave_mm(int cpu) } #endif -#endif /* ASM_X86__MMU_H */ +#endif /* _ASM_X86_MMU_H */ diff --git a/trunk/include/asm-x86/mmu_context.h b/trunk/include/asm-x86/mmu_context.h index 8ec940bfd079..fac57014e7c6 100644 --- a/trunk/include/asm-x86/mmu_context.h +++ b/trunk/include/asm-x86/mmu_context.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMU_CONTEXT_H -#define ASM_X86__MMU_CONTEXT_H +#ifndef __ASM_X86_MMU_CONTEXT_H +#define __ASM_X86_MMU_CONTEXT_H #include #include @@ -34,4 +34,4 @@ do { \ } while (0); -#endif /* ASM_X86__MMU_CONTEXT_H */ +#endif /* __ASM_X86_MMU_CONTEXT_H */ diff --git a/trunk/include/asm-x86/mmu_context_32.h b/trunk/include/asm-x86/mmu_context_32.h index cce6f6e4afd6..824fc575c6d8 100644 --- a/trunk/include/asm-x86/mmu_context_32.h +++ b/trunk/include/asm-x86/mmu_context_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMU_CONTEXT_32_H -#define ASM_X86__MMU_CONTEXT_32_H +#ifndef __I386_SCHED_H +#define __I386_SCHED_H static inline void enter_lazy_tlb(struct mm_struct *mm, struct task_struct *tsk) { @@ -53,4 +53,4 @@ static inline void switch_mm(struct mm_struct *prev, #define deactivate_mm(tsk, mm) \ asm("movl %0,%%gs": :"r" (0)); -#endif /* ASM_X86__MMU_CONTEXT_32_H */ +#endif diff --git a/trunk/include/asm-x86/mmu_context_64.h b/trunk/include/asm-x86/mmu_context_64.h index 26758673c828..c7000634ccae 100644 --- a/trunk/include/asm-x86/mmu_context_64.h +++ b/trunk/include/asm-x86/mmu_context_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMU_CONTEXT_64_H -#define ASM_X86__MMU_CONTEXT_64_H +#ifndef __X86_64_MMU_CONTEXT_H +#define __X86_64_MMU_CONTEXT_H #include @@ -51,4 +51,4 @@ do { \ asm volatile("movl %0,%%fs"::"r"(0)); \ } while (0) -#endif /* ASM_X86__MMU_CONTEXT_64_H */ +#endif diff --git a/trunk/include/asm-x86/mmx.h b/trunk/include/asm-x86/mmx.h index 2e7299bb3653..940881218ff8 100644 --- a/trunk/include/asm-x86/mmx.h +++ b/trunk/include/asm-x86/mmx.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MMX_H -#define ASM_X86__MMX_H +#ifndef _ASM_MMX_H +#define _ASM_MMX_H /* * MMX 3Dnow! helper operations @@ -11,4 +11,4 @@ extern void *_mmx_memcpy(void *to, const void *from, size_t size); extern void mmx_clear_page(void *page); extern void mmx_copy_page(void *to, void *from); -#endif /* ASM_X86__MMX_H */ +#endif diff --git a/trunk/include/asm-x86/mmzone_32.h b/trunk/include/asm-x86/mmzone_32.h index 121b65d61d86..5862e6460658 100644 --- a/trunk/include/asm-x86/mmzone_32.h +++ b/trunk/include/asm-x86/mmzone_32.h @@ -3,8 +3,8 @@ * */ -#ifndef ASM_X86__MMZONE_32_H -#define ASM_X86__MMZONE_32_H +#ifndef _ASM_MMZONE_H_ +#define _ASM_MMZONE_H_ #include @@ -131,4 +131,4 @@ static inline int pfn_valid(int pfn) }) #endif /* CONFIG_NEED_MULTIPLE_NODES */ -#endif /* ASM_X86__MMZONE_32_H */ +#endif /* _ASM_MMZONE_H_ */ diff --git a/trunk/include/asm-x86/mmzone_64.h b/trunk/include/asm-x86/mmzone_64.h index 626b03a14875..594bd0dc1d08 100644 --- a/trunk/include/asm-x86/mmzone_64.h +++ b/trunk/include/asm-x86/mmzone_64.h @@ -1,8 +1,8 @@ /* K8 NUMA support */ /* Copyright 2002,2003 by Andi Kleen, SuSE Labs */ /* 2.5 Version loosely based on the NUMAQ Code by Pat Gaughen. */ -#ifndef ASM_X86__MMZONE_64_H -#define ASM_X86__MMZONE_64_H +#ifndef _ASM_X86_64_MMZONE_H +#define _ASM_X86_64_MMZONE_H 1 #ifdef CONFIG_NUMA @@ -49,4 +49,4 @@ extern int early_pfn_to_nid(unsigned long pfn); #endif #endif -#endif /* ASM_X86__MMZONE_64_H */ +#endif diff --git a/trunk/include/asm-x86/module.h b/trunk/include/asm-x86/module.h index 48dc3e0c07d9..bfedb247871c 100644 --- a/trunk/include/asm-x86/module.h +++ b/trunk/include/asm-x86/module.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MODULE_H -#define ASM_X86__MODULE_H +#ifndef _ASM_MODULE_H +#define _ASM_MODULE_H /* x86_32/64 are simple */ struct mod_arch_specific {}; @@ -79,4 +79,4 @@ struct mod_arch_specific {}; # define MODULE_ARCH_VERMAGIC MODULE_PROC_FAMILY MODULE_STACKSIZE #endif -#endif /* ASM_X86__MODULE_H */ +#endif /* _ASM_MODULE_H */ diff --git a/trunk/include/asm-x86/mpspec.h b/trunk/include/asm-x86/mpspec.h index 118da365e371..b6995e567fcc 100644 --- a/trunk/include/asm-x86/mpspec.h +++ b/trunk/include/asm-x86/mpspec.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MPSPEC_H -#define ASM_X86__MPSPEC_H +#ifndef _AM_X86_MPSPEC_H +#define _AM_X86_MPSPEC_H #include @@ -141,4 +141,4 @@ static inline void physid_set_mask_of_physid(int physid, physid_mask_t *map) extern physid_mask_t phys_cpu_present_map; -#endif /* ASM_X86__MPSPEC_H */ +#endif diff --git a/trunk/include/asm-x86/mpspec_def.h b/trunk/include/asm-x86/mpspec_def.h index 79166b048012..38d1e73b49e4 100644 --- a/trunk/include/asm-x86/mpspec_def.h +++ b/trunk/include/asm-x86/mpspec_def.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MPSPEC_DEF_H -#define ASM_X86__MPSPEC_DEF_H +#ifndef __ASM_MPSPEC_DEF_H +#define __ASM_MPSPEC_DEF_H /* * Structure definitions for SMP machines following the @@ -177,4 +177,4 @@ enum mp_bustype { MP_BUS_PCI, MP_BUS_MCA, }; -#endif /* ASM_X86__MPSPEC_DEF_H */ +#endif diff --git a/trunk/include/asm-x86/msgbuf.h b/trunk/include/asm-x86/msgbuf.h index 1b538c907a3d..7e4e9481f51c 100644 --- a/trunk/include/asm-x86/msgbuf.h +++ b/trunk/include/asm-x86/msgbuf.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MSGBUF_H -#define ASM_X86__MSGBUF_H +#ifndef _ASM_X86_MSGBUF_H +#define _ASM_X86_MSGBUF_H /* * The msqid64_ds structure for i386 architecture. @@ -36,4 +36,4 @@ struct msqid64_ds { unsigned long __unused5; }; -#endif /* ASM_X86__MSGBUF_H */ +#endif /* _ASM_X86_MSGBUF_H */ diff --git a/trunk/include/asm-x86/msidef.h b/trunk/include/asm-x86/msidef.h index ed9190246876..296f29ce426d 100644 --- a/trunk/include/asm-x86/msidef.h +++ b/trunk/include/asm-x86/msidef.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MSIDEF_H -#define ASM_X86__MSIDEF_H +#ifndef ASM_MSIDEF_H +#define ASM_MSIDEF_H /* * Constants for Intel APIC based MSI messages. @@ -48,8 +48,4 @@ #define MSI_ADDR_DEST_ID(dest) (((dest) << MSI_ADDR_DEST_ID_SHIFT) & \ MSI_ADDR_DEST_ID_MASK) -#define MSI_ADDR_IR_EXT_INT (1 << 4) -#define MSI_ADDR_IR_SHV (1 << 3) -#define MSI_ADDR_IR_INDEX1(index) ((index & 0x8000) >> 13) -#define MSI_ADDR_IR_INDEX2(index) ((index & 0x7fff) << 5) -#endif /* ASM_X86__MSIDEF_H */ +#endif /* ASM_MSIDEF_H */ diff --git a/trunk/include/asm-x86/msr-index.h b/trunk/include/asm-x86/msr-index.h index 3052f058ab06..44bce773012e 100644 --- a/trunk/include/asm-x86/msr-index.h +++ b/trunk/include/asm-x86/msr-index.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MSR_INDEX_H -#define ASM_X86__MSR_INDEX_H +#ifndef __ASM_MSR_INDEX_H +#define __ASM_MSR_INDEX_H /* CPU model specific register (MSR) numbers */ @@ -310,4 +310,4 @@ /* Geode defined MSRs */ #define MSR_GEODE_BUSCONT_CONF0 0x00001900 -#endif /* ASM_X86__MSR_INDEX_H */ +#endif /* __ASM_MSR_INDEX_H */ diff --git a/trunk/include/asm-x86/msr.h b/trunk/include/asm-x86/msr.h index eee83f783f6d..2362cfda1fbc 100644 --- a/trunk/include/asm-x86/msr.h +++ b/trunk/include/asm-x86/msr.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__MSR_H -#define ASM_X86__MSR_H +#ifndef __ASM_X86_MSR_H_ +#define __ASM_X86_MSR_H_ #include @@ -221,4 +221,4 @@ static inline int wrmsr_safe_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h) #endif /* __KERNEL__ */ -#endif /* ASM_X86__MSR_H */ +#endif diff --git a/trunk/include/asm-x86/mtrr.h b/trunk/include/asm-x86/mtrr.h index 23a7f83da953..a69a01a51729 100644 --- a/trunk/include/asm-x86/mtrr.h +++ b/trunk/include/asm-x86/mtrr.h @@ -20,8 +20,8 @@ The postal address is: Richard Gooch, c/o ATNF, P. O. Box 76, Epping, N.S.W., 2121, Australia. */ -#ifndef ASM_X86__MTRR_H -#define ASM_X86__MTRR_H +#ifndef _ASM_X86_MTRR_H +#define _ASM_X86_MTRR_H #include #include @@ -170,4 +170,4 @@ struct mtrr_gentry32 { #endif /* __KERNEL__ */ -#endif /* ASM_X86__MTRR_H */ +#endif /* _ASM_X86_MTRR_H */ diff --git a/trunk/include/asm-x86/mutex_32.h b/trunk/include/asm-x86/mutex_32.h index 25c16d8ba3c7..73e928ef5f03 100644 --- a/trunk/include/asm-x86/mutex_32.h +++ b/trunk/include/asm-x86/mutex_32.h @@ -6,8 +6,8 @@ * * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar */ -#ifndef ASM_X86__MUTEX_32_H -#define ASM_X86__MUTEX_32_H +#ifndef _ASM_MUTEX_H +#define _ASM_MUTEX_H #include @@ -122,4 +122,4 @@ static inline int __mutex_fastpath_trylock(atomic_t *count, #endif } -#endif /* ASM_X86__MUTEX_32_H */ +#endif diff --git a/trunk/include/asm-x86/mutex_64.h b/trunk/include/asm-x86/mutex_64.h index 918ba21ab9d9..f3fae9becb38 100644 --- a/trunk/include/asm-x86/mutex_64.h +++ b/trunk/include/asm-x86/mutex_64.h @@ -6,8 +6,8 @@ * * Copyright (C) 2004, 2005, 2006 Red Hat, Inc., Ingo Molnar */ -#ifndef ASM_X86__MUTEX_64_H -#define ASM_X86__MUTEX_64_H +#ifndef _ASM_MUTEX_H +#define _ASM_MUTEX_H /** * __mutex_fastpath_lock - decrement and call function if negative @@ -97,4 +97,4 @@ static inline int __mutex_fastpath_trylock(atomic_t *count, return 0; } -#endif /* ASM_X86__MUTEX_64_H */ +#endif diff --git a/trunk/include/asm-x86/nmi.h b/trunk/include/asm-x86/nmi.h index f8b76f383904..21f8d0202a82 100644 --- a/trunk/include/asm-x86/nmi.h +++ b/trunk/include/asm-x86/nmi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__NMI_H -#define ASM_X86__NMI_H +#ifndef _ASM_X86_NMI_H_ +#define _ASM_X86_NMI_H_ #include #include @@ -81,4 +81,4 @@ void enable_lapic_nmi_watchdog(void); void stop_nmi(void); void restart_nmi(void); -#endif /* ASM_X86__NMI_H */ +#endif diff --git a/trunk/include/asm-x86/nops.h b/trunk/include/asm-x86/nops.h index ae742721ae73..ad0bedd10b89 100644 --- a/trunk/include/asm-x86/nops.h +++ b/trunk/include/asm-x86/nops.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__NOPS_H -#define ASM_X86__NOPS_H +#ifndef _ASM_NOPS_H +#define _ASM_NOPS_H 1 /* Define nops for use with alternative() */ @@ -115,4 +115,4 @@ #define ASM_NOP_MAX 8 -#endif /* ASM_X86__NOPS_H */ +#endif diff --git a/trunk/include/asm-x86/numa_32.h b/trunk/include/asm-x86/numa_32.h index 44cb07855c5b..220d7b7707a0 100644 --- a/trunk/include/asm-x86/numa_32.h +++ b/trunk/include/asm-x86/numa_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__NUMA_32_H -#define ASM_X86__NUMA_32_H +#ifndef _ASM_X86_32_NUMA_H +#define _ASM_X86_32_NUMA_H 1 extern int pxm_to_nid(int pxm); extern void numa_remove_cpu(int cpu); @@ -8,4 +8,4 @@ extern void numa_remove_cpu(int cpu); extern void set_highmem_pages_init(void); #endif -#endif /* ASM_X86__NUMA_32_H */ +#endif /* _ASM_X86_32_NUMA_H */ diff --git a/trunk/include/asm-x86/numa_64.h b/trunk/include/asm-x86/numa_64.h index 15c990395b02..3830094434a9 100644 --- a/trunk/include/asm-x86/numa_64.h +++ b/trunk/include/asm-x86/numa_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__NUMA_64_H -#define ASM_X86__NUMA_64_H +#ifndef _ASM_X8664_NUMA_H +#define _ASM_X8664_NUMA_H 1 #include #include @@ -40,4 +40,4 @@ static inline void numa_add_cpu(int cpu, int node) { } static inline void numa_remove_cpu(int cpu) { } #endif -#endif /* ASM_X86__NUMA_64_H */ +#endif diff --git a/trunk/include/asm-x86/numaq.h b/trunk/include/asm-x86/numaq.h index 124bf7d4b70a..34b92d581fa3 100644 --- a/trunk/include/asm-x86/numaq.h +++ b/trunk/include/asm-x86/numaq.h @@ -23,8 +23,8 @@ * Send feedback to */ -#ifndef ASM_X86__NUMAQ_H -#define ASM_X86__NUMAQ_H +#ifndef NUMAQ_H +#define NUMAQ_H #ifdef CONFIG_X86_NUMAQ @@ -165,5 +165,5 @@ static inline int get_memcfg_numaq(void) return 0; } #endif /* CONFIG_X86_NUMAQ */ -#endif /* ASM_X86__NUMAQ_H */ +#endif /* NUMAQ_H */ diff --git a/trunk/include/asm-x86/olpc.h b/trunk/include/asm-x86/olpc.h index d7328b1a05c1..97d47133486f 100644 --- a/trunk/include/asm-x86/olpc.h +++ b/trunk/include/asm-x86/olpc.h @@ -1,7 +1,7 @@ /* OLPC machine specific definitions */ -#ifndef ASM_X86__OLPC_H -#define ASM_X86__OLPC_H +#ifndef ASM_OLPC_H_ +#define ASM_OLPC_H_ #include @@ -129,4 +129,4 @@ extern int olpc_ec_mask_unset(uint8_t bits); #define OLPC_GPIO_LID geode_gpio(26) #define OLPC_GPIO_ECSCI geode_gpio(27) -#endif /* ASM_X86__OLPC_H */ +#endif diff --git a/trunk/include/asm-x86/page.h b/trunk/include/asm-x86/page.h index 79544e6ffb8b..49982110e4d9 100644 --- a/trunk/include/asm-x86/page.h +++ b/trunk/include/asm-x86/page.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PAGE_H -#define ASM_X86__PAGE_H +#ifndef _ASM_X86_PAGE_H +#define _ASM_X86_PAGE_H #include @@ -199,4 +199,4 @@ static inline pteval_t native_pte_flags(pte_t pte) #define __HAVE_ARCH_GATE_AREA 1 #endif /* __KERNEL__ */ -#endif /* ASM_X86__PAGE_H */ +#endif /* _ASM_X86_PAGE_H */ diff --git a/trunk/include/asm-x86/page_32.h b/trunk/include/asm-x86/page_32.h index f32062a821c5..ab8528793f08 100644 --- a/trunk/include/asm-x86/page_32.h +++ b/trunk/include/asm-x86/page_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PAGE_32_H -#define ASM_X86__PAGE_32_H +#ifndef _ASM_X86_PAGE_32_H +#define _ASM_X86_PAGE_32_H /* * This handles the memory map. @@ -96,7 +96,6 @@ extern void find_low_pfn_range(void); extern unsigned long init_memory_mapping(unsigned long start, unsigned long end); extern void initmem_init(unsigned long, unsigned long); -extern void free_initmem(void); extern void setup_bootmem_allocator(void); @@ -127,4 +126,4 @@ static inline void copy_page(void *to, void *from) #endif /* CONFIG_X86_3DNOW */ #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__PAGE_32_H */ +#endif /* _ASM_X86_PAGE_32_H */ diff --git a/trunk/include/asm-x86/page_64.h b/trunk/include/asm-x86/page_64.h index 5e64acfed0a4..c6916c83e6b1 100644 --- a/trunk/include/asm-x86/page_64.h +++ b/trunk/include/asm-x86/page_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PAGE_64_H -#define ASM_X86__PAGE_64_H +#ifndef _X86_64_PAGE_H +#define _X86_64_PAGE_H #define PAGETABLE_LEVELS 4 @@ -91,7 +91,6 @@ extern unsigned long init_memory_mapping(unsigned long start, unsigned long end); extern void initmem_init(unsigned long start_pfn, unsigned long end_pfn); -extern void free_initmem(void); extern void init_extra_mapping_uc(unsigned long phys, unsigned long size); extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); @@ -103,4 +102,4 @@ extern void init_extra_mapping_wb(unsigned long phys, unsigned long size); #endif -#endif /* ASM_X86__PAGE_64_H */ +#endif /* _X86_64_PAGE_H */ diff --git a/trunk/include/asm-x86/param.h b/trunk/include/asm-x86/param.h index 0009cfb11a5f..6f0d0422f4ca 100644 --- a/trunk/include/asm-x86/param.h +++ b/trunk/include/asm-x86/param.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PARAM_H -#define ASM_X86__PARAM_H +#ifndef _ASM_X86_PARAM_H +#define _ASM_X86_PARAM_H #ifdef __KERNEL__ # define HZ CONFIG_HZ /* Internal kernel timer frequency */ @@ -19,4 +19,4 @@ #define MAXHOSTNAMELEN 64 /* max length of hostname */ -#endif /* ASM_X86__PARAM_H */ +#endif /* _ASM_X86_PARAM_H */ diff --git a/trunk/include/asm-x86/paravirt.h b/trunk/include/asm-x86/paravirt.h index ff9a7e4bc3f6..fbbde93f12d6 100644 --- a/trunk/include/asm-x86/paravirt.h +++ b/trunk/include/asm-x86/paravirt.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PARAVIRT_H -#define ASM_X86__PARAVIRT_H +#ifndef __ASM_PARAVIRT_H +#define __ASM_PARAVIRT_H /* Various instructions on x86 need to be replaced for * para-virtualization: those hooks are defined here. */ @@ -200,6 +200,12 @@ struct pv_irq_ops { struct pv_apic_ops { #ifdef CONFIG_X86_LOCAL_APIC + /* + * Direct APIC operations, principally for VMI. Ideally + * these shouldn't be in this interface. + */ + void (*apic_write)(unsigned long reg, u32 v); + u32 (*apic_read)(unsigned long reg); void (*setup_boot_clock)(void); void (*setup_secondary_clock)(void); @@ -892,6 +898,19 @@ static inline void slow_down_io(void) } #ifdef CONFIG_X86_LOCAL_APIC +/* + * Basic functions accessing APICs. + */ +static inline void apic_write(unsigned long reg, u32 v) +{ + PVOP_VCALL2(pv_apic_ops.apic_write, reg, v); +} + +static inline u32 apic_read(unsigned long reg) +{ + return PVOP_CALL1(unsigned long, pv_apic_ops.apic_read, reg); +} + static inline void setup_boot_clock(void) { PVOP_VCALL0(pv_apic_ops.setup_boot_clock); @@ -1615,4 +1634,4 @@ static inline unsigned long __raw_local_irq_save(void) #endif /* __ASSEMBLY__ */ #endif /* CONFIG_PARAVIRT */ -#endif /* ASM_X86__PARAVIRT_H */ +#endif /* __ASM_PARAVIRT_H */ diff --git a/trunk/include/asm-x86/parport.h b/trunk/include/asm-x86/parport.h index 2e3dda4dc3d9..3c4ffeb467e9 100644 --- a/trunk/include/asm-x86/parport.h +++ b/trunk/include/asm-x86/parport.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PARPORT_H -#define ASM_X86__PARPORT_H +#ifndef _ASM_X86_PARPORT_H +#define _ASM_X86_PARPORT_H static int __devinit parport_pc_find_isa_ports(int autoirq, int autodma); static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) @@ -7,4 +7,4 @@ static int __devinit parport_pc_find_nonpci_ports(int autoirq, int autodma) return parport_pc_find_isa_ports(autoirq, autodma); } -#endif /* ASM_X86__PARPORT_H */ +#endif /* _ASM_X86_PARPORT_H */ diff --git a/trunk/include/asm-x86/pat.h b/trunk/include/asm-x86/pat.h index 482c3e3f9879..7edc47307217 100644 --- a/trunk/include/asm-x86/pat.h +++ b/trunk/include/asm-x86/pat.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PAT_H -#define ASM_X86__PAT_H +#ifndef _ASM_PAT_H +#define _ASM_PAT_H #include @@ -19,4 +19,4 @@ extern int free_memtype(u64 start, u64 end); extern void pat_disable(char *reason); -#endif /* ASM_X86__PAT_H */ +#endif diff --git a/trunk/include/asm-x86/pci-direct.h b/trunk/include/asm-x86/pci-direct.h index da42be07b690..80c775d9fe20 100644 --- a/trunk/include/asm-x86/pci-direct.h +++ b/trunk/include/asm-x86/pci-direct.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PCI_DIRECT_H -#define ASM_X86__PCI_DIRECT_H +#ifndef ASM_PCI_DIRECT_H +#define ASM_PCI_DIRECT_H 1 #include @@ -18,4 +18,4 @@ extern int early_pci_allowed(void); extern unsigned int pci_early_dump_regs; extern void early_dump_pci_device(u8 bus, u8 slot, u8 func); extern void early_dump_pci_devices(void); -#endif /* ASM_X86__PCI_DIRECT_H */ +#endif diff --git a/trunk/include/asm-x86/pci.h b/trunk/include/asm-x86/pci.h index 602583192991..2db14cf17db8 100644 --- a/trunk/include/asm-x86/pci.h +++ b/trunk/include/asm-x86/pci.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PCI_H -#define ASM_X86__PCI_H +#ifndef __x86_PCI_H +#define __x86_PCI_H #include /* for struct page */ #include @@ -111,4 +111,4 @@ static inline cpumask_t __pcibus_to_cpumask(struct pci_bus *bus) } #endif -#endif /* ASM_X86__PCI_H */ +#endif diff --git a/trunk/include/asm-x86/pci_32.h b/trunk/include/asm-x86/pci_32.h index 3f2288207c0c..a50d46851285 100644 --- a/trunk/include/asm-x86/pci_32.h +++ b/trunk/include/asm-x86/pci_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PCI_32_H -#define ASM_X86__PCI_32_H +#ifndef __i386_PCI_H +#define __i386_PCI_H #ifdef __KERNEL__ @@ -31,4 +31,4 @@ struct pci_dev; #endif /* __KERNEL__ */ -#endif /* ASM_X86__PCI_32_H */ +#endif /* __i386_PCI_H */ diff --git a/trunk/include/asm-x86/pci_64.h b/trunk/include/asm-x86/pci_64.h index f72e12d5770e..f330234ffa5c 100644 --- a/trunk/include/asm-x86/pci_64.h +++ b/trunk/include/asm-x86/pci_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PCI_64_H -#define ASM_X86__PCI_64_H +#ifndef __x8664_PCI_H +#define __x8664_PCI_H #ifdef __KERNEL__ @@ -63,4 +63,4 @@ extern void pci_iommu_alloc(void); #endif /* __KERNEL__ */ -#endif /* ASM_X86__PCI_64_H */ +#endif /* __x8664_PCI_H */ diff --git a/trunk/include/asm-x86/pda.h b/trunk/include/asm-x86/pda.h index 80860afffbdb..b34e9a7cc80b 100644 --- a/trunk/include/asm-x86/pda.h +++ b/trunk/include/asm-x86/pda.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PDA_H -#define ASM_X86__PDA_H +#ifndef X86_64_PDA_H +#define X86_64_PDA_H #ifndef __ASSEMBLY__ #include @@ -134,4 +134,4 @@ do { \ #define PDA_STACKOFFSET (5*8) -#endif /* ASM_X86__PDA_H */ +#endif diff --git a/trunk/include/asm-x86/percpu.h b/trunk/include/asm-x86/percpu.h index e10a1d0678cf..f643a3a92da0 100644 --- a/trunk/include/asm-x86/percpu.h +++ b/trunk/include/asm-x86/percpu.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PERCPU_H -#define ASM_X86__PERCPU_H +#ifndef _ASM_X86_PERCPU_H_ +#define _ASM_X86_PERCPU_H_ #ifdef CONFIG_X86_64 #include @@ -215,4 +215,4 @@ do { \ #endif /* !CONFIG_SMP */ -#endif /* ASM_X86__PERCPU_H */ +#endif /* _ASM_X86_PERCPU_H_ */ diff --git a/trunk/include/asm-x86/pgalloc.h b/trunk/include/asm-x86/pgalloc.h index 3cd23adedae8..d63ea431cb3b 100644 --- a/trunk/include/asm-x86/pgalloc.h +++ b/trunk/include/asm-x86/pgalloc.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGALLOC_H -#define ASM_X86__PGALLOC_H +#ifndef _ASM_X86_PGALLOC_H +#define _ASM_X86_PGALLOC_H #include #include /* for struct page */ @@ -111,4 +111,4 @@ extern void __pud_free_tlb(struct mmu_gather *tlb, pud_t *pud); #endif /* PAGETABLE_LEVELS > 3 */ #endif /* PAGETABLE_LEVELS > 2 */ -#endif /* ASM_X86__PGALLOC_H */ +#endif /* _ASM_X86_PGALLOC_H */ diff --git a/trunk/include/asm-x86/pgtable-2level-defs.h b/trunk/include/asm-x86/pgtable-2level-defs.h index 7ec48f4e5347..0f71c9f13da4 100644 --- a/trunk/include/asm-x86/pgtable-2level-defs.h +++ b/trunk/include/asm-x86/pgtable-2level-defs.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_2LEVEL_DEFS_H -#define ASM_X86__PGTABLE_2LEVEL_DEFS_H +#ifndef _I386_PGTABLE_2LEVEL_DEFS_H +#define _I386_PGTABLE_2LEVEL_DEFS_H #define SHARED_KERNEL_PMD 0 @@ -17,4 +17,4 @@ #define PTRS_PER_PTE 1024 -#endif /* ASM_X86__PGTABLE_2LEVEL_DEFS_H */ +#endif /* _I386_PGTABLE_2LEVEL_DEFS_H */ diff --git a/trunk/include/asm-x86/pgtable-2level.h b/trunk/include/asm-x86/pgtable-2level.h index 60440b191626..46bc52c0eae1 100644 --- a/trunk/include/asm-x86/pgtable-2level.h +++ b/trunk/include/asm-x86/pgtable-2level.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_2LEVEL_H -#define ASM_X86__PGTABLE_2LEVEL_H +#ifndef _I386_PGTABLE_2LEVEL_H +#define _I386_PGTABLE_2LEVEL_H #define pte_ERROR(e) \ printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, (e).pte_low) @@ -78,4 +78,4 @@ static inline pte_t native_ptep_get_and_clear(pte_t *xp) #define __pte_to_swp_entry(pte) ((swp_entry_t) { (pte).pte_low }) #define __swp_entry_to_pte(x) ((pte_t) { .pte = (x).val }) -#endif /* ASM_X86__PGTABLE_2LEVEL_H */ +#endif /* _I386_PGTABLE_2LEVEL_H */ diff --git a/trunk/include/asm-x86/pgtable-3level-defs.h b/trunk/include/asm-x86/pgtable-3level-defs.h index c05fe6ff3720..448ac9516314 100644 --- a/trunk/include/asm-x86/pgtable-3level-defs.h +++ b/trunk/include/asm-x86/pgtable-3level-defs.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_3LEVEL_DEFS_H -#define ASM_X86__PGTABLE_3LEVEL_DEFS_H +#ifndef _I386_PGTABLE_3LEVEL_DEFS_H +#define _I386_PGTABLE_3LEVEL_DEFS_H #ifdef CONFIG_PARAVIRT #define SHARED_KERNEL_PMD (pv_info.shared_kernel_pmd) @@ -25,4 +25,4 @@ */ #define PTRS_PER_PTE 512 -#endif /* ASM_X86__PGTABLE_3LEVEL_DEFS_H */ +#endif /* _I386_PGTABLE_3LEVEL_DEFS_H */ diff --git a/trunk/include/asm-x86/pgtable-3level.h b/trunk/include/asm-x86/pgtable-3level.h index e713bd5f39a6..105057f34032 100644 --- a/trunk/include/asm-x86/pgtable-3level.h +++ b/trunk/include/asm-x86/pgtable-3level.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_3LEVEL_H -#define ASM_X86__PGTABLE_3LEVEL_H +#ifndef _I386_PGTABLE_3LEVEL_H +#define _I386_PGTABLE_3LEVEL_H /* * Intel Physical Address Extension (PAE) Mode - three-level page @@ -179,4 +179,4 @@ static inline unsigned long pte_pfn(pte_t pte) #define __pte_to_swp_entry(pte) ((swp_entry_t){ (pte).pte_high }) #define __swp_entry_to_pte(x) ((pte_t){ { .pte_high = (x).val } }) -#endif /* ASM_X86__PGTABLE_3LEVEL_H */ +#endif /* _I386_PGTABLE_3LEVEL_H */ diff --git a/trunk/include/asm-x86/pgtable.h b/trunk/include/asm-x86/pgtable.h index 57d919a2d79d..04caa2f544df 100644 --- a/trunk/include/asm-x86/pgtable.h +++ b/trunk/include/asm-x86/pgtable.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_H -#define ASM_X86__PGTABLE_H +#ifndef _ASM_X86_PGTABLE_H +#define _ASM_X86_PGTABLE_H #define FIRST_USER_ADDRESS 0 @@ -313,8 +313,6 @@ static inline void native_pagetable_setup_start(pgd_t *base) {} static inline void native_pagetable_setup_done(pgd_t *base) {} #endif -extern int arch_report_meminfo(char *page); - #ifdef CONFIG_PARAVIRT #include #else /* !CONFIG_PARAVIRT */ @@ -523,4 +521,4 @@ static inline void clone_pgd_range(pgd_t *dst, pgd_t *src, int count) #include #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__PGTABLE_H */ +#endif /* _ASM_X86_PGTABLE_H */ diff --git a/trunk/include/asm-x86/pgtable_32.h b/trunk/include/asm-x86/pgtable_32.h index 45c8235400fe..5c3b26567a95 100644 --- a/trunk/include/asm-x86/pgtable_32.h +++ b/trunk/include/asm-x86/pgtable_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_32_H -#define ASM_X86__PGTABLE_32_H +#ifndef _I386_PGTABLE_H +#define _I386_PGTABLE_H /* @@ -31,7 +31,6 @@ static inline void pgtable_cache_init(void) { } static inline void check_pgt_cache(void) { } void paging_init(void); -extern void set_pmd_pfn(unsigned long, unsigned long, pgprot_t); /* * The Linux x86 paging architecture is 'compile-time dual-mode', it @@ -187,4 +186,4 @@ do { \ #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ remap_pfn_range(vma, vaddr, pfn, size, prot) -#endif /* ASM_X86__PGTABLE_32_H */ +#endif /* _I386_PGTABLE_H */ diff --git a/trunk/include/asm-x86/pgtable_64.h b/trunk/include/asm-x86/pgtable_64.h index e3dcf7a08a0b..549144d03d99 100644 --- a/trunk/include/asm-x86/pgtable_64.h +++ b/trunk/include/asm-x86/pgtable_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PGTABLE_64_H -#define ASM_X86__PGTABLE_64_H +#ifndef _X86_64_PGTABLE_H +#define _X86_64_PGTABLE_H #include #ifndef __ASSEMBLY__ @@ -284,4 +284,4 @@ extern void cleanup_highmap(void); #define __HAVE_ARCH_PTE_SAME #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__PGTABLE_64_H */ +#endif /* _X86_64_PGTABLE_H */ diff --git a/trunk/include/asm-x86/posix_types_32.h b/trunk/include/asm-x86/posix_types_32.h index 70cf2bb05939..b031efda37ec 100644 --- a/trunk/include/asm-x86/posix_types_32.h +++ b/trunk/include/asm-x86/posix_types_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__POSIX_TYPES_32_H -#define ASM_X86__POSIX_TYPES_32_H +#ifndef __ARCH_I386_POSIX_TYPES_H +#define __ARCH_I386_POSIX_TYPES_H /* * This file is generally used by user-level software, so you need to @@ -82,4 +82,4 @@ do { \ #endif /* defined(__KERNEL__) */ -#endif /* ASM_X86__POSIX_TYPES_32_H */ +#endif diff --git a/trunk/include/asm-x86/posix_types_64.h b/trunk/include/asm-x86/posix_types_64.h index 388b4e7f4a44..d6624c95854a 100644 --- a/trunk/include/asm-x86/posix_types_64.h +++ b/trunk/include/asm-x86/posix_types_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__POSIX_TYPES_64_H -#define ASM_X86__POSIX_TYPES_64_H +#ifndef _ASM_X86_64_POSIX_TYPES_H +#define _ASM_X86_64_POSIX_TYPES_H /* * This file is generally used by user-level software, so you need to @@ -116,4 +116,4 @@ static inline void __FD_ZERO(__kernel_fd_set *p) #endif /* defined(__KERNEL__) */ -#endif /* ASM_X86__POSIX_TYPES_64_H */ +#endif diff --git a/trunk/include/asm-x86/prctl.h b/trunk/include/asm-x86/prctl.h index e7ae34eb4103..52952adef1ca 100644 --- a/trunk/include/asm-x86/prctl.h +++ b/trunk/include/asm-x86/prctl.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PRCTL_H -#define ASM_X86__PRCTL_H +#ifndef X86_64_PRCTL_H +#define X86_64_PRCTL_H 1 #define ARCH_SET_GS 0x1001 #define ARCH_SET_FS 0x1002 @@ -7,4 +7,4 @@ #define ARCH_GET_GS 0x1004 -#endif /* ASM_X86__PRCTL_H */ +#endif diff --git a/trunk/include/asm-x86/processor-cyrix.h b/trunk/include/asm-x86/processor-cyrix.h index 1198f2a0e42c..97568ada1f97 100644 --- a/trunk/include/asm-x86/processor-cyrix.h +++ b/trunk/include/asm-x86/processor-cyrix.h @@ -28,11 +28,3 @@ static inline void setCx86(u8 reg, u8 data) outb(reg, 0x22); outb(data, 0x23); } - -#define getCx86_old(reg) ({ outb((reg), 0x22); inb(0x23); }) - -#define setCx86_old(reg, data) do { \ - outb((reg), 0x22); \ - outb((data), 0x23); \ -} while (0) - diff --git a/trunk/include/asm-x86/processor-flags.h b/trunk/include/asm-x86/processor-flags.h index 5dd79774f693..eff2ecd7fff0 100644 --- a/trunk/include/asm-x86/processor-flags.h +++ b/trunk/include/asm-x86/processor-flags.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PROCESSOR_FLAGS_H -#define ASM_X86__PROCESSOR_FLAGS_H +#ifndef __ASM_I386_PROCESSOR_FLAGS_H +#define __ASM_I386_PROCESSOR_FLAGS_H /* Various flags defined: can be included from assembler. */ /* @@ -96,4 +96,4 @@ #endif #endif -#endif /* ASM_X86__PROCESSOR_FLAGS_H */ +#endif /* __ASM_I386_PROCESSOR_FLAGS_H */ diff --git a/trunk/include/asm-x86/processor.h b/trunk/include/asm-x86/processor.h index 10471cfab145..4df3e2f6fb56 100644 --- a/trunk/include/asm-x86/processor.h +++ b/trunk/include/asm-x86/processor.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PROCESSOR_H -#define ASM_X86__PROCESSOR_H +#ifndef __ASM_X86_PROCESSOR_H +#define __ASM_X86_PROCESSOR_H #include @@ -140,8 +140,6 @@ DECLARE_PER_CPU(struct cpuinfo_x86, cpu_info); #define current_cpu_data boot_cpu_data #endif -extern const struct seq_operations cpuinfo_op; - static inline int hlt_works(int cpu) { #ifdef CONFIG_X86_32 @@ -155,8 +153,6 @@ static inline int hlt_works(int cpu) extern void cpu_detect(struct cpuinfo_x86 *c); -extern struct pt_regs *idle_regs(struct pt_regs *); - extern void early_cpu_init(void); extern void identify_boot_cpu(void); extern void identify_secondary_cpu(struct cpuinfo_x86 *); @@ -947,4 +943,4 @@ extern void start_thread(struct pt_regs *regs, unsigned long new_ip, extern int get_tsc_mode(unsigned long adr); extern int set_tsc_mode(unsigned int val); -#endif /* ASM_X86__PROCESSOR_H */ +#endif diff --git a/trunk/include/asm-x86/proto.h b/trunk/include/asm-x86/proto.h index 6e89e8b4de0e..3dd458c385c0 100644 --- a/trunk/include/asm-x86/proto.h +++ b/trunk/include/asm-x86/proto.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PROTO_H -#define ASM_X86__PROTO_H +#ifndef _ASM_X8664_PROTO_H +#define _ASM_X8664_PROTO_H 1 #include @@ -29,4 +29,4 @@ long do_arch_prctl(struct task_struct *task, int code, unsigned long addr); #define round_up(x, y) (((x) + (y) - 1) & ~((y) - 1)) #define round_down(x, y) ((x) & ~((y) - 1)) -#endif /* ASM_X86__PROTO_H */ +#endif diff --git a/trunk/include/asm-x86/ptrace-abi.h b/trunk/include/asm-x86/ptrace-abi.h index d0cf3344a586..72e7b9db29bb 100644 --- a/trunk/include/asm-x86/ptrace-abi.h +++ b/trunk/include/asm-x86/ptrace-abi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PTRACE_ABI_H -#define ASM_X86__PTRACE_ABI_H +#ifndef _ASM_X86_PTRACE_ABI_H +#define _ASM_X86_PTRACE_ABI_H #ifdef __i386__ @@ -140,4 +140,4 @@ struct ptrace_bts_config { Returns number of BTS records drained. */ -#endif /* ASM_X86__PTRACE_ABI_H */ +#endif diff --git a/trunk/include/asm-x86/ptrace.h b/trunk/include/asm-x86/ptrace.h index 66ff7bd47379..8a71db803da6 100644 --- a/trunk/include/asm-x86/ptrace.h +++ b/trunk/include/asm-x86/ptrace.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PTRACE_H -#define ASM_X86__PTRACE_H +#ifndef _ASM_X86_PTRACE_H +#define _ASM_X86_PTRACE_H #include /* For __user */ #include @@ -148,9 +148,6 @@ extern void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, void signal_fault(struct pt_regs *regs, void __user *frame, char *where); #endif -extern long syscall_trace_enter(struct pt_regs *); -extern void syscall_trace_leave(struct pt_regs *); - static inline unsigned long regs_return_value(struct pt_regs *regs) { return regs->ax; @@ -242,4 +239,4 @@ extern int do_set_thread_area(struct task_struct *p, int idx, #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__PTRACE_H */ +#endif diff --git a/trunk/include/asm-x86/pvclock-abi.h b/trunk/include/asm-x86/pvclock-abi.h index edb3b4ecfc81..6857f840b243 100644 --- a/trunk/include/asm-x86/pvclock-abi.h +++ b/trunk/include/asm-x86/pvclock-abi.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PVCLOCK_ABI_H -#define ASM_X86__PVCLOCK_ABI_H +#ifndef _ASM_X86_PVCLOCK_ABI_H_ +#define _ASM_X86_PVCLOCK_ABI_H_ #ifndef __ASSEMBLY__ /* @@ -39,4 +39,4 @@ struct pvclock_wall_clock { } __attribute__((__packed__)); #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__PVCLOCK_ABI_H */ +#endif /* _ASM_X86_PVCLOCK_ABI_H_ */ diff --git a/trunk/include/asm-x86/pvclock.h b/trunk/include/asm-x86/pvclock.h index 1a38f6834800..85b1bba8e0a3 100644 --- a/trunk/include/asm-x86/pvclock.h +++ b/trunk/include/asm-x86/pvclock.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__PVCLOCK_H -#define ASM_X86__PVCLOCK_H +#ifndef _ASM_X86_PVCLOCK_H_ +#define _ASM_X86_PVCLOCK_H_ #include #include @@ -10,4 +10,4 @@ void pvclock_read_wallclock(struct pvclock_wall_clock *wall, struct pvclock_vcpu_time_info *vcpu, struct timespec *ts); -#endif /* ASM_X86__PVCLOCK_H */ +#endif /* _ASM_X86_PVCLOCK_H_ */ diff --git a/trunk/include/asm-x86/reboot.h b/trunk/include/asm-x86/reboot.h index 1c2f0ce9e31e..206f355786dc 100644 --- a/trunk/include/asm-x86/reboot.h +++ b/trunk/include/asm-x86/reboot.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__REBOOT_H -#define ASM_X86__REBOOT_H +#ifndef _ASM_REBOOT_H +#define _ASM_REBOOT_H struct pt_regs; @@ -18,4 +18,4 @@ void native_machine_crash_shutdown(struct pt_regs *regs); void native_machine_shutdown(void); void machine_real_restart(const unsigned char *code, int length); -#endif /* ASM_X86__REBOOT_H */ +#endif /* _ASM_REBOOT_H */ diff --git a/trunk/include/asm-x86/reboot_fixups.h b/trunk/include/asm-x86/reboot_fixups.h index 2c2987d97570..0cb7d87c2b68 100644 --- a/trunk/include/asm-x86/reboot_fixups.h +++ b/trunk/include/asm-x86/reboot_fixups.h @@ -1,6 +1,6 @@ -#ifndef ASM_X86__REBOOT_FIXUPS_H -#define ASM_X86__REBOOT_FIXUPS_H +#ifndef _LINUX_REBOOT_FIXUPS_H +#define _LINUX_REBOOT_FIXUPS_H extern void mach_reboot_fixups(void); -#endif /* ASM_X86__REBOOT_FIXUPS_H */ +#endif /* _LINUX_REBOOT_FIXUPS_H */ diff --git a/trunk/include/asm-x86/required-features.h b/trunk/include/asm-x86/required-features.h index a01c4e376331..adec887dd7cd 100644 --- a/trunk/include/asm-x86/required-features.h +++ b/trunk/include/asm-x86/required-features.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__REQUIRED_FEATURES_H -#define ASM_X86__REQUIRED_FEATURES_H +#ifndef _ASM_REQUIRED_FEATURES_H +#define _ASM_REQUIRED_FEATURES_H 1 /* Define minimum CPUID feature set for kernel These bits are checked really early to actually display a visible error message before the @@ -41,12 +41,6 @@ # define NEED_3DNOW 0 #endif -#if defined(CONFIG_X86_P6_NOP) || defined(CONFIG_X86_64) -# define NEED_NOPL (1<<(X86_FEATURE_NOPL & 31)) -#else -# define NEED_NOPL 0 -#endif - #ifdef CONFIG_X86_64 #define NEED_PSE 0 #define NEED_MSR (1<<(X86_FEATURE_MSR & 31)) @@ -73,10 +67,10 @@ #define REQUIRED_MASK1 (NEED_LM|NEED_3DNOW) #define REQUIRED_MASK2 0 -#define REQUIRED_MASK3 (NEED_NOPL) +#define REQUIRED_MASK3 0 #define REQUIRED_MASK4 0 #define REQUIRED_MASK5 0 #define REQUIRED_MASK6 0 #define REQUIRED_MASK7 0 -#endif /* ASM_X86__REQUIRED_FEATURES_H */ +#endif diff --git a/trunk/include/asm-x86/resume-trace.h b/trunk/include/asm-x86/resume-trace.h index 519a8ecbfc95..8d9f0b41ee86 100644 --- a/trunk/include/asm-x86/resume-trace.h +++ b/trunk/include/asm-x86/resume-trace.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__RESUME_TRACE_H -#define ASM_X86__RESUME_TRACE_H +#ifndef _ASM_X86_RESUME_TRACE_H +#define _ASM_X86_RESUME_TRACE_H #include @@ -18,4 +18,4 @@ do { \ } \ } while (0) -#endif /* ASM_X86__RESUME_TRACE_H */ +#endif diff --git a/trunk/include/asm-x86/rio.h b/trunk/include/asm-x86/rio.h index 5e1256bdee83..c9448bd8968f 100644 --- a/trunk/include/asm-x86/rio.h +++ b/trunk/include/asm-x86/rio.h @@ -5,8 +5,8 @@ * Author: Laurent Vivier */ -#ifndef ASM_X86__RIO_H -#define ASM_X86__RIO_H +#ifndef __ASM_RIO_H +#define __ASM_RIO_H #define RIO_TABLE_VERSION 3 @@ -60,4 +60,4 @@ enum { ALT_CALGARY = 5, /* Second Planar Calgary */ }; -#endif /* ASM_X86__RIO_H */ +#endif /* __ASM_RIO_H */ diff --git a/trunk/include/asm-x86/rwlock.h b/trunk/include/asm-x86/rwlock.h index 48a3109e1a7d..6a8c0d645108 100644 --- a/trunk/include/asm-x86/rwlock.h +++ b/trunk/include/asm-x86/rwlock.h @@ -1,8 +1,8 @@ -#ifndef ASM_X86__RWLOCK_H -#define ASM_X86__RWLOCK_H +#ifndef _ASM_X86_RWLOCK_H +#define _ASM_X86_RWLOCK_H #define RW_LOCK_BIAS 0x01000000 /* Actual code is in asm/spinlock.h or in arch/x86/lib/rwlock.S */ -#endif /* ASM_X86__RWLOCK_H */ +#endif /* _ASM_X86_RWLOCK_H */ diff --git a/trunk/include/asm-x86/rwsem.h b/trunk/include/asm-x86/rwsem.h index 3ff3015b71a8..750f2a3542b3 100644 --- a/trunk/include/asm-x86/rwsem.h +++ b/trunk/include/asm-x86/rwsem.h @@ -29,8 +29,8 @@ * front, then they'll all be woken up, but no other readers will be. */ -#ifndef ASM_X86__RWSEM_H -#define ASM_X86__RWSEM_H +#ifndef _I386_RWSEM_H +#define _I386_RWSEM_H #ifndef _LINUX_RWSEM_H #error "please don't include asm/rwsem.h directly, use linux/rwsem.h instead" @@ -262,4 +262,4 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) } #endif /* __KERNEL__ */ -#endif /* ASM_X86__RWSEM_H */ +#endif /* _I386_RWSEM_H */ diff --git a/trunk/include/asm-x86/scatterlist.h b/trunk/include/asm-x86/scatterlist.h index ee48f880005d..c0432061f81a 100644 --- a/trunk/include/asm-x86/scatterlist.h +++ b/trunk/include/asm-x86/scatterlist.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SCATTERLIST_H -#define ASM_X86__SCATTERLIST_H +#ifndef _ASM_X86_SCATTERLIST_H +#define _ASM_X86_SCATTERLIST_H #include @@ -30,4 +30,4 @@ struct scatterlist { # define sg_dma_len(sg) ((sg)->dma_length) #endif -#endif /* ASM_X86__SCATTERLIST_H */ +#endif diff --git a/trunk/include/asm-x86/seccomp_32.h b/trunk/include/asm-x86/seccomp_32.h index cf9ab2dbcef1..36e71c5f306f 100644 --- a/trunk/include/asm-x86/seccomp_32.h +++ b/trunk/include/asm-x86/seccomp_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SECCOMP_32_H -#define ASM_X86__SECCOMP_32_H +#ifndef _ASM_SECCOMP_H +#define _ASM_SECCOMP_H #include @@ -14,4 +14,4 @@ #define __NR_seccomp_exit __NR_exit #define __NR_seccomp_sigreturn __NR_sigreturn -#endif /* ASM_X86__SECCOMP_32_H */ +#endif /* _ASM_SECCOMP_H */ diff --git a/trunk/include/asm-x86/seccomp_64.h b/trunk/include/asm-x86/seccomp_64.h index 03274cea751f..76cfe69aa63c 100644 --- a/trunk/include/asm-x86/seccomp_64.h +++ b/trunk/include/asm-x86/seccomp_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SECCOMP_64_H -#define ASM_X86__SECCOMP_64_H +#ifndef _ASM_SECCOMP_H +#define _ASM_SECCOMP_H #include @@ -22,4 +22,4 @@ #define __NR_seccomp_exit_32 __NR_ia32_exit #define __NR_seccomp_sigreturn_32 __NR_ia32_sigreturn -#endif /* ASM_X86__SECCOMP_64_H */ +#endif /* _ASM_SECCOMP_H */ diff --git a/trunk/include/asm-x86/segment.h b/trunk/include/asm-x86/segment.h index ea5f0a8686f7..646452ea9ea3 100644 --- a/trunk/include/asm-x86/segment.h +++ b/trunk/include/asm-x86/segment.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SEGMENT_H -#define ASM_X86__SEGMENT_H +#ifndef _ASM_X86_SEGMENT_H_ +#define _ASM_X86_SEGMENT_H_ /* Constructor for a conventional segment GDT (or LDT) entry */ /* This is a macro so it can be used in initializers */ @@ -212,4 +212,4 @@ extern const char early_idt_handlers[NUM_EXCEPTION_VECTORS][10]; #endif #endif -#endif /* ASM_X86__SEGMENT_H */ +#endif diff --git a/trunk/include/asm-x86/sembuf.h b/trunk/include/asm-x86/sembuf.h index 81f06b7e5a3f..ee50c801f7b7 100644 --- a/trunk/include/asm-x86/sembuf.h +++ b/trunk/include/asm-x86/sembuf.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SEMBUF_H -#define ASM_X86__SEMBUF_H +#ifndef _ASM_X86_SEMBUF_H +#define _ASM_X86_SEMBUF_H /* * The semid64_ds structure for x86 architecture. @@ -21,4 +21,4 @@ struct semid64_ds { unsigned long __unused4; }; -#endif /* ASM_X86__SEMBUF_H */ +#endif /* _ASM_X86_SEMBUF_H */ diff --git a/trunk/include/asm-x86/serial.h b/trunk/include/asm-x86/serial.h index 303660b671e5..628c801535ea 100644 --- a/trunk/include/asm-x86/serial.h +++ b/trunk/include/asm-x86/serial.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SERIAL_H -#define ASM_X86__SERIAL_H +#ifndef _ASM_X86_SERIAL_H +#define _ASM_X86_SERIAL_H /* * This assumes you have a 1.8432 MHz clock for your UART. @@ -26,4 +26,4 @@ { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \ { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */ -#endif /* ASM_X86__SERIAL_H */ +#endif /* _ASM_X86_SERIAL_H */ diff --git a/trunk/include/asm-x86/setup.h b/trunk/include/asm-x86/setup.h index 11b6cc14b289..a07c6f1c01e1 100644 --- a/trunk/include/asm-x86/setup.h +++ b/trunk/include/asm-x86/setup.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SETUP_H -#define ASM_X86__SETUP_H +#ifndef _ASM_X86_SETUP_H +#define _ASM_X86_SETUP_H #define COMMAND_LINE_SIZE 2048 @@ -38,11 +38,9 @@ struct x86_quirks { void (*mpc_oem_pci_bus)(struct mpc_config_bus *m); void (*smp_read_mpc_oem)(struct mp_config_oemtable *oemtable, unsigned short oemsize); - int (*setup_ioapic_ids)(void); }; extern struct x86_quirks *x86_quirks; -extern unsigned long saved_video_mode; #ifndef CONFIG_PARAVIRT #define paravirt_post_allocator_init() do {} while (0) @@ -102,4 +100,4 @@ void __init x86_64_start_reservations(char *real_mode_data); #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ -#endif /* ASM_X86__SETUP_H */ +#endif /* _ASM_X86_SETUP_H */ diff --git a/trunk/include/asm-x86/shmbuf.h b/trunk/include/asm-x86/shmbuf.h index f51aec2298e9..b51413b74971 100644 --- a/trunk/include/asm-x86/shmbuf.h +++ b/trunk/include/asm-x86/shmbuf.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SHMBUF_H -#define ASM_X86__SHMBUF_H +#ifndef _ASM_X86_SHMBUF_H +#define _ASM_X86_SHMBUF_H /* * The shmid64_ds structure for x86 architecture. @@ -48,4 +48,4 @@ struct shminfo64 { unsigned long __unused4; }; -#endif /* ASM_X86__SHMBUF_H */ +#endif /* _ASM_X86_SHMBUF_H */ diff --git a/trunk/include/asm-x86/shmparam.h b/trunk/include/asm-x86/shmparam.h index a83a1fd96a0e..0880cf0917b9 100644 --- a/trunk/include/asm-x86/shmparam.h +++ b/trunk/include/asm-x86/shmparam.h @@ -1,6 +1,6 @@ -#ifndef ASM_X86__SHMPARAM_H -#define ASM_X86__SHMPARAM_H +#ifndef _ASM_X86_SHMPARAM_H +#define _ASM_X86_SHMPARAM_H #define SHMLBA PAGE_SIZE /* attach addr a multiple of this */ -#endif /* ASM_X86__SHMPARAM_H */ +#endif /* _ASM_X86_SHMPARAM_H */ diff --git a/trunk/include/asm-x86/sigcontext.h b/trunk/include/asm-x86/sigcontext.h index 24879c85b291..2f9c884d2c0f 100644 --- a/trunk/include/asm-x86/sigcontext.h +++ b/trunk/include/asm-x86/sigcontext.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SIGCONTEXT_H -#define ASM_X86__SIGCONTEXT_H +#ifndef _ASM_X86_SIGCONTEXT_H +#define _ASM_X86_SIGCONTEXT_H #include #include @@ -202,4 +202,4 @@ struct sigcontext { #endif /* !__i386__ */ -#endif /* ASM_X86__SIGCONTEXT_H */ +#endif diff --git a/trunk/include/asm-x86/sigcontext32.h b/trunk/include/asm-x86/sigcontext32.h index 4e2ec732dd01..57a9686fb491 100644 --- a/trunk/include/asm-x86/sigcontext32.h +++ b/trunk/include/asm-x86/sigcontext32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SIGCONTEXT32_H -#define ASM_X86__SIGCONTEXT32_H +#ifndef _SIGCONTEXT32_H +#define _SIGCONTEXT32_H 1 /* signal context for 32bit programs. */ @@ -68,4 +68,4 @@ struct sigcontext_ia32 { unsigned int cr2; }; -#endif /* ASM_X86__SIGCONTEXT32_H */ +#endif diff --git a/trunk/include/asm-x86/siginfo.h b/trunk/include/asm-x86/siginfo.h index 808bdfb2958c..a477bea0c2a1 100644 --- a/trunk/include/asm-x86/siginfo.h +++ b/trunk/include/asm-x86/siginfo.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SIGINFO_H -#define ASM_X86__SIGINFO_H +#ifndef _ASM_X86_SIGINFO_H +#define _ASM_X86_SIGINFO_H #ifdef __x86_64__ # define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) @@ -7,4 +7,4 @@ #include -#endif /* ASM_X86__SIGINFO_H */ +#endif diff --git a/trunk/include/asm-x86/signal.h b/trunk/include/asm-x86/signal.h index 65acc82d267a..6dac49364e95 100644 --- a/trunk/include/asm-x86/signal.h +++ b/trunk/include/asm-x86/signal.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SIGNAL_H -#define ASM_X86__SIGNAL_H +#ifndef _ASM_X86_SIGNAL_H +#define _ASM_X86_SIGNAL_H #ifndef __ASSEMBLY__ #include @@ -140,9 +140,6 @@ struct sigaction { struct k_sigaction { struct sigaction sa; }; - -extern void do_notify_resume(struct pt_regs *, void *, __u32); - # else /* __KERNEL__ */ /* Here we must cater to libcs that poke about in kernel headers. */ @@ -259,4 +256,4 @@ struct pt_regs; #endif /* __KERNEL__ */ #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__SIGNAL_H */ +#endif diff --git a/trunk/include/asm-x86/smp.h b/trunk/include/asm-x86/smp.h index 29324c103341..3c877f74f279 100644 --- a/trunk/include/asm-x86/smp.h +++ b/trunk/include/asm-x86/smp.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SMP_H -#define ASM_X86__SMP_H +#ifndef _ASM_X86_SMP_H_ +#define _ASM_X86_SMP_H_ #ifndef __ASSEMBLY__ #include #include @@ -34,9 +34,6 @@ extern cpumask_t cpu_initialized; DECLARE_PER_CPU(cpumask_t, cpu_sibling_map); DECLARE_PER_CPU(cpumask_t, cpu_core_map); DECLARE_PER_CPU(u16, cpu_llc_id); -#ifdef CONFIG_X86_32 -DECLARE_PER_CPU(int, cpu_number); -#endif DECLARE_EARLY_PER_CPU(u16, x86_cpu_to_apicid); DECLARE_EARLY_PER_CPU(u16, x86_bios_cpu_apicid); @@ -145,6 +142,7 @@ extern unsigned disabled_cpus __cpuinitdata; * from the initial startup. We map APIC_BASE very early in page_setup(), * so this is correct in the x86 case. */ +DECLARE_PER_CPU(int, cpu_number); #define raw_smp_processor_id() (x86_read_percpu(cpu_number)) extern int safe_smp_processor_id(void); @@ -167,33 +165,30 @@ extern int safe_smp_processor_id(void); #ifdef CONFIG_X86_LOCAL_APIC -#ifndef CONFIG_X86_64 static inline int logical_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR)); } -#include +#ifndef CONFIG_X86_64 static inline unsigned int read_apic_id(void) { - unsigned int reg; - - reg = *(u32 *)(APIC_BASE + APIC_ID); - - return GET_APIC_ID(reg); + return *(u32 *)(APIC_BASE + APIC_ID); } +#else +extern unsigned int read_apic_id(void); #endif -# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64) +# ifdef APIC_DEFINITION extern int hard_smp_processor_id(void); # else -#include +# include static inline int hard_smp_processor_id(void) { /* we don't want to mark this access volatile - bad code generation */ - return read_apic_id(); + return GET_APIC_ID(read_apic_id()); } # endif /* APIC_DEFINITION */ @@ -210,4 +205,4 @@ extern void cpu_uninit(void); #endif #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__SMP_H */ +#endif diff --git a/trunk/include/asm-x86/socket.h b/trunk/include/asm-x86/socket.h index db73274c83c3..80af9c4ccad7 100644 --- a/trunk/include/asm-x86/socket.h +++ b/trunk/include/asm-x86/socket.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SOCKET_H -#define ASM_X86__SOCKET_H +#ifndef _ASM_SOCKET_H +#define _ASM_SOCKET_H #include @@ -54,4 +54,4 @@ #define SO_MARK 36 -#endif /* ASM_X86__SOCKET_H */ +#endif /* _ASM_SOCKET_H */ diff --git a/trunk/include/asm-x86/sockios.h b/trunk/include/asm-x86/sockios.h index a006704fdc84..49cc72b5d3c9 100644 --- a/trunk/include/asm-x86/sockios.h +++ b/trunk/include/asm-x86/sockios.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SOCKIOS_H -#define ASM_X86__SOCKIOS_H +#ifndef _ASM_X86_SOCKIOS_H +#define _ASM_X86_SOCKIOS_H /* Socket-level I/O control calls. */ #define FIOSETOWN 0x8901 @@ -10,4 +10,4 @@ #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ -#endif /* ASM_X86__SOCKIOS_H */ +#endif /* _ASM_X86_SOCKIOS_H */ diff --git a/trunk/include/asm-x86/sparsemem.h b/trunk/include/asm-x86/sparsemem.h index 38f8e6bc3186..9bd48b0a534b 100644 --- a/trunk/include/asm-x86/sparsemem.h +++ b/trunk/include/asm-x86/sparsemem.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SPARSEMEM_H -#define ASM_X86__SPARSEMEM_H +#ifndef _ASM_X86_SPARSEMEM_H +#define _ASM_X86_SPARSEMEM_H #ifdef CONFIG_SPARSEMEM /* @@ -31,4 +31,4 @@ #endif #endif /* CONFIG_SPARSEMEM */ -#endif /* ASM_X86__SPARSEMEM_H */ +#endif diff --git a/trunk/include/asm-x86/spinlock.h b/trunk/include/asm-x86/spinlock.h index 5d08fa280fdf..e39c790dbfd2 100644 --- a/trunk/include/asm-x86/spinlock.h +++ b/trunk/include/asm-x86/spinlock.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SPINLOCK_H -#define ASM_X86__SPINLOCK_H +#ifndef _X86_SPINLOCK_H_ +#define _X86_SPINLOCK_H_ #include #include @@ -366,4 +366,4 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) #define _raw_read_relax(lock) cpu_relax() #define _raw_write_relax(lock) cpu_relax() -#endif /* ASM_X86__SPINLOCK_H */ +#endif diff --git a/trunk/include/asm-x86/spinlock_types.h b/trunk/include/asm-x86/spinlock_types.h index 6aa9b562c508..06c071c9eee9 100644 --- a/trunk/include/asm-x86/spinlock_types.h +++ b/trunk/include/asm-x86/spinlock_types.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SPINLOCK_TYPES_H -#define ASM_X86__SPINLOCK_TYPES_H +#ifndef __ASM_SPINLOCK_TYPES_H +#define __ASM_SPINLOCK_TYPES_H #ifndef __LINUX_SPINLOCK_TYPES_H # error "please don't include this file directly" @@ -17,4 +17,4 @@ typedef struct { #define __RAW_RW_LOCK_UNLOCKED { RW_LOCK_BIAS } -#endif /* ASM_X86__SPINLOCK_TYPES_H */ +#endif diff --git a/trunk/include/asm-x86/srat.h b/trunk/include/asm-x86/srat.h index 5363e4f7e1cd..774c919dc232 100644 --- a/trunk/include/asm-x86/srat.h +++ b/trunk/include/asm-x86/srat.h @@ -24,8 +24,8 @@ * Send feedback to Pat Gaughen */ -#ifndef ASM_X86__SRAT_H -#define ASM_X86__SRAT_H +#ifndef _ASM_SRAT_H_ +#define _ASM_SRAT_H_ #ifdef CONFIG_ACPI_NUMA extern int get_memcfg_from_srat(void); @@ -36,4 +36,4 @@ static inline int get_memcfg_from_srat(void) } #endif -#endif /* ASM_X86__SRAT_H */ +#endif /* _ASM_SRAT_H_ */ diff --git a/trunk/include/asm-x86/stacktrace.h b/trunk/include/asm-x86/stacktrace.h index f43517e28532..30f82526a8e2 100644 --- a/trunk/include/asm-x86/stacktrace.h +++ b/trunk/include/asm-x86/stacktrace.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__STACKTRACE_H -#define ASM_X86__STACKTRACE_H +#ifndef _ASM_STACKTRACE_H +#define _ASM_STACKTRACE_H 1 extern int kstack_depth_to_print; @@ -18,4 +18,4 @@ void dump_trace(struct task_struct *tsk, struct pt_regs *regs, unsigned long *stack, unsigned long bp, const struct stacktrace_ops *ops, void *data); -#endif /* ASM_X86__STACKTRACE_H */ +#endif diff --git a/trunk/include/asm-x86/stat.h b/trunk/include/asm-x86/stat.h index 1e120f628905..5c22dcb5d17e 100644 --- a/trunk/include/asm-x86/stat.h +++ b/trunk/include/asm-x86/stat.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__STAT_H -#define ASM_X86__STAT_H +#ifndef _ASM_X86_STAT_H +#define _ASM_X86_STAT_H #define STAT_HAVE_NSEC 1 @@ -111,4 +111,4 @@ struct __old_kernel_stat { #endif }; -#endif /* ASM_X86__STAT_H */ +#endif diff --git a/trunk/include/asm-x86/statfs.h b/trunk/include/asm-x86/statfs.h index 3f005bc3aa5b..7c651aa97252 100644 --- a/trunk/include/asm-x86/statfs.h +++ b/trunk/include/asm-x86/statfs.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__STATFS_H -#define ASM_X86__STATFS_H +#ifndef _ASM_X86_STATFS_H +#define _ASM_X86_STATFS_H #ifdef __i386__ #include @@ -60,4 +60,4 @@ struct compat_statfs64 { } __attribute__((packed)); #endif /* !__i386__ */ -#endif /* ASM_X86__STATFS_H */ +#endif diff --git a/trunk/include/asm-x86/string_32.h b/trunk/include/asm-x86/string_32.h index 487843ed245a..193578cd1fd9 100644 --- a/trunk/include/asm-x86/string_32.h +++ b/trunk/include/asm-x86/string_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__STRING_32_H -#define ASM_X86__STRING_32_H +#ifndef _I386_STRING_H_ +#define _I386_STRING_H_ #ifdef __KERNEL__ @@ -323,4 +323,4 @@ extern void *memscan(void *addr, int c, size_t size); #endif /* __KERNEL__ */ -#endif /* ASM_X86__STRING_32_H */ +#endif diff --git a/trunk/include/asm-x86/string_64.h b/trunk/include/asm-x86/string_64.h index a2add11d3b66..52b5ab383395 100644 --- a/trunk/include/asm-x86/string_64.h +++ b/trunk/include/asm-x86/string_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__STRING_64_H -#define ASM_X86__STRING_64_H +#ifndef _X86_64_STRING_H_ +#define _X86_64_STRING_H_ #ifdef __KERNEL__ @@ -57,4 +57,4 @@ int strcmp(const char *cs, const char *ct); #endif /* __KERNEL__ */ -#endif /* ASM_X86__STRING_64_H */ +#endif diff --git a/trunk/include/asm-x86/summit/apicdef.h b/trunk/include/asm-x86/summit/apicdef.h deleted file mode 100644 index f3fbca1f61c1..000000000000 --- a/trunk/include/asm-x86/summit/apicdef.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __ASM_SUMMIT_APICDEF_H -#define __ASM_SUMMIT_APICDEF_H - -#define APIC_ID_MASK (0xFF<<24) - -static inline unsigned get_apic_id(unsigned long x) -{ - return (x>>24)&0xFF; -} - -#define GET_APIC_ID(x) get_apic_id(x) - -#endif diff --git a/trunk/include/asm-x86/suspend_32.h b/trunk/include/asm-x86/suspend_32.h index acb6d4d491f4..8675c6782a7d 100644 --- a/trunk/include/asm-x86/suspend_32.h +++ b/trunk/include/asm-x86/suspend_32.h @@ -3,8 +3,8 @@ * Based on code * Copyright 2001 Patrick Mochel */ -#ifndef ASM_X86__SUSPEND_32_H -#define ASM_X86__SUSPEND_32_H +#ifndef __ASM_X86_32_SUSPEND_H +#define __ASM_X86_32_SUSPEND_H #include #include @@ -48,4 +48,4 @@ static inline void acpi_save_register_state(unsigned long return_point) extern int acpi_save_state_mem(void); #endif -#endif /* ASM_X86__SUSPEND_32_H */ +#endif /* __ASM_X86_32_SUSPEND_H */ diff --git a/trunk/include/asm-x86/suspend_64.h b/trunk/include/asm-x86/suspend_64.h index cf821dd310e8..dc3262b43072 100644 --- a/trunk/include/asm-x86/suspend_64.h +++ b/trunk/include/asm-x86/suspend_64.h @@ -3,8 +3,8 @@ * Based on code * Copyright 2001 Patrick Mochel */ -#ifndef ASM_X86__SUSPEND_64_H -#define ASM_X86__SUSPEND_64_H +#ifndef __ASM_X86_64_SUSPEND_H +#define __ASM_X86_64_SUSPEND_H #include #include @@ -49,4 +49,4 @@ extern int acpi_save_state_mem(void); extern char core_restore_code; extern char restore_registers; -#endif /* ASM_X86__SUSPEND_64_H */ +#endif /* __ASM_X86_64_SUSPEND_H */ diff --git a/trunk/include/asm-x86/swiotlb.h b/trunk/include/asm-x86/swiotlb.h index 1e20adbcad4b..2730b351afcf 100644 --- a/trunk/include/asm-x86/swiotlb.h +++ b/trunk/include/asm-x86/swiotlb.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SWIOTLB_H -#define ASM_X86__SWIOTLB_H +#ifndef _ASM_SWIOTLB_H +#define _ASM_SWIOTLB_H 1 #include @@ -55,4 +55,4 @@ static inline void pci_swiotlb_init(void) static inline void dma_mark_clean(void *addr, size_t size) {} -#endif /* ASM_X86__SWIOTLB_H */ +#endif /* _ASM_SWIOTLB_H */ diff --git a/trunk/include/asm-x86/sync_bitops.h b/trunk/include/asm-x86/sync_bitops.h index b689bee71104..b47a1d0b8a83 100644 --- a/trunk/include/asm-x86/sync_bitops.h +++ b/trunk/include/asm-x86/sync_bitops.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SYNC_BITOPS_H -#define ASM_X86__SYNC_BITOPS_H +#ifndef _I386_SYNC_BITOPS_H +#define _I386_SYNC_BITOPS_H /* * Copyright 1992, Linus Torvalds. @@ -127,4 +127,4 @@ static inline int sync_test_and_change_bit(int nr, volatile unsigned long *addr) #undef ADDR -#endif /* ASM_X86__SYNC_BITOPS_H */ +#endif /* _I386_SYNC_BITOPS_H */ diff --git a/trunk/include/asm-x86/syscalls.h b/trunk/include/asm-x86/syscalls.h deleted file mode 100644 index 87803da44010..000000000000 --- a/trunk/include/asm-x86/syscalls.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * syscalls.h - Linux syscall interfaces (arch-specific) - * - * Copyright (c) 2008 Jaswinder Singh - * - * This file is released under the GPLv2. - * See the file COPYING for more details. - */ - -#ifndef _ASM_X86_SYSCALLS_H -#define _ASM_X86_SYSCALLS_H - -#include -#include -#include -#include - -/* Common in X86_32 and X86_64 */ -/* kernel/ioport.c */ -asmlinkage long sys_ioperm(unsigned long, unsigned long, int); - -/* X86_32 only */ -#ifdef CONFIG_X86_32 -/* kernel/process_32.c */ -asmlinkage int sys_fork(struct pt_regs); -asmlinkage int sys_clone(struct pt_regs); -asmlinkage int sys_vfork(struct pt_regs); -asmlinkage int sys_execve(struct pt_regs); - -/* kernel/signal_32.c */ -asmlinkage int sys_sigsuspend(int, int, old_sigset_t); -asmlinkage int sys_sigaction(int, const struct old_sigaction __user *, - struct old_sigaction __user *); -asmlinkage int sys_sigaltstack(unsigned long); -asmlinkage unsigned long sys_sigreturn(unsigned long); -asmlinkage int sys_rt_sigreturn(unsigned long); - -/* kernel/ioport.c */ -asmlinkage long sys_iopl(unsigned long); - -/* kernel/ldt.c */ -asmlinkage int sys_modify_ldt(int, void __user *, unsigned long); - -/* kernel/sys_i386_32.c */ -asmlinkage long sys_mmap2(unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long); -struct mmap_arg_struct; -asmlinkage int old_mmap(struct mmap_arg_struct __user *); -struct sel_arg_struct; -asmlinkage int old_select(struct sel_arg_struct __user *); -asmlinkage int sys_ipc(uint, int, int, int, void __user *, long); -struct old_utsname; -asmlinkage int sys_uname(struct old_utsname __user *); -struct oldold_utsname; -asmlinkage int sys_olduname(struct oldold_utsname __user *); - -/* kernel/tls.c */ -asmlinkage int sys_set_thread_area(struct user_desc __user *); -asmlinkage int sys_get_thread_area(struct user_desc __user *); - -/* kernel/vm86_32.c */ -asmlinkage int sys_vm86old(struct pt_regs); -asmlinkage int sys_vm86(struct pt_regs); - -#else /* CONFIG_X86_32 */ - -/* X86_64 only */ -/* kernel/process_64.c */ -asmlinkage long sys_fork(struct pt_regs *); -asmlinkage long sys_clone(unsigned long, unsigned long, - void __user *, void __user *, - struct pt_regs *); -asmlinkage long sys_vfork(struct pt_regs *); -asmlinkage long sys_execve(char __user *, char __user * __user *, - char __user * __user *, - struct pt_regs *); - -/* kernel/ioport.c */ -asmlinkage long sys_iopl(unsigned int, struct pt_regs *); - -/* kernel/signal_64.c */ -asmlinkage long sys_sigaltstack(const stack_t __user *, stack_t __user *, - struct pt_regs *); -asmlinkage long sys_rt_sigreturn(struct pt_regs *); - -/* kernel/sys_x86_64.c */ -asmlinkage long sys_mmap(unsigned long, unsigned long, unsigned long, - unsigned long, unsigned long, unsigned long); -struct new_utsname; -asmlinkage long sys_uname(struct new_utsname __user *); - -#endif /* CONFIG_X86_32 */ -#endif /* _ASM_X86_SYSCALLS_H */ diff --git a/trunk/include/asm-x86/system.h b/trunk/include/asm-x86/system.h index 34505dd7b24d..983ce37c491f 100644 --- a/trunk/include/asm-x86/system.h +++ b/trunk/include/asm-x86/system.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SYSTEM_H -#define ASM_X86__SYSTEM_H +#ifndef _ASM_X86_SYSTEM_H_ +#define _ASM_X86_SYSTEM_H_ #include #include @@ -419,4 +419,4 @@ static inline void rdtsc_barrier(void) alternative(ASM_NOP3, "lfence", X86_FEATURE_LFENCE_RDTSC); } -#endif /* ASM_X86__SYSTEM_H */ +#endif diff --git a/trunk/include/asm-x86/system_64.h b/trunk/include/asm-x86/system_64.h index 5aedb8bffc5a..97fa251ccb2b 100644 --- a/trunk/include/asm-x86/system_64.h +++ b/trunk/include/asm-x86/system_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__SYSTEM_64_H -#define ASM_X86__SYSTEM_64_H +#ifndef __ASM_SYSTEM_H +#define __ASM_SYSTEM_H #include #include @@ -19,4 +19,4 @@ static inline void write_cr8(unsigned long val) #include -#endif /* ASM_X86__SYSTEM_64_H */ +#endif diff --git a/trunk/include/asm-x86/tce.h b/trunk/include/asm-x86/tce.h index e7932d7fbbab..b1a4ea00df78 100644 --- a/trunk/include/asm-x86/tce.h +++ b/trunk/include/asm-x86/tce.h @@ -21,8 +21,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef ASM_X86__TCE_H -#define ASM_X86__TCE_H +#ifndef _ASM_X86_64_TCE_H +#define _ASM_X86_64_TCE_H extern unsigned int specified_table_size; struct iommu_table; @@ -45,4 +45,4 @@ extern void * __init alloc_tce_table(void); extern void __init free_tce_table(void *tbl); extern int __init build_tce_table(struct pci_dev *dev, void __iomem *bbar); -#endif /* ASM_X86__TCE_H */ +#endif /* _ASM_X86_64_TCE_H */ diff --git a/trunk/include/asm-x86/termbits.h b/trunk/include/asm-x86/termbits.h index 3d00dc5e0c71..af1b70ea440f 100644 --- a/trunk/include/asm-x86/termbits.h +++ b/trunk/include/asm-x86/termbits.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TERMBITS_H -#define ASM_X86__TERMBITS_H +#ifndef _ASM_X86_TERMBITS_H +#define _ASM_X86_TERMBITS_H #include @@ -195,4 +195,4 @@ struct ktermios { #define TCSADRAIN 1 #define TCSAFLUSH 2 -#endif /* ASM_X86__TERMBITS_H */ +#endif /* _ASM_X86_TERMBITS_H */ diff --git a/trunk/include/asm-x86/termios.h b/trunk/include/asm-x86/termios.h index e235db248071..f72956331c49 100644 --- a/trunk/include/asm-x86/termios.h +++ b/trunk/include/asm-x86/termios.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TERMIOS_H -#define ASM_X86__TERMIOS_H +#ifndef _ASM_X86_TERMIOS_H +#define _ASM_X86_TERMIOS_H #include #include @@ -110,4 +110,4 @@ static inline int kernel_termios_to_user_termios_1(struct termios __user *u, #endif /* __KERNEL__ */ -#endif /* ASM_X86__TERMIOS_H */ +#endif /* _ASM_X86_TERMIOS_H */ diff --git a/trunk/include/asm-x86/therm_throt.h b/trunk/include/asm-x86/therm_throt.h index 1c7f57b6b66e..399bf6026b16 100644 --- a/trunk/include/asm-x86/therm_throt.h +++ b/trunk/include/asm-x86/therm_throt.h @@ -1,9 +1,9 @@ -#ifndef ASM_X86__THERM_THROT_H -#define ASM_X86__THERM_THROT_H +#ifndef __ASM_I386_THERM_THROT_H__ +#define __ASM_I386_THERM_THROT_H__ 1 #include extern atomic_t therm_throt_en; int therm_throt_process(int curr); -#endif /* ASM_X86__THERM_THROT_H */ +#endif /* __ASM_I386_THERM_THROT_H__ */ diff --git a/trunk/include/asm-x86/thread_info.h b/trunk/include/asm-x86/thread_info.h index e64be8863b76..da0a675adf94 100644 --- a/trunk/include/asm-x86/thread_info.h +++ b/trunk/include/asm-x86/thread_info.h @@ -4,8 +4,8 @@ * - Incorporating suggestions made by Linus Torvalds and Dave Miller */ -#ifndef ASM_X86__THREAD_INFO_H -#define ASM_X86__THREAD_INFO_H +#ifndef _ASM_X86_THREAD_INFO_H +#define _ASM_X86_THREAD_INFO_H #include #include @@ -258,4 +258,4 @@ extern void free_thread_info(struct thread_info *ti); extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); #define arch_task_cache_init arch_task_cache_init #endif -#endif /* ASM_X86__THREAD_INFO_H */ +#endif /* _ASM_X86_THREAD_INFO_H */ diff --git a/trunk/include/asm-x86/time.h b/trunk/include/asm-x86/time.h index 3e724eef7ac4..a17fa473e91d 100644 --- a/trunk/include/asm-x86/time.h +++ b/trunk/include/asm-x86/time.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TIME_H -#define ASM_X86__TIME_H +#ifndef _ASMX86_TIME_H +#define _ASMX86_TIME_H extern void hpet_time_init(void); @@ -46,8 +46,6 @@ static inline int native_set_wallclock(unsigned long nowtime) #endif -extern void time_init(void); - #ifdef CONFIG_PARAVIRT #include #else /* !CONFIG_PARAVIRT */ @@ -60,4 +58,4 @@ extern void time_init(void); extern unsigned long __init calibrate_cpu(void); -#endif /* ASM_X86__TIME_H */ +#endif diff --git a/trunk/include/asm-x86/timer.h b/trunk/include/asm-x86/timer.h index d0babce4b47a..fb2a4ddddf3d 100644 --- a/trunk/include/asm-x86/timer.h +++ b/trunk/include/asm-x86/timer.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TIMER_H -#define ASM_X86__TIMER_H +#ifndef _ASMi386_TIMER_H +#define _ASMi386_TIMER_H #include #include #include @@ -9,12 +9,9 @@ unsigned long long native_sched_clock(void); unsigned long native_calibrate_tsc(void); -#ifdef CONFIG_X86_32 extern int timer_ack; -extern int recalibrate_cpu_khz(void); -#endif /* CONFIG_X86_32 */ - extern int no_timer_check; +extern int recalibrate_cpu_khz(void); #ifndef CONFIG_PARAVIRT #define calibrate_tsc() native_calibrate_tsc() @@ -63,4 +60,4 @@ static inline unsigned long long cycles_2_ns(unsigned long long cyc) return ns; } -#endif /* ASM_X86__TIMER_H */ +#endif diff --git a/trunk/include/asm-x86/timex.h b/trunk/include/asm-x86/timex.h index d1ce2416a5da..43e5a78500c5 100644 --- a/trunk/include/asm-x86/timex.h +++ b/trunk/include/asm-x86/timex.h @@ -1,6 +1,6 @@ /* x86 architecture timex specifications */ -#ifndef ASM_X86__TIMEX_H -#define ASM_X86__TIMEX_H +#ifndef _ASM_X86_TIMEX_H +#define _ASM_X86_TIMEX_H #include #include @@ -16,4 +16,4 @@ #define ARCH_HAS_READ_CURRENT_TIMER -#endif /* ASM_X86__TIMEX_H */ +#endif diff --git a/trunk/include/asm-x86/tlb.h b/trunk/include/asm-x86/tlb.h index db36e9e89e87..e4e9e2d07a93 100644 --- a/trunk/include/asm-x86/tlb.h +++ b/trunk/include/asm-x86/tlb.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TLB_H -#define ASM_X86__TLB_H +#ifndef _ASM_X86_TLB_H +#define _ASM_X86_TLB_H #define tlb_start_vma(tlb, vma) do { } while (0) #define tlb_end_vma(tlb, vma) do { } while (0) @@ -8,4 +8,4 @@ #include -#endif /* ASM_X86__TLB_H */ +#endif diff --git a/trunk/include/asm-x86/tlbflush.h b/trunk/include/asm-x86/tlbflush.h index ef68b76dc3c5..35c76ceb9f40 100644 --- a/trunk/include/asm-x86/tlbflush.h +++ b/trunk/include/asm-x86/tlbflush.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TLBFLUSH_H -#define ASM_X86__TLBFLUSH_H +#ifndef _ASM_X86_TLBFLUSH_H +#define _ASM_X86_TLBFLUSH_H #include #include @@ -165,4 +165,4 @@ static inline void flush_tlb_kernel_range(unsigned long start, flush_tlb_all(); } -#endif /* ASM_X86__TLBFLUSH_H */ +#endif /* _ASM_X86_TLBFLUSH_H */ diff --git a/trunk/include/asm-x86/topology.h b/trunk/include/asm-x86/topology.h index 7eca9bc022b2..90ac7718469a 100644 --- a/trunk/include/asm-x86/topology.h +++ b/trunk/include/asm-x86/topology.h @@ -22,8 +22,8 @@ * * Send feedback to */ -#ifndef ASM_X86__TOPOLOGY_H -#define ASM_X86__TOPOLOGY_H +#ifndef _ASM_X86_TOPOLOGY_H +#define _ASM_X86_TOPOLOGY_H #ifdef CONFIG_X86_32 # ifdef CONFIG_X86_HT @@ -255,4 +255,4 @@ static inline void set_mp_bus_to_node(int busnum, int node) } #endif -#endif /* ASM_X86__TOPOLOGY_H */ +#endif /* _ASM_X86_TOPOLOGY_H */ diff --git a/trunk/include/asm-x86/trampoline.h b/trunk/include/asm-x86/trampoline.h index 0406bbd898a9..b156b08d0131 100644 --- a/trunk/include/asm-x86/trampoline.h +++ b/trunk/include/asm-x86/trampoline.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TRAMPOLINE_H -#define ASM_X86__TRAMPOLINE_H +#ifndef __TRAMPOLINE_HEADER +#define __TRAMPOLINE_HEADER #ifndef __ASSEMBLY__ @@ -18,4 +18,4 @@ extern unsigned long setup_trampoline(void); #endif /* __ASSEMBLY__ */ -#endif /* ASM_X86__TRAMPOLINE_H */ +#endif /* __TRAMPOLINE_HEADER */ diff --git a/trunk/include/asm-x86/traps.h b/trunk/include/asm-x86/traps.h index 2ccebc6fb0b0..a4b65a71bd66 100644 --- a/trunk/include/asm-x86/traps.h +++ b/trunk/include/asm-x86/traps.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TRAPS_H -#define ASM_X86__TRAPS_H +#ifndef _ASM_X86_TRAPS_H +#define _ASM_X86_TRAPS_H /* Common in X86_32 and X86_64 */ asmlinkage void divide_error(void); @@ -51,8 +51,6 @@ void do_spurious_interrupt_bug(struct pt_regs *, long); unsigned long patch_espfix_desc(unsigned long, unsigned long); asmlinkage void math_emulate(long); -void do_page_fault(struct pt_regs *regs, unsigned long error_code); - #else /* CONFIG_X86_32 */ asmlinkage void double_fault(void); @@ -64,7 +62,5 @@ asmlinkage void do_coprocessor_error(struct pt_regs *); asmlinkage void do_simd_coprocessor_error(struct pt_regs *); asmlinkage void do_spurious_interrupt_bug(struct pt_regs *); -asmlinkage void do_page_fault(struct pt_regs *regs, unsigned long error_code); - #endif /* CONFIG_X86_32 */ -#endif /* ASM_X86__TRAPS_H */ +#endif /* _ASM_X86_TRAPS_H */ diff --git a/trunk/include/asm-x86/tsc.h b/trunk/include/asm-x86/tsc.h index ad0f5c41e78c..cb6f6ee45b8f 100644 --- a/trunk/include/asm-x86/tsc.h +++ b/trunk/include/asm-x86/tsc.h @@ -1,8 +1,8 @@ /* * x86 TSC related functions */ -#ifndef ASM_X86__TSC_H -#define ASM_X86__TSC_H +#ifndef _ASM_X86_TSC_H +#define _ASM_X86_TSC_H #include @@ -59,4 +59,4 @@ extern void check_tsc_sync_target(void); extern int notsc_setup(char *); -#endif /* ASM_X86__TSC_H */ +#endif diff --git a/trunk/include/asm-x86/types.h b/trunk/include/asm-x86/types.h index e78b52e17444..1ac80cd9acf8 100644 --- a/trunk/include/asm-x86/types.h +++ b/trunk/include/asm-x86/types.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__TYPES_H -#define ASM_X86__TYPES_H +#ifndef _ASM_X86_TYPES_H +#define _ASM_X86_TYPES_H #include @@ -33,4 +33,4 @@ typedef u32 dma_addr_t; #endif /* __ASSEMBLY__ */ #endif /* __KERNEL__ */ -#endif /* ASM_X86__TYPES_H */ +#endif diff --git a/trunk/include/asm-x86/uaccess.h b/trunk/include/asm-x86/uaccess.h index 48ebc0ad40ec..5f702d1d5218 100644 --- a/trunk/include/asm-x86/uaccess.h +++ b/trunk/include/asm-x86/uaccess.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UACCESS_H -#define ASM_X86__UACCESS_H +#ifndef _ASM_UACCES_H_ +#define _ASM_UACCES_H_ /* * User space memory access functions */ @@ -450,5 +450,5 @@ extern struct movsl_mask { # include "uaccess_64.h" #endif -#endif /* ASM_X86__UACCESS_H */ +#endif diff --git a/trunk/include/asm-x86/uaccess_32.h b/trunk/include/asm-x86/uaccess_32.h index 6b5b57d9c6d1..6fdef39a0bcb 100644 --- a/trunk/include/asm-x86/uaccess_32.h +++ b/trunk/include/asm-x86/uaccess_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UACCESS_32_H -#define ASM_X86__UACCESS_32_H +#ifndef __i386_UACCESS_H +#define __i386_UACCESS_H /* * User space memory access functions @@ -215,4 +215,4 @@ long strnlen_user(const char __user *str, long n); unsigned long __must_check clear_user(void __user *mem, unsigned long len); unsigned long __must_check __clear_user(void __user *mem, unsigned long len); -#endif /* ASM_X86__UACCESS_32_H */ +#endif /* __i386_UACCESS_H */ diff --git a/trunk/include/asm-x86/uaccess_64.h b/trunk/include/asm-x86/uaccess_64.h index 5cfd2951c9e7..515d4dce96b5 100644 --- a/trunk/include/asm-x86/uaccess_64.h +++ b/trunk/include/asm-x86/uaccess_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UACCESS_64_H -#define ASM_X86__UACCESS_64_H +#ifndef __X86_64_UACCESS_H +#define __X86_64_UACCESS_H /* * User space memory access functions @@ -198,4 +198,4 @@ static inline int __copy_from_user_inatomic_nocache(void *dst, unsigned long copy_user_handle_tail(char *to, char *from, unsigned len, unsigned zerorest); -#endif /* ASM_X86__UACCESS_64_H */ +#endif /* __X86_64_UACCESS_H */ diff --git a/trunk/include/asm-x86/ucontext.h b/trunk/include/asm-x86/ucontext.h index 9948dd328084..50a79f7fcde9 100644 --- a/trunk/include/asm-x86/ucontext.h +++ b/trunk/include/asm-x86/ucontext.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UCONTEXT_H -#define ASM_X86__UCONTEXT_H +#ifndef _ASM_X86_UCONTEXT_H +#define _ASM_X86_UCONTEXT_H struct ucontext { unsigned long uc_flags; @@ -9,4 +9,4 @@ struct ucontext { sigset_t uc_sigmask; /* mask last for extensibility */ }; -#endif /* ASM_X86__UCONTEXT_H */ +#endif /* _ASM_X86_UCONTEXT_H */ diff --git a/trunk/include/asm-x86/unaligned.h b/trunk/include/asm-x86/unaligned.h index 59dcdec37160..a7bd416b4763 100644 --- a/trunk/include/asm-x86/unaligned.h +++ b/trunk/include/asm-x86/unaligned.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UNALIGNED_H -#define ASM_X86__UNALIGNED_H +#ifndef _ASM_X86_UNALIGNED_H +#define _ASM_X86_UNALIGNED_H /* * The x86 can do unaligned accesses itself. @@ -11,4 +11,4 @@ #define get_unaligned __get_unaligned_le #define put_unaligned __put_unaligned_le -#endif /* ASM_X86__UNALIGNED_H */ +#endif /* _ASM_X86_UNALIGNED_H */ diff --git a/trunk/include/asm-x86/unistd_32.h b/trunk/include/asm-x86/unistd_32.h index 017f4a87c913..d7394673b772 100644 --- a/trunk/include/asm-x86/unistd_32.h +++ b/trunk/include/asm-x86/unistd_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UNISTD_32_H -#define ASM_X86__UNISTD_32_H +#ifndef _ASM_I386_UNISTD_H_ +#define _ASM_I386_UNISTD_H_ /* * This file contains the system call numbers. @@ -376,4 +376,4 @@ #endif #endif /* __KERNEL__ */ -#endif /* ASM_X86__UNISTD_32_H */ +#endif /* _ASM_I386_UNISTD_H_ */ diff --git a/trunk/include/asm-x86/unistd_64.h b/trunk/include/asm-x86/unistd_64.h index ace83f1f6787..3a341d791792 100644 --- a/trunk/include/asm-x86/unistd_64.h +++ b/trunk/include/asm-x86/unistd_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UNISTD_64_H -#define ASM_X86__UNISTD_64_H +#ifndef _ASM_X86_64_UNISTD_H_ +#define _ASM_X86_64_UNISTD_H_ #ifndef __SYSCALL #define __SYSCALL(a, b) @@ -690,4 +690,4 @@ __SYSCALL(__NR_inotify_init1, sys_inotify_init1) #define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall") #endif /* __KERNEL__ */ -#endif /* ASM_X86__UNISTD_64_H */ +#endif /* _ASM_X86_64_UNISTD_H_ */ diff --git a/trunk/include/asm-x86/unwind.h b/trunk/include/asm-x86/unwind.h index a2151567db44..8b064bd9c553 100644 --- a/trunk/include/asm-x86/unwind.h +++ b/trunk/include/asm-x86/unwind.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UNWIND_H -#define ASM_X86__UNWIND_H +#ifndef _ASM_X86_UNWIND_H +#define _ASM_X86_UNWIND_H #define UNW_PC(frame) ((void)(frame), 0UL) #define UNW_SP(frame) ((void)(frame), 0UL) @@ -10,4 +10,4 @@ static inline int arch_unw_user_mode(const void *info) return 0; } -#endif /* ASM_X86__UNWIND_H */ +#endif /* _ASM_X86_UNWIND_H */ diff --git a/trunk/include/asm-x86/user32.h b/trunk/include/asm-x86/user32.h index aa66c1857f06..a3d910047879 100644 --- a/trunk/include/asm-x86/user32.h +++ b/trunk/include/asm-x86/user32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__USER32_H -#define ASM_X86__USER32_H +#ifndef USER32_H +#define USER32_H 1 /* IA32 compatible user structures for ptrace. * These should be used for 32bit coredumps too. */ @@ -67,4 +67,4 @@ struct user32 { }; -#endif /* ASM_X86__USER32_H */ +#endif diff --git a/trunk/include/asm-x86/user_32.h b/trunk/include/asm-x86/user_32.h index e0fe2f55f1a6..d6e51edc259d 100644 --- a/trunk/include/asm-x86/user_32.h +++ b/trunk/include/asm-x86/user_32.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__USER_32_H -#define ASM_X86__USER_32_H +#ifndef _I386_USER_H +#define _I386_USER_H #include /* Core file format: The core file is written in such a way that gdb @@ -128,4 +128,4 @@ struct user{ #define HOST_TEXT_START_ADDR (u.start_code) #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) -#endif /* ASM_X86__USER_32_H */ +#endif /* _I386_USER_H */ diff --git a/trunk/include/asm-x86/user_64.h b/trunk/include/asm-x86/user_64.h index 38b5799863b4..6037b634c77f 100644 --- a/trunk/include/asm-x86/user_64.h +++ b/trunk/include/asm-x86/user_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__USER_64_H -#define ASM_X86__USER_64_H +#ifndef _X86_64_USER_H +#define _X86_64_USER_H #include #include @@ -134,4 +134,4 @@ struct user { #define HOST_TEXT_START_ADDR (u.start_code) #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) -#endif /* ASM_X86__USER_64_H */ +#endif /* _X86_64_USER_H */ diff --git a/trunk/include/asm-x86/uv/bios.h b/trunk/include/asm-x86/uv/bios.h index 7cd6d7ec1308..aa73362ff5df 100644 --- a/trunk/include/asm-x86/uv/bios.h +++ b/trunk/include/asm-x86/uv/bios.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__UV__BIOS_H -#define ASM_X86__UV__BIOS_H +#ifndef _ASM_X86_BIOS_H +#define _ASM_X86_BIOS_H /* * BIOS layer definitions. @@ -65,4 +65,4 @@ x86_bios_freq_base(unsigned long which, unsigned long *ticks_per_second, unsigned long *drift_info); extern const char *x86_bios_strerror(long status); -#endif /* ASM_X86__UV__BIOS_H */ +#endif /* _ASM_X86_BIOS_H */ diff --git a/trunk/include/asm-x86/uv/uv_bau.h b/trunk/include/asm-x86/uv/uv_bau.h index 77153fb18f5e..610b6b308e93 100644 --- a/trunk/include/asm-x86/uv/uv_bau.h +++ b/trunk/include/asm-x86/uv/uv_bau.h @@ -8,8 +8,8 @@ * Copyright (C) 2008 Silicon Graphics, Inc. All rights reserved. */ -#ifndef ASM_X86__UV__UV_BAU_H -#define ASM_X86__UV__UV_BAU_H +#ifndef __ASM_X86_UV_BAU__ +#define __ASM_X86_UV_BAU__ #include #define BITSPERBYTE 8 @@ -329,4 +329,4 @@ extern int uv_flush_tlb_others(cpumask_t *, struct mm_struct *, unsigned long); extern void uv_bau_message_intr1(void); extern void uv_bau_timeout_intr1(void); -#endif /* ASM_X86__UV__UV_BAU_H */ +#endif /* __ASM_X86_UV_BAU__ */ diff --git a/trunk/include/asm-x86/uv/uv_hub.h b/trunk/include/asm-x86/uv/uv_hub.h index bdb5b01afbf5..a4ef26e5850b 100644 --- a/trunk/include/asm-x86/uv/uv_hub.h +++ b/trunk/include/asm-x86/uv/uv_hub.h @@ -8,8 +8,8 @@ * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. */ -#ifndef ASM_X86__UV__UV_HUB_H -#define ASM_X86__UV__UV_HUB_H +#ifndef __ASM_X86_UV_HUB_H__ +#define __ASM_X86_UV_HUB_H__ #include #include @@ -350,5 +350,5 @@ static inline int uv_num_possible_blades(void) return uv_possible_blades; } -#endif /* ASM_X86__UV__UV_HUB_H */ +#endif /* __ASM_X86_UV_HUB__ */ diff --git a/trunk/include/asm-x86/uv/uv_mmrs.h b/trunk/include/asm-x86/uv/uv_mmrs.h index 8b03d89d2459..151fd7fcb809 100644 --- a/trunk/include/asm-x86/uv/uv_mmrs.h +++ b/trunk/include/asm-x86/uv/uv_mmrs.h @@ -8,8 +8,8 @@ * Copyright (C) 2007-2008 Silicon Graphics, Inc. All rights reserved. */ -#ifndef ASM_X86__UV__UV_MMRS_H -#define ASM_X86__UV__UV_MMRS_H +#ifndef __ASM_X86_UV_MMRS__ +#define __ASM_X86_UV_MMRS__ #define UV_MMR_ENABLE (1UL << 63) @@ -1292,4 +1292,4 @@ union uvh_si_alias2_overlay_config_u { }; -#endif /* ASM_X86__UV__UV_MMRS_H */ +#endif /* __ASM_X86_UV_MMRS__ */ diff --git a/trunk/include/asm-x86/vdso.h b/trunk/include/asm-x86/vdso.h index 4ab320913ea3..8e18fb80f5e6 100644 --- a/trunk/include/asm-x86/vdso.h +++ b/trunk/include/asm-x86/vdso.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VDSO_H -#define ASM_X86__VDSO_H +#ifndef _ASM_X86_VDSO_H +#define _ASM_X86_VDSO_H 1 #ifdef CONFIG_X86_64 extern const char VDSO64_PRELINK[]; @@ -44,4 +44,4 @@ extern const char vdso32_int80_start, vdso32_int80_end; extern const char vdso32_syscall_start, vdso32_syscall_end; extern const char vdso32_sysenter_start, vdso32_sysenter_end; -#endif /* ASM_X86__VDSO_H */ +#endif /* asm-x86/vdso.h */ diff --git a/trunk/include/asm-x86/vga.h b/trunk/include/asm-x86/vga.h index b9e493d07d07..0ccf804377e6 100644 --- a/trunk/include/asm-x86/vga.h +++ b/trunk/include/asm-x86/vga.h @@ -4,8 +4,8 @@ * (c) 1998 Martin Mares */ -#ifndef ASM_X86__VGA_H -#define ASM_X86__VGA_H +#ifndef _LINUX_ASM_VGA_H_ +#define _LINUX_ASM_VGA_H_ /* * On the PC, we can just recalculate addresses and then @@ -17,4 +17,4 @@ #define vga_readb(x) (*(x)) #define vga_writeb(x, y) (*(y) = (x)) -#endif /* ASM_X86__VGA_H */ +#endif diff --git a/trunk/include/asm-x86/vgtod.h b/trunk/include/asm-x86/vgtod.h index 38fd13364021..3301f0929342 100644 --- a/trunk/include/asm-x86/vgtod.h +++ b/trunk/include/asm-x86/vgtod.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VGTOD_H -#define ASM_X86__VGTOD_H +#ifndef _ASM_VGTOD_H +#define _ASM_VGTOD_H 1 #include #include @@ -26,4 +26,4 @@ extern struct vsyscall_gtod_data __vsyscall_gtod_data __section_vsyscall_gtod_data; extern struct vsyscall_gtod_data vsyscall_gtod_data; -#endif /* ASM_X86__VGTOD_H */ +#endif diff --git a/trunk/include/asm-x86/visws/cobalt.h b/trunk/include/asm-x86/visws/cobalt.h index 9627a8fe84e9..995258831b7f 100644 --- a/trunk/include/asm-x86/visws/cobalt.h +++ b/trunk/include/asm-x86/visws/cobalt.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VISWS__COBALT_H -#define ASM_X86__VISWS__COBALT_H +#ifndef __I386_SGI_COBALT_H +#define __I386_SGI_COBALT_H #include @@ -122,4 +122,4 @@ extern char visws_board_type; extern char visws_board_rev; -#endif /* ASM_X86__VISWS__COBALT_H */ +#endif /* __I386_SGI_COBALT_H */ diff --git a/trunk/include/asm-x86/visws/lithium.h b/trunk/include/asm-x86/visws/lithium.h index b36d3b378c63..dfcd4f07ab85 100644 --- a/trunk/include/asm-x86/visws/lithium.h +++ b/trunk/include/asm-x86/visws/lithium.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VISWS__LITHIUM_H -#define ASM_X86__VISWS__LITHIUM_H +#ifndef __I386_SGI_LITHIUM_H +#define __I386_SGI_LITHIUM_H #include @@ -49,5 +49,5 @@ static inline unsigned short li_pcib_read16(unsigned long reg) return *((volatile unsigned short *)(LI_PCIB_VADDR+reg)); } -#endif /* ASM_X86__VISWS__LITHIUM_H */ +#endif diff --git a/trunk/include/asm-x86/visws/piix4.h b/trunk/include/asm-x86/visws/piix4.h index 61c938045ec9..83ea4f46e419 100644 --- a/trunk/include/asm-x86/visws/piix4.h +++ b/trunk/include/asm-x86/visws/piix4.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VISWS__PIIX4_H -#define ASM_X86__VISWS__PIIX4_H +#ifndef __I386_SGI_PIIX_H +#define __I386_SGI_PIIX_H /* * PIIX4 as used on SGI Visual Workstations @@ -104,4 +104,4 @@ */ #define PIIX_GPI_STPCLK 0x4 // STPCLK signal routed back in -#endif /* ASM_X86__VISWS__PIIX4_H */ +#endif diff --git a/trunk/include/asm-x86/vm86.h b/trunk/include/asm-x86/vm86.h index 998bd18eb737..5ce351325e01 100644 --- a/trunk/include/asm-x86/vm86.h +++ b/trunk/include/asm-x86/vm86.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VM86_H -#define ASM_X86__VM86_H +#ifndef _LINUX_VM86_H +#define _LINUX_VM86_H /* * I'm guessing at the VIF/VIP flag usage, but hope that this is how @@ -205,4 +205,4 @@ static inline int handle_vm86_trap(struct kernel_vm86_regs *a, long b, int c) #endif /* __KERNEL__ */ -#endif /* ASM_X86__VM86_H */ +#endif diff --git a/trunk/include/asm-x86/vmi_time.h b/trunk/include/asm-x86/vmi_time.h index b2d39e6a08b7..c3118c385156 100644 --- a/trunk/include/asm-x86/vmi_time.h +++ b/trunk/include/asm-x86/vmi_time.h @@ -22,8 +22,8 @@ * */ -#ifndef ASM_X86__VMI_TIME_H -#define ASM_X86__VMI_TIME_H +#ifndef __VMI_TIME_H +#define __VMI_TIME_H /* * Raw VMI call indices for timer functions @@ -95,4 +95,4 @@ extern void __devinit vmi_time_ap_init(void); #define CONFIG_VMI_ALARM_HZ 100 -#endif /* ASM_X86__VMI_TIME_H */ +#endif diff --git a/trunk/include/asm-x86/vsyscall.h b/trunk/include/asm-x86/vsyscall.h index dcd4682413de..6b66ff905af0 100644 --- a/trunk/include/asm-x86/vsyscall.h +++ b/trunk/include/asm-x86/vsyscall.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__VSYSCALL_H -#define ASM_X86__VSYSCALL_H +#ifndef _ASM_X86_64_VSYSCALL_H_ +#define _ASM_X86_64_VSYSCALL_H_ enum vsyscall_num { __NR_vgettimeofday, @@ -41,4 +41,4 @@ extern void map_vsyscall(void); #endif /* __KERNEL__ */ -#endif /* ASM_X86__VSYSCALL_H */ +#endif /* _ASM_X86_64_VSYSCALL_H_ */ diff --git a/trunk/include/asm-x86/xen/events.h b/trunk/include/asm-x86/xen/events.h index 8151f5b8b6cb..8ded74720024 100644 --- a/trunk/include/asm-x86/xen/events.h +++ b/trunk/include/asm-x86/xen/events.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__XEN__EVENTS_H -#define ASM_X86__XEN__EVENTS_H +#ifndef __XEN_EVENTS_H +#define __XEN_EVENTS_H enum ipi_vector { XEN_RESCHEDULE_VECTOR, @@ -21,4 +21,4 @@ static inline void xen_do_IRQ(int irq, struct pt_regs *regs) do_IRQ(regs); } -#endif /* ASM_X86__XEN__EVENTS_H */ +#endif /* __XEN_EVENTS_H */ diff --git a/trunk/include/asm-x86/xen/grant_table.h b/trunk/include/asm-x86/xen/grant_table.h index c4baab4d2b68..2444d4593a3b 100644 --- a/trunk/include/asm-x86/xen/grant_table.h +++ b/trunk/include/asm-x86/xen/grant_table.h @@ -1,7 +1,7 @@ -#ifndef ASM_X86__XEN__GRANT_TABLE_H -#define ASM_X86__XEN__GRANT_TABLE_H +#ifndef __XEN_GRANT_TABLE_H +#define __XEN_GRANT_TABLE_H #define xen_alloc_vm_area(size) alloc_vm_area(size) #define xen_free_vm_area(area) free_vm_area(area) -#endif /* ASM_X86__XEN__GRANT_TABLE_H */ +#endif /* __XEN_GRANT_TABLE_H */ diff --git a/trunk/include/asm-x86/xen/hypercall.h b/trunk/include/asm-x86/xen/hypercall.h index 44f4259bee3f..91cb7fd5c123 100644 --- a/trunk/include/asm-x86/xen/hypercall.h +++ b/trunk/include/asm-x86/xen/hypercall.h @@ -30,8 +30,8 @@ * IN THE SOFTWARE. */ -#ifndef ASM_X86__XEN__HYPERCALL_H -#define ASM_X86__XEN__HYPERCALL_H +#ifndef __HYPERCALL_H__ +#define __HYPERCALL_H__ #include #include @@ -524,4 +524,4 @@ MULTI_stack_switch(struct multicall_entry *mcl, mcl->args[1] = esp; } -#endif /* ASM_X86__XEN__HYPERCALL_H */ +#endif /* __HYPERCALL_H__ */ diff --git a/trunk/include/asm-x86/xen/hypervisor.h b/trunk/include/asm-x86/xen/hypervisor.h index 0ef3a88b869d..04ee0610014a 100644 --- a/trunk/include/asm-x86/xen/hypervisor.h +++ b/trunk/include/asm-x86/xen/hypervisor.h @@ -30,8 +30,8 @@ * IN THE SOFTWARE. */ -#ifndef ASM_X86__XEN__HYPERVISOR_H -#define ASM_X86__XEN__HYPERVISOR_H +#ifndef __HYPERVISOR_H__ +#define __HYPERVISOR_H__ #include #include @@ -69,4 +69,4 @@ u64 jiffies_to_st(unsigned long jiffies); #define is_running_on_xen() (xen_start_info ? 1 : 0) -#endif /* ASM_X86__XEN__HYPERVISOR_H */ +#endif /* __HYPERVISOR_H__ */ diff --git a/trunk/include/asm-x86/xen/interface.h b/trunk/include/asm-x86/xen/interface.h index d077bba96da9..9d810f2538a2 100644 --- a/trunk/include/asm-x86/xen/interface.h +++ b/trunk/include/asm-x86/xen/interface.h @@ -6,8 +6,8 @@ * Copyright (c) 2004, K A Fraser */ -#ifndef ASM_X86__XEN__INTERFACE_H -#define ASM_X86__XEN__INTERFACE_H +#ifndef __ASM_X86_XEN_INTERFACE_H +#define __ASM_X86_XEN_INTERFACE_H #ifdef __XEN__ #define __DEFINE_GUEST_HANDLE(name, type) \ @@ -172,4 +172,4 @@ DEFINE_GUEST_HANDLE_STRUCT(vcpu_guest_context); #define XEN_CPUID XEN_EMULATE_PREFIX "cpuid" #endif -#endif /* ASM_X86__XEN__INTERFACE_H */ +#endif /* __ASM_X86_XEN_INTERFACE_H */ diff --git a/trunk/include/asm-x86/xen/interface_32.h b/trunk/include/asm-x86/xen/interface_32.h index 08167e19fc66..d8ac41d5db86 100644 --- a/trunk/include/asm-x86/xen/interface_32.h +++ b/trunk/include/asm-x86/xen/interface_32.h @@ -6,8 +6,8 @@ * Copyright (c) 2004, K A Fraser */ -#ifndef ASM_X86__XEN__INTERFACE_32_H -#define ASM_X86__XEN__INTERFACE_32_H +#ifndef __ASM_X86_XEN_INTERFACE_32_H +#define __ASM_X86_XEN_INTERFACE_32_H /* @@ -94,4 +94,4 @@ typedef struct xen_callback xen_callback_t; #define xen_pfn_to_cr3(pfn) (((unsigned)(pfn) << 12) | ((unsigned)(pfn) >> 20)) #define xen_cr3_to_pfn(cr3) (((unsigned)(cr3) >> 12) | ((unsigned)(cr3) << 20)) -#endif /* ASM_X86__XEN__INTERFACE_32_H */ +#endif /* __ASM_X86_XEN_INTERFACE_32_H */ diff --git a/trunk/include/asm-x86/xen/interface_64.h b/trunk/include/asm-x86/xen/interface_64.h index 046c0f1e01d4..842266ce96e6 100644 --- a/trunk/include/asm-x86/xen/interface_64.h +++ b/trunk/include/asm-x86/xen/interface_64.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__XEN__INTERFACE_64_H -#define ASM_X86__XEN__INTERFACE_64_H +#ifndef __ASM_X86_XEN_INTERFACE_64_H +#define __ASM_X86_XEN_INTERFACE_64_H /* * 64-bit segment selectors @@ -156,4 +156,4 @@ typedef unsigned long xen_callback_t; #endif /* !__ASSEMBLY__ */ -#endif /* ASM_X86__XEN__INTERFACE_64_H */ +#endif /* __ASM_X86_XEN_INTERFACE_64_H */ diff --git a/trunk/include/asm-x86/xen/page.h b/trunk/include/asm-x86/xen/page.h index c50185dccec1..7b3835d3b77d 100644 --- a/trunk/include/asm-x86/xen/page.h +++ b/trunk/include/asm-x86/xen/page.h @@ -1,5 +1,5 @@ -#ifndef ASM_X86__XEN__PAGE_H -#define ASM_X86__XEN__PAGE_H +#ifndef __XEN_PAGE_H +#define __XEN_PAGE_H #include @@ -162,4 +162,4 @@ xmaddr_t arbitrary_virt_to_machine(void *address); void make_lowmem_page_readonly(void *vaddr); void make_lowmem_page_readwrite(void *vaddr); -#endif /* ASM_X86__XEN__PAGE_H */ +#endif /* __XEN_PAGE_H */ diff --git a/trunk/include/linux/dmar.h b/trunk/include/linux/dmar.h index c360c558e59e..56c73b847551 100644 --- a/trunk/include/linux/dmar.h +++ b/trunk/include/linux/dmar.h @@ -25,99 +25,9 @@ #include #include -#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) +#ifdef CONFIG_DMAR struct intel_iommu; -struct dmar_drhd_unit { - struct list_head list; /* list of drhd units */ - struct acpi_dmar_header *hdr; /* ACPI header */ - u64 reg_base_addr; /* register base address*/ - struct pci_dev **devices; /* target device array */ - int devices_cnt; /* target device count */ - u8 ignored:1; /* ignore drhd */ - u8 include_all:1; - struct intel_iommu *iommu; -}; - -extern struct list_head dmar_drhd_units; - -#define for_each_drhd_unit(drhd) \ - list_for_each_entry(drhd, &dmar_drhd_units, list) - -extern int dmar_table_init(void); -extern int early_dmar_detect(void); -extern int dmar_dev_scope_init(void); - -/* Intel IOMMU detection */ -extern void detect_intel_iommu(void); - - -extern int parse_ioapics_under_ir(void); -extern int alloc_iommu(struct dmar_drhd_unit *); -#else -static inline void detect_intel_iommu(void) -{ - return; -} - -static inline int dmar_table_init(void) -{ - return -ENODEV; -} -#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ - -#ifdef CONFIG_INTR_REMAP -extern int intr_remapping_enabled; -extern int enable_intr_remapping(int); - -struct irte { - union { - struct { - __u64 present : 1, - fpd : 1, - dst_mode : 1, - redir_hint : 1, - trigger_mode : 1, - dlvry_mode : 3, - avail : 4, - __reserved_1 : 4, - vector : 8, - __reserved_2 : 8, - dest_id : 32; - }; - __u64 low; - }; - - union { - struct { - __u64 sid : 16, - sq : 2, - svt : 2, - __reserved_3 : 44; - }; - __u64 high; - }; -}; -extern int get_irte(int irq, struct irte *entry); -extern int modify_irte(int irq, struct irte *irte_modified); -extern int alloc_irte(struct intel_iommu *iommu, int irq, u16 count); -extern int set_irte_irq(int irq, struct intel_iommu *iommu, u16 index, - u16 sub_handle); -extern int map_irq_to_irte_handle(int irq, u16 *sub_handle); -extern int clear_irte_irq(int irq, struct intel_iommu *iommu, u16 index); -extern int flush_irte(int irq); -extern int free_irte(int irq); - -extern int irq_remapped(int irq); -extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); -extern struct intel_iommu *map_ioapic_to_ir(int apic); -#else -#define irq_remapped(irq) (0) -#define enable_intr_remapping(mode) (-1) -#define intr_remapping_enabled (0) -#endif - -#ifdef CONFIG_DMAR extern const char *dmar_get_fault_reason(u8 fault_reason); /* Can't use the common MSI interrupt functions @@ -130,30 +40,47 @@ extern void dmar_msi_write(int irq, struct msi_msg *msg); extern int dmar_set_interrupt(struct intel_iommu *iommu); extern int arch_setup_dmar_msi(unsigned int irq); -extern int iommu_detected, no_iommu; +/* Intel IOMMU detection and initialization functions */ +extern void detect_intel_iommu(void); +extern int intel_iommu_init(void); + +extern int dmar_table_init(void); +extern int early_dmar_detect(void); + +extern struct list_head dmar_drhd_units; extern struct list_head dmar_rmrr_units; + +struct dmar_drhd_unit { + struct list_head list; /* list of drhd units */ + u64 reg_base_addr; /* register base address*/ + struct pci_dev **devices; /* target device array */ + int devices_cnt; /* target device count */ + u8 ignored:1; /* ignore drhd */ + u8 include_all:1; + struct intel_iommu *iommu; +}; + struct dmar_rmrr_unit { struct list_head list; /* list of rmrr units */ - struct acpi_dmar_header *hdr; /* ACPI header */ u64 base_address; /* reserved base address*/ u64 end_address; /* reserved end address */ struct pci_dev **devices; /* target devices */ int devices_cnt; /* target device count */ }; +#define for_each_drhd_unit(drhd) \ + list_for_each_entry(drhd, &dmar_drhd_units, list) #define for_each_rmrr_units(rmrr) \ list_for_each_entry(rmrr, &dmar_rmrr_units, list) -/* Intel DMAR initialization functions */ -extern int intel_iommu_init(void); -extern int dmar_disabled; #else +static inline void detect_intel_iommu(void) +{ + return; +} static inline int intel_iommu_init(void) { -#ifdef CONFIG_INTR_REMAP - return dmar_dev_scope_init(); -#else return -ENODEV; -#endif } + #endif /* !CONFIG_DMAR */ #endif /* __DMAR_H__ */ diff --git a/trunk/include/linux/ioport.h b/trunk/include/linux/ioport.h index 8d3b7a9afd17..fded376b94e3 100644 --- a/trunk/include/linux/ioport.h +++ b/trunk/include/linux/ioport.h @@ -108,6 +108,9 @@ extern struct resource iomem_resource; extern int request_resource(struct resource *root, struct resource *new); extern int release_resource(struct resource *new); +extern void reserve_region_with_split(struct resource *root, + resource_size_t start, resource_size_t end, + const char *name); extern int insert_resource(struct resource *parent, struct resource *new); extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); extern int allocate_resource(struct resource *root, struct resource *new, diff --git a/trunk/include/linux/irq.h b/trunk/include/linux/irq.h index 8d9411bc60f6..8ccb462ea42c 100644 --- a/trunk/include/linux/irq.h +++ b/trunk/include/linux/irq.h @@ -62,7 +62,6 @@ typedef void (*irq_flow_handler_t)(unsigned int irq, #define IRQ_MOVE_PENDING 0x00200000 /* need to re-target IRQ destination */ #define IRQ_NO_BALANCING 0x00400000 /* IRQ is excluded from balancing */ #define IRQ_SPURIOUS_DISABLED 0x00800000 /* IRQ was disabled by the spurious trap */ -#define IRQ_MOVE_PCNTXT 0x01000000 /* IRQ migration from process context */ #ifdef CONFIG_IRQ_PER_CPU # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) diff --git a/trunk/kernel/irq/manage.c b/trunk/kernel/irq/manage.c index 60c49e324390..0314074fa232 100644 --- a/trunk/kernel/irq/manage.c +++ b/trunk/kernel/irq/manage.c @@ -89,14 +89,7 @@ int irq_set_affinity(unsigned int irq, cpumask_t cpumask) set_balance_irq_affinity(irq, cpumask); #ifdef CONFIG_GENERIC_PENDING_IRQ - if (desc->status & IRQ_MOVE_PCNTXT) { - unsigned long flags; - - spin_lock_irqsave(&desc->lock, flags); - desc->chip->set_affinity(irq, cpumask); - spin_unlock_irqrestore(&desc->lock, flags); - } else - set_pending_irq(irq, cpumask); + set_pending_irq(irq, cpumask); #else desc->affinity = cpumask; desc->chip->set_affinity(irq, cpumask); diff --git a/trunk/kernel/resource.c b/trunk/kernel/resource.c index 03d796c1b2e9..414d6fc9131e 100644 --- a/trunk/kernel/resource.c +++ b/trunk/kernel/resource.c @@ -516,6 +516,74 @@ int adjust_resource(struct resource *res, resource_size_t start, resource_size_t return result; } +static void __init __reserve_region_with_split(struct resource *root, + resource_size_t start, resource_size_t end, + const char *name) +{ + struct resource *parent = root; + struct resource *conflict; + struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); + + if (!res) + return; + + res->name = name; + res->start = start; + res->end = end; + res->flags = IORESOURCE_BUSY; + + for (;;) { + conflict = __request_resource(parent, res); + if (!conflict) + break; + if (conflict != parent) { + parent = conflict; + if (!(conflict->flags & IORESOURCE_BUSY)) + continue; + } + + /* Uhhuh, that didn't work out.. */ + kfree(res); + res = NULL; + break; + } + + if (!res) { + printk(KERN_DEBUG " __reserve_region_with_split: (%s) [%llx, %llx], res: (%s) [%llx, %llx]\n", + conflict->name, conflict->start, conflict->end, + name, start, end); + + /* failed, split and try again */ + + /* conflict coverred whole area */ + if (conflict->start <= start && conflict->end >= end) + return; + + if (conflict->start > start) + __reserve_region_with_split(root, start, conflict->start-1, name); + if (!(conflict->flags & IORESOURCE_BUSY)) { + resource_size_t common_start, common_end; + + common_start = max(conflict->start, start); + common_end = min(conflict->end, end); + if (common_start < common_end) + __reserve_region_with_split(root, common_start, common_end, name); + } + if (conflict->end < end) + __reserve_region_with_split(root, conflict->end+1, end, name); + } + +} + +void reserve_region_with_split(struct resource *root, + resource_size_t start, resource_size_t end, + const char *name) +{ + write_lock(&resource_lock); + __reserve_region_with_split(root, start, end, name); + write_unlock(&resource_lock); +} + EXPORT_SYMBOL(adjust_resource); /** diff --git a/trunk/lib/Kconfig.debug b/trunk/lib/Kconfig.debug index 8b5a7d304a5f..0b504814e378 100644 --- a/trunk/lib/Kconfig.debug +++ b/trunk/lib/Kconfig.debug @@ -394,7 +394,7 @@ config LOCKDEP bool depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT select STACKTRACE - select FRAME_POINTER if !X86 && !MIPS + select FRAME_POINTER if !X86 && !MIPS && !PPC select KALLSYMS select KALLSYMS_ALL @@ -676,13 +676,13 @@ config FAULT_INJECTION_STACKTRACE_FILTER depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT depends on !X86_64 select STACKTRACE - select FRAME_POINTER + select FRAME_POINTER if !PPC help Provide stacktrace filter for fault-injection capabilities config LATENCYTOP bool "Latency measuring infrastructure" - select FRAME_POINTER if !MIPS + select FRAME_POINTER if !MIPS && !PPC select KALLSYMS select KALLSYMS_ALL select STACKTRACE diff --git a/trunk/net/tipc/bcast.c b/trunk/net/tipc/bcast.c index b1ff16aa4bdb..3ddaff42d1bb 100644 --- a/trunk/net/tipc/bcast.c +++ b/trunk/net/tipc/bcast.c @@ -96,8 +96,8 @@ struct bcbearer { struct media media; struct bcbearer_pair bpairs[MAX_BEARERS]; struct bcbearer_pair bpairs_temp[TIPC_MAX_LINK_PRI + 1]; - struct node_map remains; - struct node_map remains_new; + struct tipc_node_map remains; + struct tipc_node_map remains_new; }; /** @@ -110,7 +110,7 @@ struct bcbearer { struct bclink { struct link link; - struct node node; + struct tipc_node node; }; @@ -149,7 +149,7 @@ static void bcbuf_decr_acks(struct sk_buff *buf) * Called with 'node' locked, bc_lock unlocked */ -static void bclink_set_gap(struct node *n_ptr) +static void bclink_set_gap(struct tipc_node *n_ptr) { struct sk_buff *buf = n_ptr->bclink.deferred_head; @@ -202,7 +202,7 @@ static void bclink_retransmit_pkt(u32 after, u32 to) * Node is locked, bc_lock unlocked. */ -void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) +void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked) { struct sk_buff *crs; struct sk_buff *next; @@ -250,7 +250,7 @@ void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked) * tipc_net_lock and node lock set */ -static void bclink_send_ack(struct node *n_ptr) +static void bclink_send_ack(struct tipc_node *n_ptr) { struct link *l_ptr = n_ptr->active_links[n_ptr->addr & 1]; @@ -264,7 +264,7 @@ static void bclink_send_ack(struct node *n_ptr) * tipc_net_lock and node lock set */ -static void bclink_send_nack(struct node *n_ptr) +static void bclink_send_nack(struct tipc_node *n_ptr) { struct sk_buff *buf; struct tipc_msg *msg; @@ -308,7 +308,7 @@ static void bclink_send_nack(struct node *n_ptr) * tipc_net_lock and node lock set */ -void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) +void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 last_sent) { if (!n_ptr->bclink.supported || less_eq(last_sent, mod(n_ptr->bclink.last_in))) @@ -328,7 +328,7 @@ void tipc_bclink_check_gap(struct node *n_ptr, u32 last_sent) static void tipc_bclink_peek_nack(u32 dest, u32 sender_tag, u32 gap_after, u32 gap_to) { - struct node *n_ptr = tipc_node_find(dest); + struct tipc_node *n_ptr = tipc_node_find(dest); u32 my_after, my_to; if (unlikely(!n_ptr || !tipc_node_is_up(n_ptr))) @@ -418,7 +418,7 @@ void tipc_bclink_recv_pkt(struct sk_buff *buf) static int rx_count = 0; #endif struct tipc_msg *msg = buf_msg(buf); - struct node* node = tipc_node_find(msg_prevnode(msg)); + struct tipc_node* node = tipc_node_find(msg_prevnode(msg)); u32 next_in; u32 seqno; struct sk_buff *deferred; @@ -538,7 +538,7 @@ u32 tipc_bclink_get_last_sent(void) return last_sent; } -u32 tipc_bclink_acks_missing(struct node *n_ptr) +u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr) { return (n_ptr->bclink.supported && (tipc_bclink_get_last_sent() != n_ptr->bclink.acked)); diff --git a/trunk/net/tipc/bcast.h b/trunk/net/tipc/bcast.h index a2416fa6b906..5aa024b99c55 100644 --- a/trunk/net/tipc/bcast.h +++ b/trunk/net/tipc/bcast.h @@ -41,12 +41,12 @@ #define WSIZE 32 /** - * struct node_map - set of node identifiers + * struct tipc_node_map - set of node identifiers * @count: # of nodes in set * @map: bitmap of node identifiers that are in the set */ -struct node_map { +struct tipc_node_map { u32 count; u32 map[MAX_NODES / WSIZE]; }; @@ -68,7 +68,7 @@ struct port_list { }; -struct node; +struct tipc_node; extern char tipc_bclink_name[]; @@ -77,7 +77,7 @@ extern char tipc_bclink_name[]; * nmap_add - add a node to a node map */ -static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) +static inline void tipc_nmap_add(struct tipc_node_map *nm_ptr, u32 node) { int n = tipc_node(node); int w = n / WSIZE; @@ -93,7 +93,7 @@ static inline void tipc_nmap_add(struct node_map *nm_ptr, u32 node) * nmap_remove - remove a node from a node map */ -static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) +static inline void tipc_nmap_remove(struct tipc_node_map *nm_ptr, u32 node) { int n = tipc_node(node); int w = n / WSIZE; @@ -109,7 +109,7 @@ static inline void tipc_nmap_remove(struct node_map *nm_ptr, u32 node) * nmap_equal - test for equality of node maps */ -static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) +static inline int tipc_nmap_equal(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b) { return !memcmp(nm_a, nm_b, sizeof(*nm_a)); } @@ -121,8 +121,8 @@ static inline int tipc_nmap_equal(struct node_map *nm_a, struct node_map *nm_b) * @nm_diff: output node map A-B (i.e. nodes of A that are not in B) */ -static inline void tipc_nmap_diff(struct node_map *nm_a, struct node_map *nm_b, - struct node_map *nm_diff) +static inline void tipc_nmap_diff(struct tipc_node_map *nm_a, struct tipc_node_map *nm_b, + struct tipc_node_map *nm_diff) { int stop = sizeof(nm_a->map) / sizeof(u32); int w; @@ -195,12 +195,12 @@ static inline void tipc_port_list_free(struct port_list *pl_ptr) int tipc_bclink_init(void); void tipc_bclink_stop(void); -void tipc_bclink_acknowledge(struct node *n_ptr, u32 acked); +void tipc_bclink_acknowledge(struct tipc_node *n_ptr, u32 acked); int tipc_bclink_send_msg(struct sk_buff *buf); void tipc_bclink_recv_pkt(struct sk_buff *buf); u32 tipc_bclink_get_last_sent(void); -u32 tipc_bclink_acks_missing(struct node *n_ptr); -void tipc_bclink_check_gap(struct node *n_ptr, u32 seqno); +u32 tipc_bclink_acks_missing(struct tipc_node *n_ptr); +void tipc_bclink_check_gap(struct tipc_node *n_ptr, u32 seqno); int tipc_bclink_stats(char *stats_buf, const u32 buf_size); int tipc_bclink_reset_stats(void); int tipc_bclink_set_queue_limits(u32 limit); diff --git a/trunk/net/tipc/bearer.c b/trunk/net/tipc/bearer.c index 6a9aba3edd08..a7a36779b9b3 100644 --- a/trunk/net/tipc/bearer.c +++ b/trunk/net/tipc/bearer.c @@ -599,7 +599,7 @@ int tipc_block_bearer(const char *name) spin_lock_bh(&b_ptr->publ.lock); b_ptr->publ.blocked = 1; list_for_each_entry_safe(l_ptr, temp_l_ptr, &b_ptr->links, link_list) { - struct node *n_ptr = l_ptr->owner; + struct tipc_node *n_ptr = l_ptr->owner; spin_lock_bh(&n_ptr->lock); tipc_link_reset(l_ptr); diff --git a/trunk/net/tipc/bearer.h b/trunk/net/tipc/bearer.h index 6a36b6600e6c..ca5734892713 100644 --- a/trunk/net/tipc/bearer.h +++ b/trunk/net/tipc/bearer.h @@ -104,7 +104,7 @@ struct bearer { u32 continue_count; int active; char net_plane; - struct node_map nodes; + struct tipc_node_map nodes; }; struct bearer_name { diff --git a/trunk/net/tipc/cluster.c b/trunk/net/tipc/cluster.c index 46ee6c58532d..689fdefe9d04 100644 --- a/trunk/net/tipc/cluster.c +++ b/trunk/net/tipc/cluster.c @@ -48,8 +48,8 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, u32 lower, u32 upper); static struct sk_buff *tipc_cltr_prepare_routing_msg(u32 data_size, u32 dest); -struct node **tipc_local_nodes = NULL; -struct node_map tipc_cltr_bcast_nodes = {0,{0,}}; +struct tipc_node **tipc_local_nodes = NULL; +struct tipc_node_map tipc_cltr_bcast_nodes = {0,{0,}}; u32 tipc_highest_allowed_slave = 0; struct cluster *tipc_cltr_create(u32 addr) @@ -115,7 +115,7 @@ void tipc_cltr_delete(struct cluster *c_ptr) u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) { - struct node *n_ptr; + struct tipc_node *n_ptr; u32 n_num = tipc_node(addr) + 1; if (!c_ptr) @@ -133,7 +133,7 @@ u32 tipc_cltr_next_node(struct cluster *c_ptr, u32 addr) return 0; } -void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr) +void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr) { u32 n_num = tipc_node(n_ptr->addr); u32 max_n_num = tipc_max_nodes; @@ -196,7 +196,7 @@ u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref) * Uses deterministic and fair algorithm. */ -struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) +struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector) { u32 n_num; u32 mask = tipc_max_nodes; @@ -379,7 +379,7 @@ void tipc_cltr_recv_routing_table(struct sk_buff *buf) { struct tipc_msg *msg = buf_msg(buf); struct cluster *c_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; unchar *node_table; u32 table_size; u32 router; @@ -499,7 +499,7 @@ static void tipc_cltr_multicast(struct cluster *c_ptr, struct sk_buff *buf, u32 lower, u32 upper) { struct sk_buff *buf_copy; - struct node *n_ptr; + struct tipc_node *n_ptr; u32 n_num; u32 tstop; @@ -534,7 +534,7 @@ void tipc_cltr_broadcast(struct sk_buff *buf) { struct sk_buff *buf_copy; struct cluster *c_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; u32 n_num; u32 tstart; u32 tstop; diff --git a/trunk/net/tipc/cluster.h b/trunk/net/tipc/cluster.h index 62df074afaec..333efb0b9c44 100644 --- a/trunk/net/tipc/cluster.h +++ b/trunk/net/tipc/cluster.h @@ -54,24 +54,24 @@ struct cluster { u32 addr; struct _zone *owner; - struct node **nodes; + struct tipc_node **nodes; u32 highest_node; u32 highest_slave; }; -extern struct node **tipc_local_nodes; +extern struct tipc_node **tipc_local_nodes; extern u32 tipc_highest_allowed_slave; -extern struct node_map tipc_cltr_bcast_nodes; +extern struct tipc_node_map tipc_cltr_bcast_nodes; void tipc_cltr_remove_as_router(struct cluster *c_ptr, u32 router); void tipc_cltr_send_ext_routes(struct cluster *c_ptr, u32 dest); -struct node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); +struct tipc_node *tipc_cltr_select_node(struct cluster *c_ptr, u32 selector); u32 tipc_cltr_select_router(struct cluster *c_ptr, u32 ref); void tipc_cltr_recv_routing_table(struct sk_buff *buf); struct cluster *tipc_cltr_create(u32 addr); void tipc_cltr_delete(struct cluster *c_ptr); -void tipc_cltr_attach_node(struct cluster *c_ptr, struct node *n_ptr); +void tipc_cltr_attach_node(struct cluster *c_ptr, struct tipc_node *n_ptr); void tipc_cltr_send_slave_routes(struct cluster *c_ptr, u32 dest); void tipc_cltr_broadcast(struct sk_buff *buf); int tipc_cltr_init(void); diff --git a/trunk/net/tipc/discover.c b/trunk/net/tipc/discover.c index 1657f0e795ff..74b7d1e28aec 100644 --- a/trunk/net/tipc/discover.c +++ b/trunk/net/tipc/discover.c @@ -193,7 +193,7 @@ void tipc_disc_recv_msg(struct sk_buff *buf, struct bearer *b_ptr) /* Always accept link here */ struct sk_buff *rbuf; struct tipc_media_addr *addr; - struct node *n_ptr = tipc_node_find(orig); + struct tipc_node *n_ptr = tipc_node_find(orig); int link_fully_up; dbg(" in own cluster\n"); diff --git a/trunk/net/tipc/link.c b/trunk/net/tipc/link.c index d60113ba4b1b..dd4c18b9a35b 100644 --- a/trunk/net/tipc/link.c +++ b/trunk/net/tipc/link.c @@ -1155,7 +1155,7 @@ int tipc_link_send_buf(struct link *l_ptr, struct sk_buff *buf) int tipc_link_send(struct sk_buff *buf, u32 dest, u32 selector) { struct link *l_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; int res = -ELINKCONG; read_lock_bh(&tipc_net_lock); @@ -1226,7 +1226,7 @@ static int link_send_buf_fast(struct link *l_ptr, struct sk_buff *buf, int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode) { struct link *l_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; int res; u32 selector = msg_origport(buf_msg(buf)) & 1; u32 dummy; @@ -1270,7 +1270,7 @@ int tipc_link_send_sections_fast(struct port *sender, struct tipc_msg *hdr = &sender->publ.phdr; struct link *l_ptr; struct sk_buff *buf; - struct node *node; + struct tipc_node *node; int res; u32 selector = msg_origport(hdr) & 1; @@ -1364,7 +1364,7 @@ static int link_send_sections_long(struct port *sender, u32 destaddr) { struct link *l_ptr; - struct node *node; + struct tipc_node *node; struct tipc_msg *hdr = &sender->publ.phdr; u32 dsz = msg_data_sz(hdr); u32 max_pkt,fragm_sz,rest; @@ -1636,7 +1636,7 @@ void tipc_link_push_queue(struct link *l_ptr) static void link_reset_all(unsigned long addr) { - struct node *n_ptr; + struct tipc_node *n_ptr; char addr_string[16]; u32 i; @@ -1682,7 +1682,7 @@ static void link_retransmit_failure(struct link *l_ptr, struct sk_buff *buf) /* Handle failure on broadcast link */ - struct node *n_ptr; + struct tipc_node *n_ptr; char addr_string[16]; tipc_printf(TIPC_OUTPUT, "Msg seq number: %u, ", msg_seqno(msg)); @@ -1843,7 +1843,7 @@ void tipc_recv_msg(struct sk_buff *head, struct tipc_bearer *tb_ptr) read_lock_bh(&tipc_net_lock); while (head) { struct bearer *b_ptr = (struct bearer *)tb_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; struct link *l_ptr; struct sk_buff *crs; struct sk_buff *buf = head; @@ -2935,7 +2935,7 @@ void tipc_link_set_queue_limits(struct link *l_ptr, u32 window) * Returns pointer to link (or 0 if invalid link name). */ -static struct link *link_find_link(const char *name, struct node **node) +static struct link *link_find_link(const char *name, struct tipc_node **node) { struct link_name link_name_parts; struct bearer *b_ptr; @@ -2965,7 +2965,7 @@ struct sk_buff *tipc_link_cmd_config(const void *req_tlv_area, int req_tlv_space struct tipc_link_config *args; u32 new_value; struct link *l_ptr; - struct node *node; + struct tipc_node *node; int res; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_CONFIG)) @@ -3043,7 +3043,7 @@ struct sk_buff *tipc_link_cmd_reset_stats(const void *req_tlv_area, int req_tlv_ { char *link_name; struct link *l_ptr; - struct node *node; + struct tipc_node *node; if (!TLV_CHECK(req_tlv_area, req_tlv_space, TIPC_TLV_LINK_NAME)) return tipc_cfg_reply_error_string(TIPC_CFG_TLV_ERROR); @@ -3091,7 +3091,7 @@ static int tipc_link_stats(const char *name, char *buf, const u32 buf_size) { struct print_buf pb; struct link *l_ptr; - struct node *node; + struct tipc_node *node; char *status; u32 profile_total = 0; @@ -3207,7 +3207,7 @@ int link_control(const char *name, u32 op, u32 val) int res = -EINVAL; struct link *l_ptr; u32 bearer_id; - struct node * node; + struct tipc_node * node; u32 a; a = link_name2addr(name, &bearer_id); @@ -3249,7 +3249,7 @@ int link_control(const char *name, u32 op, u32 val) u32 tipc_link_get_max_pkt(u32 dest, u32 selector) { - struct node *n_ptr; + struct tipc_node *n_ptr; struct link *l_ptr; u32 res = MAX_PKT_DEFAULT; diff --git a/trunk/net/tipc/link.h b/trunk/net/tipc/link.h index 52f3e7c1871f..6a51e38ad25c 100644 --- a/trunk/net/tipc/link.h +++ b/trunk/net/tipc/link.h @@ -116,7 +116,7 @@ struct link { char name[TIPC_MAX_LINK_NAME]; struct tipc_media_addr media_addr; struct timer_list timer; - struct node *owner; + struct tipc_node *owner; struct list_head link_list; /* Management and link supervision data */ diff --git a/trunk/net/tipc/name_table.h b/trunk/net/tipc/name_table.h index b9e7cd336d76..139882d4ed00 100644 --- a/trunk/net/tipc/name_table.h +++ b/trunk/net/tipc/name_table.h @@ -76,7 +76,7 @@ struct publication { u32 node; u32 ref; u32 key; - struct node_subscr subscr; + struct tipc_node_subscr subscr; struct list_head local_list; struct list_head pport_list; struct publication *node_list_next; diff --git a/trunk/net/tipc/net.c b/trunk/net/tipc/net.c index ec7b04fbdc43..7906608bf510 100644 --- a/trunk/net/tipc/net.c +++ b/trunk/net/tipc/net.c @@ -118,7 +118,7 @@ DEFINE_RWLOCK(tipc_net_lock); struct network tipc_net = { NULL }; -struct node *tipc_net_select_remote_node(u32 addr, u32 ref) +struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref) { return tipc_zone_select_remote_node(tipc_net.zones[tipc_zone(addr)], addr, ref); } diff --git a/trunk/net/tipc/net.h b/trunk/net/tipc/net.h index d154ac2bda9a..de2b9ad8f646 100644 --- a/trunk/net/tipc/net.h +++ b/trunk/net/tipc/net.h @@ -55,7 +55,7 @@ extern rwlock_t tipc_net_lock; void tipc_net_remove_as_router(u32 router); void tipc_net_send_external_routes(u32 dest); void tipc_net_route_msg(struct sk_buff *buf); -struct node *tipc_net_select_remote_node(u32 addr, u32 ref); +struct tipc_node *tipc_net_select_remote_node(u32 addr, u32 ref); u32 tipc_net_select_router(u32 addr, u32 ref); int tipc_net_start(u32 addr); diff --git a/trunk/net/tipc/node.c b/trunk/net/tipc/node.c index ee952ad60218..20d98c56e152 100644 --- a/trunk/net/tipc/node.c +++ b/trunk/net/tipc/node.c @@ -46,11 +46,11 @@ #include "bearer.h" #include "name_distr.h" -void node_print(struct print_buf *buf, struct node *n_ptr, char *str); -static void node_lost_contact(struct node *n_ptr); -static void node_established_contact(struct node *n_ptr); +void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str); +static void node_lost_contact(struct tipc_node *n_ptr); +static void node_established_contact(struct tipc_node *n_ptr); -struct node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ +struct tipc_node *tipc_nodes = NULL; /* sorted list of nodes within cluster */ static DEFINE_SPINLOCK(node_create_lock); @@ -66,11 +66,11 @@ u32 tipc_own_tag = 0; * but this is a non-trivial change.) */ -struct node *tipc_node_create(u32 addr) +struct tipc_node *tipc_node_create(u32 addr) { struct cluster *c_ptr; - struct node *n_ptr; - struct node **curr_node; + struct tipc_node *n_ptr; + struct tipc_node **curr_node; spin_lock_bh(&node_create_lock); @@ -120,7 +120,7 @@ struct node *tipc_node_create(u32 addr) return n_ptr; } -void tipc_node_delete(struct node *n_ptr) +void tipc_node_delete(struct tipc_node *n_ptr) { if (!n_ptr) return; @@ -146,7 +146,7 @@ void tipc_node_delete(struct node *n_ptr) * Link becomes active (alone or shared) or standby, depending on its priority. */ -void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) +void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr) { struct link **active = &n_ptr->active_links[0]; @@ -180,7 +180,7 @@ void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr) * node_select_active_links - select active link */ -static void node_select_active_links(struct node *n_ptr) +static void node_select_active_links(struct tipc_node *n_ptr) { struct link **active = &n_ptr->active_links[0]; u32 i; @@ -208,7 +208,7 @@ static void node_select_active_links(struct node *n_ptr) * tipc_node_link_down - handle loss of link */ -void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) +void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr) { struct link **active; @@ -235,30 +235,30 @@ void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr) node_lost_contact(n_ptr); } -int tipc_node_has_active_links(struct node *n_ptr) +int tipc_node_has_active_links(struct tipc_node *n_ptr) { return (n_ptr && ((n_ptr->active_links[0]) || (n_ptr->active_links[1]))); } -int tipc_node_has_redundant_links(struct node *n_ptr) +int tipc_node_has_redundant_links(struct tipc_node *n_ptr) { return (n_ptr->working_links > 1); } -static int tipc_node_has_active_routes(struct node *n_ptr) +static int tipc_node_has_active_routes(struct tipc_node *n_ptr) { return (n_ptr && (n_ptr->last_router >= 0)); } -int tipc_node_is_up(struct node *n_ptr) +int tipc_node_is_up(struct tipc_node *n_ptr) { return (tipc_node_has_active_links(n_ptr) || tipc_node_has_active_routes(n_ptr)); } -struct node *tipc_node_attach_link(struct link *l_ptr) +struct tipc_node *tipc_node_attach_link(struct link *l_ptr) { - struct node *n_ptr = tipc_node_find(l_ptr->addr); + struct tipc_node *n_ptr = tipc_node_find(l_ptr->addr); if (!n_ptr) n_ptr = tipc_node_create(l_ptr->addr); @@ -285,7 +285,7 @@ struct node *tipc_node_attach_link(struct link *l_ptr) return NULL; } -void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) +void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr) { n_ptr->links[l_ptr->b_ptr->identity] = NULL; tipc_net.zones[tipc_zone(l_ptr->addr)]->links--; @@ -338,7 +338,7 @@ void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr) * */ -static void node_established_contact(struct node *n_ptr) +static void node_established_contact(struct tipc_node *n_ptr) { struct cluster *c_ptr; @@ -384,10 +384,10 @@ static void node_established_contact(struct node *n_ptr) tipc_highest_allowed_slave); } -static void node_lost_contact(struct node *n_ptr) +static void node_lost_contact(struct tipc_node *n_ptr) { struct cluster *c_ptr; - struct node_subscr *ns, *tns; + struct tipc_node_subscr *ns, *tns; char addr_string[16]; u32 i; @@ -466,9 +466,9 @@ static void node_lost_contact(struct node *n_ptr) * Called by when cluster local lookup has failed. */ -struct node *tipc_node_select_next_hop(u32 addr, u32 selector) +struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector) { - struct node *n_ptr; + struct tipc_node *n_ptr; u32 router_addr; if (!tipc_addr_domain_valid(addr)) @@ -513,7 +513,7 @@ struct node *tipc_node_select_next_hop(u32 addr, u32 selector) * Uses a deterministic and fair algorithm for selecting router node. */ -u32 tipc_node_select_router(struct node *n_ptr, u32 ref) +u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref) { u32 ulim; u32 mask; @@ -551,7 +551,7 @@ u32 tipc_node_select_router(struct node *n_ptr, u32 ref) return tipc_addr(own_zone(), own_cluster(), r); } -void tipc_node_add_router(struct node *n_ptr, u32 router) +void tipc_node_add_router(struct tipc_node *n_ptr, u32 router) { u32 r_num = tipc_node(router); @@ -562,7 +562,7 @@ void tipc_node_add_router(struct node *n_ptr, u32 router) !n_ptr->routers[n_ptr->last_router]); } -void tipc_node_remove_router(struct node *n_ptr, u32 router) +void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router) { u32 r_num = tipc_node(router); @@ -580,7 +580,7 @@ void tipc_node_remove_router(struct node *n_ptr, u32 router) } #if 0 -void node_print(struct print_buf *buf, struct node *n_ptr, char *str) +void node_print(struct print_buf *buf, struct tipc_node *n_ptr, char *str) { u32 i; @@ -597,7 +597,7 @@ void node_print(struct print_buf *buf, struct node *n_ptr, char *str) u32 tipc_available_nodes(const u32 domain) { - struct node *n_ptr; + struct tipc_node *n_ptr; u32 cnt = 0; read_lock_bh(&tipc_net_lock); @@ -615,7 +615,7 @@ struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space) { u32 domain; struct sk_buff *buf; - struct node *n_ptr; + struct tipc_node *n_ptr; struct tipc_node_info node_info; u32 payload_size; @@ -667,7 +667,7 @@ struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space) { u32 domain; struct sk_buff *buf; - struct node *n_ptr; + struct tipc_node *n_ptr; struct tipc_link_info link_info; u32 payload_size; diff --git a/trunk/net/tipc/node.h b/trunk/net/tipc/node.h index cd1882654bbb..6f990da5d143 100644 --- a/trunk/net/tipc/node.h +++ b/trunk/net/tipc/node.h @@ -43,7 +43,7 @@ #include "bearer.h" /** - * struct node - TIPC node structure + * struct tipc_node - TIPC node structure * @addr: network address of node * @lock: spinlock governing access to structure * @owner: pointer to cluster that node belongs to @@ -68,11 +68,11 @@ * @defragm: list of partially reassembled b'cast message fragments from node */ -struct node { +struct tipc_node { u32 addr; spinlock_t lock; struct cluster *owner; - struct node *next; + struct tipc_node *next; struct list_head nsub; struct link *active_links[2]; struct link *links[MAX_BEARERS]; @@ -94,26 +94,26 @@ struct node { } bclink; }; -extern struct node *tipc_nodes; +extern struct tipc_node *tipc_nodes; extern u32 tipc_own_tag; -struct node *tipc_node_create(u32 addr); -void tipc_node_delete(struct node *n_ptr); -struct node *tipc_node_attach_link(struct link *l_ptr); -void tipc_node_detach_link(struct node *n_ptr, struct link *l_ptr); -void tipc_node_link_down(struct node *n_ptr, struct link *l_ptr); -void tipc_node_link_up(struct node *n_ptr, struct link *l_ptr); -int tipc_node_has_active_links(struct node *n_ptr); -int tipc_node_has_redundant_links(struct node *n_ptr); -u32 tipc_node_select_router(struct node *n_ptr, u32 ref); -struct node *tipc_node_select_next_hop(u32 addr, u32 selector); -int tipc_node_is_up(struct node *n_ptr); -void tipc_node_add_router(struct node *n_ptr, u32 router); -void tipc_node_remove_router(struct node *n_ptr, u32 router); +struct tipc_node *tipc_node_create(u32 addr); +void tipc_node_delete(struct tipc_node *n_ptr); +struct tipc_node *tipc_node_attach_link(struct link *l_ptr); +void tipc_node_detach_link(struct tipc_node *n_ptr, struct link *l_ptr); +void tipc_node_link_down(struct tipc_node *n_ptr, struct link *l_ptr); +void tipc_node_link_up(struct tipc_node *n_ptr, struct link *l_ptr); +int tipc_node_has_active_links(struct tipc_node *n_ptr); +int tipc_node_has_redundant_links(struct tipc_node *n_ptr); +u32 tipc_node_select_router(struct tipc_node *n_ptr, u32 ref); +struct tipc_node *tipc_node_select_next_hop(u32 addr, u32 selector); +int tipc_node_is_up(struct tipc_node *n_ptr); +void tipc_node_add_router(struct tipc_node *n_ptr, u32 router); +void tipc_node_remove_router(struct tipc_node *n_ptr, u32 router); struct sk_buff *tipc_node_get_links(const void *req_tlv_area, int req_tlv_space); struct sk_buff *tipc_node_get_nodes(const void *req_tlv_area, int req_tlv_space); -static inline struct node *tipc_node_find(u32 addr) +static inline struct tipc_node *tipc_node_find(u32 addr) { if (likely(in_own_cluster(addr))) return tipc_local_nodes[tipc_node(addr)]; @@ -126,19 +126,19 @@ static inline struct node *tipc_node_find(u32 addr) return NULL; } -static inline struct node *tipc_node_select(u32 addr, u32 selector) +static inline struct tipc_node *tipc_node_select(u32 addr, u32 selector) { if (likely(in_own_cluster(addr))) return tipc_local_nodes[tipc_node(addr)]; return tipc_node_select_next_hop(addr, selector); } -static inline void tipc_node_lock(struct node *n_ptr) +static inline void tipc_node_lock(struct tipc_node *n_ptr) { spin_lock_bh(&n_ptr->lock); } -static inline void tipc_node_unlock(struct node *n_ptr) +static inline void tipc_node_unlock(struct tipc_node *n_ptr) { spin_unlock_bh(&n_ptr->lock); } diff --git a/trunk/net/tipc/node_subscr.c b/trunk/net/tipc/node_subscr.c index 8ecbd0fb6103..19194d476a9e 100644 --- a/trunk/net/tipc/node_subscr.c +++ b/trunk/net/tipc/node_subscr.c @@ -44,7 +44,7 @@ * tipc_nodesub_subscribe - create "node down" subscription for specified node */ -void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, +void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, void *usr_handle, net_ev_handler handle_down) { if (addr == tipc_own_addr) { @@ -69,7 +69,7 @@ void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, * tipc_nodesub_unsubscribe - cancel "node down" subscription (if any) */ -void tipc_nodesub_unsubscribe(struct node_subscr *node_sub) +void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub) { if (!node_sub->node) return; diff --git a/trunk/net/tipc/node_subscr.h b/trunk/net/tipc/node_subscr.h index 5f3f5859b84c..006ed739f515 100644 --- a/trunk/net/tipc/node_subscr.h +++ b/trunk/net/tipc/node_subscr.h @@ -42,22 +42,22 @@ typedef void (*net_ev_handler) (void *usr_handle); /** - * struct node_subscr - "node down" subscription entry + * struct tipc_node_subscr - "node down" subscription entry * @node: ptr to node structure of interest (or NULL, if none) * @handle_node_down: routine to invoke when node fails * @usr_handle: argument to pass to routine when node fails * @nodesub_list: adjacent entries in list of subscriptions for the node */ -struct node_subscr { - struct node *node; +struct tipc_node_subscr { + struct tipc_node *node; net_ev_handler handle_node_down; void *usr_handle; struct list_head nodesub_list; }; -void tipc_nodesub_subscribe(struct node_subscr *node_sub, u32 addr, +void tipc_nodesub_subscribe(struct tipc_node_subscr *node_sub, u32 addr, void *usr_handle, net_ev_handler handle_down); -void tipc_nodesub_unsubscribe(struct node_subscr *node_sub); +void tipc_nodesub_unsubscribe(struct tipc_node_subscr *node_sub); #endif diff --git a/trunk/net/tipc/port.h b/trunk/net/tipc/port.h index e5f8c16429bd..ff31ee4a1dc3 100644 --- a/trunk/net/tipc/port.h +++ b/trunk/net/tipc/port.h @@ -105,7 +105,7 @@ struct port { u32 probing_interval; u32 last_in_seqno; struct timer_list timer; - struct node_subscr subscription; + struct tipc_node_subscr subscription; }; extern spinlock_t tipc_port_list_lock; diff --git a/trunk/net/tipc/zone.c b/trunk/net/tipc/zone.c index 3506f8563441..2c01ba2d86bf 100644 --- a/trunk/net/tipc/zone.c +++ b/trunk/net/tipc/zone.c @@ -111,10 +111,10 @@ void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest) } } -struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) +struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref) { struct cluster *c_ptr; - struct node *n_ptr; + struct tipc_node *n_ptr; u32 c_num; if (!z_ptr) diff --git a/trunk/net/tipc/zone.h b/trunk/net/tipc/zone.h index 6e7a08df8af5..7bdc3406ba9b 100644 --- a/trunk/net/tipc/zone.h +++ b/trunk/net/tipc/zone.h @@ -54,7 +54,7 @@ struct _zone { u32 links; }; -struct node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); +struct tipc_node *tipc_zone_select_remote_node(struct _zone *z_ptr, u32 addr, u32 ref); u32 tipc_zone_select_router(struct _zone *z_ptr, u32 addr, u32 ref); void tipc_zone_remove_as_router(struct _zone *z_ptr, u32 router); void tipc_zone_send_external_routes(struct _zone *z_ptr, u32 dest); diff --git a/trunk/security/selinux/ss/services.c b/trunk/security/selinux/ss/services.c index b52f923ce680..d11a8154500f 100644 --- a/trunk/security/selinux/ss/services.c +++ b/trunk/security/selinux/ss/services.c @@ -811,11 +811,12 @@ static int string_to_context_struct(struct policydb *pol, /* Check the validity of the new context. */ if (!policydb_context_isvalid(pol, ctx)) { rc = -EINVAL; - context_destroy(ctx); goto out; } rc = 0; out: + if (rc) + context_destroy(ctx); return rc; } @@ -868,8 +869,7 @@ static int security_context_to_sid_core(const char *scontext, u32 scontext_len, } else if (rc) goto out; rc = sidtab_context_to_sid(&sidtab, &context, sid); - if (rc) - context_destroy(&context); + context_destroy(&context); out: read_unlock(&policy_rwlock); kfree(scontext2);