提交 19173fd3 编写于 作者: R Richard Henderson

hw/misc/nrf51_rng: Use qemu_guest_getrandom_nofail

The random number is intended for use by the guest.  As such, we should
honor the -seed argument for reproducibility.  Use the *_nofail routine
instead of error_abort directly.
Reviewed-by: NLaurent Vivier <lvivier@redhat.com>
Reviewed-by: NJoel Stanley <joel@jms.id.au>
Signed-off-by: NRichard Henderson <richard.henderson@linaro.org>
上级 9d44cb5b
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#include "qapi/error.h" #include "qapi/error.h"
#include "hw/arm/nrf51.h" #include "hw/arm/nrf51.h"
#include "hw/misc/nrf51_rng.h" #include "hw/misc/nrf51_rng.h"
#include "crypto/random.h" #include "qemu/guest-random.h"
static void update_irq(NRF51RNGState *s) static void update_irq(NRF51RNGState *s)
{ {
...@@ -145,7 +145,7 @@ static void nrf51_rng_timer_expire(void *opaque) ...@@ -145,7 +145,7 @@ static void nrf51_rng_timer_expire(void *opaque)
{ {
NRF51RNGState *s = NRF51_RNG(opaque); NRF51RNGState *s = NRF51_RNG(opaque);
qcrypto_random_bytes(&s->value, 1, &error_abort); qemu_guest_getrandom_nofail(&s->value, 1);
s->event_valrdy = 1; s->event_valrdy = 1;
qemu_set_irq(s->eep_valrdy, 1); qemu_set_irq(s->eep_valrdy, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册