Initial commit
This commit is contained in:
meta-luxshare/meta-common/recipes-luxshare/ipmi-lux-oem/ipmi-standard-override/ipmi-override-app.cpp
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#include "ipmi-standard-override.hpp"
|
||||
|
||||
void register_ipmi_override_functions() __attribute__((constructor));
|
||||
|
||||
auto ipmiAppGetSelfTestResultsOverride() -> ipmi::RspType<uint8_t, uint8_t> {
|
||||
// Byte 2:
|
||||
// 55h - No error.
|
||||
// 56h - Self Test function not implemented in this controller.
|
||||
// 57h - Corrupted or inaccesssible data or devices.
|
||||
// 58h - Fatal hardware error.
|
||||
// FFh - reserved.
|
||||
// all other: Device-specific 'internal failure'.
|
||||
// Byte 3:
|
||||
// For byte 2 = 55h, 56h, FFh: 00h
|
||||
// For byte 2 = 58h, all other: Device-specific
|
||||
// For byte 2 = 57h: self-test error bitfield.
|
||||
// Note: returning 57h does not imply that all test were run.
|
||||
// [7] 1b = Cannot access SEL device.
|
||||
// [6] 1b = Cannot access SDR Repository.
|
||||
// [5] 1b = Cannot access BMC FRU device.
|
||||
// [4] 1b = IPMB signal lines do not respond.
|
||||
// [3] 1b = SDR Repository empty.
|
||||
// [2] 1b = Internal Use Area of BMC FRU corrupted.
|
||||
// [1] 1b = controller update 'boot block' firmware corrupted.
|
||||
// [0] 1b = controller operational firmware corrupted.
|
||||
constexpr uint8_t noError = 0x55;
|
||||
constexpr uint8_t bmcOK = 0x55;
|
||||
return ipmi::responseSuccess(noError, bmcOK);
|
||||
}
|
||||
|
||||
void register_ipmi_override_functions() {
|
||||
|
||||
// <Get Self Test Results>
|
||||
ipmi::registerHandler(ipmi::prioOverride, ipmi::netFnApp,
|
||||
ipmi::app::cmdGetSelfTestResults, ipmi::Privilege::User,
|
||||
ipmiAppGetSelfTestResultsOverride);
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
#include <ipmid/api.hpp>
|
||||
#include <ipmid/message.hpp>
|
||||
#include <ipmid/utils.hpp>
|
||||
#include <sdbusplus/message/types.hpp>
|
||||
|
||||
namespace ipmi {
|
||||
constexpr int prioOverride = ipmi::prioMax;
|
||||
namespace ipmiOverride {} // namespace ipmiOverride
|
||||
} // namespace ipmi
|
||||
Executable
+60
@@ -0,0 +1,60 @@
|
||||
project(
|
||||
'ipmi-oem',
|
||||
'cpp',
|
||||
version: '0.1',
|
||||
meson_version: '>=1.1.1',
|
||||
default_options: [
|
||||
'werror=true',
|
||||
'warning_level=3',
|
||||
'cpp_std=c++23',
|
||||
])
|
||||
|
||||
root = meson.current_source_dir()
|
||||
root_inc = include_directories('.')
|
||||
cpp = meson.get_compiler('cpp')
|
||||
add_project_arguments(
|
||||
cpp.get_supported_arguments([
|
||||
'-DBOOST_ERROR_CODE_HEADER_ONLY',
|
||||
'-DBOOST_SYSTEM_NO_DEPRECATED',
|
||||
'-DBOOST_COROUTINES_NO_DEPRECATION_WARNING',
|
||||
'-DBOOST_ASIO_DISABLE_THREADS',
|
||||
'-DBOOST_ALL_NO_LIB',
|
||||
]),
|
||||
language : 'cpp')
|
||||
|
||||
add_project_arguments(
|
||||
cpp.get_supported_arguments([
|
||||
'-Wno-psabi',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-pedantic',
|
||||
'-Wno-non-virtual-dtor'
|
||||
]),
|
||||
language: 'cpp')
|
||||
|
||||
phosphor_logging_dep = dependency('phosphor-logging')
|
||||
phosphor_dbus_interfaces_dep = dependency('phosphor-dbus-interfaces')
|
||||
systemd = dependency('systemd')
|
||||
boost_coroutine = cpp.find_library('boost_coroutine', required: true)
|
||||
sdbusplus_dep = dependency('sdbusplus')
|
||||
ipmid_dep = dependency('libipmid')
|
||||
libs = declare_dependency(
|
||||
include_directories: root_inc,
|
||||
dependencies: [
|
||||
phosphor_dbus_interfaces_dep,
|
||||
phosphor_logging_dep,
|
||||
sdbusplus_dep,
|
||||
ipmid_dep,
|
||||
systemd
|
||||
])
|
||||
|
||||
ipmi_override_lib = library(
|
||||
'ipmioverride',
|
||||
'ipmi-override-app.cpp',
|
||||
implicit_include_directories: false,
|
||||
dependencies: libs,
|
||||
version: meson.project_version(),
|
||||
override_options: ['b_lundef=false'],
|
||||
install: true,
|
||||
install_dir: get_option('libdir') / 'ipmid-providers')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user