shared_stack: using watchpoint 1 to monitor the shared_stack instead of watchpoint 0
This commit is contained in:
parent
33c9826372
commit
9c8289b0d9
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#include "freertos/FreeRTOS.h"
|
#include "freertos/FreeRTOS.h"
|
||||||
#include "freertos/semphr.h"
|
#include "freertos/semphr.h"
|
||||||
|
#include "freertos/task.h"
|
||||||
#include "esp_debug_helpers.h"
|
#include "esp_debug_helpers.h"
|
||||||
#include "esp_log.h"
|
#include "esp_log.h"
|
||||||
|
|
||||||
|
@ -42,6 +43,10 @@ extern "C" {
|
||||||
expression; \
|
expression; \
|
||||||
} \
|
} \
|
||||||
esp_switch_stack_exit(&backup); \
|
esp_switch_stack_exit(&backup); \
|
||||||
|
StaticTask_t *current = (StaticTask_t *)xTaskGetCurrentTaskHandle(); \
|
||||||
|
/* pxDummy6 is the stack base of current thread defined in TCB_t */ \
|
||||||
|
/* place the watchpoint on current task stack after function execution*/ \
|
||||||
|
vPortSetStackWatchpoint(current->pxDummy6); \
|
||||||
xSemaphoreGive(lock); \
|
xSemaphoreGive(lock); \
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -386,6 +386,7 @@ extern void esp_vApplicationTickHook( void );
|
||||||
|
|
||||||
void _xt_coproc_release(volatile void * coproc_sa_base);
|
void _xt_coproc_release(volatile void * coproc_sa_base);
|
||||||
void vApplicationSleep( TickType_t xExpectedIdleTime );
|
void vApplicationSleep( TickType_t xExpectedIdleTime );
|
||||||
|
void vPortSetStackWatchpoint( void* pxStackStart );
|
||||||
|
|
||||||
#define portSUPPRESS_TICKS_AND_SLEEP( idleTime ) vApplicationSleep( idleTime )
|
#define portSUPPRESS_TICKS_AND_SLEEP( idleTime ) vApplicationSleep( idleTime )
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
StackType_t * esp_switch_stack_setup(StackType_t *stack, size_t stack_size)
|
StackType_t * esp_switch_stack_setup(StackType_t *stack, size_t stack_size)
|
||||||
{
|
{
|
||||||
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
|
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
|
||||||
esp_clear_watchpoint(0);
|
esp_clear_watchpoint(1);
|
||||||
uint32_t watchpoint_place = ((uint32_t)stack + 32) & 0x1f ;
|
uint32_t watchpoint_place = ((uint32_t)stack + 32) & 0x1f ;
|
||||||
#endif
|
#endif
|
||||||
StackType_t *top_of_stack = (StackType_t *)&stack[0] +
|
StackType_t *top_of_stack = (StackType_t *)&stack[0] +
|
||||||
|
@ -36,7 +36,7 @@ StackType_t * esp_switch_stack_setup(StackType_t *stack, size_t stack_size)
|
||||||
frame->a1 = (UBaseType_t)top_of_stack;
|
frame->a1 = (UBaseType_t)top_of_stack;
|
||||||
|
|
||||||
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
|
#if CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK
|
||||||
esp_set_watchpoint(0, (uint8_t *)watchpoint_place, 32, ESP_WATCHPOINT_STORE);
|
esp_set_watchpoint(1, (uint8_t *)watchpoint_place, 32, ESP_WATCHPOINT_STORE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return top_of_stack;
|
return top_of_stack;
|
||||||
|
|
Loading…
Reference in a new issue