added typecast for starck_start in arm_cpu to ensure correct calculation
This commit is contained in:
parent
f19ec9649f
commit
b4f36f4af9
@ -37,7 +37,7 @@ char *thread_stack_init(void (*task_func)(void), void *stack_start, int stack_si
|
|||||||
{
|
{
|
||||||
unsigned int *stk;
|
unsigned int *stk;
|
||||||
int i;
|
int i;
|
||||||
stk = (unsigned int *)(stack_start + stack_size);
|
stk = (unsigned int *)((unsigned int)stack_start + stack_size);
|
||||||
stk--;
|
stk--;
|
||||||
|
|
||||||
*stk = STACK_MARKER;
|
*stk = STACK_MARKER;
|
||||||
@ -48,7 +48,7 @@ char *thread_stack_init(void (*task_func)(void), void *stack_start, int stack_si
|
|||||||
|
|
||||||
/* set the stack pointer (SP) */
|
/* set the stack pointer (SP) */
|
||||||
stk--;
|
stk--;
|
||||||
*stk = (unsigned int)(stack_start + stack_size) - 4;
|
*stk = (unsigned int)((unsigned int)stack_start + stack_size) - 4;
|
||||||
|
|
||||||
/* build base stack */
|
/* build base stack */
|
||||||
for (i = REGISTER_CNT; i >= 0 ; i--) {
|
for (i = REGISTER_CNT; i >= 0 ; i--) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user