diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-11-08 19:02:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2013-07-25 10:24:16 +0200 |
commit | 50f75a1a0e3c51fca1576bd41588d6e71caff02e (patch) | |
tree | 962ab1e2d69db1dc451a19e7185fdeda9c2ed924 /include/stdlib.h | |
parent | 10f7528afbc9dfa232c02f8a2b45857858fc64b4 (diff) | |
download | barebox-50f75a1a0e3c51fca1576bd41588d6e71caff02e.tar.gz barebox-50f75a1a0e3c51fca1576bd41588d6e71caff02e.tar.xz |
UBI: reimport UBI from Linux v3.10
This is a fresh UBI import from Linux v3.10
This is done mainly to get fastmap support.
This was tested with the i.MX nand driver, the MXS nand driver and
on CFI NOR flash.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/stdlib.h')
-rw-r--r-- | include/stdlib.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/stdlib.h b/include/stdlib.h index dc720132e8..07d6e582a7 100644 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -10,7 +10,15 @@ unsigned int rand(void); void srand(unsigned int seed); /* fill a buffer with pseudo-random data */ -void get_random_bytes(char *buf, int len); +void get_random_bytes(void *buf, int len); +static inline u32 random32(void) +{ + u32 ret; + + get_random_bytes(&ret, 4); + + return ret; +} #endif /* __STDLIB_H */ |