Add __volatile__ to all __asm__ and make consistent indenting
This commit is contained in:
parent
d7810023c5
commit
cef28fd943
@ -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,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standard __asm__ format:
|
* Standard _asm format:
|
||||||
*
|
*
|
||||||
* __asm__(
|
* __asm__ __volatile__(
|
||||||
* "command;"
|
* "command;"
|
||||||
* "command;"
|
* "command;"
|
||||||
* "command;"
|
* "command;"
|
||||||
@ -120,7 +120,7 @@ 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)
|
||||||
@ -159,7 +159,7 @@ 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));
|
||||||
@ -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,7 +203,7 @@ 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));
|
||||||
@ -248,7 +248,7 @@ 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;"
|
||||||
@ -270,7 +270,7 @@ 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));
|
||||||
@ -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;"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user