Add assember CFI directives to millicode division and remainder routines.
[official-gcc.git] / gcc / config / bpf / coreout.h
blob8bdb364b72283ebff1efecef3e17cc9c2fdda423
1 /* coreout.h - Declarations and definitions related to
2 BPF Compile Once - Run Everywhere (CO-RE) support.
3 Copyright (C) 2021-2023 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful, but
13 WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3. If not see
19 <http://www.gnu.org/licenses/>. */
22 #ifndef __COREOUT_H
23 #define __COREOUT_H
25 #include <stdint.h>
27 #ifdef __cplusplus
28 extern "C"
30 #endif
32 /* .BTF.ext information. */
34 struct btf_ext_section_header
36 uint32_t sec_name_off;
37 uint32_t num_records;
40 /* A funcinfo record, in the .BTF.ext funcinfo section. */
41 struct btf_ext_funcinfo
43 uint32_t insn_off; /* Offset of the first instruction of the function. */
44 uint32_t type; /* Type ID of a BTF_KIND_FUNC type. */
47 /* A lineinfo record, in the .BTF.ext lineinfo section. */
48 struct btf_ext_lineinfo
50 uint32_t insn_off; /* Offset of the instruction. */
51 uint32_t file_name_off; /* Offset of file name in BTF string table. */
52 uint32_t line_off; /* Offset of source line in BTF string table. */
53 uint32_t line_col; /* Line number (bits 31-11) and column (11-0). */
56 enum btf_core_reloc_kind
58 BPF_RELO_FIELD_BYTE_OFFSET = 0,
59 BPF_RELO_FIELD_BYTE_SIZE = 1,
60 BPF_RELO_FIELD_EXISTS = 2,
61 BPF_RELO_FIELD_SIGNED = 3,
62 BPF_RELO_FIELD_LSHIFT_U64 = 4,
63 BPF_RELO_FIELD_RSHIFT_U64 = 5,
64 BPF_RELO_TYPE_ID_LOCAL = 6,
65 BPF_RELO_TYPE_ID_TARGET = 7,
66 BPF_RELO_TYPE_EXISTS = 8,
67 BPF_RELO_TYPE_SIZE = 9,
68 BPF_RELO_ENUMVAL_EXISTS = 10,
69 BPF_RELO_ENUMVAL_VALUE = 11
72 struct btf_ext_reloc
74 uint32_t insn_off; /* Offset of instruction to be patched. A
75 section-relative label at compile time. */
76 uint32_t type_id; /* Type ID of the outermost containing entity, e.g.
77 the containing structure. */
78 uint32_t access_str_off; /* Offset of CO-RE accessor string in .BTF strings
79 section. */
80 uint32_t kind; /* An enum btf_core_reloc_kind. Note that it always
81 takes 32 bits. */
84 struct btf_ext_header
86 uint16_t magic; /* Magic number (BTF_MAGIC). */
87 uint8_t version; /* Data format version (BTF_VERSION). */
88 uint8_t flags; /* Flags. Currently unused. */
89 uint32_t hdr_len; /* Length of this header in bytes. */
91 /* Following offsets are relative to the end of this header, in bytes.
92 Following lengths are in bytes. */
93 uint32_t func_info_off; /* Offset of funcinfo section. */
94 uint32_t func_info_len; /* Length of funcinfo section. */
95 uint32_t line_info_off; /* Offset of lineinfo section. */
96 uint32_t line_info_len; /* Length of lineinfo section. */
98 uint32_t core_relo_off; /* Offset of CO-RE relocation section. */
99 uint32_t core_relo_len; /* Length of CO-RE relocation section. */
102 extern void btf_ext_init (void);
103 extern void btf_ext_output (void);
105 extern void bpf_core_reloc_add (const tree, const char *, vec<unsigned int> *,
106 rtx_code_label *, enum btf_core_reloc_kind);
107 extern int bpf_core_get_sou_member_index (ctf_container_ref, const tree);
109 #ifdef __cplusplus
111 #endif
113 #endif /* __COREOUT_H */