Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F142685325
D32478.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32478.diff
View Options
Index: sys/dev/random/fortuna.h
===================================================================
--- sys/dev/random/fortuna.h
+++ sys/dev/random/fortuna.h
@@ -31,10 +31,10 @@
#ifdef _KERNEL
typedef struct mtx mtx_t;
-#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&fortuna_state.fs_mtx, "reseed mutex", NULL, MTX_DEF)
+#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&fortuna_state.fs_mtx, "reseed mutex", NULL, MTX_SPIN)
#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&fortuna_state.fs_mtx)
-#define RANDOM_RESEED_LOCK(x) mtx_lock(&fortuna_state.fs_mtx)
-#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&fortuna_state.fs_mtx)
+#define RANDOM_RESEED_LOCK(x) mtx_lock_spin(&fortuna_state.fs_mtx)
+#define RANDOM_RESEED_UNLOCK(x) mtx_unlock_spin(&fortuna_state.fs_mtx)
#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) mtx_assert(&fortuna_state.fs_mtx, MA_OWNED)
#define RANDOM_RESEED_ASSERT_LOCK_NOT_OWNED() mtx_assert(&fortuna_state.fs_mtx, MA_NOTOWNED)
#else
Index: sys/dev/random/other_algorithm.h
===================================================================
--- sys/dev/random/other_algorithm.h
+++ sys/dev/random/other_algorithm.h
@@ -45,10 +45,10 @@
#ifdef _KERNEL
typedef struct mtx mtx_t;
-#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&other_mtx, "reseed mutex", NULL, MTX_DEF)
+#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&other_mtx, "reseed mutex", NULL, MTX_SPIN)
#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&other_mtx)
-#define RANDOM_RESEED_LOCK(x) mtx_lock(&other_mtx)
-#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&other_mtx)
+#define RANDOM_RESEED_LOCK(x) mtx_lock_spin(&other_mtx)
+#define RANDOM_RESEED_UNLOCK(x) mtx_unlock_spin(&other_mtx)
#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) mtx_assert(&other_mtx, MA_OWNED)
#else
#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&other_mtx, mtx_plain)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jan 23, 5:48 AM (1 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27877345
Default Alt Text
D32478.diff (1 KB)
Attached To
Mode
D32478: kern: random: use a spinlock for the reseed lock
Attached
Detach File
Event Timeline
Log In to Comment