-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <davem@davemloft.net>
- Loading branch information
David S. Miller
authored and
David S. Miller
committed
Jun 5, 2007
1 parent
5ecd310
commit eff3414
Showing
3 changed files
with
28 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* sysfs.c: Toplogy sysfs support code for sparc64. | ||
* | ||
* Copyright (C) 2007 David S. Miller <davem@davemloft.net> | ||
*/ | ||
#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); |