From e6791e5eb015b8ecdac59e0a5f68830931444583 Mon Sep 17 00:00:00 2001 From: wawa Date: Fri, 16 Mar 2018 15:11:26 +0000 Subject: [PATCH] another attempt at making the asm inlines portable, the syntax should now be compliant with gcc in order to produce elf binaries. more info here: http://eab.abime.net/showthread.php?t=84429&page=3 git-svn-id: https://svn.aros.org/svn/aros/trunk/contrib@55064 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- FryingPan/framework/LowLevel/Atomic_m68k.h | 106 ++++++++++++++--------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/FryingPan/framework/LowLevel/Atomic_m68k.h b/FryingPan/framework/LowLevel/Atomic_m68k.h index 6e153efc2..7b05f4050 100644 --- a/FryingPan/framework/LowLevel/Atomic_m68k.h +++ b/FryingPan/framework/LowLevel/Atomic_m68k.h @@ -23,13 +23,13 @@ static inline void _atomic_stack_push(struct _atomic_stack* list, struct _atomic_item* item) { - asm volatile(" move.l %0,%%a0\n" - " move.l %1,%%a1\n" - "1: bset.b #0,4(%%a1)\n" + asm volatile(" move.l %0,%/a0\n" + " move.l %1,%/a1\n" + "1: bset.b %#0,4(%/a1)\n" " bne.b 1b\n" - "2: move.l (%%a1),(%%a0)\n" - " move.l %%a0,(%%a1)\n" - " bclr.b #0,4(%%a1)\n" + "2: move.l (%/a1),(%/a0)\n" + " move.l %/a0,(%/a1)\n" + " bclr.b %#0,4(%/a1)\n" : : "m" (item), "m" (list) : "a0", "a1", "cc", "memory" @@ -40,15 +40,15 @@ static inline struct _atomic_item* _atomic_stack_pop(struct _atomic_stack* list) { register struct _atomic_item *n; - asm volatile(" move.l %1,%%a1\n" - "1: bset.b #0,4(%%a1)\n" + asm volatile(" move.l %1,%/a1\n" + "1: bset.b %#0,4(%/a1)\n" " bne.b 1b\n" - "2: move.l (%%a1),%%d0\n" + "2: move.l (%/a1),%/d0\n" " beq 3f\n" - " move.l %%d0,%%a0\n" - " move.l (%%a0),(%%a1)\n" - "3: bclr.b #0,4(%%a1)\n" - " move.l %%d0,%0\n" + " move.l %/d0,%/a0\n" + " move.l (%/a0),(%/a1)\n" + "3: bclr.b %#0,4(%/a1)\n" + " move.l %/d0,%0\n" : "=g" (n) : "m" (list) : "a0", "a1", "d0", "cc", "memory" @@ -58,8 +58,8 @@ static inline struct _atomic_item* _atomic_stack_pop(struct _atomic_stack* list) static inline void _atomic_cnt_inc(struct _atomic_cnt* cnt) { - asm volatile(" move.l %0,%%a0\n" - " addq.l #1,(%%a0)\n" + asm volatile(" move.l %0,%/a0\n" + " addq.l %#1,(%/a0)\n" : : "m" (cnt) : "a0", "cc", "memory" @@ -68,8 +68,8 @@ static inline void _atomic_cnt_inc(struct _atomic_cnt* cnt) static inline void _atomic_cnt_dec(struct _atomic_cnt* cnt) { - asm volatile(" move.l %0,%%a0\n" - " subq.l #1,(%%a0)\n" + asm volatile(" move.l %0,%/a0\n" + " subq.l %#1,(%/a0)\n" : : "m" (cnt) : "a0", "cc", "memory" @@ -80,18 +80,18 @@ static inline int32 _atomic_slock_trywrite(struct _atomic_slock* lock) { register int32 res; - asm volatile(" move.l %1,%%a0\n" - "1: bset.b #7,(%%a0)\n" + asm volatile(" move.l %1,%/a0\n" + "1: bset.b %#7,(%/a0)\n" " bne.b 1b\n" - " move.l (%%a0),%%d0\n" - " bclr.b #31,%%d0\n" - " moveq #0,%%d1\n" - " tst.l %%d0\n" + " move.l (%/a0),%/d0\n" + " bclr.b %#31,%/d0\n" + " moveq %#0,%/d1\n" + " tst.l %/d0\n" " bne.b 2f\n" - " moveq #-1,%%d1\n" - " move.l %%d1,(%%a0)\n" - "2: bclr.b #7,(%%a0)\n" - " move.l %%d1,%0\n" + " moveq %#-1,%/d1\n" + " move.l %/d1,(%/a0)\n" + "2: bclr.b %#7,(%/a0)\n" + " move.l %/d1,%0\n" : "=g"(res) : "m"(lock) : "a0", "d0", "d1", "cc", "memory"); @@ -100,16 +100,16 @@ static inline int32 _atomic_slock_trywrite(struct _atomic_slock* lock) static inline void _atomic_slock_unlockwrite(struct _atomic_slock* lock) { - asm volatile(" move.l %0,%%a0\n" - "1: bset.b #7,(%%a0)\n" + asm volatile(" move.l %0,%/a0\n" + "1: bset.b %#7,(%/a0)\n" " bne.b 1b\n" - " move.l (%%a0),%%d0\n" - " moveq #-1,%%d1\n" - " cmp.l %%d0,%%d1\n" + " move.l (%/a0),%/d0\n" + " moveq %#-1,%/d1\n" + " cmp.l %/d0,%/d1\n" " bne.b 2f\n" - " moveq #0,%%d0\n" - " move.l %%d0,(%%a0)\n" - "2: bclr.b #7,(%%a0)\n" + " moveq %#0,%/d0\n" + " move.l %/d0,(%/a0)\n" + "2: bclr.b %#7,(%/a0)\n" : : "m"(lock) : "a0", "d0", "d1", "cc", "memory"); @@ -119,17 +119,17 @@ static inline int32 _atomic_slock_tryread(struct _atomic_slock* lock) { register int32 res; - asm volatile(" move.l %1,%%a0\n" - "1: bset.b #7,(%%a0)\n" + asm volatile(" move.l %1,%/a0\n" + "1: bset.b %#7,(%/a0)\n" " bne.b 1b\n" - " move.l (%%a0),%%d0\n" - " moveq.l #-1,%%d1\n" - " cmp.l %%d0,%%d1\n" + " move.l (%/a0),%/d0\n" + " moveq.l %#-1,%/d1\n" + " cmp.l %/d0,%/d1\n" " beq.b 2f\n" - " addq.l #1,(%%a0)\n" - " bclr.b #31,%%d0\n" - "2: bclr.b #7,(%%a0)\n" - " move.l %%d0,%0\n" + " addq.l %#1,(%/a0)\n" + " bclr.b %#31,%/d0\n" + "2: bclr.b %#7,(%/a0)\n" + " move.l %/d0,%0\n" : "=g"(res) : "m"(lock) : "a0", "d0", "d1", "cc", "memory"); @@ -140,17 +140,17 @@ static inline int32 _atomic_slock_unlockread(struct _atomic_slock* lock) { register int32 res; - asm volatile(" move.l %1,%%a0\n" - "1: bset.b #7,(%%a0)\n" + asm volatile(" move.l %1,%/a0\n" + "1: bset.b %#7,(%/a0)\n" " bne.b 1b\n" - " move.l (%%a0),%%d0\n" - " moveq.l #-1,%%d0\n" - " cmp.l %%d0,%%d1\n" + " move.l (%/a0),%/d0\n" + " moveq.l %#-1,%/d0\n" + " cmp.l %/d0,%/d1\n" " beq.b 2f\n" - " subq.l #1,(%%a0)\n" - " bclr.b #31,%%d0\n" - " bclr.b #7,(%%a0)\n" - "2: move.l %%d0,%0\n" + " subq.l %#1,(%/a0)\n" + " bclr.b %#31,%/d0\n" + " bclr.b %#7,(%/a0)\n" + "2: move.l %/d0,%0\n" : "=g"(res) : "m"(lock) : "a0", "d0", "d1", "cc", "memory"); -- 2.11.4.GIT