1
0
Fork 0
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:
Jens Arnold 2005-09-01 20:06:38 +00:00
parent 4172a009f6
commit 904f7fd970

View file

@ -27,6 +27,7 @@
#ifdef CPU_COLDFIRE #ifdef CPU_COLDFIRE
struct regs struct regs
{ {
unsigned int macsr; /* EMAC status register */
unsigned int d[6]; /* d2-d7 */ unsigned int d[6]; /* d2-d7 */
unsigned int a[5]; /* a2-a6 */ unsigned int a[5]; /* a2-a6 */
void *sp; /* Stack pointer (a7) */ void *sp; /* Stack pointer (a7) */
@ -77,31 +78,33 @@ static inline void load_context(const void* addr) __attribute__ ((always_inline)
static inline void store_context(void* addr) static inline void store_context(void* addr)
{ {
asm volatile ( asm volatile (
"movem.l %%d2-%%d7/%%a2-%%a7,(%0)\n" "move.l %%macsr,%%d0 \n"
: : "a" (addr) "movem.l %%d0/%%d2-%%d7/%%a2-%%a7,(%0) \n"
: : "a" (addr) : "d0" /* only! */
); );
} }
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Load non-volatile context. * Load non-volatile context.
*--------------------------------------------------------------------------- *---------------------------------------------------------------------------
*/ */
static inline void load_context(const void* addr) static inline void load_context(const void* addr)
{ {
asm volatile ( asm volatile (
"movem.l (%0),%%d2-%%d7/%%a2-%%a7\n" /* Load context */ "movem.l (%0),%%d0/%%d2-%%d7/%%a2-%%a7 \n" /* Load context */
"move.l (48,%0),%%d0 \n" /* Get start address */ "move.l %%d0,%%macsr \n"
"beq.b .running \n" /* NULL -> already running */ "move.l (52,%0),%%d0 \n" /* Get start address */
"clr.l (48,%0) \n" /* Clear start address.. */ "beq.b .running \n" /* NULL -> already running */
"move.l %%d0,%0 \n" "clr.l (52,%0) \n" /* Clear start address.. */
"jmp (%0) \n" /* ..and start the thread */ "move.l %%d0,%0 \n"
".running: \n" "jmp (%0) \n" /* ..and start the thread */
".running: \n"
: : "a" (addr) : "d0" /* only! */ : : "a" (addr) : "d0" /* only! */
); );
} }
#elif CONFIG_CPU == SH7034 #elif CONFIG_CPU == SH7034
/*--------------------------------------------------------------------------- /*---------------------------------------------------------------------------
* Store non-volatile context. * Store non-volatile context.
*--------------------------------------------------------------------------- *---------------------------------------------------------------------------
*/ */