diff options
author | Roman Gushchin <guro@fb.com> | 2018-08-23 10:45:26 -0700 |
---|---|---|
committer | Roman Gushchin <guro@fb.com> | 2018-10-09 09:46:36 -0700 |
commit | e867866623893c7683c5df9b5a0d0d9801bebfe2 (patch) | |
tree | 7893f6ab27b60b2b9593da4a00bc188faed2adc9 /src/shared/linux | |
parent | 17f149556af0c0610b44f7353de34487b168317d (diff) | |
download | systemd-e867866623893c7683c5df9b5a0d0d9801bebfe2.tar.gz |
libbpf.h: add BPF_JMP_A macro
Add unconditional jump macro to use in generated bpf programs.
Diffstat (limited to 'src/shared/linux')
-rw-r--r-- | src/shared/linux/libbpf.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/linux/libbpf.h b/src/shared/linux/libbpf.h index ad131fcb12..391eee5a4e 100644 --- a/src/shared/linux/libbpf.h +++ b/src/shared/linux/libbpf.h @@ -174,6 +174,16 @@ struct bpf_insn; .off = OFF, \ .imm = IMM }) +/* Unconditional jumps */ + +#define BPF_JMP_A(OFF) \ + ((struct bpf_insn) { \ + .code = BPF_JMP | BPF_JA, \ + .dst_reg = 0, \ + .src_reg = 0, \ + .off = OFF, \ + .imm = 0 }) + /* Raw code statement block */ #define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ |