Page MenuHomeFreeBSD

D52626.id162430.diff
No OneTemporary

D52626.id162430.diff

diff --git a/sys/sys/_atomic_subword.h b/sys/sys/_atomic_subword.h
--- a/sys/sys/_atomic_subword.h
+++ b/sys/sys/_atomic_subword.h
@@ -205,4 +205,31 @@
#undef _ATOMIC_BYTE_SHIFT
#undef _ATOMIC_HWORD_SHIFT
+static __inline void
+atomic_set_short(volatile u_short *p, u_short bit)
+{
+ u_short v;
+
+ v = atomic_load_short(p);
+ for (;;) {
+ if (atomic_fcmpset_short(p, &v, v | bit))
+ break;
+ }
+}
+
+static __inline void
+atomic_clear_short(volatile u_short *p, u_short bit)
+{
+ u_short v;
+
+ v = atomic_load_short(p);
+ for (;;) {
+ if (atomic_fcmpset_short(p, &v, v & ~bit))
+ break;
+ }
+}
+
+#define atomic_set_16 atomic_set_short
+#define atomic_clear_16 atomic_clear_short
+
#endif /* _SYS__ATOMIC_SUBWORD_H_ */

File Metadata

Mime Type
text/plain
Expires
Mon, Sep 7, 10:47 PM (3 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38490760
Default Alt Text
D52626.id162430.diff (733 B)

Event Timeline