linux/include/asm-i386
Zhang, Yanmin 69dcc99199 [PATCH] Export cpu topology in sysfs
The patch implements cpu topology exportation by sysfs.

Items (attributes) are similar to /proc/cpuinfo.

1) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
	represent the physical package id of  cpu X;
2) /sys/devices/system/cpu/cpuX/topology/core_id:
	represent the cpu core id to cpu X;
3) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
	represent the thread siblings to cpu X in the same core;
4) /sys/devices/system/cpu/cpuX/topology/core_siblings:
	represent the thread siblings to cpu X in the same physical package;

To implement it in an architecture-neutral way, a new source file,
driver/base/topology.c, is to export the 5 attributes.

If one architecture wants to support this feature, it just needs to
implement 4 defines, typically in file include/asm-XXX/topology.h.
The 4 defines are:
#define topology_physical_package_id(cpu)
#define topology_core_id(cpu)
#define topology_thread_siblings(cpu)
#define topology_core_siblings(cpu)

The type of **_id is int.
The type of siblings is cpumask_t.

To be consistent on all architectures, the 4 attributes should have
deafult values if their values are unavailable. Below is the rule.

1) physical_package_id: If cpu has no physical package id, -1 is the
default value.

2) core_id: If cpu doesn't support multi-core, its core id is 0.

3) thread_siblings: Just include itself, if the cpu doesn't support
HT/multi-thread.

4) core_siblings: Just include itself, if the cpu doesn't support
multi-core and HT/Multi-thread.

So be careful when declaring the 4 defines in include/asm-XXX/topology.h.

If an attribute isn't defined on an architecture, it won't be exported.

Thank Nathan, Greg, Andi, Paul and Venki.

The patch provides defines for i386/x86_64/ia64.

Signed-off-by: Zhang, Yanmin <yanmin.zhang@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-02-03 08:32:09 -08:00
..
mach-bigsmp
mach-default [PATCH] x86_64/i386: Remove preempt disable calls in lowlevel IPI 2006-01-11 19:01:57 -08:00
mach-es7000
mach-generic
mach-numaq
mach-summit
mach-visws
mach-voyager
8253pit.h
a.out.h
acpi.h
agp.h
apic.h [PATCH] i386: Handle missing local APIC timer interrupts on C3 state 2006-01-11 19:04:54 -08:00
apicdef.h
arch_hooks.h
atomic.h [PATCH] EDAC: core EDAC support code 2006-01-18 19:20:31 -08:00
auxvec.h
bitops.h [PATCH] mark several functions __always_inline 2006-01-14 18:27:15 -08:00
boot.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h
cpu.h
cpufeature.h [PATCH] i386/x86-64: Generalize X86_FEATURE_CONSTANT_TSC flag 2006-01-11 19:01:12 -08:00
cputime.h
current.h [PATCH] mark several functions __always_inline 2006-01-14 18:27:15 -08:00
debugreg.h
delay.h
desc.h
div64.h
dma-mapping.h [PATCH] i386: make pci_map_single/pci_map_sg warn for zero length. 2006-01-11 19:04:56 -08:00
dma.h
e820.h
edac.h [PATCH] EDAC: core EDAC support code 2006-01-18 19:20:31 -08:00
elf.h
emergency-restart.h
errno.h
fcntl.h
fixmap.h
floppy.h
futex.h [PATCH] uml: remove leftover from patch revertal 2006-01-18 19:20:20 -08:00
genapic.h
hardirq.h
highmem.h
hpet.h
hw_irq.h
i387.h [PATCH] i386: task_thread_info() 2006-01-12 09:08:51 -08:00
i8253.h
i8259.h
ide.h
io.h [PATCH] x86_64: Generalize DMI and enable for x86-64 2006-01-11 19:04:51 -08:00
io_apic.h
ioctl.h
ioctls.h
ipc.h
ipcbuf.h
irq.h
ist.h
kdebug.h
kexec.h
kmap_types.h
kprobes.h
ldt.h
linkage.h
local.h
math_emu.h
mc146818rtc.h
mca.h
mca_dma.h
mman.h
mmu.h
mmu_context.h
mmx.h
mmzone.h
module.h
mpspec.h
mpspec_def.h
msgbuf.h
msi.h
msr.h
mtrr.h
mutex.h
namei.h
nmi.h
node.h
numa.h
numaq.h
numnodes.h
page.h [PATCH] VMSPLIT config options 2006-02-01 08:53:21 -08:00
param.h
parport.h
pci-direct.h
pci.h
percpu.h
pgalloc.h
pgtable-2level-defs.h
pgtable-2level.h
pgtable-3level-defs.h
pgtable-3level.h
pgtable.h
poll.h
posix_types.h
processor.h [PATCH] i386: task_stack_page() 2006-01-12 09:08:52 -08:00
ptrace.h
resource.h
rtc.h
rwlock.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
segment.h
semaphore.h
sembuf.h
serial.h
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h [PATCH] Handle TIF_RESTORE_SIGMASK for i386 2006-01-18 19:20:29 -08:00
smp.h
socket.h
sockios.h
sparsemem.h
spinlock.h
spinlock_types.h
srat.h
stat.h
statfs.h
string.h [PATCH] mark several functions __always_inline 2006-01-14 18:27:15 -08:00
suspend.h
system.h [PATCH] sched: add cacheflush() asm 2006-01-12 09:08:49 -08:00
termbits.h
termios.h
thread_info.h [PATCH] Handle TIF_RESTORE_SIGMASK for i386 2006-01-18 19:20:29 -08:00
timer.h
timex.h
tlb.h
tlbflush.h
topology.h [PATCH] Export cpu topology in sysfs 2006-02-03 08:32:09 -08:00
types.h
uaccess.h [PATCH] mark several functions __always_inline 2006-01-14 18:27:15 -08:00
ucontext.h
unaligned.h
unistd.h [PATCH] Add pselect/ppoll system calls on i386 2006-01-18 19:20:30 -08:00
user.h
vga.h
vic.h
vm86.h
voyager.h
xor.h