1 #ifndef __ASM_RANDOM_H__
2 #define __ASM_RANDOM_H__
3 
4 #include <asm/processor.h>
5 
arch_get_random(void)6 static inline unsigned int arch_get_random(void)
7 {
8     unsigned int val = 0;
9 
10     if ( cpu_has(&current_cpu_data, X86_FEATURE_RDRAND) )
11         asm volatile ( ".byte 0x0f,0xc7,0xf0" : "+a" (val) );
12 
13     return val;
14 }
15 
16 #endif /* __ASM_RANDOM_H__ */
17