mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
lib: add rand() function
It's a PRNG using the simple and fast xorshift method. Signed-off-by: Michael Walle <michael@walle.cc> Cc: Wolfgang Denk <wd@denx.de>
This commit is contained in:
parent
d131ad68c6
commit
9acf1ca50d
3 changed files with 57 additions and 0 deletions
|
@ -760,6 +760,14 @@ char * strmhz(char *buf, unsigned long hz);
|
|||
/* lib/crc32.c */
|
||||
#include <u-boot/crc.h>
|
||||
|
||||
/* lib/rand.c */
|
||||
#ifdef CONFIG_RANDOM_MACADDR
|
||||
#define RAND_MAX -1U
|
||||
void srand(unsigned int seed);
|
||||
unsigned int rand(void);
|
||||
unsigned int rand_r(unsigned int *seedp);
|
||||
#endif
|
||||
|
||||
/* common/console.c */
|
||||
int console_init_f(void); /* Before relocation; uses the serial stuff */
|
||||
int console_init_r(void); /* After relocation; uses the console stuff */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue