Find the answer to your Linux question:
Results 1 to 5 of 5
can anyone please help me with the code for how to identify the current CPU in IA64 2.6.x kernel in SLES 10...
  1. #1
    Just Joined!
    Join Date
    Apr 2008
    Posts
    6

    how the current CPU is identified in IA64 2.6.X kernel

    can anyone please help me with the code for how to identify the current CPU in IA64 2.6.x kernel in SLES 10

  2. #2
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    What are you really looking for?
    If you are developing a kernel module then
    smp_processor_id() is the function.

  3. #3
    Just Joined!
    Join Date
    Apr 2008
    Posts
    6
    Quote Originally Posted by digvijay.gahlot View Post
    What are you really looking for?
    If you are developing a kernel module then
    smp_processor_id() is the function.
    I dont want to include smp.h header in which this smp_processor_id() function is defined as including that is throwing errors..
    I have written this code:
    #include<linux/smp.h>
    int main()
    {
    unsigned int a;
    a=get_cpu();
    return 0;
    }

    It is throwing errors related to linux header files in /usr/include...
    how can I get rid of this compilation error??

    If any patch is available for this please let me know
    Also, if we can get current cpuid by some other means so as to avoid these errors, please tell me

  4. #4
    Linux Newbie
    Join Date
    Mar 2008
    Location
    Hyderabad
    Posts
    109
    How are you compiling???

  5. #5
    Just Joined!
    Join Date
    Apr 2008
    Posts
    6
    I am compiling by giving g++ example.cpp(the file in which i have written the same piece of code) gcc version is 4.1.0

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...