diff options
author | David Miller <davem@davemloft.net> | 2013-10-03 17:24:51 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@linaro.org> | 2013-10-15 15:09:10 -0400 |
commit | d1cb9d1af0bc11b7450a6032f43935c746609418 (patch) | |
tree | 061b56dbd9e656730262445b373bacd399c0678e /include/linux/cpu.h | |
parent | 444c91e5720cb5b825356e32c67c2c5184d1c09a (diff) |
of: Make cpu node handling more portable.
Use for_each_node_by_type() to iterate all cpu nodes in the
system.
Provide and overridable function arch_find_n_match_cpu_physical_id,
which sees if the given device node matches 'cpu' and if so sets
'*thread' when non-NULL to the cpu thread number within the core.
The default implementation behaves the same as the existing code.
Add a sparc64 implementation.
Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Sudeep KarkadaNagesha <Sudeep.KarkadaNagesha@arm.com>
Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'include/linux/cpu.h')
-rw-r--r-- | include/linux/cpu.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 801ff9e73679..fbd25c3c2923 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/cpumask.h> | 18 | #include <linux/cpumask.h> |
19 | 19 | ||
20 | struct device; | 20 | struct device; |
21 | struct device_node; | ||
21 | 22 | ||
22 | struct cpu { | 23 | struct cpu { |
23 | int node_id; /* The node which contains the CPU */ | 24 | int node_id; /* The node which contains the CPU */ |
@@ -29,6 +30,8 @@ extern int register_cpu(struct cpu *cpu, int num); | |||
29 | extern struct device *get_cpu_device(unsigned cpu); | 30 | extern struct device *get_cpu_device(unsigned cpu); |
30 | extern bool cpu_is_hotpluggable(unsigned cpu); | 31 | extern bool cpu_is_hotpluggable(unsigned cpu); |
31 | extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id); | 32 | extern bool arch_match_cpu_phys_id(int cpu, u64 phys_id); |
33 | extern bool arch_find_n_match_cpu_physical_id(struct device_node *cpun, | ||
34 | int cpu, unsigned int *thread); | ||
32 | 35 | ||
33 | extern int cpu_add_dev_attr(struct device_attribute *attr); | 36 | extern int cpu_add_dev_attr(struct device_attribute *attr); |
34 | extern void cpu_remove_dev_attr(struct device_attribute *attr); | 37 | extern void cpu_remove_dev_attr(struct device_attribute *attr); |