Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171033310
D58605.id184657.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
867 B
Referenced Files
None
Subscribers
None
D58605.id184657.diff
View Options
Index: sys/dev/bnxt/bnxt_en/bnxt.h
===================================================================
--- sys/dev/bnxt/bnxt_en/bnxt.h
+++ sys/dev/bnxt/bnxt_en/bnxt.h
@@ -1584,4 +1584,28 @@
panic("%s: invalid bar_idx %u", __func__, bar_idx);
}
}
+
+/*
+ * Non-atomic test-and-set/clear: caller must already hold whatever lock
+ * serializes access to bmap. bitstring.h has no equivalent primitives;
+ * find-first/find-next of a clear or set bit are covered directly by
+ * bit_ffc()/bit_ffc_at()/bit_ffs_at().
+ */
+static inline int
+bnxt_test_and_set_bit_nonatomic(int nr, bitstr_t *bmap)
+{
+ if (bit_test(bmap, nr))
+ return (1);
+ bit_set(bmap, nr);
+ return (0);
+}
+
+static inline int
+bnxt_test_and_clear_bit_nonatomic(int nr, bitstr_t *bmap)
+{
+ if (!bit_test(bmap, nr))
+ return (0);
+ bit_clear(bmap, nr);
+ return (1);
+}
#endif /* _BNXT_H */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 9, 7:35 AM (7 h, 57 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38514094
Default Alt Text
D58605.id184657.diff (867 B)
Attached To
Mode
D58605: if_bnxt: add bitmap search/test-and-set helpers
Attached
Detach File
Event Timeline
Log In to Comment