

State as saved by the HAL and into a register dump in the format HAL_GET_GDB_REGISTERS() translates a register To the variable passed as the second argument. Pointer to the HAL_SavedRegisters structure Value saved by the thread context macros. The stack pointer passed in should be the Pointer to a HAL_SavedRegisters structureįrom a stack pointer value. HAL_THREAD_GET_SAVED_REGISTERS() extracts a These macros provide support for interfacing GDB to the HAL. Interrupts will be disabled again when the original threadĤ.2.8. GDB support HAL_THREAD_GET_SAVED_REGISTERS( sp, regs )

If a thread disables interrupts and does something to cause aĬontext switch, interrupts may be re-enabled on switching to another Interrupt state is saved and restored as part of the threadĬontext. Saved state to become corrupted by an interrupt. Should never be invalid, or loaded with a value that might cause the Interrupts that occur will be delivered onto the stack to which theĬurrent CPU stack pointer points. Note that interrupts are not disabled during this process, any Stack and a jump or return made back to the saved PC. To load a threadĬontext simply requires the saved registers to be restored from the
#TARGET CLOCKS CODE#
With a littleĬare this can be implemented by sharing code with Loads a thread context, destroying the current context. The implementation of HAL_THREAD_LOAD_CONTEXT() Forĭebugging purposes it is useful to save the entire register set, butįor performance only the ABI-defined callee-saved registers need beĬYGDBG_HAL_COMMON_CONTEXT_SAVE_MINIMUM controls Interrupt state (or at least the register that contains it). Saves the current CPU state on the stack, including the current The implementation of HAL_THREAD_SWITCH_CONTEXT() Second, the calling conventions mean that theĬompiler will have already saved the caller-saved registers before theĬall, so the HAL need only save the callee-saved registers.
#TARGET CLOCKS PC#
Return link of the call provides a convenient PC value to be used in There are two advantages to doing it this way. They are normally implemented as calls to assembly code functions in While these two operations may be implemented with inline assembler, *to is then read and the state of the new Stack pointer, and the address of the saved state placed in This is only used once, to load the first thread when theįor HAL_THREAD_SWITCH_CONTEXT() the state of theĬurrent thread is saved onto its stack, using the current value of the State is discarded and the state of the destination thread is This section describes the main HAL interfaces.Ī pointer to a location where the stack pointer of the currentĪ pointer to a location from where the stack pointer of the nextįor HAL_THREAD_LOAD_CONTEXT() the current CPU
