Debian Codegraph @

src/include/port/atomics/arch-arm.h

raw
1 /*-------------------------------------------------------------------------
2 *
3 * arch-arm.h
4 * Atomic operations considerations specific to ARM
5 *
6 * Portions Copyright (c) 2013-2025, PostgreSQL Global Development Group
7 *
8 * NOTES:
9 *
10 * src/include/port/atomics/arch-arm.h
11 *
12 *-------------------------------------------------------------------------
13 */
14
15 /* intentionally no include guards, should only be included by atomics.h */
16 #ifndef INSIDE_ATOMICS_H
17 #error "should be included via atomics.h"
18 #endif
19
20 /*
21 * 64 bit atomics on ARM32 are implemented using kernel fallbacks and thus
22 * might be slow, so disable entirely. On ARM64 that problem doesn't exist.
23 */
24 #if !defined(__aarch64__)
25 #define PG_DISABLE_64_BIT_ATOMICS
26 #else
27 /*
28 * Architecture Reference Manual for ARMv8 states aligned read/write to/from
29 * general purpose register is atomic.
30 */
31 #define PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY
32 #endif /* __aarch64__ */