git: 0f908dae9d08 - main - powerpc: Define the sub-word atomic load and store directly

From: Justin Hibbits <jhibbits_at_FreeBSD.org>
Date: Sat, 07 Nov 2026 04:06:33 UTC
The branch main has been updated by jhibbits:

URL: https://cgit.FreeBSD.org/src/commit/?id=0f908dae9d08a7146bc1d783189899852f4d8ca4

commit 0f908dae9d08a7146bc1d783189899852f4d8ca4
Author:     Justin Hibbits <jhibbits@FreeBSD.org>
AuthorDate: 2026-10-26 21:05:56 +0000
Commit:     Justin Hibbits <jhibbits@FreeBSD.org>
CommitDate: 2026-11-07 04:05:56 +0000

    powerpc: Define the sub-word atomic load and store directly
    
    All currently supported powerpc CPUs handle single-copy atomicity for
    any size up to the native word size, so load and store operations are
    guaranteed for sub-word size that are naturally aligned.
---
 sys/powerpc/include/atomic.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h
index 60fb678e6b41..e2a991a4ec25 100644
--- a/sys/powerpc/include/atomic.h
+++ b/sys/powerpc/include/atomic.h
@@ -573,8 +573,14 @@ atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v)	\
 	*p = v;							\
 }
 
+ATOMIC_STORE_LOAD(char)
+ATOMIC_STORE_LOAD(short)
 ATOMIC_STORE_LOAD(int)
 
+#define	atomic_load_acq_8	atomic_load_acq_char
+#define	atomic_store_rel_8	atomic_store_rel_char
+#define	atomic_load_acq_16	atomic_load_acq_short
+#define	atomic_store_rel_16	atomic_store_rel_short
 #define	atomic_load_acq_32	atomic_load_acq_int
 #define	atomic_store_rel_32	atomic_store_rel_int