summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/null_entropy.h
diff options
context:
space:
mode:
authorMichael Brown2018-03-20 19:42:39 +0100
committerMichael Brown2018-03-20 19:56:01 +0100
commit0d35411f88dd37dda755d52b4549337f8299c698 (patch)
tree9129fb0cee236f97af83024b5910cb2cb2b83b08 /src/include/ipxe/null_entropy.h
parent[golan] Set log_max_qp to 1 (diff)
downloadipxe-0d35411f88dd37dda755d52b4549337f8299c698.tar.gz
ipxe-0d35411f88dd37dda755d52b4549337f8299c698.tar.xz
ipxe-0d35411f88dd37dda755d52b4549337f8299c698.zip
[rng] Use fixed-point calculations for min-entropy quantities
We currently perform various min-entropy calculations using build-time floating-point arithmetic. No floating-point code ends up in the final binary, since the results are eventually converted to integers and asserted to be compile-time constants. Though this mechanism is undoubtedly cute, it inhibits us from using "-mno-sse" to prevent the use of SSE registers by the compiler. Fix by using fixed-point arithmetic instead. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/null_entropy.h')
-rw-r--r--src/include/ipxe/null_entropy.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/ipxe/null_entropy.h b/src/include/ipxe/null_entropy.h
index 91adefa69..5a6bb6218 100644
--- a/src/include/ipxe/null_entropy.h
+++ b/src/include/ipxe/null_entropy.h
@@ -30,14 +30,14 @@ ENTROPY_INLINE ( null, entropy_disable ) ( void ) {
/* Do nothing */
}
-static inline __always_inline double
+static inline __always_inline min_entropy_t
ENTROPY_INLINE ( null, min_entropy_per_sample ) ( void ) {
/* Actual amount of min-entropy is zero. To avoid
* division-by-zero errors and to allow compilation of
* entropy-consuming code, pretend to have 1 bit of entropy in
* each sample.
*/
- return 1.0;
+ return MIN_ENTROPY ( 1.0 );
}
static inline __always_inline int