Skip to contentSkip to conversation

Make common x86 arch area for i386 and x86_64 - Take 3

PATCH In review Steven Rostedt 8 participants 31 messages Mar 15, 2007 – Mar 19, 2007

Subsystems (7)
x86 Kbuild ACPI PCI +3 more subsystems
lore
Share & tools
lore
#0 lore raw

cover Make common x86 arch area for i386 and x86_64 - Take 3

Once again here's an attempt to put the shared files of x86_64 and i386 into a separate directory.

This time, I took the pains to make sure that each patch in this series compiles after it is applied. I did this on both x86_64 as well as i386, with the affected files config options turned on.

I still stayed away from the pci shared code.

This time I moved the speedstep-lib.h into include/asm-x86. Although all references to this files now needs to explicitly state
#include <asm-x86/speedstep-lib.h>
But this will also create a doorway for other shared headers to go into.

And yes the long term goal is to perhaps make a single arch that can handle both the i386 modern CPUs as well as the x86_64 code. And then phase out the x86_64, keeping the current i386 for legacy hardware.

Used git-diff -M for the diffs, so the renames are explicitly stated as such, but no delete/create diff is made (so patch and quilt will not apply theses).

Comments and flames welcome.

-- Steve

#1 lore raw

PATCH 1/20 early_printk.c switch

Move the early_printk.c to the common area.

arch/i386/kernel/Makefile +0 -1
index 4ae3dcf..a57040d 100644
@@ -35,7 +35,6 @@ obj-$(CONFIG_ACPI_SRAT) 	+= srat.o
 obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
 obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
 obj-$(CONFIG_VM86)		+= vm86.o
-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
 obj-$(CONFIG_K8_NB)		+= k8.o
 
arch/i386/kernel/early_printk.c deleted +0 -2
deleted file mode 100644
index 92f812b..0000000
@@ -1,2 +0,0 @@
-
-#include "../../x86_64/kernel/early_printk.c"
arch/x86/kernel/Makefile new file +2 -0
new file mode 100644
index 0000000..55f268f
@@ -0,0 +1,2 @@
+
+obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
arch/x86/kernel/early_printk.c renamed from arch/x86_64/kernel/early_printk.c +0 -0
similarity index 100%
rename from arch/x86_64/kernel/early_printk.c
rename to arch/x86/kernel/early_printk.c
arch/x86_64/Makefile +1 -0
index 2941a91..3cf9198 100644
@@ -79,6 +79,7 @@ head-y := arch/x86_64/kernel/head.o arch/x86_64/kernel/head64.o arch/x86_64/kern
 
 libs-y 					+= arch/x86_64/lib/
 core-y					+= arch/x86_64/kernel/ \
+					   arch/x86/kernel/ \
 					   arch/x86_64/mm/ \
 					   arch/x86_64/crypto/
 core-$(CONFIG_IA32_EMULATION)		+= arch/x86_64/ia32/
arch/x86_64/kernel/Makefile +0 -1
index bb47e86..8b2535c 100644
@@ -28,7 +28,6 @@ obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 obj-$(CONFIG_PM)		+= suspend.o
 obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
 obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
-obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 obj-$(CONFIG_IOMMU)		+= pci-gart.o aperture.o
 obj-$(CONFIG_CALGARY_IOMMU)	+= pci-calgary.o tce.o
 obj-$(CONFIG_SWIOTLB)		+= pci-swiotlb.o
arch/i386/Makefile +1 -0
index bd28f9f..d73a830 100644
@@ -100,6 +100,7 @@ head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
 
 libs-y 					+= arch/i386/lib/
 core-y					+= arch/i386/kernel/ \
+					   arch/x86/kernel/ \
 					   arch/i386/mm/ \
 					   arch/i386/$(mcore-y)/ \
 					   arch/i386/crypto/

--

#2 lore raw

PATCH 2/20 tsc_sync.c switch

In reply to Steven Rostedt

Move tsc_sync.c to the common area.

arch/i386/kernel/Makefile +1 -1
index a57040d..c8fe439 100644
@@ -18,7 +18,7 @@ obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_APM)		+= apm.o
-obj-$(CONFIG_X86_SMP)		+= smp.o smpboot.o tsc_sync.o
+obj-$(CONFIG_X86_SMP)		+= smp.o smpboot.o
 obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline.o
 obj-$(CONFIG_X86_MPPARSE)	+= mpparse.o
 obj-$(CONFIG_X86_LOCAL_APIC)	+= apic.o nmi.o
arch/i386/kernel/tsc_sync.c deleted +0 -1
deleted file mode 100644
index 1242462..0000000
@@ -1 +0,0 @@
-#include "../../x86_64/kernel/tsc_sync.c"
arch/x86/kernel/Makefile +5 -0
index 55f268f..bd548e6 100644
@@ -1,2 +1,7 @@
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
+
+# i386 defines CONFIG_X86_SMP when CONFIG_SMP and !CONFIG_X86_VOYAGER
+ifeq ($(CONFIG_X86_VOYAGER), )
+obj-$(CONFIG_SMP)		+= tsc_sync.o
+endif
arch/x86/kernel/tsc_sync.c renamed from arch/x86_64/kernel/tsc_sync.c +0 -0
similarity index 100%
rename from arch/x86_64/kernel/tsc_sync.c
rename to arch/x86/kernel/tsc_sync.c
arch/x86_64/kernel/Makefile +1 -1
index 8b2535c..54fe500 100644
@@ -19,7 +19,7 @@ obj-$(CONFIG_ACPI)		+= acpi/
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
-obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o tsc_sync.o
+obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-y				+= apic.o  nmi.o
 obj-y				+= io_apic.o mpparse.o \
 		genapic.o genapic_cluster.o genapic_flat.o

--

#3 lore raw

PATCH 3/20 bootflag.c switch

In reply to Steven Rostedt

Move the bootflag.c to the common area.

arch/i386/kernel/Makefile +1 -1
index c8fe439..4622355 100644
@@ -6,7 +6,7 @@ extra-y := head.o init_task.o vmlinux.lds
 
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
-		pci-dma.o i386_ksyms.o i387.o bootflag.o e820.o\
+		pci-dma.o i386_ksyms.o i387.o e820.o\
 		quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
arch/x86/kernel/Makefile +1 -0
index bd548e6..fe2e4ea 100644
@@ -1,3 +1,4 @@
+obj-y				+= bootflag.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/bootflag.c renamed from arch/i386/kernel/bootflag.c +0 -0
similarity index 100%
rename from arch/i386/kernel/bootflag.c
rename to arch/x86/kernel/bootflag.c
arch/x86_64/kernel/Makefile +1 -2
index 54fe500..1ffc4ea 100644
@@ -7,7 +7,7 @@ EXTRA_AFLAGS	:= -traditional
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
 		x8664_ksyms.o i387.o syscall.o vsyscall.o \
-		setup64.o bootflag.o e820.o reboot.o quirks.o i8237.o \
+		setup64.o e820.o reboot.o quirks.o i8237.o \
 		pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
@@ -47,7 +47,6 @@ obj-y				+= pcspeaker.o
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
 therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
-bootflag-y			+= ../../i386/kernel/bootflag.o
 cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 topology-y                     += ../../i386/kernel/topology.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o

