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

Commit5c7603c

Browse files
committed
Add ARM64 (aarch64) support to s_lock.h.
Use the same gcc atomic functions as we do on newer ARM chips.(Basically this is a copy and paste of the __arm__ code block,but omitting the SWPB option since that definitely won't work.)Back-patch to 9.2. The patch would work further back, but we'd alsoneed to update config.guess/config.sub in older branches to make thembuild out-of-the-box, and there hasn't been demand for it.Mark Salter
1 parentdbc6eb1 commit5c7603c

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

‎src/include/storage/s_lock.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,29 @@ tas(volatile slock_t *lock)
336336
#endif/* __arm__ */
337337

338338

339+
/*
340+
* On ARM64, we use __sync_lock_test_and_set(int *, int) if available.
341+
*/
342+
#if defined(__aarch64__)|| defined(__aarch64)
343+
#ifdefHAVE_GCC_INT_ATOMICS
344+
#defineHAS_TEST_AND_SET
345+
346+
#defineTAS(lock) tas(lock)
347+
348+
typedefintslock_t;
349+
350+
static __inline__int
351+
tas(volatileslock_t*lock)
352+
{
353+
return__sync_lock_test_and_set(lock,1);
354+
}
355+
356+
#defineS_UNLOCK(lock) __sync_lock_release(lock)
357+
358+
#endif/* HAVE_GCC_INT_ATOMICS */
359+
#endif/* __aarch64__ */
360+
361+
339362
/* S/390 and S/390x Linux (32- and 64-bit zSeries) */
340363
#if defined(__s390__)|| defined(__s390x__)
341364
#defineHAS_TEST_AND_SET

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp