geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
SSTIoctl.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 #ifndef SSTIOCTL_HPP_INCLUDE
6 #define SSTIOCTL_HPP_INCLUDE
7 
8 #include <cstdint>
9 
10 #include <memory>
11 #include <vector>
12 
13 namespace geopm
14 {
16  struct sst_version_s {
18  uint16_t driver_version;
22  };
23 
26  uint32_t cpu_index;
27  uint32_t punit_cpu;
28  };
29 
34  uint32_t num_entries;
36  };
37 
40  uint32_t is_write;
41  uint32_t cpu_index;
42  uint32_t register_offset;
43  uint32_t value;
44  };
45 
50  uint32_t num_entries;
52  };
53 
56  uint32_t cpu_index;
57  uint32_t mbox_interface_param; // Parameter to the mbox interface
58  // itself
59  uint32_t write_value; // Mailbox data, or input parameter for a read
60  uint32_t read_value; // Mailbox data (read-only)
61  uint16_t command;
62  uint16_t subcommand;
63  uint32_t reserved;
64  };
65 
70  uint32_t num_entries;
72  };
73 
75  class SSTIoctl
76  {
77  public:
78  virtual ~SSTIoctl() = default;
79 
82  virtual int version(sst_version_s *version) = 0;
83 
88  virtual int get_cpu_id(sst_cpu_map_interface_batch_s *cpu_batch) = 0;
89 
95  virtual int mbox(sst_mbox_interface_batch_s *mbox_batch) = 0;
96 
102  virtual int mmio(sst_mmio_interface_batch_s *mmio_batch) = 0;
103 
106  static std::shared_ptr<SSTIoctl> make_shared(const std::string &path);
107  };
108 }
109 #endif
Defines functions that interact directly with SST ioctls.
Definition: SSTIoctl.hpp:76
virtual int mbox(sst_mbox_interface_batch_s *mbox_batch)=0
Interact with the SST mailbox. This may be for send or receive operations.
virtual ~SSTIoctl()=default
virtual int mmio(sst_mmio_interface_batch_s *mmio_batch)=0
Interact with the SST MMIO interface. This may be for read or write operations.
static std::shared_ptr< SSTIoctl > make_shared(const std::string &path)
create an object to interact with this interface.
Definition: SSTIoctl.cpp:27
virtual int get_cpu_id(sst_cpu_map_interface_batch_s *cpu_batch)=0
Get mappings of logical CPUs to punit CPUs.
virtual int version(sst_version_s *version)=0
Send an ioctl to the SST version interface.
Definition: Agg.cpp:20
Definition: SSTIoctl.hpp:33
sst_cpu_map_interface_s interfaces[1]
Definition: SSTIoctl.hpp:35
uint32_t num_entries
Definition: SSTIoctl.hpp:34
A single mapping of logical CPU index to punit CPU.
Definition: SSTIoctl.hpp:25
uint32_t punit_cpu
Definition: SSTIoctl.hpp:27
uint32_t cpu_index
Definition: SSTIoctl.hpp:26
Definition: SSTIoctl.hpp:69
uint32_t num_entries
Definition: SSTIoctl.hpp:70
sst_mbox_interface_s interfaces[1]
Definition: SSTIoctl.hpp:71
A single mailbox operation.
Definition: SSTIoctl.hpp:55
uint32_t mbox_interface_param
Definition: SSTIoctl.hpp:57
uint32_t write_value
Definition: SSTIoctl.hpp:59
uint16_t subcommand
Definition: SSTIoctl.hpp:62
uint32_t reserved
Definition: SSTIoctl.hpp:63
uint32_t read_value
Definition: SSTIoctl.hpp:60
uint16_t command
Definition: SSTIoctl.hpp:61
uint32_t cpu_index
Definition: SSTIoctl.hpp:56
Definition: SSTIoctl.hpp:49
sst_mmio_interface_s interfaces[1]
Definition: SSTIoctl.hpp:51
uint32_t num_entries
Definition: SSTIoctl.hpp:50
A single MMIO operation.
Definition: SSTIoctl.hpp:39
uint32_t value
Definition: SSTIoctl.hpp:43
uint32_t is_write
Definition: SSTIoctl.hpp:40
uint32_t cpu_index
Definition: SSTIoctl.hpp:41
uint32_t register_offset
Definition: SSTIoctl.hpp:42
SST Version information.
Definition: SSTIoctl.hpp:16
uint8_t is_mmio_supported
Definition: SSTIoctl.hpp:21
uint16_t interface_version
Definition: SSTIoctl.hpp:17
uint16_t batch_command_limit
Definition: SSTIoctl.hpp:19
uint16_t driver_version
Definition: SSTIoctl.hpp:18
uint8_t is_mbox_supported
Definition: SSTIoctl.hpp:20