Coverage Report

Created: 2017-10-25 09:10

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