Patrick Venture | e772842 | 2018-11-14 20:16:33 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <cstdint> |
| 4 | #include <utility> |
| 5 | |
| 6 | namespace blobs |
| 7 | { |
| 8 | |
| 9 | /** |
| 10 | * Different LPC memory map implementations may require different mechanisms for |
| 11 | * specific tasks such as mapping the memory window. |
| 12 | */ |
| 13 | class LpcMapperInterface |
| 14 | { |
| 15 | public: |
| 16 | virtual ~LpcMapperInterface() = default; |
| 17 | |
| 18 | /** |
| 19 | * Returns a windowOffset and windowSize if the requested window was mapped. |
| 20 | * |
| 21 | * TODO: If the length requested is too large, windowSize will be written |
| 22 | * with the max size that the BMC can map and returns false. |
| 23 | * |
| 24 | * @param[in] address - The address for mapping (passed to LPC window) |
| 25 | * @param[in] length - The length of the region |
| 26 | * @return windowOffset, windowSize - The offset into the window and |
| 27 | * length of the region. On failure, length is set to 0. |
| 28 | */ |
| 29 | virtual std::pair<std::uint32_t, std::uint32_t> |
| 30 | mapWindow(std::uint32_t address, std::uint32_t length) = 0; |
| 31 | }; |
| 32 | |
| 33 | } // namespace blobs |