Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/hax.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions platforms/darwin/hax_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux/hax_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion platforms/netbsd/hax_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion platforms/windows/hax_wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down