blob: 852d8462b19f31a26775a472aec23aa771a502e5 [file] [log] [blame]
Patrick Venture1cde5f92018-11-07 08:26:47 -08001#include "pci_handler.hpp"
2
3#include <cstdint>
Patrick Venturea8a99ae2018-11-09 11:14:58 -08004#include <cstring>
Patrick Venture1cde5f92018-11-07 08:26:47 -08005#include <vector>
6
7namespace blobs
8{
9
10std::vector<std::uint8_t> PciDataHandler::copyFrom(std::uint32_t length)
11{
12 /* TODO: implement this. */
13 return {};
14}
15
Patrick Venture8c535332018-11-08 15:58:00 -080016bool PciDataHandler::write(const std::vector<std::uint8_t>& configuration)
17{
18 /* PCI handler doesn't require configuration write, only read. */
19 return false;
20}
21
22std::vector<std::uint8_t> PciDataHandler::read()
23{
24 /* PCI handler does require returning a configuration from read. */
25 struct PciConfigResponse reply;
26 reply.address = 0;
27
28 std::vector<std::uint8_t> bytes;
29 bytes.resize(sizeof(reply));
Patrick Venturea8a99ae2018-11-09 11:14:58 -080030 std::memcpy(bytes.data(), &reply, sizeof(reply));
Patrick Venture8c535332018-11-08 15:58:00 -080031
32 return bytes;
33}
34
Patrick Venture1cde5f92018-11-07 08:26:47 -080035} // namespace blobs