| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: rnd.h,v 1.24 2011/11/26 01:17:17 tls Exp $ */ | | 1 | /* $NetBSD: rnd.h,v 1.25 2011/11/28 08:00:48 tls Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1997 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Michael Graff <explorer@flame.org>. This code uses ideas and | | 8 | * by Michael Graff <explorer@flame.org>. This code uses ideas and |
9 | * algorithms from the Linux driver written by Ted Ts'o. | | 9 | * algorithms from the Linux driver written by Ted Ts'o. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -179,26 +179,28 @@ void rndpool_add_data(rndpool_t *, void | | | @@ -179,26 +179,28 @@ void rndpool_add_data(rndpool_t *, void |
179 | uint32_t rndpool_extract_data(rndpool_t *, void *, uint32_t, uint32_t); | | 179 | uint32_t rndpool_extract_data(rndpool_t *, void *, uint32_t, uint32_t); |
180 | void rnd_init(void); | | 180 | void rnd_init(void); |
181 | void rnd_add_uint32(krndsource_t *, uint32_t); | | 181 | void rnd_add_uint32(krndsource_t *, uint32_t); |
182 | void rnd_add_data(krndsource_t *, const void *const, uint32_t, | | 182 | void rnd_add_data(krndsource_t *, const void *const, uint32_t, |
183 | uint32_t); | | 183 | uint32_t); |
184 | uint32_t rnd_extract_data(void *, uint32_t, uint32_t); | | 184 | uint32_t rnd_extract_data(void *, uint32_t, uint32_t); |
185 | void rnd_attach_source(krndsource_t *, const char *, | | 185 | void rnd_attach_source(krndsource_t *, const char *, |
186 | uint32_t, uint32_t); | | 186 | uint32_t, uint32_t); |
187 | void rnd_detach_source(krndsource_t *); | | 187 | void rnd_detach_source(krndsource_t *); |
188 | | | 188 | |
189 | void rndsink_attach(rndsink_t *); | | 189 | void rndsink_attach(rndsink_t *); |
190 | void rndsink_detach(rndsink_t *); | | 190 | void rndsink_detach(rndsink_t *); |
191 | | | 191 | |
| | | 192 | void rnd_seed(void *, size_t); |
| | | 193 | |
192 | #endif /* _KERNEL */ | | 194 | #endif /* _KERNEL */ |
193 | | | 195 | |
194 | #define RND_MAXSTATCOUNT 10 /* 10 sources at once max */ | | 196 | #define RND_MAXSTATCOUNT 10 /* 10 sources at once max */ |
195 | | | 197 | |
196 | /* | | 198 | /* |
197 | * return "count" random entries, starting at "start" | | 199 | * return "count" random entries, starting at "start" |
198 | */ | | 200 | */ |
199 | typedef struct { | | 201 | typedef struct { |
200 | uint32_t start; | | 202 | uint32_t start; |
201 | uint32_t count; | | 203 | uint32_t count; |
202 | rndsource_t source[RND_MAXSTATCOUNT]; | | 204 | rndsource_t source[RND_MAXSTATCOUNT]; |
203 | } rndstat_t; | | 205 | } rndstat_t; |
204 | | | 206 | |