xref: /haiku/src/add-ons/kernel/bus_managers/random/yarrow_rng.h (revision 899e0ef82b5624ace2ccfa5f5a58c8ebee54aaef)
1 /*
2  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Jérôme Duval, korli@berlios.de
7  */
8 #ifndef _YARROW_RNG_H
9 #define _YARROW_RNG_H
10 
11 
12 #include <OS.h>
13 
14 #include "random.h"
15 
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 status_t yarrow_init();
22 void yarrow_uninit();
23 void yarrow_enqueue_randomness(const uint64 value);
24 
25 status_t yarrow_rng_read(void* cookie, void *_buffer, size_t *_numBytes);
26 status_t yarrow_rng_write(void* cookie, const void *_buffer, size_t *_numBytes);
27 
28 
29 #define RANDOM_INIT yarrow_init
30 #define RANDOM_UNINIT yarrow_uninit
31 #define RANDOM_ENQUEUE yarrow_enqueue_randomness
32 #define RANDOM_READ yarrow_rng_read
33 #define RANDOM_WRITE yarrow_rng_write
34 
35 
36 #ifdef __cplusplus
37 }
38 #endif
39 
40 
41 #endif /* _YARROW_RNG_H */
42