Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F176824130
D41583.1793436602.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D41583.1793436602.diff
View Options
diff --git a/sys/dev/random/nehemiah.c b/sys/dev/random/nehemiah.c
--- a/sys/dev/random/nehemiah.c
+++ b/sys/dev/random/nehemiah.c
@@ -43,8 +43,6 @@
#include <dev/random/randomdev.h>
-static void random_nehemiah_init(void);
-static void random_nehemiah_deinit(void);
static u_int random_nehemiah_read(void *, u_int);
static struct random_source random_nehemiah = {
@@ -53,8 +51,6 @@
.rs_read = random_nehemiah_read
};
-static struct fpu_kern_ctx *fpu_ctx_save;
-
/* This H/W source never stores more than 8 bytes in one go */
/* ARGSUSED */
static __inline size_t
@@ -75,20 +71,6 @@
return (0);
}
-static void
-random_nehemiah_init(void)
-{
-
- fpu_ctx_save = fpu_kern_alloc_ctx(FPU_KERN_NORMAL);
-}
-
-static void
-random_nehemiah_deinit(void)
-{
-
- fpu_kern_free_ctx(fpu_ctx_save);
-}
-
/* It is specifically allowed that buf is a multiple of sizeof(long) */
static u_int
random_nehemiah_read(void *buf, u_int c)
@@ -97,14 +79,14 @@
size_t count, ret;
uint64_t tmp;
- fpu_kern_enter(curthread, fpu_ctx_save, FPU_KERN_NORMAL);
+ fpu_kern_enter(curthread, NULL, FPU_KERN_NORMAL | FPU_KERN_NOCTX);
b = buf;
for (count = c; count > 0; count -= ret) {
ret = MIN(VIA_RNG_store(&tmp), count);
memcpy(b, &tmp, ret);
b += ret;
}
- fpu_kern_leave(curthread, fpu_ctx_save);
+ fpu_kern_leave(curthread, NULL);
return (c);
}
@@ -119,13 +101,11 @@
if (via_feature_rng & VIA_HAS_RNG) {
random_source_register(&random_nehemiah);
printf("random: fast provider: \"%s\"\n", random_nehemiah.rs_ident);
- random_nehemiah_init();
}
break;
case MOD_UNLOAD:
if (via_feature_rng & VIA_HAS_RNG) {
- random_nehemiah_deinit();
random_source_deregister(&random_nehemiah);
}
break;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Oct 31, 8:50 AM (5 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41256252
Default Alt Text
D41583.1793436602.diff (1 KB)
Attached To
Mode
D41583: nehemiah RNG: Switch to using FPU_KERN_NOCTX
Attached
Detach File
Event Timeline