linux/arch/powerpc
Vaidyanathan Srinivasan 99d8670525 powerpc: Cleanup APIs for cpu/thread/core mappings
These APIs take logical cpu number as input
Change cpu_first_thread_in_core() to cpu_first_thread_sibling()
Change cpu_last_thread_in_core() to cpu_last_thread_sibling()

These APIs convert core number (index) to logical cpu/thread numbers
Add cpu_first_thread_of_core(int core)
Changed cpu_thread_to_core() to cpu_core_index_of_thread(int cpu)

The goal is to make 'threads_per_core' accessible to the
pseries_energy module.  Instead of making an API to read
threads_per_core, this is a higher level wrapper function to
convert from logical cpu number to core number.

The current APIs cpu_first_thread_in_core() and
cpu_last_thread_in_core() returns logical CPU number while
cpu_thread_to_core() returns core number or index which is
not a logical CPU number.  The new APIs are now clearly named to
distinguish 'core number' versus first and last 'logical cpu
number' in that core.

The new APIs cpu_{first,last}_thread_sibling() work on
logical cpu numbers.  While cpu_first_thread_of_core() and
cpu_core_index_of_thread() work on core index.

Example usage:  (4 threads per core system)

cpu_first_thread_sibling(5) = 4
cpu_last_thread_sibling(5) = 7
cpu_core_index_of_thread(5) = 1
cpu_first_thread_of_core(1) = 4

cpu_core_index_of_thread() is used in cpu_to_drc_index() in the
module and cpu_first_thread_of_core() is used in
drc_index_to_cpu() in the module.

Make API changes to few callers.  Export symbols for use in modules.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2010-11-29 15:48:19 +11:00
..
boot powerpc: Fix div64 in bootloader 2010-11-18 14:39:24 +11:00
configs Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2010-10-25 08:32:05 -07:00
include/asm powerpc: Cleanup APIs for cpu/thread/core mappings 2010-11-29 15:48:19 +11:00
kernel powerpc: Cleanup APIs for cpu/thread/core mappings 2010-11-29 15:48:19 +11:00
kvm KVM: PPC: BookE: Load the lower half of MSR 2010-11-05 14:42:29 -02:00
lib powerpc: Add support for popcnt instructions 2010-11-29 15:48:17 +11:00
math-emu powerpc/Makefiles: Change to new flag variables 2010-10-13 16:19:22 +11:00
mm powerpc: Cleanup APIs for cpu/thread/core mappings 2010-11-29 15:48:19 +11:00
oprofile oprofile/fsl emb: Don't set MSR[PMM] until after clearing the interrupt. 2010-10-14 00:53:05 -05:00
platforms powerpc/pseries: Add kernel parameter to disable batched hcalls 2010-11-29 15:48:18 +11:00
sysdev Merge git://git.infradead.org/mtd-2.6 2010-10-30 08:31:35 -07:00
xmon powerpc/Makefiles: Change to new flag variables 2010-10-13 16:19:22 +11:00
Kconfig powerpc: enable ARCH_DMA_ADDR_T_64BIT with ARCH_PHYS_ADDR_T_64BIT 2010-11-29 15:48:19 +11:00
Kconfig.debug powerpc: Unconditionally enabled irq stacks 2010-06-15 15:02:37 +10:00
Makefile powerpc: Fix typo in uImage target 2010-08-24 15:26:32 +10:00
relocs_check.pl powerpc: Check for unsupported relocs when using CONFIG_RELOCATABLE 2009-09-24 15:31:40 +10:00