mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-04 14:00:19 +00: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;
 | 
						|
}
 |