expression_with_stack_xtensa: renamed and moved assembly helpes of esp_expression_wit_stack to xtensa component

This commit is contained in:
Felipe Neves
2019-11-15 16:56:16 +08:00
parent 7b90f34c5a
commit 11266ef05d
3 changed files with 1 additions and 1 deletions
@@ -0,0 +1,29 @@
#include <xtensa/coreasm.h>
#include <freertos/xtensa_context.h>
.text
/**
* extern void switch_stack_enter(portSTACK_TYPE *stack, portSTACK_TYPE *backup_stack);
*/
.globl esp_switch_stack_enter
.type esp_switch_stack_enter,@function
.align 4
esp_switch_stack_enter:
entry sp, 0x10
mov a4, a1
s32i a4, a3, 0 /* on a3 there is a safe place to save the current stack */
l32i a4, a2, 0 /* obtains the user allocated stack buffer */
mov a1, a4 /* sp register now contains caller specified stack */
retw
/**
* extern void switch_stack_exit(portSTACK_TYPE *backup_stack);
*/
.globl esp_switch_stack_exit
.type esp_switch_stack_exit,@function
.align 4
esp_switch_stack_exit:
entry sp, 0x10
l32i a4, a2, 0 /* recover the original task stack */
mov a1, a4 /* put it on sp register again */
retw