Go to the documentation of this file.
40 #include "debug/SCMI.hh"
53 vendor(platform.params().base_vendor),
54 subvendor(platform.params().base_subvendor),
55 implementationVersion(platform.params().base_impl_version)
58 "Invalid BASE_PROTOCOL VENDOR size\n");
60 "Invalid BASE_PROTOCOL SUBVENDOR size\n");
69 DPRINTF(
SCMI,
"# Message Protocol = BASE_PROTOCOL\n");
72 switch (
static_cast<Commands>(message_id)) {
103 warn(
"Unimplemented SCMI command: %u\n", message_id);
110 auto& payload = msg.
payload.baseProtocolVersion;
115 msg.
length =
sizeof(uint32_t) * 3;
121 uint32_t _attributes = 0;
126 auto& payload = msg.
payload.baseProtocolAttributes;
128 payload.attributes = _attributes;
131 msg.
length =
sizeof(uint32_t) * 3;
137 switch (message_id) {
155 auto& payload = msg.
payload.baseProtocolMessageAttributes;
156 const auto message_id =
static_cast<Commands>(
166 payload.attributes = 0;
169 msg.
length =
sizeof(uint32_t) * 3;
175 auto& payload = msg.
payload.baseDiscoverVendor;
178 auto vendor_size =
vendor.copy(
182 msg.
length =
sizeof(uint32_t) * 2 + vendor_size;
188 auto& payload = msg.
payload.baseDiscoverSubVendor;
195 msg.
length =
sizeof(uint32_t) * 2 + subvendor_size;
201 auto& payload = msg.
payload.baseDiscoverImplementationVersion;
206 msg.
length =
sizeof(uint32_t) * 3;
212 auto& payload = msg.
payload.baseDiscoverListProtocols;
213 const uint32_t skip = payload.skip;
216 if (skip > num_protocols) {
218 msg.
length =
sizeof(uint32_t) * 2;
222 auto *protocols = (uint8_t*)payload.protocols;
223 uint32_t num_implemented = 0;
225 for (
auto protoc_id =
START + skip; protoc_id <=
END; protoc_id++) {
226 auto it = protocol_list.find(protoc_id);
227 if (it != protocol_list.end()) {
230 *protocols = it->first;
236 payload.numProtocols = num_implemented;
239 msg.
length =
sizeof(uint32_t) * 3;
246 auto& payload = msg.
payload.baseDiscoverAgent;
247 const uint32_t agent_id = payload.agentId;
251 msg.
length =
sizeof(uint32_t) * 2;
255 auto agent_name = std::string();
262 agent_name =
"platform";
265 agent_size = agent_name.length();
267 strncpy((
char *)&payload.name,
268 agent_name.c_str(), agent_size);
272 msg.
length =
sizeof(uint32_t) * 2 + agent_size;
279 auto& payload = msg.
payload.invalidCommand;
281 msg.
length =
sizeof(uint32_t) * 2;
const std::string name() const
@ DISCOVER_IMPLEMENTATION_VERSION
BaseProtocol(Platform &_platform)
@ DISCOVER_LIST_PROTOCOLS
const uint32_t implementationVersion
void discoverImplVersion(Message &msg)
@ RESET_AGENT_CONFIGURATION
bool implementedProtocol(Commands message_id) const
static const uint32_t PROTOCOL_VERSION
void discoverAgent(Message &msg)
@ SET_PROTOCOL_PERMISSIONS
static const uint32_t MAX_STRING_SIZE
void discoverListProtocols(Message &msg)
const std::string subvendor
void messageAttributes(Message &msg) override
void discoverVendor(Message &msg)
virtual const std::string name() const
void discoverSubVendor(Message &msg)
void invalidCommand(Message &msg)
void version(Message &msg) override
void handleMessage(Message &msg) override
#define fatal_if(cond,...)
Conditional fatal macro that checks the supplied condition and only causes a fatal error if the condi...
void attributes(Message &msg) override
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Generated on Tue Mar 23 2021 19:41:25 for gem5 by doxygen 1.8.17