vppinfra: Stub out get_current_cpu and get_current_numa on FreeBSD
FreeBSD has its own set of syscalls for getting current CPU and NUMA domain information. Stub out these calls and return CPU 0 and NUMA domain 0 as placeholders until we bring in FreeBSD specific calls. Type: improvement Change-Id: Id61df0273b0bcc6acf4844ee626e4f246f9f217b Signed-off-by: Tom Jones <thj@freebsd.org>
This commit is contained in:
@ -252,17 +252,25 @@ format_cpu_flags (u8 *s, va_list *args)
|
||||
__clib_export u32
|
||||
clib_get_current_cpu_id ()
|
||||
{
|
||||
#ifdef __linux__
|
||||
unsigned cpu, node;
|
||||
syscall (__NR_getcpu, &cpu, &node, 0);
|
||||
return cpu;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* __linux__ */
|
||||
}
|
||||
|
||||
__clib_export u32
|
||||
clib_get_current_numa_node ()
|
||||
{
|
||||
#ifdef __linux__
|
||||
unsigned cpu, node;
|
||||
syscall (__NR_getcpu, &cpu, &node, 0);
|
||||
return node;
|
||||
#else
|
||||
return 0;
|
||||
#endif /* __linux__ */
|
||||
}
|
||||
|
||||
__clib_export u8 *
|
||||
|
Reference in New Issue
Block a user