12 #define MAX_LINE_SIZE 4096
14 #define PROC_CPUINFO "/proc/cpuinfo"
26 typedef struct lcore {
41 typedef lcore_t *(*do_line_fn)(
const char *line, lcore_t *);
42 typedef unsigned (*getter_fn)(
const lcore_t *);
43 typedef void (*setter_fn)(lcore_t *,
unsigned new_val);
45 typedef struct action {
56 CNDP_API
struct cmap *cmap_create(
void);
64 CNDP_API
char *cmap_cpu_model(
void);
72 CNDP_API
void cmap_free(
struct cmap *cmap);
82 static inline unsigned int
83 cmap_socket_id(
const lcore_t *lc)
99 cmap_set_socket_id(lcore_t *lc,
unsigned v)
112 static inline unsigned int
113 cmap_core_id(
const lcore_t *lc)
129 cmap_set_core_id(lcore_t *lc,
unsigned v)
142 static inline unsigned int
143 cmap_thread_id(
const lcore_t *lc)
156 static inline unsigned int
157 cmap_cnt(lcore_t *lc, getter_fn get)