github.com/u-root/u-root@v7.0.1-0.20200915234505-ad7babab0a8e+incompatible/pkg/msr/msr.go (about)

     1  // Copyright 2012-2020 the u-root Authors. All rights reserved
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package msr
     6  
     7  // MSR defines an MSR address.
     8  type MSR uint32
     9  
    10  // MSRVal defines an MSR Value to be used in TestAndSet, Test, and other
    11  // operations.
    12  type MSRVal struct {
    13  	// Addr is the address of the MSR.
    14  	Addr MSR
    15  	// Name is a printable name.
    16  	Name string
    17  	// Clear are bits to clear in TestAndSet and Test.
    18  	Clear uint64
    19  	// Set are bits to set in TestAndSet and Test; or the value to write
    20  	// if the MSR is writeonly.
    21  	Set uint64
    22  	// WriteOnly indicats an MSR is writeonly.
    23  	WriteOnly bool
    24  }
    25  
    26  // String implements String() for MSRVal
    27  func (m MSRVal) String() string {
    28  	return m.Name
    29  }
    30  
    31  // Debug can be set for debug prints on MSR operaitons.
    32  // It can be set to, e.g., log.Printf.
    33  // It's default action is to do nothing.
    34  var Debug = func(string, ...interface{}) {}