Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eff3414b7277c4792debfa227f5408238d925f16
Commit:     eff3414b7277c4792debfa227f5408238d925f16
Parent:     5ecd3100e695228ac5e0ce0e325e252c0f11806f
Author:     David S. Miller <[EMAIL PROTECTED]>
AuthorDate: Sat Jun 2 14:41:44 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jun 4 21:49:50 2007 -0700

    [SPARC64]: Move topology init code into new file, sysfs.c
    
    Also, use per-cpu data for struct cpu.  Calling kmalloc for
    each cpu in topology_init() is just plain clumsy.
    
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 arch/sparc64/kernel/Makefile |    4 ++--
 arch/sparc64/kernel/setup.c  |   19 -------------------
 arch/sparc64/kernel/sysfs.c  |   26 ++++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 21 deletions(-)

diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index d8d1909..f964bf2 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.70 2002/02/09 19:49:30 davem Exp $
+#
 # Makefile for the linux kernel.
 #
 
@@ -8,7 +8,7 @@ EXTRA_CFLAGS := -Werror
 extra-y                := head.o init_task.o vmlinux.lds
 
 obj-y          := process.o setup.o cpu.o idprom.o \
-                  traps.o auxio.o una_asm.o \
+                  traps.o auxio.o una_asm.o sysfs.o \
                   irq.o ptrace.o time.o sys_sparc.o signal.o \
                   unaligned.o central.o pci.o starfire.o semaphore.o \
                   power.o sbus.o iommu_common.o sparc64_ksyms.o chmc.o \
diff --git a/arch/sparc64/kernel/setup.c b/arch/sparc64/kernel/setup.c
index de9b4c1..7490cc6 100644
--- a/arch/sparc64/kernel/setup.c
+++ b/arch/sparc64/kernel/setup.c
@@ -513,22 +513,3 @@ void sun_do_break(void)
 
 int serial_console = -1;
 int stop_a_enabled = 1;
-
-static int __init topology_init(void)
-{
-       int i, err;
-
-       err = -ENOMEM;
-
-       for_each_possible_cpu(i) {
-               struct cpu *p = kzalloc(sizeof(*p), GFP_KERNEL);
-               if (p) {
-                       register_cpu(p, i);
-                       err = 0;
-               }
-       }
-
-       return err;
-}
-
-subsys_initcall(topology_init);
diff --git a/arch/sparc64/kernel/sysfs.c b/arch/sparc64/kernel/sysfs.c
new file mode 100644
index 0000000..0808c21
--- /dev/null
+++ b/arch/sparc64/kernel/sysfs.c
@@ -0,0 +1,26 @@
+/* sysfs.c: Toplogy sysfs support code for sparc64.
+ *
+ * Copyright (C) 2007 David S. Miller <[EMAIL PROTECTED]>
+ */
+#include <linux/sysdev.h>
+#include <linux/cpu.h>
+#include <linux/smp.h>
+#include <linux/percpu.h>
+#include <linux/init.h>
+
+static DEFINE_PER_CPU(struct cpu, cpu_devices);
+
+static int __init topology_init(void)
+{
+       int cpu;
+
+       for_each_possible_cpu(cpu) {
+               struct cpu *c = &per_cpu(cpu_devices, cpu);
+
+               register_cpu(c, cpu);
+       }
+
+       return 0;
+}
+
+subsys_initcall(topology_init);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to