iPXE
msr.h
Go to the documentation of this file.
1#ifndef _IPXE_MSR_H
2#define _IPXE_MSR_H
3
4/** @file
5 *
6 * Model-specific registers
7 *
8 */
9
10FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
11
12/**
13 * Read model-specific register
14 *
15 * @v msr Model-specific register
16 * @ret value Value
17 */
18static inline __attribute__ (( always_inline )) uint64_t
19rdmsr ( unsigned int msr ) {
21
22 __asm__ __volatile__ ( "rdmsr" : "=A" ( value ) : "c" ( msr ) );
23 return value;
24}
25
26/**
27 * Write model-specific register
28 *
29 * @v msr Model-specific register
30 * @v value Value
31 */
32static inline __attribute__ (( always_inline )) void
33wrmsr ( unsigned int msr, uint64_t value ) {
34
35 __asm__ __volatile__ ( "wrmsr" : : "c" ( msr ), "A" ( value ) );
36}
37
38#endif /* _IPXE_MSR_H */
pseudo_bit_t value[0x00020]
Definition arbel.h:2
__asm__ __volatile__("call *%9" :"=a"(result), "=c"(discard_ecx), "=d"(discard_edx) :"d"(0), "a"(code), "b"(0), "c"(in_phys), "D"(0), "S"(out_phys), "m"(hypercall))
unsigned long long uint64_t
Definition stdint.h:13
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define __attribute__(x)
Definition compiler.h:10
__asm__(".section \".rodata\", \"a\", " PROGBITS "\n\t" "\nprivate_key_data:\n\t" ".size private_key_data, ( . - private_key_data )\n\t" ".equ private_key_len, ( . - private_key_data )\n\t" ".previous\n\t")