From 9acf1ca50d8b031511d146f6ffd73201fedce28c Mon Sep 17 00:00:00 2001 From: Michael Walle Date: Tue, 5 Jun 2012 11:33:14 +0000 Subject: lib: add rand() function It's a PRNG using the simple and fast xorshift method. Signed-off-by: Michael Walle Cc: Wolfgang Denk --- include/common.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 7cf15c53b..e16c53e53 100644 --- a/include/common.h +++ b/include/common.h @@ -760,6 +760,14 @@ char * strmhz(char *buf, unsigned long hz); /* lib/crc32.c */ #include +/* 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 */ -- cgit v1.2.3-70-g09d2