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:
Tom Jones
2024-01-26 13:48:49 +00:00
committed by Damjan Marion
parent 03b7ac929e
commit ac80b8be8b

View File

@ -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 *