AP_HAL_ChibiOS: match thread stack pointer types to ChibiOS

`__main_thread_stack_base__` and `__main_thread_stack_end__` are
variables whose address is defined to be the corresponding part of the
stack. These are declared as `extern stkalign_t` in ChibiOS code, and
being declared as `extern uint32_t` in ArduPilot code creates a warning
at link time when using LTO. Correct the declaration to eliminate this
warning.

Also update `__main_stack_base__` and `__main_stack_end__` which don't
currently trigger this warning but serve similar purposes and so might
in the future.

The hardware expects an alignment of `stkalign_t` (which is 8 bytes) and
the linker script defines the variable values with this alignment as
well, so this is safe.

No code size or functional change.
This commit is contained in:
Thomas Watson 2024-01-15 14:16:23 -06:00 committed by Andrew Tridgell
parent fb1209ff3c
commit 5f5673b58f

View File

@ -186,10 +186,10 @@ void stm32_flash_protect_flash(bool bootloader, bool protect);
void stm32_flash_unprotect_flash(void);
// allow stack view code to show free ISR stack
extern uint32_t __main_stack_base__;
extern uint32_t __main_stack_end__;
extern uint32_t __main_thread_stack_base__;
extern uint32_t __main_thread_stack_end__;
extern stkalign_t __main_stack_base__;
extern stkalign_t __main_stack_end__;
extern stkalign_t __main_thread_stack_base__;
extern stkalign_t __main_thread_stack_end__;
#ifdef __cplusplus
}