diff options
Diffstat (limited to 'sys/dev/random/yarrow.h')
-rw-r--r-- | sys/dev/random/yarrow.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sys/dev/random/yarrow.h b/sys/dev/random/yarrow.h index 9ba0b4e..a08d107 100644 --- a/sys/dev/random/yarrow.h +++ b/sys/dev/random/yarrow.h @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2000-2013 Mark R V Murray + * Copyright (c) 2000-2015 Mark R V Murray * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -27,18 +27,21 @@ */ #ifndef SYS_DEV_RANDOM_YARROW_H_INCLUDED -#define SYS_DEV_RANDOM_YARROW_H_INCLUDED +#define SYS_DEV_RANDOM_YARROW_H_INCLUDED #ifdef _KERNEL typedef struct mtx mtx_t; +#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&yarrow_state.ys_mtx, "reseed mutex", NULL, MTX_DEF) +#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_LOCK(x) mtx_lock(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) mtx_assert(&yarrow_state.ys_mtx, MA_OWNED) +#else +#define RANDOM_RESEED_INIT_LOCK(x) mtx_init(&yarrow_state.ys_mtx, mtx_plain) +#define RANDOM_RESEED_DEINIT_LOCK(x) mtx_destroy(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_LOCK(x) mtx_lock(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_UNLOCK(x) mtx_unlock(&yarrow_state.ys_mtx) +#define RANDOM_RESEED_ASSERT_LOCK_OWNED(x) #endif -void random_yarrow_init_alg(void); -void random_yarrow_deinit_alg(void); -void random_yarrow_read(uint8_t *, u_int); -void random_yarrow_write(uint8_t *, u_int); -void random_yarrow_reseed(void); -int random_yarrow_seeded(void); -void random_yarrow_process_event(struct harvest_event *event); - -#endif +#endif /* SYS_DEV_RANDOM_YARROW_H_INCLUDED */ |