Commit cef28fd9 authored by Bruce Momjian's avatar Bruce Momjian

Add __volatile__ to all __asm__ and make consistent indenting

parent d7810023
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.79 2001/01/19 02:58:59 momjian Exp $ * $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.80 2001/01/19 03:58:35 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -100,9 +100,9 @@ extern void s_lock_sleep(unsigned spins, int microsec, ...@@ -100,9 +100,9 @@ extern void s_lock_sleep(unsigned spins, int microsec,
*/ */
/* /*
* Standard __asm__ format: * Standard _asm format:
* *
* __asm__( * __asm__ __volatile__(
* "command;" * "command;"
* "command;" * "command;"
* "command;" * "command;"
...@@ -120,11 +120,11 @@ tas(volatile slock_t *lock) ...@@ -120,11 +120,11 @@ tas(volatile slock_t *lock)
{ {
register slock_t _res = 1; register slock_t _res = 1;
__asm__( __asm__ __volatile__(
"lock;" "lock;"
"xchgb %0,%1;" "xchgb %0,%1;"
: "=q"(_res), "=m"(*lock) : "=q"(_res), "=m"(*lock)
: "0"(_res)); : "0"(_res));
return (int) _res; return (int) _res;
} }
...@@ -159,10 +159,10 @@ tas(volatile slock_t *lock) ...@@ -159,10 +159,10 @@ tas(volatile slock_t *lock)
{ {
register slock_t _res = 1; register slock_t _res = 1;
__asm__( __asm__ __volatile__(
"swpb %0, %0, [%3];" "swpb %0, %0, [%3];"
: "=r"(_res), "=m"(*lock) : "=r"(_res), "=m"(*lock)
: "0"(_res), "r"(lock)); : "0"(_res), "r"(lock));
return (int) _res; return (int) _res;
} }
...@@ -179,7 +179,7 @@ tas(volatile slock_t *lock) ...@@ -179,7 +179,7 @@ tas(volatile slock_t *lock)
{ {
int _res; int _res;
__asm__ __volatile( __asm__ __volatile__(
"la 1,1;" "la 1,1;"
"l 2,%2;" "l 2,%2;"
"slr 0,0;" "slr 0,0;"
...@@ -203,10 +203,10 @@ tas(volatile slock_t *lock) ...@@ -203,10 +203,10 @@ tas(volatile slock_t *lock)
{ {
register slock_t _res = 1; register slock_t _res = 1;
__asm__( __asm__ __volatile__(
"ldstub [%2], %0;" "ldstub [%2], %0;"
: "=r"(_res), "=m"(*lock) : "=r"(_res), "=m"(*lock)
: "r"(lock)); : "r"(lock));
return (int) _res; return (int) _res;
} }
...@@ -248,14 +248,14 @@ tas(volatile slock_t *lock) ...@@ -248,14 +248,14 @@ tas(volatile slock_t *lock)
{ {
register _res; register _res;
__asm__( __asm__ __volatile__(
"movl $1, r0;" "movl $1, r0;"
"bbssi $0, (%1), 1f;" "bbssi $0, (%1), 1f;"
"clrl r0;" "clrl r0;"
"1: movl r0, %0;" "1: movl r0, %0;"
: "=r"(_res) : "=r"(_res)
: "r"(lock) : "r"(lock)
: "r0"); : "r0");
return (int) _res; return (int) _res;
} }
...@@ -270,10 +270,10 @@ tas(volatile slock_t *lock) ...@@ -270,10 +270,10 @@ tas(volatile slock_t *lock)
{ {
register _res; register _res;
__asm__( __asm__ __volatile__(
"sbitb 0, %0;" "sbitb 0, %0;"
"sfsd %1;" "sfsd %1;"
: "=m"(*lock), "=r"(_res)); : "=m"(*lock), "=r"(_res));
return (int) _res; return (int) _res;
} }
...@@ -326,14 +326,19 @@ tas(volatile slock_t *s_lock) ...@@ -326,14 +326,19 @@ tas(volatile slock_t *s_lock)
#if defined(__GNUC__) #if defined(__GNUC__)
#define TAS(lock) tas(lock) #define TAS(lock) tas(lock)
#define S_UNLOCK(lock) do { __asm__ volatile ("mb"); *(lock) = 0; } while (0) #define S_UNLOCK(lock) \
do \
{\
__asm__ __volatile__ ("mb"); \
*(lock) = 0; \
} while (0)
static __inline__ int static __inline__ int
tas(volatile slock_t *lock) tas(volatile slock_t *lock)
{ {
register slock_t _res; register slock_t _res;
__asm__ volatile( __asm__ __volatile__(
"ldq $0, %0;" "ldq $0, %0;"
"bne $0, 2f;" "bne $0, 2f;"
"ldq_l %1, %0;" "ldq_l %1, %0;"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment