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

Commit612ecf3

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 parent81fe138 commit612ecf3

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
@@ -335,6 +335,29 @@ tas(volatile slock_t *lock)
335335
#endif/* __arm__ */
336336

337337

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp