create_thread now reserves room for PR on the stack
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@762 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
2dd18d381f
commit
6cbe2a7301
1 changed files with 4 additions and 2 deletions
|
@ -36,7 +36,7 @@ typedef struct
|
|||
{
|
||||
int created;
|
||||
int current;
|
||||
ctx_t ctx[MAXTHREADS] __attribute__ ((aligned (32)));
|
||||
ctx_t ctx[MAXTHREADS];
|
||||
} thread_t;
|
||||
|
||||
static thread_t threads = {1, 0};
|
||||
|
@ -118,7 +118,9 @@ int create_thread(void* fp, void* sp, int stk_size)
|
|||
{
|
||||
ctx_t* ctxp = &t->ctx[t->created++];
|
||||
stctx(ctxp);
|
||||
ctxp->regs.sp = (void*)(((unsigned int)sp + stk_size) & ~31);
|
||||
/* Subtract 4 to leave room for the PR push in ldctx()
|
||||
Align it on an even 32 bit boundary */
|
||||
ctxp->regs.sp = (void*)(((unsigned int)sp + stk_size - 4) & ~3;
|
||||
ctxp->regs.pr = fp;
|
||||
}
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue