Patrick Venture | 148cd65 | 2018-11-06 10:59:47 -0800 | [diff] [blame] | 1 | #include "config.h" |
| 2 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 3 | #include "firmware_handler.hpp" |
| 4 | |
| 5 | #include <blobs-ipmid/manager.hpp> |
| 6 | #include <memory> |
| 7 | #include <phosphor-logging/log.hpp> |
| 8 | |
| 9 | namespace blobs |
| 10 | { |
| 11 | using namespace phosphor::logging; |
| 12 | |
Patrick Venture | 148cd65 | 2018-11-06 10:59:47 -0800 | [diff] [blame] | 13 | std::vector<std::string> supportedFirmware = { |
| 14 | "/flash/hash", |
| 15 | #ifdef ENABLE_STATIC_LAYOUT |
| 16 | "/flash/image", |
| 17 | #endif |
| 18 | }; |
| 19 | |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 20 | void setupFirmwareHandler() __attribute__((constructor)); |
| 21 | |
| 22 | void setupFirmwareHandler() |
| 23 | { |
| 24 | auto* manager = getBlobManager(); |
Patrick Venture | 68cf64f | 2018-11-06 10:46:51 -0800 | [diff] [blame] | 25 | if (!manager->registerHandler( |
Patrick Venture | 148cd65 | 2018-11-06 10:59:47 -0800 | [diff] [blame] | 26 | FirmwareBlobHandler::CreateFirmwareBlobHandler(supportedFirmware))) |
Patrick Venture | c7ca291 | 2018-11-02 11:38:33 -0700 | [diff] [blame] | 27 | { |
| 28 | log<level::ERR>("Failed to register Firmware Handler"); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | } // namespace blobs |