blob: e61b8b3131568d560db5ea2fb1f7693e923e28d2 [file] [log] [blame]
Elliott Hughes180edef2023-11-02 00:08:05 +00001/*
2 * This file is auto-generated. Modifications will be lost.
3 *
4 * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5 * for more information.
6 */
Christopher Ferris82d75042015-01-26 10:57:07 -08007#ifndef _UAPI__LINUX_BPF_COMMON_H__
8#define _UAPI__LINUX_BPF_COMMON_H__
9#define BPF_CLASS(code) ((code) & 0x07)
10#define BPF_LD 0x00
Christopher Ferris82d75042015-01-26 10:57:07 -080011#define BPF_LDX 0x01
12#define BPF_ST 0x02
13#define BPF_STX 0x03
14#define BPF_ALU 0x04
Christopher Ferris82d75042015-01-26 10:57:07 -080015#define BPF_JMP 0x05
16#define BPF_RET 0x06
17#define BPF_MISC 0x07
18#define BPF_SIZE(code) ((code) & 0x18)
Christopher Ferris82d75042015-01-26 10:57:07 -080019#define BPF_W 0x00
20#define BPF_H 0x08
21#define BPF_B 0x10
22#define BPF_MODE(code) ((code) & 0xe0)
Christopher Ferris82d75042015-01-26 10:57:07 -080023#define BPF_IMM 0x00
24#define BPF_ABS 0x20
25#define BPF_IND 0x40
26#define BPF_MEM 0x60
Christopher Ferris82d75042015-01-26 10:57:07 -080027#define BPF_LEN 0x80
28#define BPF_MSH 0xa0
29#define BPF_OP(code) ((code) & 0xf0)
30#define BPF_ADD 0x00
Christopher Ferris82d75042015-01-26 10:57:07 -080031#define BPF_SUB 0x10
32#define BPF_MUL 0x20
33#define BPF_DIV 0x30
34#define BPF_OR 0x40
Christopher Ferris82d75042015-01-26 10:57:07 -080035#define BPF_AND 0x50
36#define BPF_LSH 0x60
37#define BPF_RSH 0x70
38#define BPF_NEG 0x80
Christopher Ferris82d75042015-01-26 10:57:07 -080039#define BPF_MOD 0x90
40#define BPF_XOR 0xa0
41#define BPF_JA 0x00
42#define BPF_JEQ 0x10
Christopher Ferris82d75042015-01-26 10:57:07 -080043#define BPF_JGT 0x20
44#define BPF_JGE 0x30
45#define BPF_JSET 0x40
46#define BPF_SRC(code) ((code) & 0x08)
Christopher Ferris82d75042015-01-26 10:57:07 -080047#define BPF_K 0x00
48#define BPF_X 0x08
49#ifndef BPF_MAXINSNS
50#define BPF_MAXINSNS 4096
Christopher Ferris82d75042015-01-26 10:57:07 -080051#endif
52#endif