~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/bpf_common.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 #ifndef _UAPI__LINUX_BPF_COMMON_H__
  3 #define _UAPI__LINUX_BPF_COMMON_H__
  4 
  5 /* Instruction classes */
  6 #define BPF_CLASS(code) ((code) & 0x07)
  7 #define         BPF_LD          0x00
  8 #define         BPF_LDX         0x01
  9 #define         BPF_ST          0x02
 10 #define         BPF_STX         0x03
 11 #define         BPF_ALU         0x04
 12 #define         BPF_JMP         0x05
 13 #define         BPF_RET         0x06
 14 #define         BPF_MISC        0x07
 15 
 16 /* ld/ldx fields */
 17 #define BPF_SIZE(code)  ((code) & 0x18)
 18 #define         BPF_W           0x00 /* 32-bit */
 19 #define         BPF_H           0x08 /* 16-bit */
 20 #define         BPF_B           0x10 /*  8-bit */
 21 /* eBPF         BPF_DW          0x18    64-bit */
 22 #define BPF_MODE(code)  ((code) & 0xe0)
 23 #define         BPF_IMM         0x00
 24 #define         BPF_ABS         0x20
 25 #define         BPF_IND         0x40
 26 #define         BPF_MEM         0x60
 27 #define         BPF_LEN         0x80
 28 #define         BPF_MSH         0xa0
 29 
 30 /* alu/jmp fields */
 31 #define BPF_OP(code)    ((code) & 0xf0)
 32 #define         BPF_ADD         0x00
 33 #define         BPF_SUB         0x10
 34 #define         BPF_MUL         0x20
 35 #define         BPF_DIV         0x30
 36 #define         BPF_OR          0x40
 37 #define         BPF_AND         0x50
 38 #define         BPF_LSH         0x60
 39 #define         BPF_RSH         0x70
 40 #define         BPF_NEG         0x80
 41 #define         BPF_MOD         0x90
 42 #define         BPF_XOR         0xa0
 43 
 44 #define         BPF_JA          0x00
 45 #define         BPF_JEQ         0x10
 46 #define         BPF_JGT         0x20
 47 #define         BPF_JGE         0x30
 48 #define         BPF_JSET        0x40
 49 #define BPF_SRC(code)   ((code) & 0x08)
 50 #define         BPF_K           0x00
 51 #define         BPF_X           0x08
 52 
 53 #ifndef BPF_MAXINSNS
 54 #define BPF_MAXINSNS 4096
 55 #endif
 56 
 57 #endif /* _UAPI__LINUX_BPF_COMMON_H__ */
 58 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php