aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-12-30 17:31:15 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2021-12-30 17:34:05 +0100
commit1790d5670caeec954f8b77338c4e4341eb936faa (patch)
tree6e0413edde994d656e682bdb8b4294323c3e11d1 /main.c
parentDisable turbo during tests (diff)
downloadkbench9000-jd/rng.tar.xz
kbench9000-jd/rng.zip
Adjust for RNGjd/rng
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.c b/main.c
index d538f48..492ddfb 100644
--- a/main.c
+++ b/main.c
@@ -6,12 +6,22 @@
#include <linux/init.h>
#include <linux/module.h>
#include <linux/delay.h>
-#include "function.h"
+#include <linux/random.h>
+
+enum { WARMUP = 50, TRIALS = 1000, IDLE = 1 * 1000 };
static unsigned long stamp = 0;
module_param(stamp, ulong, 0);
int dummy;
+static char dummy_out[64 * 1024];
+
+static int function(void)
+{
+ get_random_bytes(dummy_out, sizeof(dummy_out));
+ return dummy_out[sizeof(dummy_out) - 1];
+}
+
static int __init mod_init(void)
{
int ret = 0, i;