--

#4 lore raw

PATCH 4/20 quirks.c switch

In reply to Steven Rostedt

Move the quirks.c to the common area.

arch/i386/kernel/Makefile +1 -1
index 4622355..c5c62af 100644
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
 		pci-dma.o i386_ksyms.o i387.o e820.o\
-		quirks.o i8237.o topology.o alternative.o i8253.o tsc.o
+		i8237.o topology.o alternative.o i8253.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-y				+= cpu/
arch/x86/kernel/Makefile +1 -1
index fe2e4ea..26feab4 100644
@@ -1,4 +1,4 @@
-obj-y				+= bootflag.o
+obj-y				+= bootflag.o quirks.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/quirks.c renamed from arch/i386/kernel/quirks.c +0 -0
similarity index 100%
rename from arch/i386/kernel/quirks.c
rename to arch/x86/kernel/quirks.c
arch/x86_64/kernel/Makefile +1 -2
index 1ffc4ea..533d4bb 100644
@@ -7,7 +7,7 @@ EXTRA_AFLAGS	:= -traditional
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
 		x8664_ksyms.o i387.o syscall.o vsyscall.o \
-		setup64.o e820.o reboot.o quirks.o i8237.o \
+		setup64.o e820.o reboot.o i8237.o \
 		pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
@@ -51,7 +51,6 @@ cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 topology-y                     += ../../i386/kernel/topology.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
-quirks-y			+= ../../i386/kernel/quirks.o
 i8237-y				+= ../../i386/kernel/i8237.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
 alternative-y			+= ../../i386/kernel/alternative.o

--

#5 lore raw

PATCH 5/20 i8237.c switch

In reply to Steven Rostedt

Move the i8237.c to the common area.

arch/i386/kernel/Makefile +1 -1
index c5c62af..1052659 100644
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
 		pci-dma.o i386_ksyms.o i387.o e820.o\
-		i8237.o topology.o alternative.o i8253.o tsc.o
+		topology.o alternative.o i8253.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-y				+= cpu/
arch/x86/kernel/Makefile +1 -1
index 26feab4..19921b9 100644
@@ -1,4 +1,4 @@
-obj-y				+= bootflag.o quirks.o
+obj-y				+= bootflag.o quirks.o i8237.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/i8237.c renamed from arch/i386/kernel/i8237.c +0 -0
similarity index 100%
rename from arch/i386/kernel/i8237.c
rename to arch/x86/kernel/i8237.c
arch/x86_64/kernel/Makefile +1 -2
index 533d4bb..c04f7a6 100644
@@ -7,7 +7,7 @@ EXTRA_AFLAGS	:= -traditional
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
 		x8664_ksyms.o i387.o syscall.o vsyscall.o \
-		setup64.o e820.o reboot.o i8237.o \
+		setup64.o e820.o reboot.o \
 		pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
@@ -51,7 +51,6 @@ cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 topology-y                     += ../../i386/kernel/topology.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
-i8237-y				+= ../../i386/kernel/i8237.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
 alternative-y			+= ../../i386/kernel/alternative.o
 pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#6 lore raw

PATCH 6/20 topology.c switch

In reply to Steven Rostedt

Move the topology.c to the common area.

arch/i386/kernel/Makefile +1 -1
index 1052659..556da60 100644
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
 		pci-dma.o i386_ksyms.o i387.o e820.o\
-		topology.o alternative.o i8253.o tsc.o
+		alternative.o i8253.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-y				+= cpu/
arch/x86/kernel/Makefile +1 -1
index 19921b9..d70dbf3 100644
@@ -1,4 +1,4 @@
-obj-y				+= bootflag.o quirks.o i8237.o
+obj-y				+= bootflag.o quirks.o i8237.o topology.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/topology.c renamed from arch/i386/kernel/topology.c +0 -0
similarity index 100%
rename from arch/i386/kernel/topology.c
rename to arch/x86/kernel/topology.c
arch/x86_64/kernel/Makefile +0 -2
index c04f7a6..3dc4c18 100644
@@ -40,7 +40,6 @@ obj-$(CONFIG_AUDIT)		+= audit.o
 obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_PCI)		+= early-quirks.o
 
-obj-y				+= topology.o
 obj-y				+= intel_cacheinfo.o
 obj-y				+= pcspeaker.o
 
@@ -48,7 +47,6 @@ CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
 therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
 cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
-topology-y                     += ../../i386/kernel/topology.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o

--

#7 lore raw

PATCH 7/20 alternative.c switch

In reply to Steven Rostedt

Move the alternative.c to the common area.

arch/i386/kernel/Makefile +1 -1
index 556da60..44c7d89 100644
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.lds
 obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \
 		pci-dma.o i386_ksyms.o i387.o e820.o\
-		alternative.o i8253.o tsc.o
+		i8253.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-y				+= cpu/
arch/x86/kernel/Makefile +1 -1
index d70dbf3..b63f832 100644
@@ -1,4 +1,4 @@
-obj-y				+= bootflag.o quirks.o i8237.o topology.o
+obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
arch/x86/kernel/alternative.c renamed from arch/i386/kernel/alternative.c +0 -0
similarity index 100%
rename from arch/i386/kernel/alternative.c
rename to arch/x86/kernel/alternative.c
arch/x86_64/kernel/Makefile +1 -2
index 3dc4c18..b12901c 100644
@@ -8,7 +8,7 @@ obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_x86_64.o \
 		x8664_ksyms.o i387.o syscall.o vsyscall.o \
 		setup64.o e820.o reboot.o \
-		pci-dma.o pci-nommu.o alternative.o hpet.o tsc.o
+		pci-dma.o pci-nommu.o hpet.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_X86_MCE)		+= mce.o therm_throt.o
@@ -50,5 +50,4 @@ cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
 msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
-alternative-y			+= ../../i386/kernel/alternative.o
 pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#8 lore raw

PATCH 8/20 msr.c switch

In reply to Steven Rostedt

Move the msr.c to the common area.

arch/i386/kernel/Makefile +0 -1
index 44c7d89..5276349 100644
@@ -14,7 +14,6 @@ obj-y				+= cpu/
 obj-y				+= acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
 obj-$(CONFIG_MCA)		+= mca.o
-obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_APM)		+= apm.o
arch/x86/kernel/Makefile +1 -0
index b63f832..4e5a88f 100644
@@ -1,5 +1,6 @@
 obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
+obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 # i386 defines CONFIG_X86_SMP when CONFIG_SMP and !CONFIG_X86_VOYAGER
arch/x86/kernel/msr.c renamed from arch/i386/kernel/msr.c +0 -0
similarity index 100%
rename from arch/i386/kernel/msr.c
rename to arch/x86/kernel/msr.c
arch/x86_64/kernel/Makefile +0 -2
index b12901c..248dbe8 100644
@@ -16,7 +16,6 @@ obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
 obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
 obj-$(CONFIG_ACPI)		+= acpi/
-obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
@@ -49,5 +48,4 @@ therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
 cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
-msr-$(subst m,y,$(CONFIG_X86_MSR))  += ../../i386/kernel/msr.o
 pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#9 lore raw

PATCH 9/20 cpuid.c switch

In reply to Steven Rostedt

