Skip to contentSkip to conversation

Proc num on an MP plateform

Linux-ia64 gerard 3 participants 3 messages Sep 4, 2001

lore
Share & tools
lore

gerard

author
#0 lore raw

Hi
I am working on a MP system and I need to know on which
proc num I am running, is there a macro/function call to do this?(kernel mode).

Thanks in advance.
Gerard LYONNAZ

#1 lore raw

Gerard,

ia64_get_lid() returns the processor interrupt id and eid. That
should be enough to uniquely identify which CPU you're one.

Alex

Quoted 9 lines · gerard

Hi
I am working on a MP system and I need to know on which
proc num I am running, is there a macro/function call to do this?(kernel mode).

Thanks in advance.
Gerard LYONNAZ

--
Alex Williamson Linux Development Lab
[email protected] Hewlett Packard
970-898-9173 Fort Collins, CO

#2 lore raw
In reply to gerard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line · gerard

Gerard> Hi I am working on a MP system and I need to know on which Gerard> proc num I am running, is there a macro/function call to do Gerard> this?(kernel mode).

Depends on what number you want. If you want the SAPIC id, ia64_get_lid() is the way to go. If you just want a unique number, you can use smp_processor_id(). If you want a number in the range from 0..smp_num_cpus-1, you can use cpu_number_map(smp_processor_id()).

	--david