aboutsummaryrefslogtreecommitdiff
path: root/sys/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys')
-rw-r--r--sys/sys/prng.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/sys/prng.h b/sys/sys/prng.h
new file mode 100644
index 000000000000..a1abe6ad1a11
--- /dev/null
+++ b/sys/sys/prng.h
@@ -0,0 +1,20 @@
+/*-
+ * This file is in the public domain.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef _SYS_PRNG_H_
+#define _SYS_PRNG_H_
+
+#define PCG_USE_INLINE_ASM 1
+#include <contrib/pcg-c/include/pcg_variants.h>
+
+#ifdef _KERNEL
+__uint32_t prng32(void);
+__uint32_t prng32_bounded(__uint32_t bound);
+__uint64_t prng64(void);
+__uint64_t prng64_bounded(__uint64_t bound);
+#endif
+
+#endif