diff --git a/include/hax.h b/include/hax.h index 174c8163..a95345f6 100644 --- a/include/hax.h +++ b/include/hax.h @@ -218,6 +218,8 @@ void hax_unmap_page(struct hax_page *page); void hax_log(int level, const char *fmt, ...); void hax_panic(const char *fmt, ...); +uint32_t hax_cpu_id(void); + #ifdef __cplusplus } #endif @@ -315,7 +317,6 @@ static inline bool cpu_is_online(hax_cpumap_t *cpu_map, uint32_t cpu_id) return !!(((hax_cpumask_t)1 << bit) & map); } -extern uint32_t hax_cpu_id(void); static inline void get_online_map(void *param) { hax_cpumap_t *omap = (hax_cpumap_t *)param; diff --git a/platforms/darwin/hax_wrapper.cpp b/platforms/darwin/hax_wrapper.cpp index 7f9eece5..fe63a472 100644 --- a/platforms/darwin/hax_wrapper.cpp +++ b/platforms/darwin/hax_wrapper.cpp @@ -78,8 +78,8 @@ extern "C" void hax_panic(const char *fmt, ...) va_end(args); } -extern int cpu_number(void); -inline uint32_t hax_cpu_id(void) +extern "C" int cpu_number(void); +extern "C" uint32_t hax_cpu_id(void) { return (uint32_t)cpu_number(); } diff --git a/platforms/linux/hax_wrapper.c b/platforms/linux/hax_wrapper.c index ed392da5..e5263a9e 100644 --- a/platforms/linux/hax_wrapper.c +++ b/platforms/linux/hax_wrapper.c @@ -81,7 +81,7 @@ void hax_panic(const char *fmt, ...) va_end(args); } -inline uint32_t hax_cpu_id(void) +uint32_t hax_cpu_id(void) { return (uint32_t)smp_processor_id(); } diff --git a/platforms/netbsd/hax_wrapper.c b/platforms/netbsd/hax_wrapper.c index bcd31d3b..78fcc6cc 100644 --- a/platforms/netbsd/hax_wrapper.c +++ b/platforms/netbsd/hax_wrapper.c @@ -73,7 +73,7 @@ void hax_panic(const char *fmt, ...) va_end(args); } -inline uint32_t hax_cpu_id(void) +uint32_t hax_cpu_id(void) { return (uint32_t)cpu_number(); } diff --git a/platforms/windows/hax_wrapper.c b/platforms/windows/hax_wrapper.c index 135c1180..b4dcc92f 100644 --- a/platforms/windows/hax_wrapper.c +++ b/platforms/windows/hax_wrapper.c @@ -31,7 +31,7 @@ #include "hax_win.h" #include "../../core/include/ia32.h" -inline uint32_t hax_cpu_id(void) +uint32_t hax_cpu_id(void) { PROCESSOR_NUMBER ProcNumber = {0}; return (uint32_t)KeGetCurrentProcessorNumberEx(&ProcNumber);