mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
Still further tweaking of s_lock assembler: do not assume that leading
whitespace is unimportant in assembly code. Also, move VAX definition of typedef slock_t to port header files to be like all the other ports. Note that netbsd.h and openbsd.h are now identical, and I rather think that freebsd.h is broken in the places where it doesn't agree --- but I'll leave it to the freebsders to look at that.
This commit is contained in:
parent
58f4028518
commit
a7ea9f46e1
@ -14,6 +14,7 @@ typedef long int slock_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__vax__)
|
#if defined(__vax__)
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#define NEED_VAX_TAS_ASM
|
#define NEED_VAX_TAS_ASM
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,43 +1,47 @@
|
|||||||
#if defined(__i386__)
|
#if defined(__i386__)
|
||||||
#define NEED_I386_TAS_ASM
|
#define NEED_I386_TAS_ASM
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__sparc__)
|
#if defined(__sparc__)
|
||||||
#define NEED_SPARC_TAS_ASM
|
#define NEED_SPARC_TAS_ASM
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__vax__)
|
#if defined(__vax__)
|
||||||
#define NEED_VAX_TAS_ASM
|
#define NEED_VAX_TAS_ASM
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__ns32k__)
|
#if defined(__ns32k__)
|
||||||
#define NEED_NS32K_TAS_ASM
|
#define NEED_NS32K_TAS_ASM
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__m68k__)
|
#if defined(__m68k__)
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__arm__)
|
#if defined(__arm__)
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned char slock_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__mips__)
|
#if defined(__mips__)
|
||||||
/* # undef HAS_TEST_AND_SET */
|
/* # undef HAS_TEST_AND_SET */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(__alpha__)
|
||||||
|
#define HAS_TEST_AND_SET
|
||||||
|
typedef unsigned long slock_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__powerpc__)
|
#if defined(__powerpc__)
|
||||||
#define HAS_TEST_AND_SET
|
#define HAS_TEST_AND_SET
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(__powerpc__)
|
|
||||||
typedef unsigned int slock_t;
|
typedef unsigned int slock_t;
|
||||||
|
|
||||||
#else
|
|
||||||
typedef unsigned char slock_t;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.84 2001/01/19 21:09:57 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/include/storage/s_lock.h,v 1.85 2001/01/20 00:03:54 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -100,9 +100,9 @@ extern void s_lock_sleep(unsigned spins, int microsec,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standard _asm format:
|
* Standard gcc asm format:
|
||||||
*
|
*
|
||||||
* __asm__ __volatile__(
|
__asm__ __volatile__(
|
||||||
" command \n"
|
" command \n"
|
||||||
" command \n"
|
" command \n"
|
||||||
" command \n"
|
" command \n"
|
||||||
@ -241,8 +241,6 @@ tas(volatile slock_t *lock)
|
|||||||
*/
|
*/
|
||||||
#define TAS(lock) tas(lock)
|
#define TAS(lock) tas(lock)
|
||||||
|
|
||||||
typedef unsigned char slock_t;
|
|
||||||
|
|
||||||
static __inline__ int
|
static __inline__ int
|
||||||
tas(volatile slock_t *lock)
|
tas(volatile slock_t *lock)
|
||||||
{
|
{
|
||||||
@ -329,7 +327,7 @@ tas(volatile slock_t *s_lock)
|
|||||||
#define S_UNLOCK(lock) \
|
#define S_UNLOCK(lock) \
|
||||||
do \
|
do \
|
||||||
{\
|
{\
|
||||||
__asm__ __volatile__ ("mb"); \
|
__asm__ __volatile__ (" mb \n"); \
|
||||||
*(lock) = 0; \
|
*(lock) = 0; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user