You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

msr.h 709B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _IPXE_MSR_H
  2. #define _IPXE_MSR_H
  3. /** @file
  4. *
  5. * Model-specific registers
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. /**
  10. * Read model-specific register
  11. *
  12. * @v msr Model-specific register
  13. * @ret value Value
  14. */
  15. static inline __attribute__ (( always_inline )) uint64_t
  16. rdmsr ( unsigned int msr ) {
  17. uint64_t value;
  18. __asm__ __volatile__ ( "rdmsr" : "=A" ( value ) : "c" ( msr ) );
  19. return value;
  20. }
  21. /**
  22. * Write model-specific register
  23. *
  24. * @v msr Model-specific register
  25. * @v value Value
  26. */
  27. static inline __attribute__ (( always_inline )) void
  28. wrmsr ( unsigned int msr, uint64_t value ) {
  29. __asm__ __volatile__ ( "wrmsr" : : "c" ( msr ), "A" ( value ) );
  30. }
  31. #endif /* _IPXE_MSR_H */