These changes are the raw update to qemu-2.6.
[kvmfornfv.git] / qemu / roms / ipxe / src / include / ipxe / linux / linux_entropy.h
1 #ifndef _IPXE_LINUX_ENTROPY_H
2 #define _IPXE_LINUX_ENTROPY_H
3
4 /** @file
5  *
6  * /dev/random-based entropy source
7  *
8  */
9
10 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12 #ifdef ENTROPY_LINUX
13 #define ENTROPY_PREFIX_linux
14 #else
15 #define ENTROPY_PREFIX_linux __linux_
16 #endif
17
18 /**
19  * min-entropy per sample
20  *
21  * @ret min_entropy     min-entropy of each sample
22  */
23 static inline __always_inline double
24 ENTROPY_INLINE ( linux, min_entropy_per_sample ) ( void ) {
25
26         /* linux_get_noise() reads a single byte from /dev/random,
27          * which is supposed to block until a sufficient amount of
28          * entropy is available.  We therefore assume that each sample
29          * contains exactly 8 bits of entropy.
30          */
31         return 8.0;
32 }
33
34 #endif /* _IPXE_LINUX_ENTROPY_H */