mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-31 18:35:42 +01:00 
			
		
		
		
	After some header file cleanups to add missing include files, remove common.h from all files in the lib directory. This primarily means just dropping the line but in a few cases we need to add in other header files now. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Tom Rini <trini@konsulko.com>
		
			
				
	
	
		
			32 lines
		
	
	
		
			477 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			477 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0+
 | |
| /*
 | |
|  * Simple xorshift PRNG
 | |
|  *   see http://www.jstatsoft.org/v08/i14/paper
 | |
|  *
 | |
|  * Copyright (c) 2012 Michael Walle
 | |
|  * Michael Walle <michael@walle.cc>
 | |
|  */
 | |
| 
 | |
| #include <rand.h>
 | |
| 
 | |
| static unsigned int y = 1U;
 | |
| 
 | |
| unsigned int rand_r(unsigned int *seedp)
 | |
| {
 | |
| 	*seedp ^= (*seedp << 13);
 | |
| 	*seedp ^= (*seedp >> 17);
 | |
| 	*seedp ^= (*seedp << 5);
 | |
| 
 | |
| 	return *seedp;
 | |
| }
 | |
| 
 | |
| unsigned int rand(void)
 | |
| {
 | |
| 	return rand_r(&y);
 | |
| }
 | |
| 
 | |
| void srand(unsigned int seed)
 | |
| {
 | |
| 	y = seed;
 | |
| }
 |