summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/mach-sandbox/include/mach/linux.h
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2019-09-09 11:31:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-09 15:23:42 +0200
commit9feb86e11d491981c0848a8923d0407d2f9abf0d (patch)
treebea1e5885737372d4b036ec7d771c9cb771960d9 /arch/sandbox/mach-sandbox/include/mach/linux.h
parentc7d68aad12e739be7793b37ff4e02479883d7707 (diff)
downloadbarebox-9feb86e11d491981c0848a8923d0407d2f9abf0d.tar.gz
barebox-9feb86e11d491981c0848a8923d0407d2f9abf0d.tar.xz
hwrng: add sandbox driver interface to host /dev/random
Linux as well as other operating systems can provide /dev/random and /dev/urandom device to service userspace need for randomness. Add a driver to use /dev/random for blocking and /dev/urandom for non-blocking barebox random numbers. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/mach-sandbox/include/mach/linux.h')
-rw-r--r--arch/sandbox/mach-sandbox/include/mach/linux.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/sandbox/mach-sandbox/include/mach/linux.h b/arch/sandbox/mach-sandbox/include/mach/linux.h
index c344285473..1e64d41c6a 100644
--- a/arch/sandbox/mach-sandbox/include/mach/linux.h
+++ b/arch/sandbox/mach-sandbox/include/mach/linux.h
@@ -51,4 +51,11 @@ void barebox_libftdi1_gpio_set_value(struct ft2232_bitbang *ftbb,
int barebox_libftdi1_update(struct ft2232_bitbang *ftbb);
void barebox_libftdi1_close(void);
+typedef struct {
+ int randomfd;
+ int urandomfd;
+} devrandom_t;
+devrandom_t *devrandom_init(void);
+int devrandom_read(devrandom_t *devrandom, void *buf, size_t len, int wait);
+
#endif /* __ASM_ARCH_LINUX_H */