Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "data_handler.hpp" |
| 4 | |
| 5 | #include <cstdint> |
| 6 | #include <vector> |
| 7 | |
| 8 | namespace blobs |
| 9 | { |
| 10 | |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame^] | 11 | /** P2A configuration response. */ |
| 12 | struct PciConfigResponse |
| 13 | { |
| 14 | std::uint32_t address; |
| 15 | } __attribute__((packed)); |
| 16 | |
| 17 | /** |
| 18 | * Data handler for reading and writing data via the P2A bridge. |
| 19 | */ |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 20 | class PciDataHandler : public DataInterface |
| 21 | { |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 22 | public: |
| 23 | PciDataHandler() = default; |
| 24 | |
| 25 | std::vector<std::uint8_t> copyFrom(std::uint32_t length) override; |
Patrick Venture | 8c53533 | 2018-11-08 15:58:00 -0800 | [diff] [blame^] | 26 | bool write(const std::vector<std::uint8_t>& configuration) override; |
| 27 | std::vector<std::uint8_t> read() override; |
Patrick Venture | 1cde5f9 | 2018-11-07 08:26:47 -0800 | [diff] [blame] | 28 | }; |
| 29 | |
| 30 | } // namespace blobs |