[X86] Move the AMD64 specific parts out of setup_64.c

Previous thread: [X86] Move the 64-bit Intel specific parts out of setup_64.c by Dave Jones on Thursday, May 22, 2008 - 3:44 pm. (3 messages)

Next thread: [PATCH] x86: Switch apm to unlocked_kernel by Alan Cox on Thursday, May 22, 2008 - 4:22 pm. (7 messages)
To: Linux Kernel <linux-kernel@...>
Cc: Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, <hpa@...>
Date: Thursday, May 22, 2008 - 3:44 pm

Create a separate amd_64.c file in the cpu/ dir for
the useful parts to live in.

Signed-off-by: Dave Jones <davej@redhat.com>
---
arch/x86/kernel/cpu/Makefile | 1 +
arch/x86/kernel/cpu/amd_64.c | 237 ++++++++++++++++++++++++++++++++++++++++++
arch/x86/kernel/setup_64.c | 231 +---------------------------------------
3 files changed, 244 insertions(+), 225 deletions(-)
create mode 100644 arch/x86/kernel/cpu/amd_64.c

diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile
index a0c6f81..ef065c1 100644
--- a/arch/x86/kernel/cpu/Makefile
+++ b/arch/x86/kernel/cpu/Makefile
@@ -7,6 +7,7 @@ obj-y += proc.o feature_names.o

obj-$(CONFIG_X86_32) += common.o bugs.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_32) += transmeta.o
diff --git a/arch/x86/kernel/cpu/amd_64.c b/arch/x86/kernel/cpu/amd_64.c
new file mode 100644
index 0000000..ee6b498
--- /dev/null
+++ b/arch/x86/kernel/cpu/amd_64.c
@@ -0,0 +1,237 @@
+#include <linux/init.h>
+#include <linux/mm.h>
+
+#include <asm/numa_64.h>
+#include <asm/mmconfig.h>
+#include <asm/cacheflush.h>
+
+#include <mach_apic.h>
+
+extern int __cpuinit get_model_name(struct cpuinfo_x86 *c);
+extern void __cpuinit display_cacheinfo(struct cpuinfo_x86 *c);
+
+int force_mwait __cpuinitdata;
+
+#ifdef CONFIG_NUMA
+static int __cpuinit nearby_node(int apicid)
+{
+ int i, node;
+
+ for (i = apicid - 1; i >= 0; i--) {
+ node = apicid_to_node[i];
+ if (node != NUMA_NO_NODE && node_online(node))
+ return node;
+ }
+ for (i = apicid + 1; i < MAX_LOCAL_APIC; i++) {
+ node = apicid_to_node[i];
+ if (node != NUMA_NO_NODE && node_online(node))
+ return node;
+ }
+ return first_node(node_online_map); /* Shouldn't happen */
+}
+#endif
+
+static void __cpuinit early_init_amd_mc(struct cpuinfo_x86 *c)
+{
+#ifdef CONFIG_SMP
+ unsigned ...

To: Dave Jones <davej@...>
Cc: Linux Kernel <linux-kernel@...>, Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, <hpa@...>
Date: Friday, May 23, 2008 - 9:16 am

This needs to be done in 32-bit kernel, too, right?

--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--

Previous thread: [X86] Move the 64-bit Intel specific parts out of setup_64.c by Dave Jones on Thursday, May 22, 2008 - 3:44 pm. (3 messages)

Next thread: [PATCH] x86: Switch apm to unlocked_kernel by Alan Cox on Thursday, May 22, 2008 - 4:22 pm. (7 messages)