forked from len0rd/rockbox
Coldfire: Made the MACSR register part of the thread context to allow easier handling in the codecs.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7445 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
4172a009f6
commit
904f7fd970
1 changed files with 14 additions and 11 deletions
|
@ -27,6 +27,7 @@
|
|||
#ifdef CPU_COLDFIRE
|
||||
struct regs
|
||||
{
|
||||
unsigned int macsr; /* EMAC status register */
|
||||
unsigned int d[6]; /* d2-d7 */
|
||||
unsigned int a[5]; /* a2-a6 */
|
||||
void *sp; /* Stack pointer (a7) */
|
||||
|
@ -77,8 +78,9 @@ static inline void load_context(const void* addr) __attribute__ ((always_inline)
|
|||
static inline void store_context(void* addr)
|
||||
{
|
||||
asm volatile (
|
||||
"movem.l %%d2-%%d7/%%a2-%%a7,(%0)\n"
|
||||
: : "a" (addr)
|
||||
"move.l %%macsr,%%d0 \n"
|
||||
"movem.l %%d0/%%d2-%%d7/%%a2-%%a7,(%0) \n"
|
||||
: : "a" (addr) : "d0" /* only! */
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -89,10 +91,11 @@ static inline void store_context(void* addr)
|
|||
static inline void load_context(const void* addr)
|
||||
{
|
||||
asm volatile (
|
||||
"movem.l (%0),%%d2-%%d7/%%a2-%%a7\n" /* Load context */
|
||||
"move.l (48,%0),%%d0 \n" /* Get start address */
|
||||
"movem.l (%0),%%d0/%%d2-%%d7/%%a2-%%a7 \n" /* Load context */
|
||||
"move.l %%d0,%%macsr \n"
|
||||
"move.l (52,%0),%%d0 \n" /* Get start address */
|
||||
"beq.b .running \n" /* NULL -> already running */
|
||||
"clr.l (48,%0) \n" /* Clear start address.. */
|
||||
"clr.l (52,%0) \n" /* Clear start address.. */
|
||||
"move.l %%d0,%0 \n"
|
||||
"jmp (%0) \n" /* ..and start the thread */
|
||||
".running: \n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue