tests/linux: add max_vcores()
authorBarret Rhoden <brho@cs.berkeley.edu>
Tue, 9 Jun 2020 01:47:22 +0000 (21:47 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 9 Jun 2020 17:10:40 +0000 (13:10 -0400)
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
tests/linux/misc-compat.h

index e6832e4..bf9a04b 100644 (file)
@@ -34,8 +34,11 @@ static inline void cpu_relax(void)
 
 #define vcore_id() (-1)
 
+/* This isn't num_vcores, but it's all Linux has */
 #define num_vcores() ((int)sysconf(_SC_NPROCESSORS_ONLN))
 
+#define max_vcores() ((int)sysconf(_SC_NPROCESSORS_ONLN))
+
 #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
 
 typedef void* atomic_t;