Skip to content

Commit 396526d

Browse files
committed
Adjust m68k spinlock code to avoid duplicate in-line and not-in-line
definitions on recent Linux systems, per Martin Pitt.
1 parent a310a1d commit 396526d

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

src/backend/storage/lmgr/s_lock.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.37 2005/08/25 17:17:09 tgl Exp $
12+
* $PostgreSQL: pgsql/src/backend/storage/lmgr/s_lock.c,v 1.38 2005/08/26 14:47:35 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -135,7 +135,12 @@ s_lock(volatile slock_t *lock, const char *file, int line)
135135
*/
136136

137137

138-
#if defined(__m68k__)
138+
/*
139+
* Note: all the if-tests here probably ought to be testing gcc version
140+
* rather than platform, but I don't have adequate info to know what to
141+
* write. Ideally we'd flush all this in favor of the inline version.
142+
*/
143+
#if defined(__m68k__) && !defined(__linux__)
139144
/* really means: extern int tas(slock_t* **lock); */
140145
static void
141146
tas_dummy()
@@ -169,7 +174,7 @@ _success: \n\
169174
#endif /* __NetBSD__ && __ELF__ */
170175
);
171176
}
172-
#endif /* __m68k__ */
177+
#endif /* __m68k__ && !__linux__ */
173178

174179

175180
#else /* not __GNUC__ */

src/include/storage/s_lock.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
6767
* Portions Copyright (c) 1994, Regents of the University of California
6868
*
69-
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.135 2005/08/25 17:17:10 tgl Exp $
69+
* $PostgreSQL: pgsql/src/include/storage/s_lock.h,v 1.136 2005/08/26 14:47:35 tgl Exp $
7070
*
7171
*-------------------------------------------------------------------------
7272
*/
@@ -191,7 +191,7 @@ tas(volatile slock_t *lock)
191191
return (int) ret;
192192
}
193193

194-
#else
194+
#else /* __INTEL_COMPILER */
195195

196196
static __inline__ int
197197
tas(volatile slock_t *lock)
@@ -203,7 +203,7 @@ tas(volatile slock_t *lock)
203203
return ret;
204204
}
205205

206-
#endif
206+
#endif /* __INTEL_COMPILER */
207207
#endif /* __ia64__ || __ia64 */
208208

209209

@@ -328,7 +328,7 @@ do \
328328
#endif /* powerpc */
329329

330330

331-
#if defined(__mc68000__) && defined(__linux__)
331+
#if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__)
332332
#define HAS_TEST_AND_SET
333333

334334
typedef unsigned char slock_t;
@@ -350,7 +350,7 @@ tas(volatile slock_t *lock)
350350
return rv;
351351
}
352352

353-
#endif /* defined(__mc68000__) && defined(__linux__) */
353+
#endif /* (__mc68000__ || __m68k__) && __linux__ */
354354

355355

356356
#if defined(__vax__)
@@ -491,7 +491,7 @@ tas(volatile slock_t *lock)
491491
/* These live in s_lock.c, but only for gcc */
492492

493493

494-
#if defined(__m68k__)
494+
#if defined(__m68k__) && !defined(__linux__)
495495
#define HAS_TEST_AND_SET
496496

497497
typedef unsigned char slock_t;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy