6 * Model-specific registers
10 FILE_LICENCE ( GPL2_OR_LATER );
13 * Read model-specific register
15 * @v msr Model-specific register
18 static inline __attribute__ (( always_inline )) uint64_t
19 rdmsr ( unsigned int msr ) {
23 __asm__ __volatile__ ( "rdmsr" :
24 "=d" ( high ), "=a" ( low ) : "c" ( msr ) );
25 return ( ( ( ( uint64_t ) high ) << 32 ) | low );
29 * Write model-specific register
31 * @v msr Model-specific register
34 static inline __attribute__ (( always_inline )) void
35 wrmsr ( unsigned int msr, uint64_t value ) {
36 uint32_t high = ( value >> 32 );
37 uint32_t low = ( value >> 0 );
39 __asm__ __volatile__ ( "wrmsr" : :
40 "c" ( msr ), "d" ( high ), "a" ( low ) );
43 #endif /* _IPXE_MSR_H */