iPXE
Functions | Variables
msr.h File Reference

Model-specific registers. More...

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
 
static __attribute__ ((always_inline)) uint64_t rdmsr(unsigned int msr)
 Read model-specific register. More...
 

Variables

static uint64_t value
 

Detailed Description

Model-specific registers.

Definition in file msr.h.

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )

◆ __attribute__()

static __attribute__ ( (always_inline)  )
inlinestatic

Read model-specific register.

Write model-specific register.

Parameters
msrModel-specific register
Return values
valueValue
Parameters
msrModel-specific register
valueValue

Definition at line 18 of file msr.h.

19  {
21 
22  __asm__ __volatile__ ( "rdmsr" : "=A" ( value ) : "c" ( msr ) );
23  return value;
24 }
unsigned long long uint64_t
Definition: stdint.h:13
static uint64_t value
Definition: msr.h:33
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__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")

References __asm__(), __volatile__(), and value.

Variable Documentation

◆ value

uint64_t value
Initial value:
{
__asm__ __volatile__ ( "wrmsr" : : "c" ( msr ), "A" ( value ) )
static uint64_t value
Definition: msr.h:33
__asm__ __volatile__("\n1:\n\t" "movb -1(%3,%1), %%al\n\t" "stosb\n\t" "loop 1b\n\t" "xorl %%eax, %%eax\n\t" "mov %4, %1\n\t" "rep stosb\n\t" :"=&D"(discard_D), "=&c"(discard_c), "+m"(*value) :"r"(data), "g"(pad_len), "0"(value0), "1"(len) :"eax")
__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")

Definition at line 33 of file msr.h.

Referenced by __attribute__().