31 lines
506 B
C
31 lines
506 B
C
#ifndef SOCKS_PERCPU_H_
|
|
#define SOCKS_PERCPU_H_
|
|
|
|
#include <socks/status.h>
|
|
#include <socks/compiler.h>
|
|
#include <socks/sched.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#define DEFINE_PERCPU_VAR(type, name) \
|
|
__section(".data.percpu") type name
|
|
|
|
#define percpu_get(var) \
|
|
__extension__({ \
|
|
preempt_disable(); \
|
|
__percpu_get(var); \
|
|
})
|
|
|
|
#define percpu_put(var) preempt_enable();
|
|
|
|
extern kern_status_t init_per_cpu_areas(void);
|
|
extern void *__percpu_get(void *var);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|