diff options
Diffstat (limited to 'arch/powerpc/kernel/smp.c')
-rw-r--r-- | arch/powerpc/kernel/smp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c index 009900dd8f25..d9d8bb0f4454 100644 --- a/arch/powerpc/kernel/smp.c +++ b/arch/powerpc/kernel/smp.c | |||
@@ -596,6 +596,21 @@ out: | |||
596 | return id; | 596 | return id; |
597 | } | 597 | } |
598 | 598 | ||
599 | /* Return the value of the chip-id property corresponding | ||
600 | * to the given logical cpu. | ||
601 | */ | ||
602 | int cpu_to_chip_id(int cpu) | ||
603 | { | ||
604 | struct device_node *np; | ||
605 | |||
606 | np = of_get_cpu_node(cpu, NULL); | ||
607 | if (!np) | ||
608 | return -1; | ||
609 | |||
610 | of_node_put(np); | ||
611 | return of_get_ibm_chip_id(np); | ||
612 | } | ||
613 | |||
599 | /* Helper routines for cpu to core mapping */ | 614 | /* Helper routines for cpu to core mapping */ |
600 | int cpu_core_index_of_thread(int cpu) | 615 | int cpu_core_index_of_thread(int cpu) |
601 | { | 616 | { |