Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects, and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Developer articles
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Small and medium teams
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
thesofproject
linux
Repository navigation
Code
Issues
290
(290)
Pull requests
58
(58)
Actions
Projects
Wiki
Security and quality
Insights
More
items
Files
Expand file tree
topic/sof-dev
Breadcrumbs
linux
/
tools
/
include
/
uapi
/
linux
/
bpf_common.h
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
57 lines (51 loc) · 1.35 KB
topic/sof-dev
Breadcrumbs
linux
/
tools
/
include
/
uapi
/
linux
/
bpf_common.h
Copy path
Top
File metadata and controls
Code
Blame
57 lines (51 loc) · 1.35 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef
_UAPI__LINUX_BPF_COMMON_H__
#define
_UAPI__LINUX_BPF_COMMON_H__
/* Instruction classes */
#define
BPF_CLASS
(
code
) ((code) & 0x07)
#define
BPF_LD
0x00
#define
BPF_LDX
0x01
#define
BPF_ST
0x02
#define
BPF_STX
0x03
#define
BPF_ALU
0x04
#define
BPF_JMP
0x05
#define
BPF_RET
0x06
#define
BPF_MISC
0x07
/* ld/ldx fields */
#define
BPF_SIZE
(
code
) ((code) & 0x18)
#define
BPF_W
0x00
/* 32-bit */
#define
BPF_H
0x08
/* 16-bit */
#define
BPF_B
0x10
/* 8-bit */
/* eBPF BPF_DW 0x18 64-bit */
#define
BPF_MODE
(
code
) ((code) & 0xe0)
#define
BPF_IMM
0x00
#define
BPF_ABS
0x20
#define
BPF_IND
0x40
#define
BPF_MEM
0x60
#define
BPF_LEN
0x80
#define
BPF_MSH
0xa0
/* alu/jmp fields */
#define
BPF_OP
(
code
) ((code) & 0xf0)
#define
BPF_ADD
0x00
#define
BPF_SUB
0x10
#define
BPF_MUL
0x20
#define
BPF_DIV
0x30
#define
BPF_OR
0x40
#define
BPF_AND
0x50
#define
BPF_LSH
0x60
#define
BPF_RSH
0x70
#define
BPF_NEG
0x80
#define
BPF_MOD
0x90
#define
BPF_XOR
0xa0
#define
BPF_JA
0x00
#define
BPF_JEQ
0x10
#define
BPF_JGT
0x20
#define
BPF_JGE
0x30
#define
BPF_JSET
0x40
#define
BPF_SRC
(
code
) ((code) & 0x08)
#define
BPF_K
0x00
#define
BPF_X
0x08
#ifndef
BPF_MAXINSNS
#define
BPF_MAXINSNS
4096
#endif
#endif
/* _UAPI__LINUX_BPF_COMMON_H__ */
You can’t perform that action at this time.