 |
Zephyr API 3.6.99
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
13#ifndef ZEPHYR_ARCH_RISCV_ELF_H
14#define ZEPHYR_ARCH_RISCV_ELF_H
31#define R_RISCV_RELATIVE 3
33#define R_RISCV_JUMP_SLOT 5
34#define R_RISCV_TLS_DTPMOD32 6
35#define R_RISCV_TLS_DTPMOD64 7
36#define R_RISCV_TLS_DTPREL32 8
37#define R_RISCV_TLS_DTPREL64 9
38#define R_RISCV_TLS_TPREL32 10
39#define R_RISCV_TLS_TPREL64 11
40#define R_RISCV_TLSDESC 12
42#define R_RISCV_BRANCH 16
44#define R_RISCV_CALL 18
45#define R_RISCV_CALL_PLT 19
46#define R_RISCV_GOT_HI20 20
47#define R_RISCV_TLS_GOT_HI20 21
48#define R_RISCV_TLS_GD_HI20 22
49#define R_RISCV_PCREL_HI20 23
50#define R_RISCV_PCREL_LO12_I 24
51#define R_RISCV_PCREL_LO12_S 25
52#define R_RISCV_HI20 26
53#define R_RISCV_LO12_I 27
54#define R_RISCV_LO12_S 28
55#define R_RISCV_TPREL_HI20 29
56#define R_RISCV_TPREL_LO12_I 30
57#define R_RISCV_TPREL_LO12_S 31
58#define R_RISCV_TPREL_ADD 32
59#define R_RISCV_ADD8 33
60#define R_RISCV_ADD16 34
61#define R_RISCV_ADD32 35
62#define R_RISCV_ADD64 36
63#define R_RISCV_SUB8 37
64#define R_RISCV_SUB16 38
65#define R_RISCV_SUB32 39
66#define R_RISCV_SUB64 40
67#define R_RISCV_GOT32_PCREL 41
69#define R_RISCV_ALIGN 43
71#define R_RISCV_RVC_BRANCH 44
72#define R_RISCV_RVC_JUMP 45
74#define R_RISCV_RELAX 51
75#define R_RISCV_SUB6 52
76#define R_RISCV_SET6 53
77#define R_RISCV_SET8 54
78#define R_RISCV_SET16 55
79#define R_RISCV_SET32 56
80#define R_RISCV_32_PCREL 57
81#define R_RISCV_IRELATIVE 58
82#define R_RISCV_PLT32 59
83#define R_RISCV_SET_ULEB128 60
84#define R_RISCV_SUB_ULEB128 61
85#define R_RISCV_TLSDESC_HI20 62
86#define R_RISCV_TLSDESC_LOAD_LO12 63
87#define R_RISCV_TLSDESC_ADD_LO12 64
88#define R_RISCV_TLSDESC_CALL 65
90#define R_RISCV_VENDOR 191
98#if defined(CONFIG_64BIT)
101typedef uint32_t r_riscv_wordclass_t;
110#define R_RISCV_IMM8_GET_BIT(imm8, bit) (((imm8) & BIT(bit)) >> (bit))
118#define R_RISCV_BTYPE_IMM8_MASK(imm8) \
119 ((R_RISCV_IMM8_GET_BIT(imm8, 12) << 31) | (R_RISCV_IMM8_GET_BIT(imm8, 10) << 30) | \
120 (R_RISCV_IMM8_GET_BIT(imm8, 9) << 29) | (R_RISCV_IMM8_GET_BIT(imm8, 8) << 28) | \
121 (R_RISCV_IMM8_GET_BIT(imm8, 7) << 27) | (R_RISCV_IMM8_GET_BIT(imm8, 6) << 26) | \
122 (R_RISCV_IMM8_GET_BIT(imm8, 5) << 25) | (R_RISCV_IMM8_GET_BIT(imm8, 4) << 11) | \
123 (R_RISCV_IMM8_GET_BIT(imm8, 3) << 10) | (R_RISCV_IMM8_GET_BIT(imm8, 2) << 9) | \
124 (R_RISCV_IMM8_GET_BIT(imm8, 1) << 8) | (R_RISCV_IMM8_GET_BIT(imm8, 11) << 7))
132#define R_RISCV_JTYPE_IMM8_MASK(imm8) \
133 ((R_RISCV_IMM8_GET_BIT(imm8, 20) << 31) | (R_RISCV_IMM8_GET_BIT(imm8, 10) << 30) | \
134 (R_RISCV_IMM8_GET_BIT(imm8, 9) << 29) | (R_RISCV_IMM8_GET_BIT(imm8, 8) << 28) | \
135 (R_RISCV_IMM8_GET_BIT(imm8, 7) << 27) | (R_RISCV_IMM8_GET_BIT(imm8, 6) << 26) | \
136 (R_RISCV_IMM8_GET_BIT(imm8, 5) << 25) | (R_RISCV_IMM8_GET_BIT(imm8, 4) << 24) | \
137 (R_RISCV_IMM8_GET_BIT(imm8, 3) << 23) | (R_RISCV_IMM8_GET_BIT(imm8, 2) << 22) | \
138 (R_RISCV_IMM8_GET_BIT(imm8, 1) << 21) | (R_RISCV_IMM8_GET_BIT(imm8, 11) << 20) | \
139 (R_RISCV_IMM8_GET_BIT(imm8, 19) << 19) | (R_RISCV_IMM8_GET_BIT(imm8, 18) << 18) | \
140 (R_RISCV_IMM8_GET_BIT(imm8, 17) << 17) | (R_RISCV_IMM8_GET_BIT(imm8, 16) << 16) | \
141 (R_RISCV_IMM8_GET_BIT(imm8, 15) << 15) | (R_RISCV_IMM8_GET_BIT(imm8, 14) << 14) | \
142 (R_RISCV_IMM8_GET_BIT(imm8, 13) << 13) | (R_RISCV_IMM8_GET_BIT(imm8, 12) << 12))
149#define R_RISCV_STYPE_IMM8_MASK(imm8) \
150 ((R_RISCV_IMM8_GET_BIT(imm8, 11) << 31) | (R_RISCV_IMM8_GET_BIT(imm8, 10) << 30) | \
151 (R_RISCV_IMM8_GET_BIT(imm8, 9) << 29) | (R_RISCV_IMM8_GET_BIT(imm8, 8) << 28) | \
152 (R_RISCV_IMM8_GET_BIT(imm8, 7) << 27) | (R_RISCV_IMM8_GET_BIT(imm8, 6) << 26) | \
153 (R_RISCV_IMM8_GET_BIT(imm8, 5) << 25) | (R_RISCV_IMM8_GET_BIT(imm8, 4) << 11) | \
154 (R_RISCV_IMM8_GET_BIT(imm8, 3) << 10) | (R_RISCV_IMM8_GET_BIT(imm8, 2) << 9) | \
155 (R_RISCV_IMM8_GET_BIT(imm8, 1) << 8) | (R_RISCV_IMM8_GET_BIT(imm8, 0) << 7))
163#define R_RISCV_CJTYPE_IMM8_MASK(imm8) \
164 ((R_RISCV_IMM8_GET_BIT(imm8, 11) << 12) | (R_RISCV_IMM8_GET_BIT(imm8, 4) << 11) | \
165 (R_RISCV_IMM8_GET_BIT(imm8, 9) << 10) | (R_RISCV_IMM8_GET_BIT(imm8, 8) << 9) | \
166 (R_RISCV_IMM8_GET_BIT(imm8, 10) << 8) | (R_RISCV_IMM8_GET_BIT(imm8, 6) << 7) | \
167 (R_RISCV_IMM8_GET_BIT(imm8, 7) << 6) | (R_RISCV_IMM8_GET_BIT(imm8, 3) << 5) | \
168 (R_RISCV_IMM8_GET_BIT(imm8, 2) << 4) | (R_RISCV_IMM8_GET_BIT(imm8, 1) << 3) | \
169 (R_RISCV_IMM8_GET_BIT(imm8, 5) << 2))
177#define R_RISCV_CBTYPE_IMM8_MASK(imm8) \
178 ((R_RISCV_IMM8_GET_BIT(imm8, 8) << 12) | (R_RISCV_IMM8_GET_BIT(imm8, 4) << 11) | \
179 (R_RISCV_IMM8_GET_BIT(imm8, 3) << 10) | (R_RISCV_IMM8_GET_BIT(imm8, 7) << 6) | \
180 (R_RISCV_IMM8_GET_BIT(imm8, 6) << 5) | (R_RISCV_IMM8_GET_BIT(imm8, 2) << 4) | \
181 (R_RISCV_IMM8_GET_BIT(imm8, 1) << 3) | (R_RISCV_IMM8_GET_BIT(imm8, 5) << 2))
188#define R_RISCV_CLEAR_BTYPE_IMM8(operand) ((operand) & ~R_RISCV_BTYPE_IMM8_MASK((uint32_t) -1))
196#define R_RISCV_SET_BTYPE_IMM8(operand, imm8) \
197 ((R_RISCV_CLEAR_BTYPE_IMM8(operand)) | R_RISCV_BTYPE_IMM8_MASK(imm8))
204#define R_RISCV_CLEAR_JTYPE_IMM8(operand) ((operand) & ~R_RISCV_JTYPE_IMM8_MASK((uint32_t) -1))
212#define R_RISCV_SET_JTYPE_IMM8(operand, imm8) \
213 ((R_RISCV_CLEAR_JTYPE_IMM8(operand)) | R_RISCV_JTYPE_IMM8_MASK(imm8))
220#define R_RISCV_CLEAR_STYPE_IMM8(operand) ((operand) & ~R_RISCV_STYPE_IMM8_MASK((uint32_t) -1))
228#define R_RISCV_SET_STYPE_IMM8(operand, imm8) \
229 ((R_RISCV_CLEAR_STYPE_IMM8(operand)) | R_RISCV_STYPE_IMM8_MASK(imm8))
236#define R_RISCV_CLEAR_CJTYPE_IMM8(operand) ((operand) & ~R_RISCV_CJTYPE_IMM8_MASK((uint32_t) -1))
244#define R_RISCV_SET_CJTYPE_IMM8(operand, imm8) \
245 ((R_RISCV_CLEAR_CJTYPE_IMM8(operand)) | R_RISCV_CJTYPE_IMM8_MASK(imm8))
252#define R_RISCV_CLEAR_CBTYPE_IMM8(operand) ((operand) & ~R_RISCV_CBTYPE_IMM8_MASK((uint32_t) -1))
260#define R_RISCV_SET_CBTYPE_IMM8(operand, imm8) \
261 ((R_RISCV_CLEAR_CBTYPE_IMM8(operand)) | R_RISCV_CBTYPE_IMM8_MASK(imm8))
268#define R_RISCV_CLEAR_UTYPE_IMM8(operand) ((operand) & ~(0xFFFFF000))
276#define R_RISCV_SET_UTYPE_IMM8(operand, imm8) \
277 ((R_RISCV_CLEAR_UTYPE_IMM8(operand)) | ((imm8) & 0xFFFFF000))
284#define R_RISCV_CLEAR_ITYPE_IMM8(operand) ((operand) & ~(0xFFF00000))
292#define R_RISCV_SET_ITYPE_IMM8(operand, imm8) ((R_RISCV_CLEAR_ITYPE_IMM8(operand)) | ((imm8) << 20))
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT64_TYPE__ uint64_t
Definition stdint.h:91