Skip to content

Commit dfdf948

Browse files
devnexenac000
authored andcommitted
Define nxt_cpu_pause for ARM64.
The isb instruction fits for spin loops where it allows to save cpu power. Reviewed-by: Andrew Clayton <a.clayton@nginx.com> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 5cfad9c commit dfdf948

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/nxt_atomic.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ typedef volatile nxt_atomic_uint_t nxt_atomic_t;
5858
#define nxt_cpu_pause() \
5959
__asm__ ("pause")
6060

61+
#elif (__aarch64__ || __arm64__)
62+
#define nxt_cpu_pause() \
63+
__asm__ ("isb")
64+
6165
#else
6266
#define nxt_cpu_pause()
6367
#endif

0 commit comments

Comments
 (0)