geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
MSR.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef MSR_HPP_INCLUDE
7 #define MSR_HPP_INCLUDE
8 
9 #include <string>
10 #include <map>
11 
12 namespace geopm
13 {
16  class MSR
17  {
18  public:
19  enum m_function_e {
20  M_FUNCTION_SCALE, // Only apply scalar value (applied by all functions)
21  M_FUNCTION_LOG_HALF, // 2.0 ^ -X
22  M_FUNCTION_7_BIT_FLOAT, // 2 ^ Y * (1.0 + Z / 4.0) : Y in [0:5), Z in [5:7)
23  M_FUNCTION_LOGIC, // A bit that controls logic
24  M_FUNCTION_OVERFLOW, // Counter that may overflow
26  };
27 
29  static m_function_e string_to_function(const std::string &str);
30  private:
31  static const std::map<std::string, m_function_e> M_FUNCTION_STRING;
32  };
33 }
34 
35 #endif
This class encodes how to access fields within an MSR, but does not hold the state of any registers.
Definition: MSR.hpp:17
m_function_e
Definition: MSR.hpp:19
@ M_FUNCTION_OVERFLOW
Definition: MSR.hpp:24
@ M_FUNCTION_LOGIC
Definition: MSR.hpp:23
@ M_FUNCTION_LOG_HALF
Definition: MSR.hpp:21
@ M_FUNCTION_SCALE
Definition: MSR.hpp:20
@ M_FUNCTION_7_BIT_FLOAT
Definition: MSR.hpp:22
@ M_NUM_FUNCTION
Definition: MSR.hpp:25
static m_function_e string_to_function(const std::string &str)
Convert a string to the corresponding m_function_e value.
Definition: MSR.cpp:20
Definition: Agg.cpp:20