Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit89779bf

Browse files
committed
Fix a few problems in barrier.h.
On HPPA, implement pg_memory_barrier() as pg_compiler_barrier(), whichshould be correct since this arch doesn't do memory access reordering,and is anyway better than the completely-nonfunctional-on-this-archdummy_spinlock code. (But note this patch only fixes things for gcc,not for builds with HP's compiler.)Also, fix incorrect default definition of pg_memory_barrier as a macrorequiring an argument.Also, fix incorrect spelling of "#elif" as "#else if" in icc code path(spotted by pgindent).This doesn't come close to fixing all of the functional and stylisticdeficiencies in barrier.h, but at least it un-breaks my personal build.Now that we're actually using barriers in the code, this file is goingto need some serious attention.
1 parent107cbc9 commit89779bf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎src/include/storage/barrier.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ extern slock_t dummy_spinlock;
5555
*/
5656
#if defined(__ia64__)|| defined(__ia64)
5757
#definepg_memory_barrier()__mf()
58-
#elseifdefined(__i386__)||defined(__x86_64__)
58+
#elif defined(__i386__)|| defined(__x86_64__)
5959
#definepg_memory_barrier()_mm_mfence()
6060
#endif
6161

@@ -119,6 +119,10 @@ extern slock_t dummy_spinlock;
119119
#definepg_memory_barrier()__asm__ __volatile__ ("mb" : : : "memory")
120120
#definepg_read_barrier()__asm__ __volatile__ ("rmb" : : : "memory")
121121
#definepg_write_barrier()__asm__ __volatile__ ("wmb" : : : "memory")
122+
#elif defined(__hppa)|| defined(__hppa__)/* HP PA-RISC */
123+
124+
/* HPPA doesn't do either read or write reordering */
125+
#definepg_memory_barrier()pg_compiler_barrier()
122126
#elif__GNUC__>4|| (__GNUC__==4&&__GNUC_MINOR__ >=1)
123127

124128
/*
@@ -153,7 +157,7 @@ extern slock_t dummy_spinlock;
153157
* fence. But all of our actual implementations seem OK in this regard.
154158
*/
155159
#if !defined(pg_memory_barrier)
156-
#definepg_memory_barrier(x) \
160+
#definepg_memory_barrier() \
157161
do { S_LOCK(&dummy_spinlock); S_UNLOCK(&dummy_spinlock); } while (0)
158162
#endif
159163

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp