Skip to content

Commit

Permalink
rtos: use target_buffer_get_u32()
Browse files Browse the repository at this point in the history
Simplify the code using the target endianness independent API.

Change-Id: I39f720d0db9cf24eb41d7f359e4321bbc2045658
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8474
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
  • Loading branch information
borneoa committed Sep 15, 2024
1 parent e5a2001 commit e5276bb
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/rtos/rtos_standard_stackings.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ target_addr_t rtos_cortex_m_stack_align(struct target *target,

new_stack_ptr = stack_ptr - stacking->stack_growth_direction *
stacking->stack_registers_size;
xpsr = (target->endianness == TARGET_LITTLE_ENDIAN) ?
le_to_h_u32(&stack_data[xpsr_offset]) :
be_to_h_u32(&stack_data[xpsr_offset]);
xpsr = target_buffer_get_u32(target, &stack_data[xpsr_offset]);
if ((xpsr & ALIGN_NEEDED) != 0) {
LOG_DEBUG("XPSR(0x%08" PRIx32 ") indicated stack alignment was necessary\r\n",
xpsr);
Expand Down

0 comments on commit e5276bb

Please sign in to comment.