Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151951893
D16982.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
903 B
Referenced Files
None
Subscribers
None
D16982.id.diff
View Options
Index: head/sys/sys/random.h
===================================================================
--- head/sys/sys/random.h
+++ head/sys/sys/random.h
@@ -57,9 +57,6 @@
* Note: if you add or remove members of random_entropy_source, remember to
* also update the strings in the static array random_source_descr[] in
* random_harvestq.c.
- *
- * NOTE: complain loudly to markm@ or on the lists if this enum gets more than 32
- * distinct values (0-31)! ENTROPYSOURCE may be == 32, but not > 32.
*/
enum random_entropy_source {
RANDOM_START = 0,
@@ -92,6 +89,8 @@
RANDOM_PURE_DARN,
ENTROPYSOURCE
};
+_Static_assert(ENTROPYSOURCE <= 32,
+ "hardcoded assumption that values fit in a typical word-sized bitset");
#define RANDOM_HARVEST_EVERYTHING_MASK ((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1)
#define RANDOM_HARVEST_PURE_MASK (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START))
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 5:44 PM (5 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31347845
Default Alt Text
D16982.id.diff (903 B)
Attached To
Mode
D16982: random(4): Translate a comment requirement into a compile-time invariant
Attached
Detach File
Event Timeline
Log In to Comment