net: introduce helper macro for_each_cmsghdr
[firefly-linux-kernel-4.4.55.git] / include / linux / bpf.h
index 3cf91754a957e5f509bf5f97050a559cab048878..bbfceb7564523bc5e17037e25663185aee02311e 100644 (file)
@@ -22,7 +22,7 @@ struct bpf_map_ops {
 
        /* funcs callable from userspace and from eBPF programs */
        void *(*map_lookup_elem)(struct bpf_map *map, void *key);
-       int (*map_update_elem)(struct bpf_map *map, void *key, void *value);
+       int (*map_update_elem)(struct bpf_map *map, void *key, void *value, u64 flags);
        int (*map_delete_elem)(struct bpf_map *map, void *key);
 };
 
@@ -128,9 +128,18 @@ struct bpf_prog_aux {
        struct work_struct work;
 };
 
+#ifdef CONFIG_BPF_SYSCALL
 void bpf_prog_put(struct bpf_prog *prog);
+#else
+static inline void bpf_prog_put(struct bpf_prog *prog) {}
+#endif
 struct bpf_prog *bpf_prog_get(u32 ufd);
 /* verify correctness of eBPF program */
 int bpf_check(struct bpf_prog *fp, union bpf_attr *attr);
 
+/* verifier prototypes for helper functions called from eBPF programs */
+extern struct bpf_func_proto bpf_map_lookup_elem_proto;
+extern struct bpf_func_proto bpf_map_update_elem_proto;
+extern struct bpf_func_proto bpf_map_delete_elem_proto;
+
 #endif /* _LINUX_BPF_H */