summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-04-22 20:55:59 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-04-22 20:55:59 +0000
commitb701c896249201b7cd1fd610146b27cb5d6a0dac (patch)
treed6d30e60dfde83d59a432a1818caed509c8eddce
parentfd0738d729894d3172814a5d15381c5416acca61 (diff)
Even nicer inline assembly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@179 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/thread.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/firmware/thread.c b/firmware/thread.c
index bf59300b51..a7d013062f 100644
--- a/firmware/thread.c
+++ b/firmware/thread.c
@@ -46,21 +46,20 @@ static thread_t threads = {1, 0};
*/
static __inline__ void stctx(void* addr)
{
- __asm__ __volatile__ ("mov.l r8, @(0, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r9, @(4, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r10, @(8, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r11, @(12, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r12, @(16, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r13, @(20, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r14, @(24, %0)" :: "r" (addr));
- __asm__ __volatile__ ("mov.l r15, @(28, %0)" :: "r" (addr));
-
- __asm__ __volatile__ ("stc sr, r0");
- __asm__ __volatile__ ("mov.l r0, @(32, %0)" :: "r" (addr));
- __asm__ __volatile__ ("stc gbr, r0");
- __asm__ __volatile__ ("mov.l r0, @(36, %0)" :: "r" (addr));
- __asm__ __volatile__ ("sts pr, r0");
- __asm__ __volatile__ ("mov.l r0, @(40, %0)" :: "r" (addr));
+ __asm__ __volatile__ ("mov.l r8, @(0, %0)\n\t"
+ "mov.l r9, @(4, %0)\n\t"
+ "mov.l r10, @(8, %0)\n\t"
+ "mov.l r11, @(12, %0)\n\t"
+ "mov.l r12, @(16, %0)\n\t"
+ "mov.l r13, @(20, %0)\n\t"
+ "mov.l r14, @(24, %0)\n\t"
+ "mov.l r15, @(28, %0)\n\t"
+ "stc sr, r0\n\t"
+ "mov.l r0, @(32, %0)\n\t"
+ "stc gbr, r0\n\t"
+ "mov.l r0, @(36, %0)\n\t"
+ "sts pr, r0\n\t"
+ "mov.l r0, @(40, %0)" :: "r" (addr));
}
/*---------------------------------------------------------------------------
@@ -69,22 +68,21 @@ static __inline__ void stctx(void* addr)
*/
static __inline__ void ldctx(void* addr)
{
- __asm__ __volatile__ ("mov.l @(0, %0), r8" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(4, %0), r9" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(8, %0), r10" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(12, %0), r11" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(16, %0), r12" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(20, %0), r13" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(24, %0), r14" :: "r" (addr));
- __asm__ __volatile__ ("mov.l @(28, %0), r15" :: "r" (addr));
-
- __asm__ __volatile__ ("mov.l @(32, %0), r0" :: "r" (addr));
- __asm__ __volatile__ ("ldc r0, sr");
- __asm__ __volatile__ ("mov.l @(36, %0), r0" :: "r" (addr));
- __asm__ __volatile__ ("ldc r0, gbr");
- __asm__ __volatile__ ("mov.l @(40, %0), r0" :: "r" (addr));
- __asm__ __volatile__ ("lds r0, pr");
- __asm__ __volatile__ ("mov.l r0, @(0, r15)");
+ __asm__ __volatile__ ("mov.l @(0, %0), r8\n\t"
+ "mov.l @(4, %0), r9\n\t"
+ "mov.l @(8, %0), r10\n\t"
+ "mov.l @(12, %0), r11\n\t"
+ "mov.l @(16, %0), r12\n\t"
+ "mov.l @(20, %0), r13\n\t"
+ "mov.l @(24, %0), r14\n\t"
+ "mov.l @(28, %0), r15\n\t"
+ "mov.l @(32, %0), r0\n\t"
+ "ldc r0, sr\n\t"
+ "mov.l @(36, %0), r0\n\t"
+ "ldc r0, gbr\n\t"
+ "mov.l @(40, %0), r0\n\t"
+ "lds r0, pr\n\t"
+ "mov.l r0, @(0, r15)" :: "r" (addr));
}
/*---------------------------------------------------------------------------