The BPF_FETCH field can be set in bpf_insn.imm, for BPF_ATOMIC instructions, in order to have the previous value of the atomically-modified memory location loaded into the src register after an atomic op is carried out.
Showing the changes to tools/include/uapi/linux (1 of 8 files). Show all
Unified · Split
| @@ -44,6 +44,9 @@ · 43 unmodified lines | ||
| 44 | 44 | #define BPF_CALL 0x80 /* function call */ |
| 45 | 45 | #define BPF_EXIT 0x90 /* function return */ |
| 46 | 46 | |
| 47 | +/* atomic op type fields (stored in immediate) */ | |
| 48 | +#define BPF_FETCH 0x01 /* fetch previous value into src reg */ | |
| 49 | + | |
| 47 | 50 | /* Register numbers */ |
| 48 | 51 | enum { |
| 49 | 52 | BPF_REG_0 = 0, |