NXGetCpuID

Returns the current processor ID (CPU number).

Library:LibC
Classification:NKS
Service:NKS Platform

Syntax

  #include <nks/plat.h>
   
  NXCpuId_t NXGetCpuID (void);
  

Return Values

Returns the current processor ID (CPU number).

Remarks

NXGetCpuID returns a snapshot of the current processor ID. Unless the calling thread is bound to a processor, the value returned could already be stale.

The NKS layer uses the following naming scheme for addressing the processors that might be currently online: if N is the number of processors online, these processors can be addressed as a sequence of integers between 0 and N-1. For example, 8 online processors can be addressed with the integers 0 through 7 respectively.

See Also

NXThreadBind