Lines Matching refs:offset
102 uint32_t sym_base_addr, const char *sym_name, int32_t *offset) in prel31_decode() argument
106 *offset = sign_extend(*(int32_t *)loc, SHIFT_PREL31_SIGN); in prel31_decode()
107 *offset += sym_base_addr - loc; in prel31_decode()
108 if (*offset >= PREL31_UPPER_BOUNDARY || *offset < PREL31_LOWER_BOUNDARY) { in prel31_decode()
119 static inline void prel31_reloc(uint32_t loc, int32_t *offset) in prel31_reloc() argument
122 *(uint32_t *)loc |= *offset & GENMASK(30, 0); in prel31_reloc()
129 int32_t offset; in prel31_handler() local
131 ret = prel31_decode(reloc_type, loc, sym_base_addr, sym_name, &offset); in prel31_handler()
133 prel31_reloc(loc, &offset); in prel31_handler()
140 uint32_t sym_base_addr, const char *sym_name, int32_t *offset) in jumps_decode() argument
144 *offset = MEM2ARMOPCODE(*(uint32_t *)loc); in jumps_decode()
145 *offset = (*offset & MASK_BRANCH_OFFSET) << SHIFT_BRANCH_OFFSET; in jumps_decode()
146 *offset = sign_extend(*offset, SHIFT_JUMPS_SIGN); in jumps_decode()
147 *offset += sym_base_addr - loc; in jumps_decode()
148 if (*offset >= JUMP_LOWER_BOUNDARY || *offset <= JUMP_UPPER_BOUNDARY) { in jumps_decode()
159 static inline void jumps_reloc(uint32_t loc, int32_t *offset) in jumps_reloc() argument
161 *offset >>= SHIFT_BRANCH_OFFSET; in jumps_reloc()
162 *offset &= MASK_BRANCH_OFFSET; in jumps_reloc()
165 *(uint32_t *)loc |= OPCODE2ARMMEM(*offset); in jumps_reloc()
172 int32_t offset; in jumps_handler() local
174 ret = jumps_decode(reloc_type, loc, sym_base_addr, sym_name, &offset); in jumps_handler()
176 jumps_reloc(loc, &offset); in jumps_handler()
185 int32_t offset; in movs_handler() local
188 offset = tmp = MEM2ARMOPCODE(*(uint32_t *)loc); in movs_handler()
189 offset = ((offset & MASK_MOV_RN) >> SHIFT_MOV_RN) | (offset & MASK_MOV_OPERAND2); in movs_handler()
190 offset = sign_extend(offset, SHIFT_MOVS_SIGN); in movs_handler()
192 offset += sym_base_addr; in movs_handler()
194 offset -= loc; in movs_handler()
197 offset >>= 16; in movs_handler()
201 tmp |= ((offset & MASK_MOV_RD) << SHIFT_MOV_RD) | (offset & MASK_MOV_OPERAND2); in movs_handler()
207 uint32_t sym_base_addr, const char *sym_name, int32_t *offset, in thm_jumps_decode() argument
220 *offset = (sign << SHIFT_THM_JUMPS_SIGN) | in thm_jumps_decode()
225 *offset = sign_extend(*offset, SHIFT_THM_JUMPS_SIGN); in thm_jumps_decode()
226 *offset += sym_base_addr - loc; in thm_jumps_decode()
228 if (*offset >= THM_JUMP_LOWER_BOUNDARY || *offset <= THM_JUMP_UPPER_BOUNDARY) { in thm_jumps_decode()
239 static inline void thm_jumps_reloc(uint32_t loc, int32_t *offset, in thm_jumps_reloc() argument
244 sign = (*offset >> SHIFT_THM_JUMPS_SIGN) & 1; in thm_jumps_reloc()
245 j_one = sign ^ (~(*offset >> SHIFT_THM_BL_J1) & 1); in thm_jumps_reloc()
246 j_two = sign ^ (~(*offset >> SHIFT_THM_BL_J2) & 1); in thm_jumps_reloc()
248 ((*offset >> SHIFT_THM_BW_IMM10) & MASK_THM_BW_IMM10)); in thm_jumps_reloc()
251 ((*offset >> 1) & MASK_THM_BL_IMM11)); in thm_jumps_reloc()
261 int32_t offset; in thm_jumps_handler() local
264 ret = thm_jumps_decode(reloc_type, loc, sym_base_addr, sym_name, &offset, &upper, &lower); in thm_jumps_handler()
266 thm_jumps_reloc(loc, &offset, &upper, &lower); in thm_jumps_handler()
275 int32_t offset; in thm_movs_handler() local
282 offset = ((upper & MASK_THM_MOV_IMM4) << SHIFT_THM_MOV_IMM4) | in thm_movs_handler()
285 offset = sign_extend(offset, SHIFT_THM_MOVS_SIGN); in thm_movs_handler()
286 offset += sym_base_addr; in thm_movs_handler()
289 offset -= loc; in thm_movs_handler()
292 offset >>= 16; in thm_movs_handler()
296 ((offset & (MASK_THM_MOV_IMM4<<SHIFT_THM_MOV_IMM4)) >> SHIFT_THM_MOV_IMM4) | in thm_movs_handler()
297 ((offset & (MASK_THM_MOV_I<<SHIFT_THM_MOV_I)) >> SHIFT_THM_MOV_I)); in thm_movs_handler()
299 ((offset & (MASK_THM_MOV_IMM3>>SHIFT_THM_MOV_IMM3)) << SHIFT_THM_MOV_IMM3) | in thm_movs_handler()
300 (offset & MASK_THM_MOV_IMM8)); in thm_movs_handler()