Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Don't inline cprng_strong{32, 64}(), so they can be calle...
details: https://anonhg.NetBSD.org/src/rev/64ee4f35eec6
branches: trunk
changeset: 930687:64ee4f35eec6
user: maxv <maxv%NetBSD.org@localhost>
date: Sun Apr 12 07:16:09 2020 +0000
description:
Don't inline cprng_strong{32,64}(), so they can be called from asm.
diffstat:
sys/kern/subr_cprng.c | 20 ++++++++++++++++++--
sys/sys/cprng.h | 19 +++----------------
2 files changed, 21 insertions(+), 18 deletions(-)
diffs (73 lines):
diff -r 0a274c83f5fb -r 64ee4f35eec6 sys/kern/subr_cprng.c
--- a/sys/kern/subr_cprng.c Sun Apr 12 06:05:34 2020 +0000
+++ b/sys/kern/subr_cprng.c Sun Apr 12 07:16:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_cprng.c,v 1.34 2019/12/04 05:36:34 riastradh Exp $ */
+/* $NetBSD: subr_cprng.c,v 1.35 2020/04/12 07:16:09 maxv Exp $ */
/*-
* Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.34 2019/12/04 05:36:34 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_cprng.c,v 1.35 2020/04/12 07:16:09 maxv Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -251,6 +251,22 @@
return result;
}
+uint32_t
+cprng_strong32(void)
+{
+ uint32_t r;
+ cprng_strong(kern_cprng, &r, sizeof(r), 0);
+ return r;
+}
+
+uint64_t
+cprng_strong64(void)
+{
+ uint64_t r;
+ cprng_strong(kern_cprng, &r, sizeof(r), 0);
+ return r;
+}
+
static void
filt_cprng_detach(struct knote *kn)
{
diff -r 0a274c83f5fb -r 64ee4f35eec6 sys/sys/cprng.h
--- a/sys/sys/cprng.h Sun Apr 12 06:05:34 2020 +0000
+++ b/sys/sys/cprng.h Sun Apr 12 07:16:09 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cprng.h,v 1.15 2019/09/02 20:09:30 riastradh Exp $ */
+/* $NetBSD: cprng.h,v 1.16 2020/04/12 07:16:09 maxv Exp $ */
/*-
* Copyright (c) 2011-2013 The NetBSD Foundation, Inc.
@@ -71,20 +71,7 @@
extern cprng_strong_t *kern_cprng;
-static __inline uint32_t
-cprng_strong32(void)
-{
- uint32_t r;
- cprng_strong(kern_cprng, &r, sizeof(r), 0);
- return r;
-}
-
-static __inline uint64_t
-cprng_strong64(void)
-{
- uint64_t r;
- cprng_strong(kern_cprng, &r, sizeof(r), 0);
- return r;
-}
+uint32_t cprng_strong32(void);
+uint64_t cprng_strong64(void);
#endif /* _CPRNG_H */
Home |
Main Index |
Thread Index |
Old Index