@@ -242,7 +242,7 @@ BPF_JSET 0x40 PC += off if dst & src
242
242
BPF_JNE 0x50 PC += off if dst != src
243
243
BPF_JSGT 0x60 PC += off if dst > src signed
244
244
BPF_JSGE 0x70 PC += off if dst >= src signed
245
- BPF_CALL 0x80 function call
245
+ BPF_CALL 0x80 function call see ` Helper functions `_
246
246
BPF_EXIT 0x90 function / program return BPF_JMP only
247
247
BPF_JLT 0xa0 PC += off if dst < src unsigned
248
248
BPF_JLE 0xb0 PC += off if dst <= src unsigned
@@ -253,6 +253,22 @@ BPF_JSLE 0xd0 PC += off if dst <= src signed
253
253
The eBPF program needs to store the return value into register R0 before doing a
254
254
BPF_EXIT.
255
255
256
+ Helper functions
257
+ ~~~~~~~~~~~~~~~~
258
+ Helper functions are a concept whereby BPF programs can call into a
259
+ set of function calls exposed by the eBPF runtime. Each helper
260
+ function is identified by an integer used in a ``BPF_CALL `` instruction.
261
+ The available helper functions may differ for each eBPF program type.
262
+
263
+ Conceptually, each helper function is implemented with a commonly shared function
264
+ signature defined as:
265
+
266
+ u64 function(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
267
+
268
+ In actuality, each helper function is defined as taking between 0 and 5 arguments,
269
+ with the remaining registers being ignored. The definition of a helper function
270
+ is responsible for specifying the type (e.g., integer, pointer, etc.) of the value returned,
271
+ the number of arguments, and the type of each argument.
256
272
257
273
Load and store instructions
258
274
===========================
0 commit comments