Move the cpuid.c to the common area.

arch/i386/kernel/Makefile +0 -1
index 5276349..4437181 100644
@@ -14,7 +14,6 @@ obj-y				+= cpu/
 obj-y				+= acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
 obj-$(CONFIG_MCA)		+= mca.o
-obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_X86_SMP)		+= smp.o smpboot.o
arch/x86/kernel/Makefile +1 -0
index 4e5a88f..912421a 100644
@@ -1,6 +1,7 @@
 obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
 obj-$(CONFIG_X86_MSR)		+= msr.o
+obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 # i386 defines CONFIG_X86_SMP when CONFIG_SMP and !CONFIG_X86_VOYAGER
arch/x86/kernel/cpuid.c renamed from arch/i386/kernel/cpuid.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpuid.c
rename to arch/x86/kernel/cpuid.c
arch/x86_64/kernel/Makefile +0 -2
index 248dbe8..f5997f3 100644
@@ -17,7 +17,6 @@ obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
 obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
 obj-$(CONFIG_ACPI)		+= acpi/
 obj-$(CONFIG_MICROCODE)		+= microcode.o
-obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-y				+= apic.o  nmi.o
 obj-y				+= io_apic.o mpparse.o \
@@ -45,7 +44,6 @@ obj-y				+= pcspeaker.o
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
 therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
-cpuid-$(subst m,y,$(CONFIG_X86_CPUID))  += ../../i386/kernel/cpuid.o
 microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
 pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#10 lore raw

PATCH 10/20 microcode.c switch

In reply to Steven Rostedt

Move the microcode.c to the common area.

arch/i386/kernel/Makefile +0 -1
index 4437181..ac925bc 100644
@@ -14,7 +14,6 @@ obj-y				+= cpu/
 obj-y				+= acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
 obj-$(CONFIG_MCA)		+= mca.o
-obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_APM)		+= apm.o
 obj-$(CONFIG_X86_SMP)		+= smp.o smpboot.o
 obj-$(CONFIG_X86_TRAMPOLINE)	+= trampoline.o
arch/x86/kernel/Makefile +1 -0
index 912421a..f1c6b2e 100644
@@ -2,6 +2,7 @@ obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
+obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 # i386 defines CONFIG_X86_SMP when CONFIG_SMP and !CONFIG_X86_VOYAGER
arch/x86/kernel/microcode.c renamed from arch/i386/kernel/microcode.c +0 -0
similarity index 100%
rename from arch/i386/kernel/microcode.c
rename to arch/x86/kernel/microcode.c
arch/x86_64/kernel/Makefile +0 -2
index f5997f3..08795d8 100644
@@ -16,7 +16,6 @@ obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
 obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
 obj-$(CONFIG_ACPI)		+= acpi/
-obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-y				+= apic.o  nmi.o
 obj-y				+= io_apic.o mpparse.o \
@@ -44,6 +43,5 @@ obj-y				+= pcspeaker.o
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
 therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
-microcode-$(subst m,y,$(CONFIG_MICROCODE))  += ../../i386/kernel/microcode.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
 pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#11 lore raw

PATCH 11/20 pcspeaker.c switch

In reply to Steven Rostedt

Move the pcspeaker.c to the common area.

arch/i386/kernel/Makefile +0 -1
index ac925bc..ce1f742 100644
@@ -37,7 +37,6 @@ obj-$(CONFIG_K8_NB)		+= k8.o
 
 obj-$(CONFIG_VMI)		+= vmi.o vmitime.o
 obj-$(CONFIG_PARAVIRT)		+= paravirt.o
-obj-y				+= pcspeaker.o
 
 EXTRA_AFLAGS   := -traditional
 
arch/x86/kernel/Makefile +2 -0
index f1c6b2e..3e15c9e 100644
@@ -5,6 +5,8 @@ obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
+obj-y				+= pcspeaker.o
+
 # i386 defines CONFIG_X86_SMP when CONFIG_SMP and !CONFIG_X86_VOYAGER
 ifeq ($(CONFIG_X86_VOYAGER), )
 obj-$(CONFIG_SMP)		+= tsc_sync.o
arch/x86/kernel/pcspeaker.c renamed from arch/i386/kernel/pcspeaker.c +0 -0
similarity index 100%
rename from arch/i386/kernel/pcspeaker.c
rename to arch/x86/kernel/pcspeaker.c
arch/x86_64/kernel/Makefile +0 -2
index 08795d8..3fae694 100644
@@ -38,10 +38,8 @@ obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_PCI)		+= early-quirks.o
 
 obj-y				+= intel_cacheinfo.o
-obj-y				+= pcspeaker.o
 
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
 therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o
-pcspeaker-y			+= ../../i386/kernel/pcspeaker.o

--

#12 lore raw

PATCH 12/20 mtrr directory switch

In reply to Steven Rostedt

Move the mtrr directory over to the common area.

arch/i386/kernel/cpu/Makefile +0 -1
index 010aecf..f8eaef8 100644
@@ -15,5 +15,4 @@ obj-y	+=	umc.o
 
 obj-$(CONFIG_X86_MCE)	+=	mcheck/
 
-obj-$(CONFIG_MTRR)	+= 	mtrr/
 obj-$(CONFIG_CPU_FREQ)	+=	cpufreq/
arch/x86/kernel/Makefile +2 -0
index 3e15c9e..c1a2b58 100644
@@ -1,5 +1,7 @@
 obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
+obj-y				+= cpu/
+
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
arch/x86/kernel/cpu/Makefile new file +2 -0
new file mode 100644
index 0000000..3e59ae7
@@ -0,0 +1,2 @@
+
+obj-$(CONFIG_MTRR)	+= 	mtrr/
arch/x86/kernel/cpu/mtrr/Makefile renamed from arch/i386/kernel/cpu/mtrr/Makefile +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/Makefile
rename to arch/x86/kernel/cpu/mtrr/Makefile
arch/x86/kernel/cpu/mtrr/amd.c renamed from arch/i386/kernel/cpu/mtrr/amd.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/amd.c
rename to arch/x86/kernel/cpu/mtrr/amd.c
arch/x86/kernel/cpu/mtrr/centaur.c renamed from arch/i386/kernel/cpu/mtrr/centaur.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/centaur.c
rename to arch/x86/kernel/cpu/mtrr/centaur.c
arch/x86/kernel/cpu/mtrr/cyrix.c renamed from arch/i386/kernel/cpu/mtrr/cyrix.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/cyrix.c
rename to arch/x86/kernel/cpu/mtrr/cyrix.c
arch/x86/kernel/cpu/mtrr/generic.c renamed from arch/i386/kernel/cpu/mtrr/generic.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/generic.c
rename to arch/x86/kernel/cpu/mtrr/generic.c
arch/x86/kernel/cpu/mtrr/if.c renamed from arch/i386/kernel/cpu/mtrr/if.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/if.c
rename to arch/x86/kernel/cpu/mtrr/if.c
arch/x86/kernel/cpu/mtrr/main.c renamed from arch/i386/kernel/cpu/mtrr/main.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/main.c
rename to arch/x86/kernel/cpu/mtrr/main.c
arch/x86/kernel/cpu/mtrr/mtrr.h renamed from arch/i386/kernel/cpu/mtrr/mtrr.h +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/mtrr.h
rename to arch/x86/kernel/cpu/mtrr/mtrr.h
arch/x86/kernel/cpu/mtrr/state.c renamed from arch/i386/kernel/cpu/mtrr/state.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mtrr/state.c
rename to arch/x86/kernel/cpu/mtrr/state.c
arch/x86_64/kernel/Makefile +0 -1
index 3fae694..60918ad 100644
@@ -14,7 +14,6 @@ obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_X86_MCE)		+= mce.o therm_throt.o
 obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
