|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
OpenRISC (or1k) ELF relocation type definitions and helpers for LLEXT. More...
Go to the source code of this file.
Macros | |
| #define | R_OR1K_INSN_REL_26_MASK 0x03ffffffU |
| OpenRISC relocation types. | |
| #define | R_OR1K_IMM16_MASK 0x0000ffffU |
| Mask for the 16-bit immediate field (bits [15:0]) - used by l.ori, l.addi, l.movhi, etc. | |
| #define | R_OR1K_PG21_MASK 0x001fffffU |
| Mask for the 21-bit page-relative field (bits [20:0]) - used by l.adrp. | |
| #define | R_OR1K_SLO_FIELD_MASK 0x03e007ffU |
| Split-immediate mask for OR1K store instructions. | |
| #define | R_OR1K_SLO_PACK(insn, imm) |
| Pack a 16-bit immediate into the OR1K split-immediate store format. | |
| #define | R_OR1K_PAGE_SIZE 8192U |
| OR1K page size for PCREL_PG21 relocations (8 KB = 2^13). | |
| #define | R_OR1K_PAGE_MASK (~(R_OR1K_PAGE_SIZE - 1U)) |
| OR1K page mask for PCREL_PG21 relocations (8 KB aligned). | |
OpenRISC (or1k) ELF relocation type definitions and helpers for LLEXT.
| #define R_OR1K_IMM16_MASK 0x0000ffffU |
Mask for the 16-bit immediate field (bits [15:0]) - used by l.ori, l.addi, l.movhi, etc.
| #define R_OR1K_INSN_REL_26_MASK 0x03ffffffU |
OpenRISC relocation types.
From the official OR1K ELF specification and binutils.
OR1K instruction field masks
OR1K instructions are fixed 32-bit, big-endian. Immediate fields are located in the low bits of the instruction word. Mask for the 26-bit jump/branch target field (bits [25:0])
| #define R_OR1K_PAGE_MASK (~(R_OR1K_PAGE_SIZE - 1U)) |
OR1K page mask for PCREL_PG21 relocations (8 KB aligned).
| #define R_OR1K_PAGE_SIZE 8192U |
OR1K page size for PCREL_PG21 relocations (8 KB = 2^13).
| #define R_OR1K_PG21_MASK 0x001fffffU |
Mask for the 21-bit page-relative field (bits [20:0]) - used by l.adrp.
| #define R_OR1K_SLO_FIELD_MASK 0x03e007ffU |
Split-immediate mask for OR1K store instructions.
Store instructions (l.sw, l.sb, l.sh) encode a 16-bit signed immediate split across two non-contiguous fields:
The combined field mask is 0x03E007FF.
| #define R_OR1K_SLO_PACK | ( | insn, | |
| imm ) |
Pack a 16-bit immediate into the OR1K split-immediate store format.
| insn | The existing 32-bit instruction word |
| imm | The 16-bit immediate value to pack |