Files
compute-runtime/level_zero/tools/source/sysman/firmware/firmware_imp.cpp
Vilvaraj, T J Vivek bddc63e8bd add firmware flashing utility interface
Signed-off-by: Vilvaraj, T J Vivek <t.j.vivek.vilvaraj@intel.com>
2020-12-22 09:10:11 +01:00

41 lines
798 B
C++

/*
* Copyright (C) 2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "firmware_imp.h"
#include "shared/source/helpers/debug_helpers.h"
#include "os_firmware.h"
#include <cmath>
namespace L0 {
ze_result_t FirmwareImp::firmwareGetProperties(zes_firmware_properties_t *pProperties) {
pOsFirmware->osGetFwProperties(pProperties);
return ZE_RESULT_SUCCESS;
}
void FirmwareImp::init() {
this->isFirmwareEnabled = pOsFirmware->isFirmwareSupported();
}
FirmwareImp::FirmwareImp(OsSysman *pOsSysman) {
pOsFirmware = OsFirmware::create(pOsSysman);
UNRECOVERABLE_IF(nullptr == pOsFirmware);
init();
}
FirmwareImp::~FirmwareImp() {
if (pOsFirmware != nullptr) {
delete pOsFirmware;
pOsFirmware = nullptr;
}
}
} // namespace L0