blob: 33dde5ac5a9e8bc362ee8c7f2f878b03649e9d28 [file] [log] [blame]
Christopher Ferris9ce28842018-10-25 12:11:39 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI__LINUX_BTF_H__
20#define _UAPI__LINUX_BTF_H__
21#include <linux/types.h>
22#define BTF_MAGIC 0xeB9F
23#define BTF_VERSION 1
24struct btf_header {
25 __u16 magic;
26 __u8 version;
27 __u8 flags;
28 __u32 hdr_len;
29 __u32 type_off;
30 __u32 type_len;
31 __u32 str_off;
32 __u32 str_len;
33};
34#define BTF_MAX_TYPE 0x0000ffff
35#define BTF_MAX_NAME_OFFSET 0x0000ffff
36#define BTF_MAX_VLEN 0xffff
37struct btf_type {
38 __u32 name_off;
39 __u32 info;
40 union {
41 __u32 size;
42 __u32 type;
43 };
44};
45#define BTF_INFO_KIND(info) (((info) >> 24) & 0x0f)
46#define BTF_INFO_VLEN(info) ((info) & 0xffff)
47#define BTF_KIND_UNKN 0
48#define BTF_KIND_INT 1
49#define BTF_KIND_PTR 2
50#define BTF_KIND_ARRAY 3
51#define BTF_KIND_STRUCT 4
52#define BTF_KIND_UNION 5
53#define BTF_KIND_ENUM 6
54#define BTF_KIND_FWD 7
55#define BTF_KIND_TYPEDEF 8
56#define BTF_KIND_VOLATILE 9
57#define BTF_KIND_CONST 10
58#define BTF_KIND_RESTRICT 11
59#define BTF_KIND_MAX 11
60#define NR_BTF_KINDS 12
61#define BTF_INT_ENCODING(VAL) (((VAL) & 0x0f000000) >> 24)
62#define BTF_INT_OFFSET(VAL) (((VAL & 0x00ff0000)) >> 16)
63#define BTF_INT_BITS(VAL) ((VAL) & 0x000000ff)
64#define BTF_INT_SIGNED (1 << 0)
65#define BTF_INT_CHAR (1 << 1)
66#define BTF_INT_BOOL (1 << 2)
67struct btf_enum {
68 __u32 name_off;
69 __s32 val;
70};
71struct btf_array {
72 __u32 type;
73 __u32 index_type;
74 __u32 nelems;
75};
76struct btf_member {
77 __u32 name_off;
78 __u32 type;
79 __u32 offset;
80};
81#endif