File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.12 1997/03/12 21:06:48 scrappy Exp $
10
+ * $Header: /cvsroot/pgsql/src/backend/storage/ipc/Attic/s_lock.c,v 1.13 1997/04/24 02:35:35 scrappy Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -453,4 +453,37 @@ S_INIT_LOCK(slock_t *lock)
453
453
454
454
#endif
455
455
456
+ #if defined(linux ) && defined(sparc )
457
+
458
+ int
459
+ tas (slock_t * m )
460
+ {
461
+ slock_t res ;
462
+ __asm__("ldstub [%1], %0"
463
+ : "=&r" (res )
464
+ : "r" (m ));
465
+ return (res != 0 );
466
+ }
467
+
468
+ void
469
+ S_LOCK (slock_t * lock )
470
+ {
471
+ while (tas (lock ))
472
+ ;
473
+ }
474
+
475
+ void
476
+ S_UNLOCK (slock_t * lock )
477
+ {
478
+ * lock = 0 ;
479
+ }
480
+
481
+ void
482
+ S_INIT_LOCK (slock_t * lock )
483
+ {
484
+ S_UNLOCK (lock );
485
+ }
486
+
487
+ #endif /* defined(linux) && defined(sparc) */
488
+
456
489
#endif /* HAS_TEST_AND_SET */
Original file line number Diff line number Diff line change 12
12
# define HAS_TEST_AND_SET
13
13
typedef unsigned char slock_t ;
14
14
# endif
15
+ # if defined(sparc )
16
+ # undef NEED_I386_TAS_ASM
17
+ # endif
You can’t perform that action at this time.
0 commit comments