X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-m32r%2Fsemaphore.h;h=53e3c60f21ec620c73f9099aa0f3cd91bc1ae5ee;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=5aca12f07ea46f82030c93f4e1dc16d2a4b3fd6c;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/include/asm-m32r/semaphore.h b/include/asm-m32r/semaphore.h index 5aca12f07..53e3c60f2 100644 --- a/include/asm-m32r/semaphore.h +++ b/include/asm-m32r/semaphore.h @@ -15,19 +15,10 @@ #include #include #include +#include #include #include -#undef LOAD -#undef STORE -#ifdef CONFIG_SMP -#define LOAD "lock" -#define STORE "unlock" -#else -#define LOAD "ld" -#define STORE "st" -#endif - struct semaphore { atomic_t count; int sleepers; @@ -97,9 +88,9 @@ static inline void down(struct semaphore * sem) __asm__ __volatile__ ( "# down \n\t" DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" + M32R_LOCK" %0, @%1; \n\t" "addi %0, #-1; \n\t" - STORE" %0, @%1; \n\t" + M32R_UNLOCK" %0, @%1; \n\t" : "=&r" (count) : "r" (&sem->count) : "memory" @@ -128,9 +119,9 @@ static inline int down_interruptible(struct semaphore * sem) __asm__ __volatile__ ( "# down_interruptible \n\t" DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" + M32R_LOCK" %0, @%1; \n\t" "addi %0, #-1; \n\t" - STORE" %0, @%1; \n\t" + M32R_UNLOCK" %0, @%1; \n\t" : "=&r" (count) : "r" (&sem->count) : "memory" @@ -160,9 +151,9 @@ static inline int down_trylock(struct semaphore * sem) __asm__ __volatile__ ( "# down_trylock \n\t" DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" + M32R_LOCK" %0, @%1; \n\t" "addi %0, #-1; \n\t" - STORE" %0, @%1; \n\t" + M32R_UNLOCK" %0, @%1; \n\t" : "=&r" (count) : "r" (&sem->count) : "memory" @@ -193,9 +184,9 @@ static inline void up(struct semaphore * sem) __asm__ __volatile__ ( "# up \n\t" DCACHE_CLEAR("%0", "r4", "%1") - LOAD" %0, @%1; \n\t" + M32R_LOCK" %0, @%1; \n\t" "addi %0, #1; \n\t" - STORE" %0, @%1; \n\t" + M32R_UNLOCK" %0, @%1; \n\t" : "=&r" (count) : "r" (&sem->count) : "memory"