2021-11-26 17:40:06 +08:00
|
|
|
/*
|
2023-02-18 00:53:57 +08:00
|
|
|
* Copyright (C) 2021-2023 Intel Corporation
|
2021-11-26 17:40:06 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-05-18 03:04:23 +08:00
|
|
|
#pragma once
|
|
|
|
|
2023-02-18 00:53:57 +08:00
|
|
|
#include <cstdint>
|
2021-11-26 17:40:06 +08:00
|
|
|
#include <map>
|
2021-12-15 03:01:21 +08:00
|
|
|
#include <poll.h>
|
2021-11-26 17:40:06 +08:00
|
|
|
#include <string>
|
2021-12-15 03:01:21 +08:00
|
|
|
#include <string_view>
|
2021-11-26 17:40:06 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
class PmtUtil {
|
|
|
|
public:
|
|
|
|
static constexpr uint32_t guidStringSize = 16u;
|
|
|
|
static void getTelemNodesInPciPath(std::string_view rootPciPath, std::map<uint32_t, std::string> &telemPciPath);
|
|
|
|
static bool readGuid(std::string_view telemDir, std::array<char, PmtUtil::guidStringSize> &guidString);
|
|
|
|
static bool readOffset(std::string_view telemDir, uint64_t &offset);
|
|
|
|
static ssize_t readTelem(std::string_view telemDir, const std::size_t size, const uint64_t offset, void *data);
|
|
|
|
};
|
|
|
|
|
2022-05-18 03:04:23 +08:00
|
|
|
} // namespace NEO
|