Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 718aa43

Browse filesBrowse files
committed
Further tidy-up for old CPU architectures.
Further to commit 92d70b7, let's drop the code we carry for the following untested architectures: M68K, M88K, M32R, SuperH. We have no idea if anything actually works there, and surely as vintage hardware and microcontrollers they would be underpowered for modern purposes. We could always consider re-adding SuperH based on evidence of usage and build farm support, if someone shows up to provide it. While here, SPARC is usually written in all caps. Suggested-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Reviewed-by: Robert Haas <robertmhaas@gmail.com> (the idea, not the patch) Discussion: https://postgr.es/m/959917.1657522169%40sss.pgh.pa.us
1 parent b40baa9 commit 718aa43
Copy full SHA for 718aa43

File tree

Expand file treeCollapse file tree

3 files changed

+2
-170
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+2
-170
lines changed

‎doc/src/sgml/installation.sgml

Copy file name to clipboardExpand all lines: doc/src/sgml/installation.sgml
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,11 +2125,10 @@ export MANPATH
21252125

21262126
<para>
21272127
In general, <productname>PostgreSQL</productname> can be expected to work on
2128-
these CPU architectures: x86, PowerPC, S/390, Sparc, ARM, MIPS, RISC-V,
2128+
these CPU architectures: x86, PowerPC, S/390, SPARC, ARM, MIPS, RISC-V,
21292129
and PA-RISC, including
21302130
big-endian, little-endian, 32-bit, and 64-bit variants where applicable.
2131-
Code support exists for M68K, M88K, M32R, and SuperH, but these
2132-
architectures are not known to have been tested recently. It is often
2131+
It is often
21332132
possible to build on an unsupported CPU type by configuring with
21342133
<option>--disable-spinlocks</option>, but performance will be poor.
21352134
</para>

‎src/backend/storage/lmgr/s_lock.c

Copy file name to clipboardExpand all lines: src/backend/storage/lmgr/s_lock.c
-65Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -220,71 +220,6 @@ update_spins_per_delay(int shared_spins_per_delay)
220220
}
221221

222222

223-
/*
224-
* Various TAS implementations that cannot live in s_lock.h as no inline
225-
* definition exists (yet).
226-
* In the future, get rid of tas.[cso] and fold it into this file.
227-
*
228-
* If you change something here, you will likely need to modify s_lock.h too,
229-
* because the definitions for these are split between this file and s_lock.h.
230-
*/
231-
232-
233-
#ifdef HAVE_SPINLOCKS /* skip spinlocks if requested */
234-
235-
236-
#if defined(__GNUC__)
237-
238-
/*
239-
* All the gcc flavors that are not inlined
240-
*/
241-
242-
243-
/*
244-
* Note: all the if-tests here probably ought to be testing gcc version
245-
* rather than platform, but I don't have adequate info to know what to
246-
* write. Ideally we'd flush all this in favor of the inline version.
247-
*/
248-
#if defined(__m68k__) && !defined(__linux__)
249-
/* really means: extern int tas(slock_t* **lock); */
250-
static void
251-
tas_dummy()
252-
{
253-
__asm__ __volatile__(
254-
#if (defined(__NetBSD__) || defined(__OpenBSD__)) && defined(__ELF__)
255-
/* no underscore for label and % for registers */
256-
"\
257-
.global tas \n\
258-
tas: \n\
259-
movel %sp@(0x4),%a0 \n\
260-
tas %a0@ \n\
261-
beq _success \n\
262-
moveq #-128,%d0 \n\
263-
rts \n\
264-
_success: \n\
265-
moveq #0,%d0 \n\
266-
rts \n"
267-
#else
268-
"\
269-
.global _tas \n\
270-
_tas: \n\
271-
movel sp@(0x4),a0 \n\
272-
tas a0@ \n\
273-
beq _success \n\
274-
moveq #-128,d0 \n\
275-
rts \n\
276-
_success: \n\
277-
moveq #0,d0 \n\
278-
rts \n"
279-
#endif /* (__NetBSD__ || __OpenBSD__) && __ELF__ */
280-
);
281-
}
282-
#endif /* __m68k__ && !__linux__ */
283-
#endif /* not __GNUC__ */
284-
#endif /* HAVE_SPINLOCKS */
285-
286-
287-
288223
/*****************************************************************************/
289224
#if defined(S_LOCK_TEST)
290225