-obj-$(CONFIG_MTRR)		+= ../../i386/kernel/cpu/mtrr/
 obj-$(CONFIG_ACPI)		+= acpi/
 obj-$(CONFIG_SMP)		+= smp.o smpboot.o trampoline.o
 obj-y				+= apic.o  nmi.o

--

#13 lore raw

PATCH 13/20 therm_throt.c switch

In reply to Steven Rostedt

Move the therm_throt.c to the common area.

arch/i386/kernel/cpu/mcheck/Makefile +1 -1
index f1ebe1c..30808f3 100644
@@ -1,2 +1,2 @@
-obj-y	=	mce.o k7.o p4.o p5.o p6.o winchip.o therm_throt.o
+obj-y	=	mce.o k7.o p4.o p5.o p6.o winchip.o
 obj-$(CONFIG_X86_MCE_NONFATAL)	+=	non-fatal.o
arch/x86/kernel/cpu/Makefile +1 -0
index 3e59ae7..e439cc1 100644
@@ -1,2 +1,3 @@
 
+obj-$(CONFIG_X86_MCE)	+=	mcheck/
 obj-$(CONFIG_MTRR)	+= 	mtrr/
arch/x86/kernel/cpu/mcheck/Makefile new file +1 -0
new file mode 100644
index 0000000..4018cde
@@ -0,0 +1 @@
+obj-y	= therm_throt.o
arch/x86/kernel/cpu/mcheck/therm_throt.c renamed from arch/i386/kernel/cpu/mcheck/therm_throt.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/mcheck/therm_throt.c
rename to arch/x86/kernel/cpu/mcheck/therm_throt.c
arch/x86_64/kernel/Makefile +1 -2
index 60918ad..ef1585d 100644
@@ -11,7 +11,7 @@ obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		pci-dma.o pci-nommu.o hpet.o tsc.o
 
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
-obj-$(CONFIG_X86_MCE)		+= mce.o therm_throt.o
+obj-$(CONFIG_X86_MCE)		+= mce.o
 obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o
 obj-$(CONFIG_ACPI)		+= acpi/
@@ -40,5 +40,4 @@ obj-y				+= intel_cacheinfo.o
 
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
-therm_throt-y                   += ../../i386/kernel/cpu/mcheck/therm_throt.o
 intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o

--

#14 lore raw

PATCH 14/20 intel_cacheinfo.c switch

In reply to Steven Rostedt

Move the intel_cacheinfo.c to the common area.

arch/i386/kernel/cpu/Makefile +1 -1
index f8eaef8..e484d74 100644
@@ -8,7 +8,7 @@ obj-y	+=	amd.o
 obj-y	+=	cyrix.o
 obj-y	+=	centaur.o
 obj-y	+=	transmeta.o
-obj-y	+=	intel.o intel_cacheinfo.o
+obj-y	+=	intel.o
 obj-y	+=	rise.o
 obj-y	+=	nexgen.o
 obj-y	+=	umc.o
arch/x86/kernel/cpu/Makefile +1 -0
index e439cc1..6557e4a 100644
@@ -1,3 +1,4 @@
+obj-y			+=	intel_cacheinfo.o
 
 obj-$(CONFIG_X86_MCE)	+=	mcheck/
 obj-$(CONFIG_MTRR)	+= 	mtrr/
arch/x86/kernel/cpu/intel_cacheinfo.c renamed from arch/i386/kernel/cpu/intel_cacheinfo.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/intel_cacheinfo.c
rename to arch/x86/kernel/cpu/intel_cacheinfo.c
arch/x86_64/kernel/Makefile +0 -3
index ef1585d..0a33b03 100644
@@ -36,8 +36,5 @@ obj-$(CONFIG_AUDIT)		+= audit.o
 obj-$(CONFIG_MODULES)		+= module.o
 obj-$(CONFIG_PCI)		+= early-quirks.o
 
-obj-y				+= intel_cacheinfo.o
-
 CFLAGS_vsyscall.o		:= $(PROFILING) -g0
 
-intel_cacheinfo-y		+= ../../i386/kernel/cpu/intel_cacheinfo.o

--

#15 lore raw

PATCH 15/20 cpufreq files switched

In reply to Steven Rostedt

Moved the shared files that were in the arch/i386/kernel/cpu/cpufreq to the common area. Since the speedstep-lib.h file was used by files that were moved as well as files that were not moved, a new directory was created to hold this shared header, called include/asm-x86. Since this directory is not full featured yet (no x86 arch fully defined) all references to this file must be of #include <asm-x86/speedstep-lib.h>

But this allows for a stepping stone approach to a generic x86 arch and a place to put more asm-x86 headers.

The Kconfig for cpufreq in the x86_64 arch directory is not moved to simplify this patch.

arch/i386/kernel/cpu/cpufreq/Makefile +1 -5
index 560f776..49c4ca4 100644
@@ -1,6 +1,6 @@
+# See also arch/x86/kernel/cpu/cpufreq/Makefile
 obj-$(CONFIG_X86_POWERNOW_K6)		+= powernow-k6.o
 obj-$(CONFIG_X86_POWERNOW_K7)		+= powernow-k7.o
-obj-$(CONFIG_X86_POWERNOW_K8)		+= powernow-k8.o
 obj-$(CONFIG_X86_LONGHAUL)		+= longhaul.o
 obj-$(CONFIG_X86_E_POWERSAVER)		+= e_powersaver.o
 obj-$(CONFIG_ELAN_CPUFREQ)		+= elanfreq.o
@@ -8,9 +8,5 @@ obj-$(CONFIG_SC520_CPUFREQ)		+= sc520_freq.o
 obj-$(CONFIG_X86_LONGRUN)		+= longrun.o  
 obj-$(CONFIG_X86_GX_SUSPMOD)		+= gx-suspmod.o
 obj-$(CONFIG_X86_SPEEDSTEP_ICH)		+= speedstep-ich.o
-obj-$(CONFIG_X86_SPEEDSTEP_LIB)		+= speedstep-lib.o
 obj-$(CONFIG_X86_SPEEDSTEP_SMI)		+= speedstep-smi.o
-obj-$(CONFIG_X86_ACPI_CPUFREQ)		+= acpi-cpufreq.o
-obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO)	+= speedstep-centrino.o
-obj-$(CONFIG_X86_P4_CLOCKMOD)		+= p4-clockmod.o
 obj-$(CONFIG_X86_CPUFREQ_NFORCE2)	+= cpufreq-nforce2.o
arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +1 -1
index b425cd3..97c14b3 100644
@@ -25,7 +25,7 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 
-#include "speedstep-lib.h"
+#include <asm-x86/speedstep-lib.h>
 
 
 /* speedstep_chipset:
arch/i386/kernel/cpu/cpufreq/speedstep-smi.c +1 -1
index ff0d898..093d7d0 100644
@@ -22,7 +22,7 @@
 #include <linux/delay.h>
 #include <asm/ist.h>
 
-#include "speedstep-lib.h"
+#include <asm-x86/speedstep-lib.h>
 
 /* speedstep system management interface port/command.
  *
arch/x86/kernel/cpu/Makefile +1 -0
index 6557e4a..4728c89 100644
@@ -2,3 +2,4 @@ obj-y			+=	intel_cacheinfo.o
 
 obj-$(CONFIG_X86_MCE)	+=	mcheck/
 obj-$(CONFIG_MTRR)	+= 	mtrr/
+obj-$(CONFIG_CPU_FREQ)	+=	cpufreq/
arch/x86/kernel/cpu/cpufreq/Makefile new file +6 -0
new file mode 100644
index 0000000..883fae4
@@ -0,0 +1,6 @@
+
+obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
+obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
+obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
+obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
+obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c renamed from arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
rename to arch/x86/kernel/cpu/cpufreq/acpi-cpufreq.c
arch/x86/kernel/cpu/cpufreq/p4-clockmod.c renamed from arch/i386/kernel/cpu/cpufreq/p4-clockmod.c +1 -1
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
rename to arch/x86/kernel/cpu/cpufreq/p4-clockmod.c
index 4786fed..5024ea8 100644
@@ -33,7 +33,7 @@
 #include <asm/msr.h>
 #include <asm/timex.h>
 
-#include "speedstep-lib.h"
+#include <asm-x86/speedstep-lib.h>
 
 #define PFX	"p4-clockmod: "
 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "p4-clockmod", msg)
arch/x86/kernel/cpu/cpufreq/powernow-k8.c renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/powernow-k8.c
rename to arch/x86/kernel/cpu/cpufreq/powernow-k8.c
arch/x86/kernel/cpu/cpufreq/powernow-k8.h renamed from arch/i386/kernel/cpu/cpufreq/powernow-k8.h +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/powernow-k8.h
rename to arch/x86/kernel/cpu/cpufreq/powernow-k8.h
arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c renamed from arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c
rename to arch/x86/kernel/cpu/cpufreq/speedstep-centrino.c
arch/x86/kernel/cpu/cpufreq/speedstep-lib.c renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.c +1 -1
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/speedstep-lib.c
rename to arch/x86/kernel/cpu/cpufreq/speedstep-lib.c
index d59277c..2de6a69 100644
@@ -17,7 +17,7 @@
 #include <linux/slab.h>
 
 #include <asm/msr.h>
-#include "speedstep-lib.h"
+#include <asm-x86/speedstep-lib.h>
 
 #define dprintk(msg...) cpufreq_debug_printk(CPUFREQ_DEBUG_DRIVER, "speedstep-lib", msg)
 
arch/x86_64/kernel/Makefile +0 -1
index 0a33b03..3d90462 100644
@@ -23,7 +23,6 @@ obj-$(CONFIG_KEXEC)		+= machine_kexec.o relocate_kernel.o crash.o
 obj-$(CONFIG_CRASH_DUMP)	+= crash_dump.o
 obj-$(CONFIG_PM)		+= suspend.o
 obj-$(CONFIG_SOFTWARE_SUSPEND)	+= suspend_asm.o
-obj-$(CONFIG_CPU_FREQ)		+= cpufreq/
 obj-$(CONFIG_IOMMU)		+= pci-gart.o aperture.o
 obj-$(CONFIG_CALGARY_IOMMU)	+= pci-calgary.o tce.o
 obj-$(CONFIG_SWIOTLB)		+= pci-swiotlb.o
arch/x86_64/kernel/cpufreq/Makefile deleted +0 -17
deleted file mode 100644
index 753ce1d..0000000
@@ -1,17 +0,0 @@
-#
-# Reuse the i386 cpufreq drivers
-#
-
-SRCDIR := ../../../i386/kernel/cpu/cpufreq
-
-obj-$(CONFIG_X86_POWERNOW_K8) += powernow-k8.o
-obj-$(CONFIG_X86_ACPI_CPUFREQ) += acpi-cpufreq.o
-obj-$(CONFIG_X86_SPEEDSTEP_CENTRINO) += speedstep-centrino.o
-obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o
-obj-$(CONFIG_X86_SPEEDSTEP_LIB) += speedstep-lib.o
-
-powernow-k8-objs := ${SRCDIR}/powernow-k8.o
-speedstep-centrino-objs := ${SRCDIR}/speedstep-centrino.o
-acpi-cpufreq-objs := ${SRCDIR}/acpi-cpufreq.o
-p4-clockmod-objs := ${SRCDIR}/p4-clockmod.o
-speedstep-lib-objs := ${SRCDIR}/speedstep-lib.o
include/asm-x86/speedstep-lib.h renamed from arch/i386/kernel/cpu/cpufreq/speedstep-lib.h +0 -0
similarity index 100%
rename from arch/i386/kernel/cpu/cpufreq/speedstep-lib.h
rename to include/asm-x86/speedstep-lib.h

--

#16 lore raw

PATCH 16/20 acpi files switched

In reply to Steven Rostedt

Moved the shared files that were in arch/i386/kernel/acpi to the common area.

Note, there still exists files in both archs in acpi. Since there's code there that is unique to the arch.

arch/i386/kernel/acpi/Makefile +0 -5
index 7f7be01..3de22c2 100644
@@ -1,10 +1,5 @@
-obj-$(CONFIG_ACPI)		+= boot.o
 ifneq ($(CONFIG_PCI),)
 obj-$(CONFIG_X86_IO_APIC)	+= earlyquirk.o
 endif
 obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wakeup.o
 
-ifneq ($(CONFIG_ACPI_PROCESSOR),)
-obj-y				+= cstate.o processor.o
-endif
-
arch/x86/kernel/Makefile +1 -0
index c1a2b58..1167962 100644
@@ -1,6 +1,7 @@
 obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
 obj-y				+= cpu/
+obj-$(CONFIG_ACPI)		+= acpi/
 
 obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
arch/x86/kernel/acpi/Makefile new file +5 -0
new file mode 100644
index 0000000..3aa3d16
@@ -0,0 +1,5 @@
+obj-y				+= boot.o
+
+ifneq ($(CONFIG_ACPI_PROCESSOR),)
+obj-y		+= processor.o cstate.o
+endif
arch/x86/kernel/acpi/boot.c renamed from arch/i386/kernel/acpi/boot.c +0 -0
similarity index 100%
rename from arch/i386/kernel/acpi/boot.c
rename to arch/x86/kernel/acpi/boot.c
arch/x86/kernel/acpi/cstate.c renamed from arch/i386/kernel/acpi/cstate.c +0 -0
similarity index 100%
rename from arch/i386/kernel/acpi/cstate.c
rename to arch/x86/kernel/acpi/cstate.c
arch/x86/kernel/acpi/processor.c renamed from arch/i386/kernel/acpi/processor.c +0 -0
similarity index 100%
rename from arch/i386/kernel/acpi/processor.c
rename to arch/x86/kernel/acpi/processor.c
arch/x86_64/kernel/acpi/Makefile +0 -7
index 080b996..eb4bc11 100644
@@ -1,9 +1,2 @@
-obj-y			:= boot.o
-boot-y			:= ../../../i386/kernel/acpi/boot.o
 obj-$(CONFIG_ACPI_SLEEP)	+= sleep.o wakeup.o
 
-ifneq ($(CONFIG_ACPI_PROCESSOR),)
-obj-y			+= processor.o
-processor-y		:= ../../../i386/kernel/acpi/processor.o ../../../i386/kernel/acpi/cstate.o
-endif
-

--

reviewer
#17 lore raw

Re: [PATCH take3 16/20] acpi files switched

Quoted 2 lines · Steven Rostedt

Moved the shared files that were in arch/i386/kernel/acpi to the common area.

When I do a "make cscope" on an i386 or an x86_64 box, will it find these files in the common area?

thanks
-Len

#18 lore raw

Re: [PATCH take3 16/20] acpi files switched

Quoted 6 lines · * Len Brown ([email protected]) wrote:
Quoted 2 lines · Steven Rostedt

Moved the shared files that were in arch/i386/kernel/acpi to the common area.

When I do a "make cscope" on an i386 or an x86_64 box, will it find these files in the common area?

The simple equiv of 'make ALLSOURCE_ARCHS="$ARCH x86" cscope' should do it. I'm sure there's a slicker way, but this brute force gives you an idea:

Makefile +7 -1
@@ -1266,6 +1266,12 @@ ifeq ($(ALLSOURCE_ARCHS),)
 ifeq ($(ALLSOURCE_ARCHS),)
 ifeq ($(ARCH),um)
 ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
+else ifeq ($(ARCH),i386)
+ALLINCLUDE_ARCHS := x86 $(ARCH)
+ALLSOURCE_ARCHS := x86 $(ARCH)
+else ifeq ($(ARCH),x86_64)
+ALLINCLUDE_ARCHS := x86 $(ARCH)
+ALLSOURCE_ARCHS := x86 $(ARCH)
 else
 ALLINCLUDE_ARCHS := $(ARCH)
 endif
@@ -1274,7 +1280,7 @@ ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
 ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
 endif
 
-ALLSOURCE_ARCHS := $(ARCH)
+ALLSOURCE_ARCHS ?= $(ARCH)
 
 define find-sources
         ( find $(__srctree) $(RCS_FIND_IGNORE) \
#19 lore raw

Re: [PATCH take3 16/20] acpi files switched

In reply to Len Brown
Quoted 6 lines · Len Brown
Quoted 2 lines · Steven Rostedt

Moved the shared files that were in arch/i386/kernel/acpi to the common area.

When I do a "make cscope" on an i386 or an x86_64 box, will it find these files in the common area?

At the moment, "no".

With this quick hack, it will work, and I'm sure someone can come up with a better idea.

Currently, the "make cscope" and "make TAGS" only get the files that are physically located in the arch. As I mentioned to Ingo, it took me an hour when I first looked for early_printk. Since it wasn't in the TAGS and my own search scripts were also arch specific. I was working in i386, and early_printk is not.

But here's a hack that will let both x86_64 and i386 see the same code in the common area for a "make cscope" or "make TAGS".

-- Steve

Makefile +8 -2
index 6393738..974c05b 100644
@@ -1265,8 +1265,16 @@ endif
 
 ifeq ($(ALLSOURCE_ARCHS),)
 ifeq ($(ARCH),um)
+ALLSOURCE_ARCHS := $(ARCH)
 ALLINCLUDE_ARCHS := $(ARCH) $(SUBARCH)
+else ifeq ($(ARCH),x86_64)
+ALLSOURCE_ARCHS := $(ARCH) x86
+ALLINCLUDE_ARCHS := $(ARCH) x86
+else ifeq ($(ARCH),i386)
+ALLSOURCE_ARCHS := $(ARCH) x86
+ALLINCLUDE_ARCHS := $(ARCH) x86
 else
+ALLSOURCE_ARCHS := $(ARCH)
 ALLINCLUDE_ARCHS := $(ARCH)
 endif
 else
@@ -1274,8 +1282,6 @@ else
 ALLINCLUDE_ARCHS := $(ALLSOURCE_ARCHS)
 endif
 
-ALLSOURCE_ARCHS := $(ARCH)
-
 define find-sources
         ( find $(__srctree) $(RCS_FIND_IGNORE) \
 	       \( -name include -o -name arch \) -prune -o \
#20 lore raw

PATCH 17/20 k8.c switch

In reply to Steven Rostedt

Move the k8.c to the common area.

arch/i386/kernel/Makefile +0 -2
index ce1f742..72e11f7 100644
@@ -33,7 +33,6 @@ obj-$(CONFIG_EFI) 		+= efi.o efi_stub.o
 obj-$(CONFIG_DOUBLEFAULT) 	+= doublefault.o
 obj-$(CONFIG_VM86)		+= vm86.o
 obj-$(CONFIG_HPET_TIMER) 	+= hpet.o
-obj-$(CONFIG_K8_NB)		+= k8.o
 
 obj-$(CONFIG_VMI)		+= vmi.o vmitime.o
 obj-$(CONFIG_PARAVIRT)		+= paravirt.o
@@ -78,6 +77,5 @@ $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
 			$(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
 	$(call if_changed,syscall)
 
-k8-y                      += ../../x86_64/kernel/k8.o
 stacktrace-y		  += ../../x86_64/kernel/stacktrace.o
 
arch/x86/kernel/Makefile +1 -0
index 1167962..06c335d 100644
@@ -7,6 +7,7 @@ obj-$(CONFIG_X86_MSR)		+= msr.o
 obj-$(CONFIG_X86_CPUID)		+= cpuid.o
 obj-$(CONFIG_MICROCODE)		+= microcode.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
+obj-$(CONFIG_K8_NB)		+= k8.o
 
 obj-y				+= pcspeaker.o
 
arch/x86/kernel/k8.c renamed from arch/x86_64/kernel/k8.c +0 -0
similarity index 100%
rename from arch/x86_64/kernel/k8.c
rename to arch/x86/kernel/k8.c
arch/x86_64/kernel/Makefile +0 -1
index 3d90462..0510887 100644
@@ -29,7 +29,6 @@ obj-$(CONFIG_SWIOTLB)		+= pci-swiotlb.o
 obj-$(CONFIG_KPROBES)		+= kprobes.o
 obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer.o
 obj-$(CONFIG_X86_VSMP)		+= vsmp.o
-obj-$(CONFIG_K8_NB)		+= k8.o
 obj-$(CONFIG_AUDIT)		+= audit.o
 
 obj-$(CONFIG_MODULES)		+= module.o

--

#21 lore raw

PATCH 18/20 stacktrace.c switch

In reply to Steven Rostedt

Move the stacktrace.c to the common area.

arch/i386/kernel/Makefile +0 -3
index 72e11f7..a5cf2e7 100644
@@ -9,7 +9,6 @@ obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		pci-dma.o i386_ksyms.o i387.o e820.o\
 		i8253.o tsc.o
 
-obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-y				+= cpu/
 obj-y				+= acpi/
 obj-$(CONFIG_X86_BIOS_REBOOT)	+= reboot.o
@@ -77,5 +76,3 @@ $(obj)/vsyscall-syms.o: $(src)/vsyscall.lds \
 			$(obj)/vsyscall-sysenter.o $(obj)/vsyscall-note.o FORCE
 	$(call if_changed,syscall)
 
-stacktrace-y		  += ../../x86_64/kernel/stacktrace.o
-
arch/x86/kernel/Makefile +2 -0
index 06c335d..297cde9 100644
@@ -1,5 +1,7 @@
 obj-y				+= bootflag.o quirks.o i8237.o topology.o alternative.o
 
+obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
+
 obj-y				+= cpu/
 obj-$(CONFIG_ACPI)		+= acpi/
 
arch/x86/kernel/stacktrace.c renamed from arch/x86_64/kernel/stacktrace.c +0 -0
similarity index 100%
rename from arch/x86_64/kernel/stacktrace.c
rename to arch/x86/kernel/stacktrace.c
arch/x86_64/kernel/Makefile +0 -1
index 0510887..7477cb1 100644
@@ -10,7 +10,6 @@ obj-y	:= process.o signal.o entry.o traps.o irq.o \
 		setup64.o e820.o reboot.o \
 		pci-dma.o pci-nommu.o hpet.o tsc.o
 
-obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_X86_MCE)		+= mce.o
 obj-$(CONFIG_X86_MCE_INTEL)	+= mce_intel.o
 obj-$(CONFIG_X86_MCE_AMD)	+= mce_amd.o

--

#22 lore raw

PATCH 19/20 hugetlbpage.c switch

In reply to Steven Rostedt

Move the hugetlbpage.c to the common area.

arch/i386/Makefile +1 -0
index d73a830..06dd07e 100644
@@ -102,6 +102,7 @@ libs-y 					+= arch/i386/lib/
 core-y					+= arch/i386/kernel/ \
 					   arch/x86/kernel/ \
 					   arch/i386/mm/ \
+					   arch/x86/mm/ \
 					   arch/i386/$(mcore-y)/ \
 					   arch/i386/crypto/
 drivers-$(CONFIG_MATH_EMULATION)	+= arch/i386/math-emu/
arch/i386/mm/Makefile +0 -1
index 80908b5..0cb01e6 100644
@@ -5,6 +5,5 @@
 obj-y	:= init.o pgtable.o fault.o ioremap.o extable.o pageattr.o mmap.o
 
 obj-$(CONFIG_NUMA) += discontig.o
-obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
 obj-$(CONFIG_HIGHMEM) += highmem.o
 obj-$(CONFIG_BOOT_IOREMAP) += boot_ioremap.o
arch/x86/mm/Makefile new file +1 -0
new file mode 100644
index 0000000..1b6e922
@@ -0,0 +1 @@
+obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
arch/x86/mm/hugetlbpage.c renamed from arch/i386/mm/hugetlbpage.c +0 -0
similarity index 100%
rename from arch/i386/mm/hugetlbpage.c
rename to arch/x86/mm/hugetlbpage.c
arch/x86_64/Makefile +1 -0
index 3cf9198..abf1829 100644
@@ -81,6 +81,7 @@ libs-y 					+= arch/x86_64/lib/
 core-y					+= arch/x86_64/kernel/ \
 					   arch/x86/kernel/ \
 					   arch/x86_64/mm/ \
+					   arch/x86/mm/ \
 					   arch/x86_64/crypto/
 core-$(CONFIG_IA32_EMULATION)		+= arch/x86_64/ia32/
 drivers-$(CONFIG_PCI)			+= arch/x86_64/pci/
arch/x86_64/mm/Makefile +0 -2
index d25ac86..b6f1f43 100644
@@ -3,9 +3,7 @@
 #
 
 obj-y	 := init.o fault.o ioremap.o extable.o pageattr.o mmap.o
-obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
 obj-$(CONFIG_NUMA) += numa.o
 obj-$(CONFIG_K8_NUMA) += k8topology.o
 obj-$(CONFIG_ACPI_NUMA) += srat.o
 
-hugetlbpage-y = ../../i386/mm/hugetlbpage.o

--

#23 lore raw

PATCH 20/20 oprofile files switched

In reply to Steven Rostedt

Move the oprofile files from arch/i386/oprofile to the common area.

arch/i386/Kconfig +1 -1
index 53d6237..137c063 100644
@@ -1226,7 +1226,7 @@ source "fs/Kconfig"
 menu "Instrumentation Support"
 	depends on EXPERIMENTAL
 
-source "arch/i386/oprofile/Kconfig"
+source "arch/x86/oprofile/Kconfig"
 
 config KPROBES
 	bool "Kprobes (EXPERIMENTAL)"
arch/i386/Makefile +1 -1
index 06dd07e..6e537be 100644
@@ -108,7 +108,7 @@ core-y					+= arch/i386/kernel/ \
 drivers-$(CONFIG_MATH_EMULATION)	+= arch/i386/math-emu/
 drivers-$(CONFIG_PCI)			+= arch/i386/pci/
 # must be linked after kernel/
-drivers-$(CONFIG_OPROFILE)		+= arch/i386/oprofile/
+drivers-$(CONFIG_OPROFILE)		+= arch/x86/oprofile/
 drivers-$(CONFIG_PM)			+= arch/i386/power/
 
 CFLAGS += $(mflags-y)
arch/x86/oprofile/Kconfig renamed from arch/i386/oprofile/Kconfig +0 -0
similarity index 100%
rename from arch/i386/oprofile/Kconfig
rename to arch/x86/oprofile/Kconfig
arch/x86/oprofile/Makefile renamed from arch/i386/oprofile/Makefile +0 -0
similarity index 100%
rename from arch/i386/oprofile/Makefile
rename to arch/x86/oprofile/Makefile
arch/x86/oprofile/backtrace.c renamed from arch/i386/oprofile/backtrace.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/backtrace.c
rename to arch/x86/oprofile/backtrace.c
arch/x86/oprofile/init.c renamed from arch/i386/oprofile/init.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/init.c
rename to arch/x86/oprofile/init.c
arch/x86/oprofile/nmi_int.c renamed from arch/i386/oprofile/nmi_int.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/nmi_int.c
rename to arch/x86/oprofile/nmi_int.c
arch/x86/oprofile/nmi_timer_int.c renamed from arch/i386/oprofile/nmi_timer_int.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/nmi_timer_int.c
rename to arch/x86/oprofile/nmi_timer_int.c
arch/x86/oprofile/op_counter.h renamed from arch/i386/oprofile/op_counter.h +0 -0
similarity index 100%
rename from arch/i386/oprofile/op_counter.h
rename to arch/x86/oprofile/op_counter.h
arch/x86/oprofile/op_model_athlon.c renamed from arch/i386/oprofile/op_model_athlon.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/op_model_athlon.c
rename to arch/x86/oprofile/op_model_athlon.c
arch/x86/oprofile/op_model_p4.c renamed from arch/i386/oprofile/op_model_p4.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/op_model_p4.c
rename to arch/x86/oprofile/op_model_p4.c
arch/x86/oprofile/op_model_ppro.c renamed from arch/i386/oprofile/op_model_ppro.c +0 -0
similarity index 100%
rename from arch/i386/oprofile/op_model_ppro.c
rename to arch/x86/oprofile/op_model_ppro.c
arch/x86/oprofile/op_x86_model.h renamed from arch/i386/oprofile/op_x86_model.h +0 -0
similarity index 100%
rename from arch/i386/oprofile/op_x86_model.h
rename to arch/x86/oprofile/op_x86_model.h
arch/x86_64/Kconfig +1 -1
index 56eb14c..12e9fc4 100644
@@ -738,7 +738,7 @@ source fs/Kconfig
 menu "Instrumentation Support"
         depends on EXPERIMENTAL
 
-source "arch/x86_64/oprofile/Kconfig"
+source "arch/x86/oprofile/Kconfig"
 
 config KPROBES
 	bool "Kprobes (EXPERIMENTAL)"
arch/x86_64/Makefile +1 -1
index abf1829..0c7e0fa 100644
@@ -85,7 +85,7 @@ core-y					+= arch/x86_64/kernel/ \
 					   arch/x86_64/crypto/
 core-$(CONFIG_IA32_EMULATION)		+= arch/x86_64/ia32/
 drivers-$(CONFIG_PCI)			+= arch/x86_64/pci/
-drivers-$(CONFIG_OPROFILE)		+= arch/x86_64/oprofile/
+drivers-$(CONFIG_OPROFILE)		+= arch/x86/oprofile/
 
 boot := arch/x86_64/boot
 
arch/x86_64/oprofile/Kconfig deleted +0 -17
deleted file mode 100644
index d8a8408..0000000
@@ -1,17 +0,0 @@
-config PROFILING
-	bool "Profiling support (EXPERIMENTAL)"
-	help
-	  Say Y here to enable the extended profiling support mechanisms used
-	  by profilers such as OProfile.
-	  
-
-config OPROFILE
-	tristate "OProfile system profiling (EXPERIMENTAL)"
-	depends on PROFILING
-	help
-	  OProfile is a profiling system capable of profiling the
-	  whole system, include the kernel, kernel modules, libraries,
-	  and applications.
-
-	  If unsure, say N.
-
arch/x86_64/oprofile/Makefile deleted +0 -19
deleted file mode 100644
index 6be3268..0000000
@@ -1,19 +0,0 @@
-#
-# oprofile for x86-64.
-# Just reuse the one from i386. 
-#
-
-obj-$(CONFIG_OPROFILE) += oprofile.o
- 
-DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
-	oprof.o cpu_buffer.o buffer_sync.o \
-	event_buffer.o oprofile_files.o \
-	oprofilefs.o oprofile_stats.o \
-	timer_int.o )
-
-OPROFILE-y := init.o backtrace.o
-OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o op_model_p4.o \
-				     op_model_ppro.o
-OPROFILE-$(CONFIG_X86_IO_APIC)    += nmi_timer_int.o 
-
-oprofile-y = $(DRIVER_OBJS) $(addprefix ../../i386/oprofile/, $(OPROFILE-y))

--

#24 lore raw
In reply to Steven Rostedt
Quoted 2 lines · Steven Rostedt

Once again here's an attempt to put the shared files of x86_64 and i386 into a separate directory.

OK, that's fine, but the next step is to have "make ARCH=x86" compile, with a config option as to whether to build 32 or 64 bit. This will involve a fair amount of Makefile hair, but if you can get Andi to buy into that then the rest is a simple matter of code churn. For most kernel hackers, this would be the flag day.

Moving the rest of the files across to xxx_32.c, xxx_64.h etc is going to involve a great deal of untangling and code cleanup. It's also going to completely screw a whole heap of my cleanup patches. Oh well.

(Still hoping for an executive summary from the PPC folks).

Cheers!
Rusty.

#25 lore raw
Quoted 4 lines · Rusty Russell

Moving the rest of the files across to xxx_32.c, xxx_64.h etc is going to involve a great deal of untangling and code cleanup. It's also going to completely screw a whole heap of my cleanup patches. Oh well.

most of your cleanups ought to be fixable via transforming the file names. But yes, and you are not the only one with some significant amount of x86 code pending - still, it's the right way to go ;-)

Ingo

#26 lore raw
In reply to Steven Rostedt
Quoted 2 lines · Steven Rostedt

Once again here's an attempt to put the shared files of x86_64 and i386 into a separate directory.

what do you think about the idea i suggested: to do an x32_/x64_ prefix (or _32/_64 postfix), in a brute-force way, _right away_. I.e. do not have any overlap of having both arch/i386/ and arch/x86_64/ and arch/x86/ - move everything to arch/x86/ right now.

in the initial step we dont even have to attempt to share anything - we just want to make sure everything still works fine. Just create a 'unified' layout with the prefix/postfix solution, and make sure that the build architecture can compile existing .configs just fine, which results in a functionally identical vmlinux that would be built if these files were still in arch/i386/ (and arch/x86_64/).

i dont think we want to have a too long 'overlap' period. Lets just unify them, that would be the only large-scale intrusive move.

Quoted 1 line

From that point on, the unification decisions would be largely per-file:

"do we want to unify process_32.c and process_64.c into the same file?".

Ingo

#27 lore raw
Quoted 9 lines · Ingo Molnar
Quoted 2 lines · Steven Rostedt

Once again here's an attempt to put the shared files of x86_64 and i386 into a separate directory.

what do you think about the idea i suggested: to do an x32_/x64_ prefix (or _32/_64 postfix), in a brute-force way, _right away_. I.e. do not have any overlap of having both arch/i386/ and arch/x86_64/ and arch/x86/ - move everything to arch/x86/ right now.

No, no, please don't do that. It would make backporting patches for stable kernels a real pain. Moving only the common files is the right way to go for a first cut...

#28 lore raw
Quoted 4 lines · Ingo Molnar
Quoted 4 lines

what do you think about the idea i suggested: to do an x32_/x64_ prefix (or _32/_64 postfix), in a brute-force way, _right away_. I.e. do not have any overlap of having both arch/i386/ and arch/x86_64/ and arch/x86/ - move everything to arch/x86/ right now.

Quoted 3 lines · Chuck Ebbert

No, no, please don't do that. It would make backporting patches for stable kernels a real pain. Moving only the common files is the right way to go for a first cut...

As if the patches come remotely close to applying in the first place. The filename patched is the least of the worries.

-- wli

#29 lore raw
Quoted 6 lines · William Lee Irwin III
Quoted 4 lines · Ingo Molnar
Quoted 4 lines

what do you think about the idea i suggested: to do an x32_/x64_ prefix (or _32/_64 postfix), in a brute-force way, _right away_. I.e. do not have any overlap of having both arch/i386/ and arch/x86_64/ and arch/x86/ - move everything to arch/x86/ right now.

Quoted 7 lines
Quoted 3 lines · Chuck Ebbert

No, no, please don't do that. It would make backporting patches for stable kernels a real pain. Moving only the common files is the right way to go for a first cut...

As if the patches come remotely close to applying in the first place. The filename patched is the least of the worries.

Actually it's surprising how many patches do apply unchanged. A massive file rename, *just for the sake of renaming*, would mean no x86 patches would apply and gain nothing anyway.

#30 lore raw
Quoted 1 line

and gain nothing anyway.

That's my gripe about the common files directory too.

-Andi