diff options
Diffstat (limited to 'kernel/bpf/helpers.c')
| -rw-r--r-- | kernel/bpf/helpers.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 39918402e6e9..045cbe673356 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -13,6 +13,7 @@  #include <linux/rcupdate.h>  #include <linux/random.h>  #include <linux/smp.h> +#include <linux/topology.h>  #include <linux/ktime.h>  #include <linux/sched.h>  #include <linux/uidgid.h> @@ -92,6 +93,17 @@ const struct bpf_func_proto bpf_get_smp_processor_id_proto = {  	.ret_type	= RET_INTEGER,  }; +BPF_CALL_0(bpf_get_numa_node_id) +{ +	return numa_node_id(); +} + +const struct bpf_func_proto bpf_get_numa_node_id_proto = { +	.func		= bpf_get_numa_node_id, +	.gpl_only	= false, +	.ret_type	= RET_INTEGER, +}; +  BPF_CALL_0(bpf_ktime_get_ns)  {  	/* NMI safe access to clock monotonic */  |