‎src/include/storage/s_lock.h

Copy file name to clipboardExpand all lines: src/include/storage/s_lock.h
-102Lines changed: 0 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -498,56 +498,6 @@ do \
498498
#endif /* powerpc */
499499

500500

501-
/* Linux Motorola 68k */
502-
#if (defined(__mc68000__) || defined(__m68k__)) && defined(__linux__)
503-
#define HAS_TEST_AND_SET
504-
505-
typedef unsigned char slock_t;
506-
507-
#define TAS(lock) tas(lock)
508-
509-
static __inline__ int
510-
tas(volatile slock_t *lock)
511-
{
512-
register int rv;
513-
514-
__asm__ __volatile__(
515-
" clrl %0 \n"
516-
" tas %1 \n"
517-
" sne %0 \n"
518-
: "=d"(rv), "+m"(*lock)
519-
: /* no inputs */
520-
: "memory", "cc");
521-
return rv;
522-
}
523-
524-
#endif /* (__mc68000__ || __m68k__) && __linux__ */
525-
526-
527-
/* Motorola 88k */
528-
#if defined(__m88k__)
529-
#define HAS_TEST_AND_SET
530-
531-
typedef unsigned int slock_t;
532-
533-
#define TAS(lock) tas(lock)
534-
535-
static __inline__ int
536-
tas(volatile slock_t *lock)
537-
{
538-
register slock_t _res = 1;
539-
540-
__asm__ __volatile__(
541-
" xmem %0, %2, %%r0 \n"
542-
: "+r"(_res), "+m"(*lock)
543-
: "r"(lock)
544-
: "memory");
545-
return (int) _res;
546-
}
547-
548-
#endif /* __m88k__ */
549-
550-
551501
#if defined(__mips__) && !defined(__sgi) /* non-SGI MIPS */
552502
#define HAS_TEST_AND_SET
553503

@@ -619,58 +569,6 @@ do \
619569
#endif /* __mips__ && !__sgi */
620570

621571

622-
#if defined(__m32r__) && defined(HAVE_SYS_TAS_H) /* Renesas' M32R */
623-
#define HAS_TEST_AND_SET
624-
625-
#include <sys/tas.h>
626-
627-
typedef int slock_t;
628-
629-
#define TAS(lock) tas(lock)
630-
631-
#endif /* __m32r__ */
632-
633-
634-
#if defined(__sh__) /* Renesas' SuperH */
635-
#define HAS_TEST_AND_SET
636-
637-
typedef unsigned char slock_t;
638-
639-
#define TAS(lock) tas(lock)
640-
641-
static __inline__ int
642-
tas(volatile slock_t *lock)
643-
{
644-
register int _res;
645-
646-
/*
647-
* This asm is coded as if %0 could be any register, but actually SuperH
648-
* restricts the target of xor-immediate to be R0. That's handled by
649-
* the "z" constraint on _res.
650-
*/
651-
__asm__ __volatile__(
652-
" tas.b @%2 \n"
653-
" movt %0 \n"
654-
" xor #1,%0 \n"
655-
: "=z"(_res), "+m"(*lock)
656-
: "r"(lock)
657-
: "memory", "t");
658-
return _res;
659-
}
660-
661-
#endif /* __sh__ */
662-
663-
664-
/* These live in s_lock.c, but only for gcc */
665-
666-
667-
#if defined(__m68k__) && !defined(__linux__) /* non-Linux Motorola 68k */
668-
#define HAS_TEST_AND_SET
669-
670-
typedef unsigned char slock_t;
671-
#endif
672-
673-
674572
#if defined(__hppa) || defined(__hppa__) /* HP PA-RISC */
675573
/*
676574
* HP's PA-RISC

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.