├── .gitignore ├── .gitmodules ├── CMake ├── Find │ ├── Findmath.cmake │ ├── Findnumactl.cmake │ └── Findsblim-cmpi.cmake └── setup.cmake ├── CMakeLists.txt ├── CMakeSettings.json ├── CppProperties.json ├── LICENSE ├── README.md ├── build_win.cmd ├── debian ├── README.Debian ├── changelog ├── clean ├── compat ├── control ├── copyright ├── ixpdimm-cli.install ├── ixpdimm-data.install ├── ixpdimm-monitor.install ├── libixpdimm-cim-dev.install ├── libixpdimm-cim.install ├── libixpdimm-cim.symbols ├── libixpdimm-cli-dev.install ├── libixpdimm-cli.install ├── libixpdimm-cli.symbols ├── libixpdimm-dev.install ├── libixpdimm.install ├── libixpdimm.symbols ├── patches │ └── series ├── rules ├── source │ └── format └── watch ├── external ├── fw_headers │ └── fw_header.h ├── os_headers │ └── linux │ │ └── ndctl.h └── rapidxml-1.13 │ ├── license.txt │ ├── manual.html │ ├── rapidxml.hpp │ ├── rapidxml_iterators.hpp │ ├── rapidxml_print.hpp │ └── rapidxml_utils.hpp ├── install ├── linux │ ├── INSTALLCONFIG.FILE │ ├── install.sh │ ├── pegasus_deregister.sh │ ├── pegasus_register.sh │ ├── rel-release │ │ └── ixpdimm_sw.spec │ ├── sfcb_deregister.sh │ ├── sfcb_register.sh │ ├── sle-release │ │ └── ixpdimm_sw.spec │ └── uninstall.sh └── windows │ ├── install.cmd │ └── uninstall.cmd ├── scripts ├── TestMI.py ├── create_ixpdimm-cli_manpage.py ├── create_ixpdimm-monitor_manpage.py ├── get_max_libtest_arg.sh ├── ixpdimm-cli.manpage.footer ├── ixpdimm-cli.manpage.header ├── ixpdimm-cli.sed ├── ixpdimm-monitor.manpage.text └── manpage_helper.py └── src ├── acpi ├── acpi.c ├── acpi.h ├── lnx_acpi.c ├── nfit.c ├── nfit.h ├── nfit_dimm.c ├── nfit_interleave.c ├── nfit_parser.c ├── nfit_parser.c.template ├── nfit_parser.h ├── nfit_parser.h.template ├── nfit_printer.c ├── nfit_printer.c.template ├── nfit_printer.h ├── nfit_printer.h.template ├── nfit_tables.h ├── nfit_tables.h.template └── win_acpi.c ├── cli ├── cli_resources.rc ├── features │ ├── ExportCli.h │ └── core │ │ ├── CommandParts.h │ │ ├── CreateGoalCommand.cpp │ │ ├── CreateGoalCommand.h │ │ ├── DeleteDevicePcdCommand.cpp │ │ ├── DeleteDevicePcdCommand.h │ │ ├── DimmProviderAdapter.cpp │ │ ├── DimmProviderAdapter.h │ │ ├── DumpDeviceSupportCommand.cpp │ │ ├── DumpDeviceSupportCommand.h │ │ ├── FieldSupportFeature.cpp │ │ ├── FieldSupportFeature.h │ │ ├── FormatDeviceCommand.cpp │ │ ├── FormatDeviceCommand.h │ │ ├── MemoryProperty.cpp │ │ ├── MemoryProperty.h │ │ ├── ModifyDeviceCommand.cpp │ │ ├── ModifyDeviceCommand.h │ │ ├── NamespaceFeature.cpp │ │ ├── NamespaceFeature.h │ │ ├── NamespaceFeature_Goals.cpp │ │ ├── NamespaceFeature_Namespaces.cpp │ │ ├── NvmCliCore.cpp │ │ ├── NvmCliCore.h │ │ ├── SensorFeature.cpp │ │ ├── SensorFeature.h │ │ ├── ShowCommandPropertyUtilities.h │ │ ├── ShowCommandUtilities.cpp │ │ ├── ShowCommandUtilities.h │ │ ├── ShowDeviceCommand.cpp │ │ ├── ShowDeviceCommand.h │ │ ├── ShowDevicePcdCommand.cpp │ │ ├── ShowDevicePcdCommand.h │ │ ├── ShowGoalCommand.cpp │ │ ├── ShowGoalCommand.h │ │ ├── ShowHostServerCommand.cpp │ │ ├── ShowHostServerCommand.h │ │ ├── ShowLogCommand.cpp │ │ ├── ShowLogCommand.h │ │ ├── ShowMemoryResourcesCommand.cpp │ │ ├── ShowMemoryResourcesCommand.h │ │ ├── ShowSocketCommand.cpp │ │ ├── ShowSocketCommand.h │ │ ├── ShowTopologyCommand.cpp │ │ ├── ShowTopologyCommand.h │ │ ├── ShowVersionCommand.cpp │ │ ├── ShowVersionCommand.h │ │ ├── SimulatorFeature.cpp │ │ ├── SimulatorFeature.h │ │ ├── StringList.cpp │ │ ├── StringList.h │ │ ├── SystemFeature.cpp │ │ ├── SystemFeature.h │ │ ├── ValidationFeature.cpp │ │ ├── ValidationFeature.h │ │ ├── VerboseController.cpp │ │ ├── VerboseController.h │ │ ├── VerboseFeatureBase.cpp │ │ ├── VerboseFeatureBase.h │ │ ├── WbemToCli.cpp │ │ ├── WbemToCli.h │ │ ├── WbemToCli_utilities.cpp │ │ ├── WbemToCli_utilities.h │ │ ├── framework │ │ ├── CliHelper.cpp │ │ ├── CliHelper.h │ │ ├── CommandBase.cpp │ │ ├── CommandBase.h │ │ ├── ConsoleAdapter.cpp │ │ ├── ConsoleAdapter.h │ │ ├── DisplayOptions.cpp │ │ ├── DisplayOptions.h │ │ ├── PropertyDefinitionBase.cpp │ │ ├── PropertyDefinitionBase.h │ │ ├── PropertyDefinitionList.cpp │ │ ├── PropertyDefinitionList.h │ │ ├── UnitsOption.cpp │ │ ├── UnitsOption.h │ │ ├── YesNoPrompt.cpp │ │ └── YesNoPrompt.h │ │ └── nvmcli_core_features_resources.rc └── nvmcli.cpp ├── common ├── common.h ├── common_types.h ├── cr_i18n.h ├── encrypt │ ├── encrypt.c │ ├── encrypt.h │ └── public.rev0.pem ├── export_common.h ├── file_ops │ ├── file_ops.c │ ├── file_ops_adapter.h │ ├── lnx_file_ops.c │ └── win_file_ops.c ├── guid │ ├── guid.c │ └── guid.h ├── os │ ├── lnx_os.c │ ├── os_adapter.h │ ├── win_msgs.mc │ └── win_os.c ├── persistence │ ├── config_settings.h │ ├── csv_log.c │ ├── csv_log.h │ ├── event.c │ ├── event.h │ ├── event_strings.h │ ├── lib_persistence.c │ ├── lib_persistence.h │ ├── logging.c │ ├── logging.h │ ├── schema.c │ ├── schema.h │ └── schema.txt ├── smbios │ ├── smbios.c │ ├── smbios.h │ └── smbios_types.h ├── string │ ├── revision.c │ ├── revision.h │ ├── s_str.c │ ├── s_str.h │ ├── unicode_utilities.c │ ├── unicode_utilities.h │ ├── x_str.c │ └── x_str.h ├── system │ ├── jedec_manufacturer.c │ ├── jedec_manufacturer.h │ ├── system.c │ └── system.h ├── time │ ├── time_utilities.c │ └── time_utilities.h └── uid │ ├── uid.c │ └── uid.h ├── core ├── Collection.cpp ├── Collection.h ├── ExportCore.h ├── Helper.cpp ├── Helper.h ├── LibWrapper.cpp ├── LibWrapper.h ├── NvmCore.cpp ├── NvmLibrary.cpp ├── NvmLibrary.h ├── Result.h ├── configuration │ ├── MemoryAllocationGoal.cpp │ ├── MemoryAllocationGoal.h │ ├── MemoryAllocationGoalCollection.cpp │ ├── MemoryAllocationGoalCollection.h │ ├── MemoryAllocationGoalService.cpp │ └── MemoryAllocationGoalService.h ├── core_resources.rc ├── device │ ├── Device.cpp │ ├── Device.h │ ├── DeviceFirmwareInfo.cpp │ ├── DeviceFirmwareInfo.h │ ├── DeviceFirmwareInfoCollection.cpp │ ├── DeviceFirmwareInfoCollection.h │ ├── DeviceFirmwareService.cpp │ ├── DeviceFirmwareService.h │ ├── DeviceHelper.cpp │ ├── DeviceHelper.h │ ├── DeviceService.cpp │ ├── DeviceService.h │ ├── FormatDeviceService.cpp │ ├── FormatDeviceService.h │ ├── Sensor.cpp │ ├── Sensor.h │ ├── SensorCelsius.cpp │ ├── SensorCelsius.h │ ├── SensorTime.cpp │ ├── SensorTime.h │ ├── Sensors.cpp │ ├── Sensors.h │ ├── Topology.cpp │ ├── Topology.h │ ├── TopologyService.cpp │ └── TopologyService.h ├── exceptions │ ├── InvalidArgumentException.cpp │ ├── InvalidArgumentException.h │ ├── LibraryException.cpp │ ├── LibraryException.h │ ├── NoMemoryException.cpp │ ├── NoMemoryException.h │ └── NvmExceptionBadRequest.h ├── firmware_interface │ ├── FwCommands.cpp │ ├── FwCommands.cpp.template │ ├── FwCommands.h │ ├── FwCommands.h.template │ ├── FwCommandsCustomPrinter.cpp │ ├── FwCommandsWrapper.cpp │ ├── FwCommandsWrapper.cpp.template │ ├── FwCommandsWrapper.h │ └── FwCommandsWrapper.h.template ├── logs │ ├── Log.cpp │ ├── Log.h │ ├── LogService.cpp │ └── LogService.h ├── memory_allocator │ ├── InterleaveableDimmSetBuilder.cpp │ ├── InterleaveableDimmSetBuilder.h │ ├── LayoutBuilder.cpp │ ├── LayoutBuilder.h │ ├── LayoutStep.cpp │ ├── LayoutStep.h │ ├── LayoutStepAppDirect.cpp │ ├── LayoutStepAppDirect.h │ ├── LayoutStepAppDirectSettingsNotRecommended.cpp │ ├── LayoutStepAppDirectSettingsNotRecommended.h │ ├── LayoutStepCheckAsymmetricalPopulation.cpp │ ├── LayoutStepCheckAsymmetricalPopulation.h │ ├── LayoutStepCheckCurrentVolatileMode.cpp │ ├── LayoutStepCheckCurrentVolatileMode.h │ ├── LayoutStepCheckDriverSupportsAppDirect.cpp │ ├── LayoutStepCheckDriverSupportsAppDirect.h │ ├── LayoutStepCheckRequestLayoutDeviation.cpp │ ├── LayoutStepCheckRequestLayoutDeviation.h │ ├── LayoutStepLimitTotalMappedMemory.cpp │ ├── LayoutStepLimitTotalMappedMemory.h │ ├── LayoutStepMemory.cpp │ ├── LayoutStepMemory.h │ ├── LayoutStepReserved.cpp │ ├── LayoutStepReserved.h │ ├── MemoryAllocationRequest.cpp │ ├── MemoryAllocationRequest.h │ ├── MemoryAllocationRequestBuilder.cpp │ ├── MemoryAllocationRequestBuilder.h │ ├── MemoryAllocationTypes.h │ ├── MemoryAllocationUtil.cpp │ ├── MemoryAllocationUtil.h │ ├── MemoryAllocator.cpp │ ├── MemoryAllocator.h │ ├── PostLayoutAddressDecoderLimitCheck.cpp │ ├── PostLayoutAddressDecoderLimitCheck.h │ ├── PostLayoutCheck.h │ ├── RequestRule.h │ ├── RuleAppDirectNotSupported.cpp │ ├── RuleAppDirectNotSupported.h │ ├── RuleDimmHasConfigGoal.cpp │ ├── RuleDimmHasConfigGoal.h │ ├── RuleDimmListInvalid.cpp │ ├── RuleDimmListInvalid.h │ ├── RuleMemoryModeCapacityNotSupported.cpp │ ├── RuleMemoryModeCapacityNotSupported.h │ ├── RuleMirroredAppDirectNotSupported.cpp │ ├── RuleMirroredAppDirectNotSupported.h │ ├── RuleNamespacesExist.cpp │ ├── RuleNamespacesExist.h │ ├── RuleNoDimms.cpp │ ├── RuleNoDimms.h │ ├── RulePartialSocketConfigured.cpp │ ├── RulePartialSocketConfigured.h │ ├── RuleProvisionCapacityNotSupported.cpp │ ├── RuleProvisionCapacityNotSupported.h │ ├── RuleRejectLockedDimms.cpp │ └── RuleRejectLockedDimms.h └── system │ ├── SmbiosType4Utility.cpp │ ├── SmbiosType4Utility.h │ ├── SoftwareInfo.cpp │ ├── SoftwareInfo.h │ ├── SystemInfo.cpp │ ├── SystemInfo.h │ ├── SystemMemoryResources.cpp │ ├── SystemMemoryResources.h │ ├── SystemService.cpp │ ├── SystemService.h │ ├── SystemSocket.cpp │ └── SystemSocket.h ├── driver_interface ├── lnx_passthrough.c ├── passthrough.c ├── passthrough.h └── win_passthrough.c ├── firmware_interface ├── fis_commands.c ├── fis_commands.c.template ├── fis_commands.h ├── fis_commands.h.template ├── fis_parser.c ├── fis_parser.c.template ├── fis_parser.h ├── fis_parser.h.template ├── fw_command_controller.c ├── fw_command_controller.c.template ├── fw_command_controller.h ├── fw_command_controller.h.template ├── fw_command_custom_printer.c ├── fw_command_custom_printer.h ├── fw_command_dump.c ├── fw_command_dump.c.template ├── fw_command_dump.h ├── fw_command_dump.h.template ├── fw_command_printer.c ├── fw_command_printer.c.template ├── fw_command_printer.h ├── fw_command_printer.h.template ├── fw_commands.c ├── fw_commands.c.template ├── fw_commands.h ├── fw_commands.h.template ├── fwcmd_args.c └── fwcmd_args.h ├── ixp ├── ixp.c ├── ixp.h ├── ixp_properties │ ├── ixp_fis_properties.c │ ├── ixp_fis_properties.c.template │ ├── ixp_fis_properties.h │ ├── ixp_fis_properties.h.template │ ├── ixp_properties.c │ ├── ixp_properties.c.template │ └── ixp_properties.h ├── ixp_prv.h ├── ixp_types.h └── ixp_types.h.template ├── lib ├── LogEnterExit.h ├── adapter_tests │ ├── WinScmTests.cpp │ └── WinScmTests.h ├── adapter_types.h ├── capabilities.c ├── capabilities.h ├── cleanup_support_events.c ├── cleanup_support_events.h ├── config_goal.c ├── config_goal.h ├── config_goal_utilities.c ├── config_goal_utilities.h ├── create_config_db │ └── main.c ├── device.c ├── device_adapter.h ├── device_fw.c ├── device_fw.h ├── device_utilities.c ├── device_utilities.h ├── diagnostic.c ├── diagnostic.h ├── diagnostic_fw.c ├── diagnostic_nfit.c ├── diagnostic_platform_config.c ├── diagnostic_platform_config_best_practices.c ├── diagnostic_quick.c ├── diagnostic_security.c ├── error_injection.c ├── event_field_metadata.c ├── event_field_metadata.h ├── export_api.h ├── fis_types.h ├── job.c ├── lib.c ├── lib_resources.rc ├── lnx_adapter.c ├── lnx_adapter.h ├── lnx_adapter_acpi_events.c ├── lnx_adapter_namespaces.c ├── lnx_adapter_passthrough.c ├── lnx_adapter_pools.c ├── lnx_system.c ├── monitor.c ├── monitor.h ├── namespace.c ├── namespace_labels.c ├── namespace_labels.h ├── namespace_utils.c ├── namespace_utils.h ├── nfit_utilities.c ├── nfit_utilities.h ├── nvm_context.c ├── nvm_context.h ├── nvm_logging.c ├── nvm_management.c ├── nvm_management.h ├── nvm_types.h ├── platform_capabilities.c ├── platform_capabilities.h ├── platform_capabilities_db.c ├── platform_capabilities_db.h ├── platform_config_data.c ├── platform_config_data.h ├── platform_config_data_db.c ├── platform_config_data_db.h ├── pool.c ├── pool_utilities.c ├── pool_utilities.h ├── save_state.c ├── security.c ├── sensor.c ├── smbios_utilities.c ├── smbios_utilities.h ├── support.c ├── support.h ├── system.c ├── system.h ├── system_utilities.c ├── system_utilities.h ├── update_firmware.c ├── utility.h ├── win_adapter.c ├── win_adapter_acpi_events.c ├── win_leg_adapter.c ├── win_leg_adapter.h ├── win_leg_adapter_namespaces.c ├── win_leg_adapter_passthrough.c ├── win_leg_adapter_shared.c ├── win_leg_adapter_shared.h ├── win_scm2_adapter.c ├── win_scm2_adapter.h ├── win_scm2_capabilities.c ├── win_scm2_capabilities.h ├── win_scm2_ioctl.c ├── win_scm2_ioctl.h ├── win_scm2_ioctl_driver_version.c ├── win_scm2_ioctl_driver_version.h ├── win_scm2_ioctl_passthrough.c ├── win_scm2_ioctl_passthrough.h ├── win_scm2_namespaces.c ├── win_scm2_passthrough.c ├── win_scm2_passthrough.h ├── win_scm2_version_info.c ├── win_scm2_version_info.h └── win_system.c ├── monitor ├── AcpiEventMonitor.cpp ├── AcpiEventMonitor.h ├── EventMonitor.cpp ├── EventMonitor.h ├── NvmMonitorBase.cpp ├── NvmMonitorBase.h ├── PerformanceMonitor.cpp ├── PerformanceMonitor.h ├── ixpdimm-monitor.service ├── lnx_main.cpp ├── monitor_resources.rc ├── win_main.cpp ├── win_service.cpp └── win_service.h └── wbem ├── ExportCim.h ├── NvmStrings.h ├── NvmWbem.cpp ├── cimom ├── cmpi │ ├── IntelCmpiProvider.cpp │ ├── cmpiMonitor.cpp │ ├── cmpiMonitor.h │ ├── pegasus_register.mof │ └── sfcb_register.reg └── wmi │ ├── DllMain.cpp │ └── register.mof ├── erasure ├── ErasureCapabilitiesFactory.cpp ├── ErasureCapabilitiesFactory.h ├── ErasureServiceFactory.cpp └── ErasureServiceFactory.h ├── exception ├── NvmExceptionBadFilter.cpp ├── NvmExceptionBadFilter.h ├── NvmExceptionBadTarget.cpp ├── NvmExceptionBadTarget.h ├── NvmExceptionDiagnosticError.cpp ├── NvmExceptionDiagnosticError.h ├── NvmExceptionInvalidPoolConfig.cpp ├── NvmExceptionInvalidPoolConfig.h ├── NvmExceptionLibError.cpp ├── NvmExceptionLibError.h ├── NvmExceptionNotManageable.cpp ├── NvmExceptionNotManageable.h ├── NvmExceptionUndoModifyFailed.cpp └── NvmExceptionUndoModifyFailed.h ├── framework_interface ├── FrameworkExtensions.cpp ├── FrameworkExtensions.h ├── NvmAssociationFactory.cpp ├── NvmAssociationFactory.h ├── NvmIndicationService.cpp ├── NvmIndicationService.h ├── NvmInstanceFactory.cpp ├── NvmInstanceFactory.h ├── NvmProviderFactory.cpp └── NvmProviderFactory.h ├── indication ├── InstIndicationFactory.cpp ├── InstIndicationFactory.h ├── NVDIMMEventFactory.cpp ├── NVDIMMEventFactory.h ├── NvmIndicationFactory.cpp ├── NvmIndicationFactory.h ├── StaticFilterFactory.cpp └── StaticFilterFactory.h ├── lib_interface ├── NvmApi.cpp ├── NvmApi.h └── NvmContext.h ├── mem_config ├── InterleaveSet.cpp ├── InterleaveSet.h ├── MemoryAllocationSettingsFactory.cpp ├── MemoryAllocationSettingsFactory.h ├── MemoryCapabilitiesFactory.cpp ├── MemoryCapabilitiesFactory.h ├── MemoryConfigurationCapabilitiesFactory.cpp ├── MemoryConfigurationCapabilitiesFactory.h ├── MemoryConfigurationFactory.cpp ├── MemoryConfigurationFactory.h ├── MemoryConfigurationServiceFactory.cpp ├── MemoryConfigurationServiceFactory.h ├── MemoryResourcesFactory.cpp ├── MemoryResourcesFactory.h ├── PoolViewFactory.cpp └── PoolViewFactory.h ├── memory ├── MemoryControllerFactory.cpp ├── MemoryControllerFactory.h ├── PersistentMemoryFactory.cpp ├── PersistentMemoryFactory.h ├── RawMemoryFactory.cpp ├── RawMemoryFactory.h ├── SystemProcessorFactory.cpp ├── SystemProcessorFactory.h ├── VolatileMemoryFactory.cpp └── VolatileMemoryFactory.h ├── mof ├── cim_schema_2.29.1_combined.mof ├── cim_schema_2.44.1_combined.mof ├── class_def.mof ├── createmof_linux.sh ├── createmof_windows.cmd ├── profile_registration.mof ├── qualifiers.mof ├── sfcb_qualifiers.mof └── snia_mofs_16Rev4-updated.mof ├── pegasus └── PegasusRegisteredProfileFactory.h ├── performance ├── NVDIMMPerformanceViewFactory.cpp ├── NVDIMMPerformanceViewFactory.h ├── PerformanceMetricCommon.h ├── PerformanceMetricDefinitionFactory.cpp ├── PerformanceMetricDefinitionFactory.h ├── PerformanceMetricFactory.cpp ├── PerformanceMetricFactory.h ├── PerformanceMetricServiceCapabilitiesFactory.cpp ├── PerformanceMetricServiceCapabilitiesFactory.h ├── PerformanceMetricServiceFactory.cpp └── PerformanceMetricServiceFactory.h ├── physical_asset ├── MemoryTopologyViewFactory.cpp ├── MemoryTopologyViewFactory.h ├── NVDIMMFactory.cpp └── NVDIMMFactory.h ├── pmem_config ├── NamespaceSettingsFactory.cpp ├── NamespaceSettingsFactory.h ├── NamespaceViewFactory.cpp ├── NamespaceViewFactory.h ├── PersistentConfigurationCapabilitiesFactory.cpp ├── PersistentConfigurationCapabilitiesFactory.h ├── PersistentMemoryCapabilitiesFactory.cpp ├── PersistentMemoryCapabilitiesFactory.h ├── PersistentMemoryNamespaceFactory.cpp ├── PersistentMemoryNamespaceFactory.h ├── PersistentMemoryPoolFactory.cpp ├── PersistentMemoryPoolFactory.h ├── PersistentMemoryServiceFactory.cpp └── PersistentMemoryServiceFactory.h ├── profile ├── RegisteredProfileFactory.cpp └── RegisteredProfileFactory.h ├── server ├── BaseServerFactory.cpp ├── BaseServerFactory.h ├── ServerChassisFactory.cpp ├── ServerChassisFactory.h ├── SystemCapabilitiesFactory.cpp └── SystemCapabilitiesFactory.h ├── software ├── AvailableFWFactory.cpp ├── AvailableFWFactory.h ├── ElementSoftwareIdentityFactory.cpp ├── ElementSoftwareIdentityFactory.h ├── HostSoftwareFactory.cpp ├── HostSoftwareFactory.h ├── ManagementSoftwareIdentityFactory.cpp ├── ManagementSoftwareIdentityFactory.h ├── NVDIMMCollectionFactory.cpp ├── NVDIMMCollectionFactory.h ├── NVDIMMDriverIdentityFactory.cpp ├── NVDIMMDriverIdentityFactory.h ├── NVDIMMFWVersionFactory.cpp ├── NVDIMMFWVersionFactory.h ├── NVDIMMSoftwareInstallationServiceFactory.cpp └── NVDIMMSoftwareInstallationServiceFactory.h ├── support ├── DiagnosticCompletionRecordFactory.cpp ├── DiagnosticCompletionRecordFactory.h ├── DiagnosticIdentityFactory.cpp ├── DiagnosticIdentityFactory.h ├── DiagnosticLogFactory.cpp ├── DiagnosticLogFactory.h ├── EventLogFilter.cpp ├── EventLogFilter.h ├── FWEventLogFactory.cpp ├── FWEventLogFactory.h ├── NVDIMMDiagnosticFactory.cpp ├── NVDIMMDiagnosticFactory.h ├── NVDIMMEventLogFactory.cpp ├── NVDIMMEventLogFactory.h ├── NVDIMMLogEntryFactory.cpp ├── NVDIMMLogEntryFactory.h ├── NVDIMMSensorFactory.cpp ├── NVDIMMSensorFactory.h ├── NVDIMMSensorViewFactory.cpp ├── NVDIMMSensorViewFactory.h ├── OpaqueSupportDataFactory.cpp ├── OpaqueSupportDataFactory.h ├── SanitizeJobFactory.cpp ├── SanitizeJobFactory.h ├── SupportDataServiceFactory.cpp └── SupportDataServiceFactory.h └── wbem_resources.rc /.gitignore: -------------------------------------------------------------------------------- 1 | output/ 2 | src/common/os/win_msgs.h 3 | scripts/manpage_helper.pyc 4 | scripts/nvmcli.8.gz 5 | scripts/nvmmonitor.8.gz 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "invm-frameworks"] 2 | path = invm-frameworks 3 | url = https://github.com/intel/invm-frameworks.git 4 | -------------------------------------------------------------------------------- /CMake/Find/Findmath.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of Intel Corporation nor the names of its contributors 13 | # may be used to endorse or promote products derived from this software 14 | # without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # - Try to find math 28 | # Once done this will define 29 | # MATH_FOUND - math found 30 | # MATH_INCLUDE_DIRS - math include directories 31 | # MATH_LIBRARIES - libraries needed to use math 32 | 33 | find_path(MATH_INCLUDE_DIR math.h 34 | HINTS ${MATH_INCLUDE_PATH}) 35 | 36 | find_library(MATH_LIBRARY NAMES m 37 | HINTS ${MATH_LIBRARY_PATH}) 38 | 39 | include(FindPackageHandleStandardArgs) 40 | # handle the QUIETLY and REQUIRED arguments and set MATH_FOUND to TRUE 41 | # if all listed variables are TRUE 42 | find_package_handle_standard_args(math DEFAULT_MSG 43 | MATH_LIBRARY MATH_INCLUDE_DIR) 44 | 45 | mark_as_advanced(MATH_INCLUDE_DIR MATH_LIBRARY) 46 | 47 | set(MATH_LIBRARIES ${MATH_LIBRARY}) 48 | set(MATH_INCLUDE_DIRS ${MATH_INCLUDE_DIR}) 49 | -------------------------------------------------------------------------------- /CMake/Find/Findnumactl.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of Intel Corporation nor the names of its contributors 13 | # may be used to endorse or promote products derived from this software 14 | # without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # - Try to find numactl 28 | # Once done this will define 29 | # NUMACTL_FOUND - numactl found 30 | # NUMACTL_INCLUDE_DIRS - numactl include directories 31 | # NUMACTL_LIBRARIES - libraries needed to use numactl 32 | 33 | find_path(NUMACTL_INCLUDE_DIR numa.h 34 | HINTS ${NUMACTL_INCLUDE_PATH}) 35 | 36 | find_library(NUMACTL_LIBRARY NAMES numa 37 | HINTS ${NUMACTL_LIBRARY_PATH}) 38 | 39 | include(FindPackageHandleStandardArgs) 40 | # handle the QUIETLY and REQUIRED arguments and set NUMACTL_FOUND to TRUE 41 | # if all listed variables are TRUE 42 | find_package_handle_standard_args(numactl DEFAULT_MSG 43 | NUMACTL_LIBRARY NUMACTL_INCLUDE_DIR) 44 | 45 | mark_as_advanced(NUMACTL_INCLUDE_DIR NUMACTL_LIBRARY) 46 | 47 | set(NUMACTL_LIBRARIES ${NUMACTL_LIBRARY}) 48 | set(NUMACTL_INCLUDE_DIRS ${NUMACTL_INCLUDE_DIR}) 49 | -------------------------------------------------------------------------------- /CMake/Find/Findsblim-cmpi.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (c) 2018, Intel Corporation 3 | # 4 | # Redistribution and use in source and binary forms, with or without 5 | # modification, are permitted provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright notice, 8 | # this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of Intel Corporation nor the names of its contributors 13 | # may be used to endorse or promote products derived from this software 14 | # without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | 27 | # - Try to find sblim-cmpi 28 | # Once done this will define 29 | # SBLIM-CMPI_FOUND - sblim-cmpi found 30 | # SBLIM-CMPI_INCLUDE_DIRS - sblim-cmpi include directories 31 | 32 | find_path(SBLIM-CMPI_INCLUDE_DIR cmpidt.h 33 | HINTS ${SBLIM-CMPI_INCLUDE_PATH} 34 | PATH_SUFFIXES cmpi) 35 | 36 | include(FindPackageHandleStandardArgs) 37 | # handle the QUIETLY and REQUIRED arguments and set SMLIM_CMPI_FOUND to TRUE 38 | # if all listed variables are TRUE 39 | find_package_handle_standard_args(sblim-cmpi DEFAULT_MSG SBLIM-CMPI_INCLUDE_DIR) 40 | 41 | mark_as_advanced(SBLIM-CMPI_INCLUDE_DIR) 42 | 43 | set(SBLIM-CMPI_INCLUDE_DIRS ${SBLIM-CMPI_INCLUDE_DIR}) 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | ixpdimm-sw for Debian 2 | 3 | Please edit this to provide information specific to 4 | this ixpdimm-sw Debian package. 5 | 6 | (Automatically generated by debmake Version 4.2.9) 7 | 8 | -- Juston Li Thu, 15 Mar 2018 15:19:00 +0000 9 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | ixpdimm-sw (01.00.00.1000-1) UNRELEASED; urgency=low 2 | 3 | * Initial release. 4 | 5 | -- Juston Li Thu, 15 Mar 2018 15:19:00 +0000 6 | -------------------------------------------------------------------------------- /debian/clean: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/ixpdimm-cli.install: -------------------------------------------------------------------------------- 1 | usr/bin/ixpdimm-cli 2 | usr/share/man/man8/ixpdimm-cli.8.gz 3 | -------------------------------------------------------------------------------- /debian/ixpdimm-data.install: -------------------------------------------------------------------------------- 1 | var/lib/ixpdimm_sw/apss.dat 2 | var/lib/ixpdimm_sw/public.rev0.pem 3 | -------------------------------------------------------------------------------- /debian/ixpdimm-monitor.install: -------------------------------------------------------------------------------- 1 | usr/bin/ixpdimm-monitor 2 | usr/share/man/man8/ixpdimm-monitor.8.gz 3 | -------------------------------------------------------------------------------- /debian/libixpdimm-cim-dev.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm-cim.so 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-cim.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm-cim.so.* 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-cim.symbols: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-cli-dev.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm-cli.so 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-cli.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm-cli.so.* 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-cli.symbols: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | -------------------------------------------------------------------------------- /debian/libixpdimm-dev.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm.so 2 | usr/lib/*/libixpdimm-common.so 3 | usr/lib/*/libixpdimm-core.so 4 | usr/include/export_api.h 5 | usr/include/nvm_management.h 6 | usr/include/nvm_types.h 7 | -------------------------------------------------------------------------------- /debian/libixpdimm.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libixpdimm.so.* 2 | usr/lib/*/libixpdimm-common.so.* 3 | usr/lib/*/libixpdimm-core.so.* 4 | 5 | -------------------------------------------------------------------------------- /debian/libixpdimm.symbols: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | -------------------------------------------------------------------------------- /debian/patches/series: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # You must remove unused comment lines for the released package. 3 | #export DH_VERBOSE = 1 4 | #export DEB_BUILD_MAINT_OPTIONS = hardening=+all 5 | #export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic 6 | #export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed 7 | 8 | %: 9 | dh $@ 10 | 11 | override_dh_auto_configure: 12 | dh_auto_configure -- \ 13 | -DEXTERNAL=ON \ 14 | -DBUILDNUM=99.99.99.9999 15 | 16 | override_dh_clean: 17 | dh_clean 18 | rm -rf output 19 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (quilt) 2 | -------------------------------------------------------------------------------- /debian/watch: -------------------------------------------------------------------------------- 1 | # You must remove unused comment lines for the released package. 2 | version=3 3 | -------------------------------------------------------------------------------- /install/linux/INSTALLCONFIG.FILE: -------------------------------------------------------------------------------- 1 | RM="rm -f" 2 | COPY="cp -av" 3 | MOVE=mv 4 | MKDIR="mkdir -p" 5 | RMDIR="rm -rf" 6 | 7 | HW_ARCH=$(uname -i) 8 | 9 | # Linux Install Directories 10 | RPM_ROOT=$(grep RPM_ROOT CMakeCache.txt | cut -d "=" -f2) 11 | 12 | LIB_DIR=$(grep LIB_DIR CMakeCache.txt | cut -d "=" -f2) 13 | if [ -z "$INCLUDE_DIR" ] 14 | then 15 | if [[ "$(uname -m)" =~ "i686" ]] 16 | then 17 | LIB_DIR=/usr/lib64 18 | CIM_LIB_DIR=/usr/lib64/cmpi 19 | else 20 | LIB_DIR=/usr/lib64 21 | CIM_LIB_DIR=/usr/lib64/cmpi 22 | fi 23 | fi 24 | 25 | CLI_NAME=ixpdimm-cli 26 | MONITOR_NAME=ixpdimm-monitor 27 | 28 | LINUX_PRODUCT_NAME=$(grep LINUX_PRODUCT_NAME CMakeCache.txt | cut -d "=" -f2) 29 | if [ -z "$LINUX_PRODUCT_NAME" ] 30 | then 31 | LINUX_PRODUCT_NAME=ixpdimm_sw 32 | fi 33 | 34 | INCLUDE_DIR=$(grep INCLUDE_DIR CMakeCache.txt | cut -d "=" -f2) 35 | if [ -z "$INCLUDE_DIR" ] 36 | then 37 | INCLUDE_DIR=/usr/include 38 | fi 39 | 40 | BIN_DIR=$(grep BIN_DIR CMakeCache.txt | cut -d "=" -f2) 41 | if [ -z "$BIN_DIR" ] 42 | then 43 | BIN_DIR=/usr/bin 44 | fi 45 | 46 | DATADIR=$(grep DATADIR CMakeCache.txt | cut -d "=" -f2) 47 | if [ -z "$DATADIR" ] 48 | then 49 | DATADIR=/var/lib 50 | fi 51 | 52 | if [ -z "$LOCALSTATE_DIR" ] 53 | then 54 | LOCALSTATE_DIR=/var 55 | fi 56 | 57 | UNIT_DIR=$(grep UNIT_DIR CMakeCache.txt | cut -d "=" -f2) 58 | if [ -z "$UNIT_DIR" ] 59 | then 60 | UNIT_DIR=/usr/lib/systemd/system 61 | fi 62 | 63 | SYSCONF_DIR=$(grep SYSCONF_DIR CMakeCache.txt | cut -d "=" -f2) 64 | if [ -z "$SYSCONF_DIR" ] 65 | then 66 | SYSCONF_DIR=/etc 67 | fi 68 | 69 | MANPAGE_DIR=$(grep MANPAGE_DIR CMakeCache.txt | cut -d "=" -f2) 70 | if [ -z "$MANPAGE_DIR" ] 71 | then 72 | MANPAGE_DIR=/usr/share/man 73 | fi 74 | 75 | PRODUCT_DATADIR=$DATADIR/$LINUX_PRODUCT_NAME 76 | PEGASUS_MOFDIR=$PRODUCT_DATADIR/Pegasus/mof 77 | SFCB_DIR=$PRODUCT_DATADIR/sfcb 78 | MAN8_DIR=$MANPAGE_DIR/man8 79 | 80 | # Linux Install Files 81 | LIB_FILES=(libixpdimm.so* libixpdimm-core.so* libixpdimm-cli.so* libinvm-cim.so* libinvm-i18n.so* libinvm-cli.so*) 82 | CIM_LIB_FILES=(libixpdimm-cim.so*) 83 | INCLUDE_FILES=(nvm_management.h nvm_types.h) 84 | BIN_FILES=($CLI_NAME $MONITOR_NAME) 85 | PEGASUS_MOF_FILES=(pegasus_register.mof profile_registration.mof intelwbem.mof) 86 | SFCB_MOF_FILES=sfcb_intelwbem.mof 87 | SFCB_REG_FILE=INTEL_NVDIMM.reg 88 | DATADIR_FILES=(apss.dat public.rev0.pem) 89 | INIT_FILES=$MONITOR_NAME.service 90 | MANPAGE_GZ_FILES=($MONITOR_NAME.8.gz $CLI_NAME.8.gz) -------------------------------------------------------------------------------- /install/linux/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . $(dirname $0)/INSTALLCONFIG.FILE 4 | 5 | BUILD_DIR=$1 6 | BUILD_SIM=$2 7 | echo "In INSTALL SCRIPT" 8 | # install files into LIB_DIR 9 | $MKDIR $RPM_ROOT$LIB_DIR 10 | $COPY ${LIB_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$LIB_DIR 11 | 12 | # install files into CIM_LIB_DIR 13 | $MKDIR $RPM_ROOT$CIM_LIB_DIR 14 | $COPY ${CIM_LIB_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$CIM_LIB_DIR 15 | 16 | # install files into INCLUDE_DIR 17 | $MKDIR $RPM_ROOT$INCLUDE_DIR 18 | $COPY ${INCLUDE_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$INCLUDE_DIR 19 | 20 | # install files into BIN_DIR 21 | $MKDIR $RPM_ROOT$BIN_DIR 22 | $COPY ${BIN_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$BIN_DIR 23 | 24 | #install files into UNIT_DIR 25 | $MKDIR $RPM_ROOT$UNIT_DIR 26 | $COPY $BUILD_DIR/$INIT_FILES $RPM_ROOT$UNIT_DIR 27 | 28 | #install files into DATADIR 29 | $MKDIR $RPM_ROOT$PRODUCT_DATADIR 30 | $COPY ${DATADIR_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$PRODUCT_DATADIR 31 | 32 | #install manpage files into MAN8_DIR 33 | $MKDIR $RPM_ROOT$MAN8_DIR 34 | $MOVE ${MANPAGE_GZ_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$MAN8_DIR 35 | mandb 36 | 37 | if [ $BUILD_SIM -eq 1 ] 38 | then 39 | LD_LIBRARY_PATH=$BUILD_DIR 40 | $(export LD_LIBRARY_PATH); $BUILD_DIR/create_simulator --path $RPM_ROOT$PRODUCT_DATADIR 41 | $MOVE $RPM_ROOT$PRODUCT_DATADIR/apss.dat.smoke $RPM_ROOT$PRODUCT_DATADIR/apss.dat 42 | fi 43 | 44 | #install Pegasus Files 45 | $MKDIR $RPM_ROOT$PEGASUS_MOFDIR 46 | $COPY ${PEGASUS_MOF_FILES[@]/#/$BUILD_DIR/} $RPM_ROOT$PEGASUS_MOFDIR 47 | 48 | #install SFCB Files 49 | $MKDIR $RPM_ROOT$SFCB_DIR 50 | $COPY $BUILD_DIR/$SFCB_MOF_FILES $RPM_ROOT$SFCB_DIR 51 | $COPY $BUILD_DIR/$SFCB_REG_FILE $RPM_ROOT$SFCB_DIR 52 | 53 | $MKDIR $RPM_ROOT$SYSCONF_DIR/ld.so.conf.d 54 | echo $CIM_LIB_DIR > $RPM_ROOT$SYSCONF_DIR/ld.so.conf.d/$LINUX_PRODUCT_NAME-$HW_ARCH.conf 55 | /sbin/ldconfig 56 | -------------------------------------------------------------------------------- /install/linux/pegasus_deregister.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . $(dirname $0)/INSTALLCONFIG.FILE 3 | 4 | RESTART=0; \ 5 | if [ -x /usr/sbin/cimserver ]; \ 6 | then \ 7 | cimserver --status &> /dev/null; \ 8 | if [ $? -ne 0 ]; \ 9 | then \ 10 | RESTART=1; \ 11 | cimserver enableHttpConnection=false enableHttpsConnection=false enableRemotePrivilegedUserAccess=false slp=false; \ 12 | fi; \ 13 | cimprovider -d -m intelwbemprovider &> /dev/null; \ 14 | cimprovider -r -m intelwbemprovider &> /dev/null; \ 15 | mofcomp -v -r -n root/intelwbem $PRODUCT_DATADIR/Pegasus/mof/intelwbem.mof; \ 16 | if [[ $RESTART -gt 0 ]]; \ 17 | then \ 18 | cimserver -s; \ 19 | fi; \ 20 | fi 21 | -------------------------------------------------------------------------------- /install/linux/pegasus_register.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . $(dirname $0)/INSTALLCONFIG.FILE 3 | 4 | if [ -x /usr/sbin/cimserver ]; \ 5 | then \ 6 | cimserver --status &> /dev/null; \ 7 | if [ $? -eq 0 ]; \ 8 | then \ 9 | CIMMOF=cimmof; \ 10 | else \ 11 | CIMMOF="cimmofl -R /var/lib/Pegasus"; \ 12 | fi; \ 13 | for ns in interop root/interop root/PG_Interop; do \ 14 | $CIMMOF -E -n"$ns" $PRODUCT_DATADIR/Pegasus/mof/pegasus_register.mof &> /dev/null; \ 15 | if [ $? -eq 0 ]; \ 16 | then \ 17 | $CIMMOF -uc -n$ns $PRODUCT_DATADIR/Pegasus/mof/pegasus_register.mof &> /dev/null; \ 18 | $CIMMOF -uc -n$ns $PRODUCT_DATADIR/Pegasus/mof/profile_registration.mof &> /dev/null; \ 19 | break; \ 20 | fi; \ 21 | done; \ 22 | $CIMMOF -uc -aE -nroot/intelwbem $PRODUCT_DATADIR/Pegasus/mof/intelwbem.mof &> /dev/null; \ 23 | fi 24 | -------------------------------------------------------------------------------- /install/linux/sfcb_deregister.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . $(dirname $0)/INSTALLCONFIG.FILE 3 | 4 | if [ -x /usr/sbin/sfcbd ]; \ 5 | then \ 6 | RESTART=0; \ 7 | systemctl is-active sblim-sfcb.service &> /dev/null; \ 8 | if [ $? -eq 0 ]; \ 9 | then \ 10 | RESTART=1; \ 11 | systemctl stop sblim-sfcb.service &> /dev/null; \ 12 | fi; \ 13 | sfcbunstage -n root/intelwbem -r INTEL_NVDIMM.reg sfcb_intelwbem.mof; \ 14 | sfcbrepos -f; \ 15 | if [[ $RESTART -gt 0 ]]; \ 16 | then \ 17 | systemctl start sblim-sfcb.service &> /dev/null; \ 18 | fi; \ 19 | fi 20 | -------------------------------------------------------------------------------- /install/linux/sfcb_register.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . $(dirname $0)/INSTALLCONFIG.FILE 3 | 4 | if [ -x /usr/sbin/sfcbd ]; \ 5 | then \ 6 | RESTART=0; \ 7 | systemctl is-active sblim-sfcb.service &> /dev/null; \ 8 | if [ $? -eq 0 ]; \ 9 | then \ 10 | RESTART=1; \ 11 | systemctl stop sblim-sfcb.service &> /dev/null; \ 12 | fi; \ 13 | sfcbstage -n root/intelwbem -r $PRODUCT_DATADIR/sfcb/INTEL_NVDIMM.reg $PRODUCT_DATADIR/sfcb/sfcb_intelwbem.mof; \ 14 | sfcbrepos -f; \ 15 | if [[ $RESTART -gt 0 ]]; \ 16 | then \ 17 | systemctl start sblim-sfcb.service &> /dev/null; \ 18 | fi; \ 19 | fi -------------------------------------------------------------------------------- /install/linux/uninstall.sh: -------------------------------------------------------------------------------- 1 | 2 | . $(dirname $0)/INSTALLCONFIG.FILE 3 | 4 | BUILD_DIR=$1 5 | BUILD_SIM=$2 6 | 7 | # uninstall files from LIB_DIR 8 | $RM ${LIB_FILES[@]/#/$LIB_DIR/} 9 | 10 | # uninstall files from CIM_LIB_DIR 11 | $RM ${CIM_LIB_FILES[@]/#/$CIM_LIB_DIR/} 12 | 13 | # uninstall files from INCLUDE_DIR 14 | $RM ${INCLUDE_FILES[@]/#/$INCLUDE_DIR/} 15 | 16 | # uninstall files from BIN_DIR 17 | $RM ${BIN_FILES[@]/#/$BIN_DIR/} 18 | 19 | # uninstall monitor service 20 | $RM $RPM_ROOT$UNIT_DIR/$MONITOR_NAME 21 | 22 | #uninstall Pegasus files 23 | $RM $PEGASUS_MOF_FILES 24 | $RMDIR $RPM_ROOT$PEGASUS_MOFDIR 25 | $RMDIR $RPM_ROOT$PRODUCT_DATADIR/Pegasus 26 | 27 | #uninstall SFCB files 28 | $RM $SFCB_DIR/$SFCB_MOF_FILES 29 | $RM $SFCB_DIR/$SFCB_REG_FILE 30 | $RMDIR $RPM_ROOT$SFCB_DIR 31 | 32 | $RM $RPM_ROOT$SYSCONF_DIR/ld.so.conf.d/$LINUX_PRODUCT_NAME-$HW_ARCH.conf 33 | 34 | # uninstall shared files 35 | $RM ${DATADIR_FILES[@]/#/$PRODUCT_DATADIR/} 36 | $RMDIR $RPM_ROOT$PRODUCT_DATADIR 37 | 38 | #uninstall manpage files 39 | $RM $MANPAGE_GZ_FILES 40 | mandb 41 | 42 | if [ $BUILD_SIM -eq 1 ] 43 | then 44 | # remove simulator DB 45 | $RM $RPM_ROOT$PRODUCT_DATADIR/sim_system.db 46 | fi 47 | 48 | -------------------------------------------------------------------------------- /install/windows/install.cmd: -------------------------------------------------------------------------------- 1 | REM setup for install 2 | set CIM_LIB_SONAME=libixpdimm-cim 3 | echo CIM_LIB_SONAME:%CIM_LIB_SONAME% 4 | set ROOT=. 5 | set BUILD_DIR=%1 6 | set BUILD_SIM=%2 7 | set NAMESPACES=interop root\interop root\PG_Interop 8 | 9 | cd %BUILD_DIR% 10 | REM register the DLL 11 | regsvr32 /s %CIM_LIB_SONAME%.dll 12 | REM compile and load the MOF file 13 | mofcomp.exe -N:root\intelwbem intelwbem.mof 14 | REM registration MOF file 15 | mofcomp.exe -N:root\intelwbem register.mof 16 | 17 | REM register with default namespace 18 | for %%a in (%NAMESPACES%) do ( 19 | powershell gwmi -namespace %%a -list 2>nul 20 | if %ERRORLEVEL% == 0 ( 21 | mofcomp.exe -N:%%a profile_registration.mof 22 | ) 23 | ) 24 | if /I "%BUILD_SIM%" EQU "1" 25 | REM Setup simulator 26 | del cim_system.db; create_simulator.exe --path `pwd`; move apss.dat.smoke apss.dat 27 | endif 28 | -------------------------------------------------------------------------------- /install/windows/uninstall.cmd: -------------------------------------------------------------------------------- 1 | set CIM_LIB_SONAME=libixpdimm-cim 2 | echo CIM_LIB_SONAME:%CIM_LIB_SONAME% 3 | set ROOT=. 4 | set BUILD_DIR=%1 5 | set BUILD_SIM=%2 6 | set NAMESPACES=interop root\interop root\PG_Interop 7 | 8 | cd %BUILD_DIR% 9 | regsvr32 /s /u %CIM_LIB_SONAME%.dll 10 | powershell gwmi -N:root -Query \"SELECT * from __Namespace WHERE Name = \'intelwbem\'\" "|" rwmi 11 | 12 | REM unregister from default namespace 13 | for %%a in (%NAMESPACES%) do ( 14 | powershell gwmi -namespace %%a -list 2>nul 15 | if %ERRORLEVEL% == 0 ( 16 | mofcomp.exe -N:%%a profile_registration.mof 17 | powershell rwmi -N:%%a -class Intel_ElementConformsToProfile; \ 18 | powershell rwmi -N:%%a -class intel_registeredprofile; \ 19 | break; \ 20 | ) 21 | ) 22 | 23 | REM might need to stop the WMI Service after registering the DLL and running a query against it. 24 | REM Unregistering the dll doesn't work most of the time. The following command will stop the WMI service. (must be admin) 25 | REM net stop "Windows Management Instrumentation" 26 | -------------------------------------------------------------------------------- /scripts/TestMI.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import print_function 4 | import pywbem 5 | import sys 6 | import getpass 7 | 8 | 9 | # support Python 2.x and 3.x for future compatibility 10 | # In practice PyWBEM is only available for 2.x at this time 11 | try: 12 | input = raw_input 13 | except: 14 | pass 15 | 16 | class IntelWbemTester(object): 17 | NAMESPACE_INTEL = 'root/intelwbem' 18 | NAMESPACE_INTEROP = 'root/interop' 19 | 20 | def __init__(self, namespace, host='localhost'): 21 | self.WBEM_HOST = host 22 | self.namespace = namespace 23 | self.connection = self.get_local_connection() 24 | self.assert_count = 0 25 | 26 | def get_local_connection(self): 27 | 'Sets up a connection to a WBEM server.' 28 | print("Testing Intel WBEM requires admin permissions.") 29 | username = input("Admin username: ") 30 | password = getpass.getpass() 31 | 32 | return pywbem.WBEMConnection('http://' + self.WBEM_HOST, 33 | creds=(username, password), 34 | default_namespace=self.namespace) 35 | 36 | 37 | def start(): 38 | tester = IntelWbemTester(IntelWbemTester.NAMESPACE_INTEL) 39 | processes = tester.connection.EnumerateInstances('Intel_BaseServer') 40 | process = processes[0] 41 | print("Value: ", process.items()) 42 | process['LogLevel'] = pywbem.Uint16(0) 43 | process['LogMax'] = pywbem.Uint32(800) 44 | print("Process: ", process.items()) 45 | tester.connection.ModifyInstance(process, PropertyList=['LogLevel','LogMax']) 46 | print("Modifying done") 47 | processes1 = tester.connection.EnumerateInstances('Intel_BaseServer') 48 | process1 = processes1[0] 49 | print("Modified LogMax: ", process1.items()) 50 | 51 | def stop(): 52 | tester.setup() 53 | 54 | 55 | action = "start" 56 | if len(sys.argv) > 1: 57 | action = sys.argv[1] 58 | exec(action + "()") 59 | -------------------------------------------------------------------------------- /scripts/create_ixpdimm-monitor_manpage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import subprocess 4 | import platform 5 | import os 6 | import time 7 | import sys 8 | import manpage_helper 9 | 10 | usageString = "Usage: create_ixpdimm-monitor_manpage.py " + manpage_helper.usage 11 | 12 | ################################################################# 13 | # Start here 14 | ################################################################# 15 | 16 | # Must be running on Linux 17 | if "Linux" not in platform.system(): 18 | exit("ERROR: Man page creation must be done on Linux.") 19 | 20 | # Text file must exist 21 | inputTextFileName = "ixpdimm-monitor.manpage.text" 22 | 23 | if not os.path.exists(inputTextFileName): 24 | exit("ERROR: Missing header file '" + inputTextFileName + "' to create man page.") 25 | 26 | #create temporary text file to be converted to the formatted man page later 27 | tempTextFileName = "ixpdimm-monitorMan.txt" 28 | 29 | # names from command line inputs override defaults 30 | for i in range(len(sys.argv)): 31 | if i > 0: 32 | if manpage_helper.setProductName(sys.argv[i]) < 0: 33 | exit(usageString) 34 | 35 | # add title line 36 | title = manpage_helper.serviceName + " 8 \"" + time.strftime("%B %d, %Y") + "\" \"\" \"" + manpage_helper.fullProductName + " Monitor\"" 37 | with open(tempTextFileName, 'w') as manfile: 38 | manfile.write(title) 39 | 40 | # copy input text file, replacing product name in text 41 | manfile.write(manpage_helper.getFileWithReplacedData(inputTextFileName)) 42 | 43 | # Create formatted man page from text file 44 | os.system('sed -f ixpdimm-cli.sed ' + tempTextFileName + ' > temp.txt') 45 | os.system('nroff -e -mandoc temp.txt 1>/dev/null') 46 | os.system('mv temp.txt ' + manpage_helper.serviceName + '.8') 47 | os.system('rm -f ' + manpage_helper.serviceName + '.8.gz') 48 | os.system('gzip ' + manpage_helper.serviceName + '.8') 49 | 50 | #delete temp files 51 | os.system('rm ' + tempTextFileName) 52 | 53 | # View man page by doing a 'man ./ixpdimm-monitor.8.gz' 54 | # Installation needs to put this ixpdimm-monitor.8.gz file in the man8 subdirectory in the 55 | # system's man path 56 | -------------------------------------------------------------------------------- /scripts/get_max_libtest_arg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | SRC_ROOT=$(dirname "$(dirname "$(readlink -f "$0")")") 4 | 5 | sed -n -e '/Test suite options/,/End test suite options/p' "${SRC_ROOT}/src/lib/unittest/test_driver.c" | \ 6 | grep '#define' | \ 7 | awk '$3>x{x=$3};END{ print $3 }' 8 | -------------------------------------------------------------------------------- /scripts/ixpdimm-cli.manpage.header: -------------------------------------------------------------------------------- 1 | 2 | NAME 3 | **cliName** - CLI to manage **fullProductName**s 4 | 5 | SYNOPSIS 6 | .B **cliName** 7 | [] [] [] 8 | 9 | .P 10 | verb 11 | .RS 12 | A command has a single verb which represents the action to be taken. 13 | Verb choices are 14 | .BR create , 15 | .BR delete , 16 | .BR dump , 17 | .BR help , 18 | .BR load , 19 | .BR set , 20 | .BR show , 21 | .BR start , 22 | and 23 | .BR version . 24 | Use 25 | .RS 26 | 27 | .B -help 28 | .RE 29 | to see available commands for a specific verb. 30 | .RE 31 | 32 | options 33 | .RS 34 | Following the verb are zero or more options which modify the action of the verb; overriding the default behavior with explicitly requested behavior. 35 | .RE 36 | 37 | targets 38 | .RS 39 | Generally one or more targets are required to indicate the object of the action. 40 | Use 41 | .RS 42 | 43 | .B -help 44 | 45 | .RE 46 | to see available commands for a verb/target pair. 47 | .RE 48 | 49 | properties 50 | .RS 51 | Finally, zero or more properties defined as a key/value pair can be used to modify the target. 52 | .RE 53 | 54 | DESCRIPTION 55 | 56 | Command line access to **abbrProductName** Management functionality is available through the **cliName** component. The NVMCLI exposes all available management features of the underlying **abbrProductName**. The Command Line Interface is an end-user, manufacturing and validation utility. 57 | 58 | -------------------------------------------------------------------------------- /scripts/ixpdimm-cli.sed: -------------------------------------------------------------------------------- 1 | 1s/^\(.*\)$/\.TH \1/ 2 | /NAME/s/^\(.*\)$/\.SH \1/ 3 | /SYNOPSIS/s/^\(.*\)$/\.SH \1/ 4 | /DESCRIPTION/s/^\(.*\)$/\.SH \1/ 5 | /OPTION/s/^\(.*\)$/\.SH \1/ 6 | /\/s/^\(.*\)$/\.SH \1/ 7 | /AUTHOR/s/^\(.*\)$/\.SH \1/ 8 | /SEE ALSO/s/^\(.*\)$/\.SH \1/ 9 | /EXIT CODES/s/^\(.*\)$/\.SH \1/ 10 | /HISTORY/s/^\(.*\)$/\.SH \1/ 11 | /FILES/s/^\(.*\)$/\.SH \1/ 12 | -------------------------------------------------------------------------------- /scripts/ixpdimm-monitor.manpage.text: -------------------------------------------------------------------------------- 1 | 2 | NAME 3 | **serviceName** - Daemon to monitor **fullProductName** management events. Used by **cliName**. 4 | 5 | SYNOPSIS 6 | .B **serviceName** 7 | .RB [ -d ] 8 | 9 | DESCRIPTION 10 | 11 | Daemon to monitor **fullProductName** management events. These events can be viewed using **cliName**. 12 | 13 | OPTION 14 | .TP 15 | .B -d 16 | Starts 17 | .B **serviceName** 18 | as a background daemon. 19 | 20 | EXIT CODES 21 | 22 | .TP 23 | .B 0 24 | The operation succeeded. 25 | .TP 26 | .B 1 27 | An error occurred. 28 | 29 | FILES 30 | **dataPath**/apss.dat 31 | .br 32 | /var/run/**serviceName**.pid 33 | 34 | SEE ALSO 35 | **cliName** (8) 36 | 37 | AUTHOR 38 | Created by Intel Corporation. 39 | -------------------------------------------------------------------------------- /src/acpi/nfit_parser.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef _NFIT_INTERFACE_NFIT_PARSER_H_ 28 | #define _NFIT_INTERFACE_NFIT_PARSER_H_ 29 | 30 | #include "nfit.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | //- for t in sub_tables 38 | /* 39 | * Allocate space for and copy the {{t.name}} table 40 | * to the parsed_nfit structure. 41 | */ 42 | int add_{{t.name}}_to_parsed_nfit( 43 | struct parsed_nfit* p_nfit, 44 | const struct {{t.name}} *p_{{t.name}}_table); 45 | //- endfor 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif //_NFIT_INTERFACE_NFIT_PRINTER_H_ -------------------------------------------------------------------------------- /src/acpi/nfit_printer.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef _NFIT_INTERFACE_NFIT_PRINTER_H_ 28 | #define _NFIT_INTERFACE_NFIT_PRINTER_H_ 29 | 30 | #include "nfit.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | //- for t in all_tables 38 | /* 39 | * Print an NFIT {{t.name}} extension table 40 | */ 41 | void print_{{t.name}}_table( 42 | const struct {{t.name}} table, 43 | const int indent_count); 44 | //- endfor 45 | 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif //_NFIT_INTERFACE_NFIT_PRINTER_H_ -------------------------------------------------------------------------------- /src/cli/cli_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include "nvm_management.h" 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_APP 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "Command Line Application" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "ixpdimm-cli.exe" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "ixpdimm-cli.exe" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | END 43 | BLOCK "VarFileInfo" 44 | BEGIN 45 | VALUE "Translation", 0x409, 1200 46 | END 47 | END 48 | 49 | #endif // !_MAC 50 | #endif // !APSTUDIO_INVOKED 51 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/cli/features/ExportCli.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _CLI_EXPORT_H_ 29 | #define _CLI_EXPORT_H_ 30 | 31 | /* 32 | * Macros for controlling what is exported by the library 33 | */ 34 | #ifdef __WINDOWS__ // Windows 35 | #define NVM_CLI_DLL_IMPORT __declspec(dllimport) 36 | #define NVM_CLI_DLL_EXPORT __declspec(dllexport) 37 | #else // Linux/ESX 38 | #define NVM_CLI_DLL_IMPORT __attribute__((visibility("default"))) 39 | #define NVM_CLI_DLL_EXPORT __attribute__((visibility("default"))) 40 | #endif // end Linux/ESX 41 | 42 | // NVM_CLI_API is used for the public API symbols. 43 | // NVM_LOCAL is used for non-api symbols. 44 | #ifdef __NVM_DLL__ // defined if compiled as a DLL 45 | #ifdef __NVM_CLI_DLL_EXPORTS__ // defined if we are building the DLL (instead of using it) 46 | #define NVM_CLI_API NVM_CLI_DLL_EXPORT 47 | #else 48 | #define NVM_CLI_API NVM_CLI_DLL_IMPORT 49 | #endif // NVM_DLL_EXPORTS 50 | #else // NVM_DLL is not defined, everything is exported 51 | #define NVM_CLI_API 52 | #endif // NVM_DLL 53 | 54 | #endif // _CLI_EXPORT_H_ -------------------------------------------------------------------------------- /src/cli/features/core/DimmProviderAdapter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "DimmProviderAdapter.h" 29 | #include "WbemToCli_utilities.h" 30 | 31 | cli::framework::ErrorResult *cli::nvmcli::DimmProviderAdapter::getDimms( 32 | const cli::framework::ParsedCommand &parsedCommand, std::vector &dimms) const 33 | { 34 | return cli::nvmcli::getDimms(parsedCommand, dimms); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/cli/features/core/DimmProviderAdapter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_DIMMPROVIDERADAPTER_H 28 | #define CR_MGMT_DIMMPROVIDERADAPTER_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace cli 36 | { 37 | namespace nvmcli 38 | { 39 | 40 | class NVM_CLI_API DimmProviderAdapter 41 | { 42 | public: 43 | virtual cli::framework::ErrorResult *getDimms( 44 | const cli::framework::ParsedCommand &parsedCommand, 45 | std::vector &dimms) const; 46 | }; 47 | } 48 | } 49 | 50 | #endif //CR_MGMT_DIMMPROVIDERADAPTER_H 51 | -------------------------------------------------------------------------------- /src/cli/features/core/NvmCliCore.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * DLL Entry point for NVMCLI core features. 30 | */ 31 | 32 | #ifndef _CLI_NVMCLI_COREFEATURES_H_ 33 | #define _CLI_NVMCLI_COREFEATURES_H_ 34 | 35 | extern "C" 36 | 37 | #include 38 | #include 39 | 40 | /*! 41 | * register the NVMCLI core features 42 | */ 43 | NVM_CLI_API void registerFeatures(); 44 | 45 | 46 | /*! 47 | * unregister the NVMCLI core features 48 | */ 49 | NVM_CLI_API void unRegisterFeatures(); 50 | 51 | 52 | #endif /* _CLI_NVMCLI_COREFEATURES_H_ */ 53 | -------------------------------------------------------------------------------- /src/cli/features/core/StringList.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "StringList.h" 29 | 30 | namespace core 31 | { 32 | StringList::StringList() { } 33 | 34 | StringList::StringList(std::vector vector) 35 | { 36 | for (size_t i = 0; i < vector.size(); i++) 37 | { 38 | push_back(vector[i]); 39 | } 40 | } 41 | 42 | bool StringList::contains(std::string value) 43 | { 44 | return std::find(begin(), end(), value) != end(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/cli/features/core/StringList.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_STRINGLIST_H 28 | #define CR_MGMT_STRINGLIST_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace core 37 | { 38 | class NVM_CLI_API StringList : public std::vector 39 | { 40 | public: 41 | 42 | StringList(); 43 | StringList(std::vector vector); 44 | bool contains(std::string value); 45 | }; 46 | } 47 | 48 | 49 | #endif //CR_MGMT_STRINGLIST_H 50 | -------------------------------------------------------------------------------- /src/cli/features/core/VerboseController.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the functionality to turn on verbose. 30 | */ 31 | 32 | #ifndef _CLI_NVMCLI_VERBOSECONTROLLER_H_ 33 | #define _CLI_NVMCLI_VERBOSECONTROLLER_H_ 34 | 35 | #include 36 | #include 37 | 38 | namespace cli 39 | { 40 | namespace nvmcli 41 | { 42 | 43 | class NVM_CLI_API VerboseController 44 | { 45 | public: 46 | VerboseController(); 47 | virtual ~VerboseController(); 48 | virtual void enableVerbose(); 49 | virtual void disableVerbose(); 50 | virtual bool getVerbose(); 51 | virtual bool set_print_mask(int mask); 52 | virtual int get_print_mask(); 53 | 54 | protected: 55 | virtual void setVerbose(bool value); 56 | bool m_verbose; 57 | int m_printMask; 58 | }; 59 | } 60 | } 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /src/cli/features/core/VerboseFeatureBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _CLI_NVMCLI_VERBOSEFEATUREBASE_H_ 29 | #define _CLI_NVMCLI_VERBOSEFEATUREBASE_H_ 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include "VerboseController.h" 36 | 37 | namespace cli 38 | { 39 | namespace nvmcli 40 | { 41 | 42 | class NVM_CLI_API VerboseFeatureBase : public cli::framework::FeatureBase 43 | { 44 | public: 45 | VerboseFeatureBase(); 46 | virtual ~VerboseFeatureBase(); 47 | virtual void setVerboseController(VerboseController *pVerboseController); 48 | virtual void enableVerbose(const framework::ParsedCommand &cmd); 49 | virtual void disableVerbose(const framework::ParsedCommand &cmd); 50 | 51 | private: 52 | VerboseController *m_pVerboseController; 53 | }; 54 | 55 | } 56 | } 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/CliHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_CLIHELPER_H 28 | #define CR_MGMT_CLIHELPER_H 29 | 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | namespace cli 36 | { 37 | namespace framework 38 | { 39 | class NVM_CLI_API CliHelper 40 | { 41 | public: 42 | static std::vector splitCommaSeperatedString(const std::string &commaList); 43 | 44 | }; 45 | } 46 | } 47 | 48 | #endif //CR_MGMT_CLIHELPER_H 49 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/CommandBase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | 30 | #include "CommandBase.h" 31 | 32 | namespace cli 33 | { 34 | namespace framework 35 | { 36 | 37 | CommandBase::CommandBase() 38 | { 39 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 40 | m_pResult = NULL; 41 | } 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/CommandBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_COMMANDBASE_H 28 | #define CR_MGMT_COMMANDBASE_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include "DisplayOptions.h" 34 | #include "UnitsOption.h" 35 | 36 | namespace cli 37 | { 38 | namespace framework 39 | { 40 | class NVM_CLI_API CommandBase 41 | { 42 | public: 43 | CommandBase(); 44 | virtual ResultBase *execute(const ParsedCommand &parsedCommand) = 0; 45 | 46 | framework::ResultBase *m_pResult; 47 | framework::ParsedCommand m_parsedCommand; 48 | framework::DisplayOptions m_displayOptions; 49 | framework::UnitsOption m_unitsOption; 50 | }; 51 | } 52 | } 53 | 54 | 55 | 56 | #endif //CR_MGMT_COMMANDBASE_H 57 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/ConsoleAdapter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include 29 | #include "ConsoleAdapter.h" 30 | 31 | 32 | namespace cli 33 | { 34 | namespace framework 35 | { 36 | 37 | ConsoleAdapter *ConsoleAdapter::m_pSingleton = NULL; 38 | 39 | ConsoleAdapter &ConsoleAdapter::getAdapter() 40 | { 41 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 42 | if (!m_pSingleton) 43 | { 44 | m_pSingleton = new ConsoleAdapter(); 45 | } 46 | 47 | return *m_pSingleton; 48 | 49 | } 50 | 51 | std::string ConsoleAdapter::getLine() const 52 | { 53 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 54 | std::string line; 55 | std::getline(std::cin, line); 56 | return line; 57 | } 58 | 59 | void ConsoleAdapter::write(const std::string &str) const 60 | { 61 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 62 | std::cout << str; 63 | } 64 | 65 | 66 | } 67 | } -------------------------------------------------------------------------------- /src/cli/features/core/framework/ConsoleAdapter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_GETLINE_H 28 | #define CR_MGMT_GETLINE_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace cli 36 | { 37 | namespace framework 38 | { 39 | /* 40 | * NOTE: This is a humble object and will not have unit tests 41 | */ 42 | class NVM_CLI_API ConsoleAdapter 43 | { 44 | public: 45 | virtual std::string getLine() const; 46 | virtual void write(const std::string &str) const; 47 | static ConsoleAdapter &getAdapter(); 48 | 49 | private: 50 | static ConsoleAdapter *m_pSingleton; 51 | }; 52 | 53 | } 54 | } 55 | 56 | 57 | #endif //CR_MGMT_GETLINE_H 58 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/DisplayOptions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_DISPLAYOPTIONS_H 28 | #define CR_MGMT_DISPLAYOPTIONS_H 29 | 30 | #include 31 | #include 32 | 33 | namespace cli 34 | { 35 | namespace framework 36 | { 37 | class NVM_CLI_API DisplayOptions 38 | { 39 | public: 40 | DisplayOptions(StringMap options = StringMap()) : m_options(options) { } 41 | bool isDefault() const; 42 | bool isAll() const; 43 | std::vector getDisplay() const; 44 | bool contains(const std::string &name) const; 45 | DisplayOptions& operator= (const DisplayOptions &other); 46 | 47 | private: 48 | StringMap m_options; 49 | }; 50 | } 51 | } 52 | 53 | #endif //CR_MGMT_DISPLAYOPTIONS_H 54 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/PropertyDefinitionBase.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "PropertyDefinitionBase.h" 29 | 30 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/PropertyDefinitionList.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "PropertyDefinitionList.h" 29 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/UnitsOption.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_UNITSOPTION_H 28 | #define CR_MGMT_UNITSOPTION_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | namespace cli 35 | { 36 | namespace framework 37 | { 38 | class NVM_CLI_API UnitsOption 39 | { 40 | public: 41 | UnitsOption(StringMap options = StringMap()) : m_options(options) { } 42 | std::string getCapacityUnits() const; 43 | UnitsOption& operator= (const UnitsOption &other); 44 | bool isValid() const; 45 | bool isEmpty() const; 46 | 47 | private: 48 | StringMap m_options; 49 | }; 50 | } 51 | } 52 | 53 | #endif //CR_MGMT_UNITSOPTION_H 54 | -------------------------------------------------------------------------------- /src/cli/features/core/framework/YesNoPrompt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_YESNOPROMPT_H 28 | #define CR_MGMT_YESNOPROMPT_H 29 | 30 | #include 31 | #include 32 | #include "ConsoleAdapter.h" 33 | #include 34 | #include 35 | 36 | namespace cli 37 | { 38 | namespace framework 39 | { 40 | class NVM_CLI_API YesNoPrompt 41 | { 42 | public: 43 | YesNoPrompt(const ConsoleAdapter &consoleAdapter = ConsoleAdapter::getAdapter()); 44 | virtual bool prompt(const std::string &message) const; 45 | private: 46 | const ConsoleAdapter &m_consoleAdapter; 47 | std::string buildQuestion(const std::string &message) const; 48 | void askQuestion(const std::string &question) const; 49 | std::string getAnswer() const; 50 | 51 | bool isAnswerCorrect(const std::string &answer) const; 52 | }; 53 | 54 | } 55 | } 56 | 57 | #endif //CR_MGMT_YESNOPROMPT_H 58 | -------------------------------------------------------------------------------- /src/cli/features/core/nvmcli_core_features_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_DLL 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "CLI Core Features Library" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "libixpdimm-cli.dll" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "libixpdimm-cli.dll" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | 43 | END 44 | BLOCK "VarFileInfo" 45 | BEGIN 46 | VALUE "Translation", 0x409, 1200 47 | END 48 | END 49 | 50 | #endif // !_MAC 51 | #endif // !APSTUDIO_INVOKED 52 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/common/common.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _COMMON_H_ 29 | #define _COMMON_H_ 30 | 31 | #ifdef __cplusplus 32 | extern "C" 33 | { 34 | #endif 35 | 36 | #ifdef __MSVC__ 37 | #define PACK_STRUCT(_structure_) __pragma(pack(push,1)) _structure_; __pragma(pack(pop)) 38 | 39 | #else 40 | #define PACK_STRUCT(_structure_) _structure_ __attribute__((packed)); 41 | #endif 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif // _COMMON_H_ 48 | -------------------------------------------------------------------------------- /src/common/cr_i18n.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file defines the interface to the internationalization library. 30 | */ 31 | 32 | #ifndef CR_I18N_H_ 33 | #define CR_I18N_H_ 34 | 35 | #ifdef __INTEL_I18N__ 36 | #include 37 | #else 38 | #include 39 | #endif 40 | 41 | #define TR(String) cr_gettext(String) //!< Translation Marker 42 | #define TRS(String) cr_gettext(String.c_str()) //!< Translation Marker for a std::string 43 | #define N_TR(String) String //!< Translation Marker with a no-op 44 | 45 | /*! 46 | * Used to steer all gettext calls to this one point 47 | * so that klockworks warnings can be suppressed. 48 | */ 49 | static inline const char *cr_gettext(const char *txt) 50 | { 51 | return (gettext(txt)); 52 | } 53 | #endif /* CR_I18N_H_ */ 54 | -------------------------------------------------------------------------------- /src/common/encrypt/public.rev0.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4oCti8y3/SdVYaHs3BDU 3 | 7GxkfxI24Jz6kSYnnoEFvaF+U6Dn1gmHL36+6WCcabKnNggj5hptQyTu/rQWjcqy 4 | HFEycOyEAyivtT0XR8umYc3Gc6AoqF5P4mtsJCAi5b6euNNbgSfdPj69jeB/+R1l 5 | FuiIv3RwYakzEivcjkLKpz93cuq/wc47+71xKp2W0oIDW3LPtZVuuibKpGtRmdIX 6 | rPtu6e7Jff8OZhZfQu5Oc3y/rHggQtNbVgbS56Llqd4ew1yGlQjEJDVX6X7wTsy4 7 | smyjQf+MphqHF4Zl5qrXqKuISxKTVzWx9sAr9OBbJdTEEFnkXM4hJO0Vj5bzEJ2Q 8 | yQIDAQAB 9 | -----END PUBLIC KEY----- 10 | -------------------------------------------------------------------------------- /src/common/os/win_msgs.mc: -------------------------------------------------------------------------------- 1 | MessageIdTypedef=DWORD 2 | 3 | SeverityNames=( 4 | Informational=0x0:INFORMATIONAL_EVENT 5 | Warning=0x1:WARNING_EVENT 6 | Error=0x2:ERROR_EVENT 7 | ) 8 | 9 | 10 | FacilityNames=( 11 | Service=0x0:FACILITY_SERVICE 12 | ) 13 | 14 | LanguageNames=(EnglishUS=0x401:MSG00401) 15 | 16 | ; // The following are message definitions. 17 | 18 | MessageId=0x0 19 | Severity=Informational 20 | Facility=Service 21 | SymbolicName=NVMDIMM_INFORMATIONAL 22 | Language=EnglishUS 23 | %1 24 | . 25 | 26 | MessageId=0x1 27 | Severity=Warning 28 | Facility=Service 29 | SymbolicName=NVMDIMM_WARNING 30 | Language=EnglishUS 31 | %1 32 | . 33 | 34 | MessageId=0x2 35 | Severity=Error 36 | Facility=Service 37 | SymbolicName=NVMDIMM_ERROR 38 | Language=EnglishUS 39 | %1 40 | . 41 | 42 | ; // A message file must end with a period on its own line 43 | ; // followed by a blank line. 44 | -------------------------------------------------------------------------------- /src/common/string/x_str.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of common string tokenizer utilities. 30 | */ 31 | 32 | #include 33 | #include 34 | #include "x_str.h" 35 | 36 | /* 37 | * Tokenize a string such that no token is omitted. 38 | */ 39 | char *x_strtok(char **input, const char *delims) 40 | { 41 | if ((input == NULL) || (*input == NULL) || (delims == NULL)) 42 | { 43 | return (NULL); 44 | } 45 | 46 | char *token = *input; 47 | char *remainder = token + strcspn(token, delims); 48 | if (*remainder != '\0') 49 | { 50 | *remainder++ = '\0'; 51 | *input = remainder; 52 | } 53 | else // last token - end of string 54 | { 55 | *input = NULL; 56 | } 57 | return (token); 58 | } 59 | -------------------------------------------------------------------------------- /src/common/system/jedec_manufacturer.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/intel/ixpdimm_sw/dbd3c99f3524ca6aff80f194ff0f67d4a543b9e3/src/common/system/jedec_manufacturer.c -------------------------------------------------------------------------------- /src/common/system/jedec_manufacturer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains a method to lookup the Jedec standard manufacturer from the ID. 30 | * The strings come directly from the Jedec specification. 31 | */ 32 | 33 | 34 | #ifndef _JEDEC_MANUFACTURER_H_ 35 | #define _JEDEC_MANUFACTURER_H_ 36 | 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" 42 | { 43 | #endif 44 | 45 | /*! 46 | * Lookup the manufacturer name given the JEDEC JEP-106 manufacturer ID. 47 | */ 48 | NVM_COMMON_API extern int lookup_jedec_jep106_manufacturer( 49 | const unsigned char *manufacturer_id, const int manufacturer_id_len, 50 | char *manufacturer, const COMMON_SIZE manufacturer_len); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif /* _JEDEC_MANUFACTURER_H_ */ 57 | -------------------------------------------------------------------------------- /src/common/uid/uid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UID_H_ 29 | #define UID_H_ 30 | 31 | #ifdef __cplusplus 32 | extern "C" 33 | { 34 | #endif 35 | 36 | #include 37 | #include 38 | 39 | NVM_COMMON_API extern void uid_copy(const char *src, COMMON_UID dst); 40 | 41 | NVM_COMMON_API extern void guid_to_uid(const COMMON_GUID guid, COMMON_UID uid); 42 | 43 | NVM_COMMON_API extern int uid_cmp(const COMMON_UID uid1, const COMMON_UID uid2); 44 | NVM_COMMON_API extern int get_uid_index(const COMMON_UID uid, const COMMON_UID *uid_list, 45 | const COMMON_UINT16 uid_list_len); 46 | NVM_COMMON_API extern COMMON_BOOL is_uid_in_list(const COMMON_UID uid, const COMMON_UID *uid_list, 47 | const COMMON_UINT16 uid_list_len); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* UID_H_ */ 54 | -------------------------------------------------------------------------------- /src/core/Collection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "Collection.h" 29 | 30 | -------------------------------------------------------------------------------- /src/core/Result.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | 29 | #ifndef CR_MGMT_RESULT_H 30 | #define CR_MGMT_RESULT_H 31 | 32 | #include "ExportCore.h" 33 | 34 | namespace core 35 | { 36 | template 37 | class Result 38 | { 39 | public: 40 | Result(const Result &other) : m_pResult(other.m_pResult->clone()) 41 | { 42 | } 43 | 44 | Result(T &result) : m_pResult(result.clone()) 45 | { 46 | } 47 | 48 | ~Result() { delete m_pResult; } 49 | 50 | Result& operator=(const Result &other) 51 | { 52 | if (this != &other) 53 | { 54 | delete m_pResult; 55 | m_pResult = other.m_pResult->clone(); 56 | } 57 | 58 | return *this; 59 | } 60 | 61 | T &getValue() { return *m_pResult; } 62 | 63 | protected: 64 | T *m_pResult; 65 | }; 66 | 67 | } 68 | 69 | #endif //CR_MGMT_RESULT_H 70 | -------------------------------------------------------------------------------- /src/core/core_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_DLL 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "Core Library" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "libixpdimm-core.dll" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "libixpdimm-core.dll" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | 43 | END 44 | BLOCK "VarFileInfo" 45 | BEGIN 46 | VALUE "Translation", 0x409, 1200 47 | END 48 | END 49 | 50 | #endif // !_MAC 51 | #endif // !APSTUDIO_INVOKED 52 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/core/device/DeviceFirmwareService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_DEVICEFIRMWARESERVICE_H 28 | #define CR_MGMT_DEVICEFIRMWARESERVICE_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include "DeviceFirmwareInfoCollection.h" 34 | #include 35 | 36 | namespace core 37 | { 38 | namespace device 39 | { 40 | class NVM_CORE_API DeviceFirmwareService 41 | { 42 | public: 43 | DeviceFirmwareService(NvmLibrary &lib = NvmLibrary::getNvmLibrary()) : m_lib(lib) { } 44 | virtual ~DeviceFirmwareService(); 45 | virtual core::Result getFirmwareInfo(const std::string &deviceUid); 46 | 47 | static DeviceFirmwareService &getService(); 48 | 49 | protected: 50 | NvmLibrary &m_lib; 51 | }; 52 | 53 | } 54 | } 55 | 56 | #endif //CR_MGMT_DEVICEFIRMWARESERVICE_H 57 | -------------------------------------------------------------------------------- /src/core/device/DeviceHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_DEVICEHELPER_H 28 | #define CR_MGMT_DEVICEHELPER_H 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | namespace core 35 | { 36 | namespace device 37 | { 38 | 39 | NVM_CORE_API bool isUidValid(const std::string &uid); 40 | 41 | /* 42 | * The following two functions are useful when needing to split a string that is part UID part 43 | * something else. For example: 8080-12345678temp 44 | */ 45 | NVM_CORE_API int findUidEnd(const std::string &stringWithUidAtBeginning); 46 | NVM_CORE_API int findUidStart(const std::string &stringWithUidAtEnd); 47 | } 48 | } 49 | 50 | #endif //CR_MGMT_DEVICEHELPER_H 51 | -------------------------------------------------------------------------------- /src/core/device/TopologyService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_TOPOLOGYSERVICE_H 28 | #define CR_MGMT_TOPOLOGYSERVICE_H 29 | 30 | #include 31 | #include 32 | #include "Topology.h" 33 | 34 | namespace core 35 | { 36 | namespace device 37 | { 38 | class NVM_CORE_API TopologyService 39 | { 40 | public: 41 | TopologyService(NvmLibrary &lib = NvmLibrary::getNvmLibrary()) : m_lib(lib) { } 42 | virtual TopologyCollection getAllTopologies(); 43 | virtual ~TopologyService() { } 44 | 45 | static TopologyService &getService(); 46 | private: 47 | NvmLibrary &m_lib; 48 | }; 49 | } 50 | } 51 | 52 | #endif //CR_MGMT_TOPOLOGYSERVICE_H 53 | -------------------------------------------------------------------------------- /src/core/exceptions/InvalidArgumentException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "InvalidArgumentException.h" 29 | -------------------------------------------------------------------------------- /src/core/exceptions/LibraryException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "LibraryException.h" 29 | 30 | -------------------------------------------------------------------------------- /src/core/exceptions/NoMemoryException.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "NoMemoryException.h" 29 | -------------------------------------------------------------------------------- /src/core/exceptions/NoMemoryException.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_NOMEMORYEXCEPTION_H 28 | #define CR_MGMT_NOMEMORYEXCEPTION_H 29 | 30 | 31 | #include 32 | #include 33 | #include 34 | 35 | #ifdef _MSC_VER 36 | // https://stackoverflow.com/questions/24511376/how-to-dllexport-a-class-derived-from-stdruntime-error 37 | #pragma warning( disable : 4275 ) 38 | #endif 39 | 40 | namespace core 41 | { 42 | class NVM_CORE_API NoMemoryException : public std::exception 43 | { 44 | 45 | }; 46 | 47 | } 48 | 49 | #endif //CR_MGMT_NOMEMORYEXCEPTION_H 50 | -------------------------------------------------------------------------------- /src/core/logs/Log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef SRC_CORE_LOGS_LOG_H_ 29 | #define SRC_CORE_LOGS_LOG_H_ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace core 37 | { 38 | namespace logs 39 | { 40 | 41 | class NVM_CORE_API Log 42 | { 43 | public: 44 | Log(); 45 | Log(const struct nvm_log &log); 46 | Log(const Log &other); 47 | virtual ~Log(); 48 | 49 | Log &operator=(const Log &other); 50 | void copy(const Log &other); 51 | 52 | bool operator>(Log rhs) const; 53 | 54 | virtual Log *clone() const; 55 | 56 | virtual std::string getFileName(); 57 | virtual NVM_UINT32 getLineNumber(); 58 | virtual std::string getLogMessage(); 59 | virtual time_t getTime(); 60 | virtual enum log_level getLogLevel(); 61 | 62 | private: 63 | struct nvm_log m_log; 64 | }; 65 | 66 | } 67 | } 68 | 69 | #endif /* SRC_CORE_LOGS_LOG_H_ */ 70 | -------------------------------------------------------------------------------- /src/core/logs/LogService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef SRC_CORE_LOGS_LOGSERVICE_H_ 29 | #define SRC_CORE_LOGS_LOGSERVICE_H_ 30 | 31 | #include 32 | #include "Log.h" 33 | #include 34 | #include 35 | 36 | namespace core 37 | { 38 | namespace logs 39 | { 40 | class NVM_CORE_API LogService 41 | { 42 | public: 43 | LogService(NvmLibrary &api = NvmLibrary::getNvmLibrary()) : m_lib(api) { } 44 | virtual ~LogService() { } 45 | 46 | static LogService &getService(); 47 | 48 | virtual std::vector getAllLogsInDescOrderbyTime(); 49 | virtual int getLogsCount(); 50 | 51 | protected: 52 | NvmLibrary &m_lib; 53 | }; 54 | 55 | } 56 | } 57 | 58 | #endif /* SRC_CORE_LOGS_LOGSERVICE_H_ */ 59 | -------------------------------------------------------------------------------- /src/core/memory_allocator/PostLayoutCheck.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Base class for layout checks that verify the validity of a MemoryAllocationLayout. 30 | * A failed check is expected to throw some kind of descriptive exception. 31 | */ 32 | 33 | #ifndef _core_LOGIC_POSTLAYOUTCHECK_H_ 34 | #define _core_LOGIC_POSTLAYOUTCHECK_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace core 42 | { 43 | namespace memory_allocator 44 | { 45 | 46 | class NVM_CORE_API PostLayoutCheck 47 | { 48 | public: 49 | virtual ~PostLayoutCheck() {} 50 | 51 | virtual void verify( 52 | const MemoryAllocationRequest& request, 53 | const MemoryAllocationLayout &layout) = 0; 54 | }; 55 | } /* namespace memory_allocator */ 56 | } /* namespace core */ 57 | 58 | #endif /* _core_LOGIC_POSTLAYOUTCHECK_H_ */ 59 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RequestRule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Base class for rules that verify the validity of a MemoryAllocationRequest. 30 | * A failed rule is expected to throw some kind of descriptive exception. 31 | */ 32 | 33 | #ifndef _core_LOGIC_REQUESTRULE_H_ 34 | #define _core_LOGIC_REQUESTRULE_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | namespace core 42 | { 43 | namespace memory_allocator 44 | { 45 | 46 | class NVM_CORE_API RequestRule 47 | { 48 | public: 49 | virtual ~RequestRule() {} 50 | 51 | virtual void verify(const MemoryAllocationRequest &request) = 0; 52 | }; 53 | 54 | } /* namespace memory_allocator */ 55 | } /* namespace core */ 56 | 57 | #endif /* _core_LOGIC_REQUESTRULE_H_ */ 58 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleDimmHasConfigGoal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Rule that checks that no config goals exist on the dimms requested 30 | */ 31 | 32 | #ifndef _core_LOGIC_RULEDIMMHASCONFIGGOAL_H_ 33 | #define _core_LOGIC_RULEDIMMHASCONFIGGOAL_H_ 34 | 35 | #include 36 | #include 37 | #include "RequestRule.h" 38 | #include 39 | 40 | namespace core 41 | { 42 | namespace memory_allocator 43 | { 44 | 45 | class NVM_CORE_API RuleDimmHasConfigGoal: public RequestRule 46 | { 47 | public: 48 | RuleDimmHasConfigGoal(core::NvmLibrary &nvmLib); 49 | virtual ~RuleDimmHasConfigGoal(); 50 | virtual void verify(const MemoryAllocationRequest &request); 51 | 52 | protected: 53 | core::NvmLibrary &m_nvmLib; 54 | 55 | bool dimmHasUnappliedGoal(const std::string &dimmUid); 56 | }; 57 | 58 | } /* namespace memory_allocator */ 59 | } /* namespace core */ 60 | 61 | #endif /* _core_LOGIC_RULEDIMMHASCONFIGGOAL_H_ */ 62 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleMemoryModeCapacityNotSupported.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Rule that checks that the platform supports memory mode 30 | * if memory capacity is requested. 31 | */ 32 | 33 | #ifndef _core_LOGIC_RULEMEMORYCAPACITYNOTSUPPORTED_H_ 34 | #define _core_LOGIC_RULEMEMORYCAPACITYNOTSUPPORTED_H_ 35 | 36 | #include 37 | #include "RequestRule.h" 38 | 39 | namespace core 40 | { 41 | namespace memory_allocator 42 | { 43 | 44 | class NVM_CORE_API RuleMemoryModeCapacityNotSupported: public RequestRule 45 | { 46 | public: 47 | RuleMemoryModeCapacityNotSupported(const struct nvm_capabilities &systemCapabilities); 48 | virtual ~RuleMemoryModeCapacityNotSupported(); 49 | virtual void verify(const MemoryAllocationRequest &request); 50 | 51 | protected: 52 | struct nvm_capabilities m_systemCapabilities; 53 | }; 54 | 55 | } /* namespace memory_allocator */ 56 | } /* namespace core */ 57 | 58 | #endif /* _core_LOGIC_RULEMEMORYCAPACITYNOTSUPPORTED_H_ */ 59 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleMirroredAppDirectNotSupported.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "RuleMirroredAppDirectNotSupported.h" 29 | 30 | #include 31 | #include 32 | 33 | core::memory_allocator::RuleMirroredAppDirectNotSupported::RuleMirroredAppDirectNotSupported() 34 | { 35 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 36 | } 37 | 38 | core::memory_allocator::RuleMirroredAppDirectNotSupported::~RuleMirroredAppDirectNotSupported() 39 | { 40 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 41 | } 42 | 43 | void core::memory_allocator::RuleMirroredAppDirectNotSupported::verify( 44 | const MemoryAllocationRequest& request) 45 | { 46 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 47 | 48 | if (request.getAppDirectExtent().mirrored) 49 | { 50 | throw core::NvmExceptionRequestNotSupported(); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleMirroredAppDirectNotSupported.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef SRC_core_LOGIC_RULEMIRROREDAPPDIRECTNOTSUPPORTED_H_ 29 | #define SRC_core_LOGIC_RULEMIRROREDAPPDIRECTNOTSUPPORTED_H_ 30 | 31 | #include 32 | #include "RequestRule.h" 33 | 34 | namespace core 35 | { 36 | namespace memory_allocator 37 | { 38 | 39 | class NVM_CORE_API RuleMirroredAppDirectNotSupported: public RequestRule 40 | { 41 | public: 42 | RuleMirroredAppDirectNotSupported(); 43 | virtual ~RuleMirroredAppDirectNotSupported(); 44 | 45 | virtual void verify(const MemoryAllocationRequest &request); 46 | }; 47 | 48 | } /* namespace memory_allocator */ 49 | } /* namespace core */ 50 | 51 | #endif /* SRC_core_LOGIC_RULEMIRROREDAPPDIRECTNOTSUPPORTED_H_ */ 52 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleNoDimms.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Rule that checks a MemoryAllocationRequest to make sure it has at least one DIMM 30 | */ 31 | 32 | #include "RuleNoDimms.h" 33 | 34 | #include 35 | #include 36 | 37 | core::memory_allocator::RuleNoDimms::RuleNoDimms() 38 | { 39 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 40 | } 41 | 42 | core::memory_allocator::RuleNoDimms::~RuleNoDimms() 43 | { 44 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 45 | } 46 | 47 | void core::memory_allocator::RuleNoDimms::verify(const MemoryAllocationRequest &request) 48 | { 49 | LogEnterExit logging(__FUNCTION__, __FILE__, __LINE__); 50 | 51 | if (request.getNumberOfDimms() == 0) 52 | { 53 | throw core::NvmExceptionBadRequestNoDimms(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleNoDimms.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Rule that checks a MemoryAllocationRequest to make sure it has at least one DIMM 30 | */ 31 | 32 | #ifndef _core_LOGIC_RULENODIMMS_H_ 33 | #define _core_LOGIC_RULENODIMMS_H_ 34 | 35 | #include 36 | #include "RequestRule.h" 37 | 38 | namespace core 39 | { 40 | namespace memory_allocator 41 | { 42 | 43 | class NVM_CORE_API RuleNoDimms: public RequestRule 44 | { 45 | public: 46 | RuleNoDimms(); 47 | virtual ~RuleNoDimms(); 48 | virtual void verify(const MemoryAllocationRequest &request); 49 | }; 50 | 51 | } /* namespace memory_allocator */ 52 | } /* namespace core */ 53 | 54 | #endif /* _core_LOGIC_RULENODIMMS_H_ */ 55 | -------------------------------------------------------------------------------- /src/core/memory_allocator/RuleProvisionCapacityNotSupported.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Rule that checks a MemoryAllocationRequest is supported 30 | */ 31 | 32 | #ifndef _core_LOGIC_RULEPROVISIONCAPACITYNOTSUPPORTED_H_ 33 | #define _core_LOGIC_RULEPROVISIONCAPACITYNOTSUPPORTED_H_ 34 | 35 | #include 36 | #include "RequestRule.h" 37 | 38 | namespace core 39 | { 40 | namespace memory_allocator 41 | { 42 | 43 | class NVM_CORE_API RuleProvisionCapacityNotSupported: public RequestRule 44 | { 45 | public: 46 | RuleProvisionCapacityNotSupported(const struct nvm_capabilities &systemCapabilities); 47 | virtual ~RuleProvisionCapacityNotSupported(); 48 | virtual void verify(const MemoryAllocationRequest &request); 49 | 50 | protected: 51 | struct nvm_capabilities m_systemCapabilities; 52 | }; 53 | 54 | } /* namespace memory_allocator */ 55 | } /* namespace core */ 56 | 57 | #endif /* _core_LOGIC_RULEPROVISIONCAPACITYNOTSUPPORTED_H_ */ 58 | -------------------------------------------------------------------------------- /src/core/system/SmbiosType4Utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_SMBIOSTYPE4UTILITY_H 28 | #define CR_MGMT_SMBIOSTYPE4UTILITY_H 29 | 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace core 37 | { 38 | namespace system 39 | { 40 | 41 | class NVM_CORE_API SmbiosType4Utility 42 | { 43 | 44 | public: 45 | SmbiosType4Utility() { } 46 | virtual ~SmbiosType4Utility() {} 47 | virtual std::string getProcessorType(unsigned char byteValue) const; 48 | virtual std::string getProcessorFamily(unsigned int wordValue) const; 49 | static SmbiosType4Utility &getUtility(); 50 | }; 51 | } 52 | } 53 | 54 | #endif //CR_MGMT_SMBIOSTYPE4UTILITY_H 55 | -------------------------------------------------------------------------------- /src/driver_interface/win_passthrough.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file implements the Windows driver adapter interface for issuing IOCTL 30 | * passthrough commands. 31 | */ 32 | #include "passthrough.h" 33 | #include 34 | /* 35 | * Execute a passthrough IOCTL 36 | */ 37 | int adapter_pt_ioctl_cmd(struct pt_fw_cmd *p_cmd) 38 | { 39 | // TODO-RYON(6/26/2017): Handle DSM Status (TA44190) 40 | unsigned int dsm_status; 41 | int rc = win_scm2_passthrough((struct fw_cmd *)p_cmd, &dsm_status); 42 | 43 | return rc; 44 | } 45 | -------------------------------------------------------------------------------- /src/firmware_interface/fis_parser.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_FIS_PARSER_H 28 | #define CR_MGMT_FIS_PARSER_H 29 | #ifdef __cplusplus 30 | extern "C" 31 | { 32 | #endif 33 | #include "fis_commands.h" 34 | #include "fw_commands.h" 35 | 36 | #define FWCMD_PARSE_SUCCESS(rc) (rc == FIS_PARSER_CODES_SUCCESS) 37 | 38 | enum fis_parser_codes 39 | { 40 | FIS_PARSER_CODES_SUCCESS = 0, 41 | FIS_PARSER_CODES_PARSING_WRONG_OFFSET = 1, 42 | FIS_PARSER_CODES_PARSING_TYPE_NOT_FOUND = 2, 43 | }; 44 | 45 | //- for cmd in commands 46 | //- if cmd.has_output 47 | enum fis_parser_codes {{cmd.name|fw_cmd_parser}}( 48 | const struct {{cmd.name|output_payload}} *p_output_payload, 49 | struct {{cmd.name|fw_cmd_data}} *p_data 50 | {%- if cmd.name == 'platform_config_data'-%} 51 | , size_t pcd_size 52 | {%- endif-%}); 53 | 54 | //- endif 55 | //- endfor 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif //CR_MGMT_FIS_PARSER_H 62 | -------------------------------------------------------------------------------- /src/firmware_interface/fw_command_controller.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_FW_PRINT_CONTROLLER_H 28 | #define CR_MGMT_FW_PRINT_CONTROLLER_H 29 | 30 | 31 | #ifdef __cplusplus 32 | extern "C" 33 | { 34 | #endif 35 | 36 | #include "fwcmd_args.h" 37 | 38 | #include 39 | 40 | void fwcmd_print_all(unsigned int handle); 41 | 42 | void fwcmd_run(const char *command_name, unsigned int handle, fwcmd_args *p_args); 43 | 44 | //- for cmd in commands 45 | void {{cmd.name|fw_cmd_print_controller}}(unsigned int handle 46 | {%- for f in cmd.input_fields_changeable -%} 47 | , const {{f.c_definition}} 48 | {%- endfor -%} 49 | ); 50 | 51 | //- endfor 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif //CR_MGMT_FW_PRINT_CONTROLLER_H 58 | -------------------------------------------------------------------------------- /src/firmware_interface/fw_command_custom_printer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_FW_COMMAND_CUSTOM_PRINTER_H 28 | #define CR_MGMT_FW_COMMAND_CUSTOM_PRINTER_H 29 | 30 | #include "fw_commands.h" 31 | 32 | void fwcmd_custom_platform_config_data_printer( 33 | const struct fwcmd_platform_config_data_data *p_value, 34 | int indent_count); 35 | 36 | #endif //CR_MGMT_FW_COMMAND_CUSTOM_PRINTER_H 37 | -------------------------------------------------------------------------------- /src/firmware_interface/fwcmd_args.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | #ifndef CR_MGMT_FWCMD_ARGS_H 28 | #define CR_MGMT_FWCMD_ARGS_H 29 | #include 30 | 31 | typedef struct 32 | { 33 | size_t count; 34 | struct 35 | { 36 | char name[32]; 37 | char value[32]; 38 | } arg[10]; 39 | } fwcmd_args; 40 | 41 | void add_arg(fwcmd_args *p_args, const char *name, const char *value); 42 | 43 | char *find_arg(fwcmd_args *p_args, const char *name); 44 | 45 | int parse_args(fwcmd_args *p_args, const char *str); 46 | 47 | 48 | #endif //CR_MGMT_FWCMD_ARGS_H 49 | -------------------------------------------------------------------------------- /src/ixp/ixp_prv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | 29 | #ifndef SRC_IXP_PRV_H_ 30 | #define SRC_IXP_PRV_H_ 31 | #include 32 | #include 33 | 34 | #ifdef __cplusplus 35 | extern "C" 36 | { 37 | #endif 38 | 39 | struct ixp_context 40 | { 41 | NVM_NFIT_DEVICE_HANDLE handle; 42 | void * user_data; 43 | }; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif /* SRC_IXP_PRV_H_ */ 50 | -------------------------------------------------------------------------------- /src/ixp/ixp_types.h.template: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2018, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | 29 | #ifndef SRC_IXP_TYPES_H_ 30 | #define SRC_IXP_TYPES_H_ 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | 38 | enum ixp_status 39 | { 40 | IXP_SUCCESS, 41 | IXP_NOT_YET_IMPLEMENTED, 42 | IXP_NULL_INPUT_PARAM, 43 | IXP_NO_MEM_RESOURCES, 44 | IXP_INTERNAL_ERROR, 45 | IXP_INVALID_PROP_KEY 46 | }; 47 | 48 | // NOTE: For simplicity in ixp_fis_properties.c, put fis properties first 49 | // and contiguously. 50 | enum ixp_prop_key 51 | { 52 | //- for key in ixp_prop_key_data 53 | {{key}}, 54 | //- endfor 55 | IXP_PROP_KEY_MAX 56 | }; 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif /* SRC_IXP_TYPES_H_ */ 63 | -------------------------------------------------------------------------------- /src/lib/adapter_tests/WinScmTests.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "WinScmTests.h" 29 | -------------------------------------------------------------------------------- /src/lib/cleanup_support_events.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * Scrub the events in the support DB to remove sensitive data. 30 | */ 31 | 32 | #ifndef CLEANUP_SUPPORT_EVENTS_H_ 33 | #define CLEANUP_SUPPORT_EVENTS_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include "event_field_metadata.h" 39 | #include 40 | 41 | NVM_API int change_serial_num_in_events(PersistentStore *p_ps, enum event_type event_type, 42 | unsigned int event_code); 43 | NVM_API void clear_serial_num_in_db_event(struct db_event *p_event, 44 | const struct event_field_metadata *p_metadata); 45 | 46 | NVM_API int change_dimm_uid_in_events(PersistentStore *p_ps); 47 | NVM_API int obfuscate_dimm_uid_in_db_event(struct db_event *p_event, 48 | const struct event_field_metadata *p_metadata); 49 | NVM_API int generate_obfuscated_dimm_uid(const NVM_UID real_uid, NVM_UID obfuscated_uid); 50 | 51 | #endif /* CLEANUP_SUPPORT_EVENTS_H_ */ 52 | -------------------------------------------------------------------------------- /src/lib/lib_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include "nvm_management.h" 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_DLL 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "Native Management Library" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "libixpdimm.dll" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "libixpdimm.dll" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | END 43 | BLOCK "VarFileInfo" 44 | BEGIN 45 | VALUE "Translation", 0x409, 1200 46 | END 47 | END 48 | 49 | #endif // !_MAC 50 | #endif // !APSTUDIO_INVOKED 51 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/lib/lnx_adapter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file declares common definitions and helper functions used throughout the Linux 30 | * device adapter. 31 | */ 32 | 33 | #ifndef LNX_ADAPTER_H_ 34 | #define LNX_ADAPTER_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #define SYSFS_ATTR_SIZE 1024 42 | 43 | int linux_err_to_nvm_lib_err(int); 44 | 45 | int open_ioctl_target(int *p_target, const char *dev_name); 46 | int send_ioctl_command(int fd, unsigned long request, void* parg); 47 | 48 | int get_dimm_by_handle(struct ndctl_ctx *ctx, unsigned int handle, struct ndctl_dimm **dimm); 49 | 50 | int get_unconfigured_namespace(struct ndctl_namespace **unconfigured_namespace, 51 | struct ndctl_region *region); 52 | 53 | #endif /* LNX_ADAPTER_H_ */ 54 | -------------------------------------------------------------------------------- /src/lib/lnx_adapter_pools.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file implements the Linux driver adapter interface for managing pools and 30 | * interleave sets. 31 | */ 32 | 33 | #include "device_adapter.h" 34 | #include "nfit_utilities.h" 35 | 36 | /* 37 | * Count the number of interleave sets as provided by the driver 38 | */ 39 | int get_interleave_set_count() 40 | { 41 | COMMON_LOG_ENTRY(); 42 | int rc = get_interleave_set_count_from_nfit(); 43 | COMMON_LOG_EXIT_RETURN_I(rc); 44 | return rc; 45 | } 46 | 47 | /* 48 | * Get interleave sets as provided by the driver. Returns the number of interleave sets returning, 49 | * or fail on first error code 50 | */ 51 | int get_interleave_sets(const NVM_UINT32 count, struct nvm_interleave_set *p_sets) 52 | { 53 | COMMON_LOG_ENTRY(); 54 | int rc = get_interleave_sets_from_nfit(count, p_sets); 55 | COMMON_LOG_EXIT_RETURN_I(rc); 56 | return rc; 57 | } 58 | -------------------------------------------------------------------------------- /src/lib/namespace_labels.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "nvm_types.h" 29 | #include "adapter_types.h" 30 | 31 | #ifndef NAMESPACE_LABELS_H 32 | #define NAMESPACE_LABELS_H 33 | 34 | /* 35 | * Retrieve the count of namespaces from the PCD data on all manageable DIMMs 36 | */ 37 | int get_namespace_count_from_pcd(); 38 | 39 | /* 40 | * Retrieve namespace discovery information from the PCD data on all manageable DIMMs 41 | */ 42 | int get_namespaces_from_pcd(const NVM_UINT32 count, 43 | struct nvm_namespace_discovery *p_namespaces); 44 | 45 | /* 46 | * Retrieve namespace details from the PCD data on all manageable DIMMs 47 | */ 48 | int get_namespace_details_from_pcd(const NVM_UID namespace_uid, 49 | struct nvm_namespace_details *p_details); 50 | 51 | /* 52 | * Zero the namespace label PCD partition on the specified DIMM 53 | */ 54 | int zero_dimm_namespace_labels(const NVM_UINT32 device_handle); 55 | 56 | #endif // NAMESPACE_LABELS_H 57 | -------------------------------------------------------------------------------- /src/lib/namespace_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "nvm_management.h" 29 | #include "adapter_types.h" 30 | #include "pool_utilities.h" 31 | #include "export_api.h" 32 | 33 | NVM_API void adjust_namespace_block_count_if_allowed(NVM_UINT64 *p_block_count, 34 | const NVM_UINT16 block_size, 35 | NVM_UINT8 ways, const NVM_BOOL allow_adjustment); 36 | 37 | NVM_API NVM_UINT32 get_alignment_size(NVM_UINT32 block_size, NVM_UINT32 ways); 38 | 39 | NVM_API NVM_BOOL check_namespace_alignment(NVM_UINT64 capacity, NVM_UINT32 block_size, NVM_UINT8 ways); 40 | 41 | NVM_API NVM_UINT64 capacity_to_real_block_count(NVM_UINT64 capacity, NVM_UINT32 block_size); 42 | 43 | NVM_API int get_nvm_namespaces_details_alloc(struct nvm_namespace_details **pp_namespaces); 44 | -------------------------------------------------------------------------------- /src/lib/nfit_utilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains NFIT helper functions 30 | */ 31 | 32 | #ifndef NFIT_UTILITIES_H 33 | #define NFIT_UTILITIES_H 34 | 35 | #include 36 | #include "nvm_management.h" 37 | #include "adapter_types.h" 38 | 39 | /* 40 | * Get the number of DIMMS from the NFIT 41 | */ 42 | int get_topology_count_from_nfit(); 43 | 44 | /* 45 | * Get the DIMMs from the NFIT 46 | */ 47 | int get_topology_from_nfit(const NVM_UINT8 count, struct nvm_topology *p_dimm_topo); 48 | 49 | /* 50 | * Get the number of interleave sets from the NFIT 51 | */ 52 | int get_interleave_set_count_from_nfit(); 53 | 54 | /* 55 | * Get the interleave sets from the NFIT 56 | */ 57 | int get_interleave_sets_from_nfit(const NVM_UINT8 count, 58 | struct nvm_interleave_set *p_interleaves); 59 | 60 | 61 | #endif /* NFIT_UTILITIES_H */ 62 | -------------------------------------------------------------------------------- /src/lib/system_utilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains shared utility functions for system-level data. 30 | */ 31 | 32 | #include 33 | 34 | /* 35 | * Find the core_id number of a given socket_id 36 | */ 37 | int get_first_core_id(NVM_UINT16 socket_id); 38 | -------------------------------------------------------------------------------- /src/lib/win_scm2_ioctl_driver_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CR_MGMT_WIN_SCM2_IOCTL_DRIVER_VERSION_H 29 | #define CR_MGMT_WIN_SCM2_IOCTL_DRIVER_VERSION_H 30 | 31 | #define DRIVER_VERSION_LEN 25 32 | 33 | int win_scm2_ioctl_driver_version(unsigned short nfit_handle, 34 | char driver_revision[DRIVER_VERSION_LEN]); 35 | 36 | 37 | #endif // CR_MGMT_WIN_SCM2_IOCTL_DRIVER_VERSION_H 38 | -------------------------------------------------------------------------------- /src/lib/win_scm2_passthrough.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CR_MGMT_WIN_SCM2_PASSTHROUGH_H 29 | #define CR_MGMT_WIN_SCM2_PASSTHROUGH_H 30 | 31 | #include "fis_types.h" 32 | 33 | 34 | #ifdef __cplusplus 35 | extern "C" 36 | { 37 | #endif 38 | 39 | int win_scm2_passthrough(struct fw_cmd *p_cmd, unsigned int *p_dsm_status); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif // CR_MGMT_WIN_SCM2_PASSTHROUGH_H 46 | -------------------------------------------------------------------------------- /src/lib/win_scm2_version_info.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CR_MGMT_SCM2_VERSION_INFO_H 29 | #define CR_MGMT_SCM2_VERSION_INFO_H 30 | #include 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | typedef struct _GET_INTERFACE_VERSION_OUTPUT_PAYLOAD { 38 | ULONG MajorVersion; 39 | ULONG MinorVersion; 40 | } GET_INTERFACE_VERSION_OUTPUT_PAYLOAD; 41 | 42 | int win_scm2_version_info(unsigned short nfit_handle, 43 | GET_INTERFACE_VERSION_OUTPUT_PAYLOAD *p_version_info); 44 | 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | #endif // CR_MGMT_SCM2_VERSION_INFO_H 50 | -------------------------------------------------------------------------------- /src/monitor/ixpdimm-monitor.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=NVM Monitoring Service 3 | 4 | [Service] 5 | Type=forking 6 | ExecStart=/usr/bin/ixpdimm-monitor -d 7 | PIDFile=/var/run/ixpdimm-monitor.pid 8 | 9 | [Install] 10 | WantedBy=multi-user.target 11 | -------------------------------------------------------------------------------- /src/monitor/monitor_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include "nvm_management.h" 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_APP 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "IXPDIMM Monitor Service" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "ixpdimm-monitor.exe" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "ixpdimm-monitor.exe" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | END 43 | BLOCK "VarFileInfo" 44 | BEGIN 45 | VALUE "Translation", 0x409, 1200 46 | END 47 | END 48 | 49 | #endif // !_MAC 50 | #endif // !APSTUDIO_INVOKED 51 | ///////////////////////////////////////////////////////////////////////////// -------------------------------------------------------------------------------- /src/monitor/win_service.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the definition of Windows system service utility methods. 30 | */ 31 | 32 | #include 33 | #include "NvmMonitorBase.h" 34 | #include 35 | 36 | /* 37 | * Install the service into Windows SCM 38 | */ 39 | bool serviceInstall(std::string serviceName, std::string displayName); 40 | 41 | /* 42 | * Uninstall the service from Windows SCM 43 | */ 44 | bool serviceUninstall(const char *service_name); 45 | 46 | /* 47 | * Initialize the service when it is starting 48 | */ 49 | bool serviceInit(std::string serviceName); 50 | -------------------------------------------------------------------------------- /src/wbem/ExportCim.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2017, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _CIM_EXPORT_H_ 29 | #define _CIM_EXPORT_H_ 30 | 31 | /* 32 | * Macros for controlling what is exported by the library 33 | */ 34 | #ifdef __WINDOWS__ // Windows 35 | #define NVM_CIM_DLL_IMPORT __declspec(dllimport) 36 | #define NVM_CIM_DLL_EXPORT __declspec(dllexport) 37 | #else // Linux/ESX 38 | #define NVM_CIM_DLL_IMPORT __attribute__((visibility("default"))) 39 | #define NVM_CIM_DLL_EXPORT __attribute__((visibility("default"))) 40 | #endif // end Linux/ESX 41 | 42 | // NVM_CIM_API is used for the public API symbols. 43 | #ifdef __NVM_DLL__ // defined if compiled as a DLL 44 | #ifdef __NVM_CIM_DLL_EXPORTS__ // defined if we are building the DLL (instead of using it) 45 | #define NVM_CIM_API NVM_CIM_DLL_EXPORT 46 | #else 47 | #define NVM_CIM_API NVM_CIM_DLL_IMPORT 48 | #endif // NVM_DLL_EXPORTS 49 | #else // NVM_DLL is not defined, everything is exported 50 | #define NVM_CIM_API 51 | #endif // NVM_DLL 52 | 53 | #endif // _CIM_EXPORT_H_ -------------------------------------------------------------------------------- /src/wbem/cimom/cmpi/cmpiMonitor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the NvmMonitor entry point from the CMPI provider. 30 | */ 31 | 32 | namespace cmpiMonitor 33 | { 34 | /* 35 | * Initialize the monitor 36 | */ 37 | void Init(); 38 | 39 | /* 40 | * Cleanup the monitor 41 | */ 42 | void Cleanup(); 43 | } 44 | -------------------------------------------------------------------------------- /src/wbem/cimom/wmi/register.mof: -------------------------------------------------------------------------------- 1 | Instance of __Win32Provider as $P // $P is an alias 2 | { 3 | // Name that describes your provider 4 | Name = "intelwbemprovider" ; 5 | // CLSID - must match CLSID of registered DLL 6 | ClsId = "{7BADB4CD-9E85-429b-B5EA-4FB86BEF45EF}"; 7 | HostingModel = "NetworkServiceHost"; 8 | } ; 9 | 10 | instance of __InstanceProviderRegistration 11 | { 12 | Provider = $P; // Alias to the __Win32Provider 13 | SupportsPut = TRUE; // Does not support the Put method 14 | SupportsGet = TRUE; // Supports the Get method 15 | SupportsDelete = TRUE; // Does not support the Delete method 16 | SupportsEnumeration = TRUE; // Supports enumeration. 17 | }; 18 | 19 | instance of __MethodProviderRegistration 20 | { 21 | Provider = $P; 22 | }; 23 | 24 | Instance of __EventProviderRegistration 25 | { 26 | provider = $P; 27 | EventQueryList = { 28 | "SELECT * FROM __InstanceModificationEvent WHERE TargetInstance ISA \"CIM_Sensor\"", 29 | "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA \"CIM_PersistentMemoryNamespace\"", 30 | "SELECT * FROM __InstanceDeletionEvent WHERE TargetInstance ISA \"CIM_PersistentMemoryNamespace\"", 31 | "SELECT * FROM __InstanceCreationEvent WHERE TargetInstance ISA \"CIM_PhysicalMemory\"", 32 | "SELECT * FROM __InstanceDeletionEvent WHERE TargetInstance ISA \"CIM_PhysicalMemory\"", 33 | "SELECT * FROM Intel_NVDIMMEvent" 34 | }; 35 | }; 36 | 37 | // Provider for cross-namespace associations 38 | #pragma namespace("\\\\.\\root\\interop") 39 | Instance of __Win32Provider as $R // $R is an alias 40 | { 41 | // Name that describes your provider 42 | Name = "intelwbemprovider" ; 43 | // CLSID - must match CLSID of registered DLL 44 | ClsId = "{7BADB4CD-9E85-429b-B5EA-4FB86BEF45EF}"; 45 | HostingModel = "NetworkServiceHost"; 46 | } ; 47 | 48 | instance of __InstanceProviderRegistration 49 | { 50 | Provider = $R; // Alias to the __Win32Provider 51 | SupportsPut = false; // Does not support the Put method 52 | SupportsGet = TRUE; // Supports the Get method 53 | SupportsDelete = false; // Does not support the Delete method 54 | SupportsEnumeration = TRUE; // Supports enumeration. 55 | }; 56 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionBadFilter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of the exception class if a 30 | * filter could not be generated from a set of inputs. 31 | */ 32 | 33 | #include 34 | 35 | namespace wbem 36 | { 37 | namespace exception 38 | { 39 | 40 | NvmExceptionBadFilter::NvmExceptionBadFilter(const std::string &filterStr) : 41 | Exception(), 42 | m_filterStr(filterStr) 43 | { 44 | m_Message = TRS(NVMEXCEPTIONBADFILTER_MESSAGE) + filterStr; 45 | } 46 | 47 | NvmExceptionBadFilter::~NvmExceptionBadFilter() throw () 48 | { 49 | } 50 | 51 | } /* namespace framework */ 52 | } /* namespace wbem */ 53 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionDiagnosticError.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of the exception class 30 | * for a Native API library error. 31 | */ 32 | 33 | #include "NvmExceptionDiagnosticError.h" 34 | 35 | #include 36 | #include 37 | #include 38 | /* 39 | * Constructor for a library error take the error code. Asks the library 40 | * for a description of the error. 41 | */ 42 | wbem::exception::NvmExceptionDiagnosticError::NvmExceptionDiagnosticError(int libError) 43 | : wbem::framework::ExceptionSystemError(libError) 44 | { 45 | // get the error description from the management library 46 | NVM_ERROR_DESCRIPTION description; 47 | if (nvm_get_error((enum return_code)libError, description, NVM_ERROR_LEN) != NVM_SUCCESS) 48 | { 49 | s_snprintf(description, sizeof(description), EXCEPTION_LIBERROR_MSG.c_str(), libError); 50 | } 51 | m_Message = description; 52 | 53 | logDebugMessage(); 54 | } 55 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionDiagnosticError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the definition of the exception class 30 | * for a Native API library error. 31 | */ 32 | 33 | 34 | #ifndef _WBEM_FRAMEWORK_NVMEXCEPTION_DIAGNOSTICERROR_H_ 35 | #define _WBEM_FRAMEWORK_NVMEXCEPTION_DIAGNOSTICERROR_H_ 36 | 37 | #include 38 | #include 39 | #include 40 | 41 | namespace wbem 42 | { 43 | namespace exception 44 | { 45 | 46 | /*! 47 | * Exception caused by a library error 48 | */ 49 | class NVM_CIM_API NvmExceptionDiagnosticError: public framework::ExceptionSystemError 50 | { 51 | public: 52 | /*! 53 | * Initialize a new exception with a Native API library return_code. 54 | * @param[in] libError 55 | * The library return_code. 56 | */ 57 | NvmExceptionDiagnosticError(int libError); 58 | }; 59 | 60 | } // framework 61 | } // wbem 62 | 63 | #endif // _WBEM_FRAMEWORK_NVMEXCEPTION_DIAGNOSTICERROR_H_ 64 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionInvalidPoolConfig.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of the exception class 30 | * thrown when an invalid pool configuration is detected. 31 | */ 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | namespace wbem 39 | { 40 | namespace exception 41 | { 42 | 43 | NvmExceptionInvalidPoolConfig::NvmExceptionInvalidPoolConfig(const char *pReason) : 44 | Exception() 45 | { 46 | if (pReason && (pReason[0] != '\0')) 47 | { 48 | m_Message = pReason; 49 | } 50 | else 51 | { 52 | throw Exception(); 53 | } 54 | logDebugMessage(); 55 | } 56 | 57 | NvmExceptionInvalidPoolConfig::~NvmExceptionInvalidPoolConfig() throw () 58 | {} 59 | 60 | } /* namespace framework */ 61 | } /* namespace wbem */ 62 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionInvalidPoolConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the definition of the exception class 30 | * thrown when an invalid pool configuration is detected. 31 | */ 32 | 33 | #ifndef NVMEXCEPTIONINVALIDPOOLCONFIG_H_ 34 | #define NVMEXCEPTIONINVALIDPOOLCONFIG_H_ 35 | 36 | #include 37 | #include 38 | #include 39 | 40 | namespace wbem 41 | { 42 | namespace exception 43 | { 44 | 45 | class NVM_CIM_API NvmExceptionInvalidPoolConfig : public framework::Exception 46 | { 47 | public: 48 | NvmExceptionInvalidPoolConfig(const char *pReason); 49 | virtual ~NvmExceptionInvalidPoolConfig() throw (); 50 | 51 | /*! 52 | * Returns a string explaining why the pool configuration was invalid. 53 | */ 54 | std::string getInvalidReason() { return m_Message; } 55 | }; 56 | 57 | } /* namespace framework */ 58 | } /* namespace wbem */ 59 | 60 | #endif /* NVMEXCEPTIONINVALIDPOOLCONFIG_H_ */ 61 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionNotManageable.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of the exception class 30 | * for an unmanageable DIMM. 31 | */ 32 | 33 | #include 34 | 35 | #include 36 | #include 37 | 38 | /* 39 | * Constructor 40 | */ 41 | wbem::exception::NvmExceptionNotManageable::NvmExceptionNotManageable(const char *pUnmanageableDimm) 42 | : wbem::framework::Exception() 43 | { 44 | m_unmanageableDimm = pUnmanageableDimm != NULL ? pUnmanageableDimm : ""; 45 | char description[ERROR_MESSAGE_LEN]; 46 | 47 | s_snprintf(description, ERROR_MESSAGE_LEN, EXCEPTION_NOTMANAGEABLE_MSG.c_str(), 48 | pUnmanageableDimm); 49 | m_Message = description; 50 | logDebugMessage(); 51 | } 52 | 53 | std::string wbem::exception::NvmExceptionNotManageable::getDimmValue() 54 | { 55 | return m_unmanageableDimm; 56 | } 57 | 58 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionUndoModifyFailed.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the implementation of the exception class 30 | * thrown when a modify operation could not be reverted to the original state. 31 | */ 32 | 33 | #include 34 | 35 | wbem::exception::NvmExceptionUndoModifyFailed::NvmExceptionUndoModifyFailed(int libError) 36 | : wbem::exception::NvmExceptionLibError(libError) 37 | { 38 | m_Message += " Failed to restore the original state."; 39 | } 40 | -------------------------------------------------------------------------------- /src/wbem/exception/NvmExceptionUndoModifyFailed.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | /* 29 | * This file contains the definition of the exception class 30 | * thrown when a modify operation could not be reverted to the original state. 31 | */ 32 | 33 | 34 | #ifndef _WBEM_FRAMEWORK_NVMEXCEPTION_UNDOMODIFYFAILED_H_ 35 | #define _WBEM_FRAMEWORK_NVMEXCEPTION_UNDOMODIFYFAILED_H_ 36 | 37 | #include 38 | 39 | namespace wbem 40 | { 41 | namespace exception 42 | { 43 | 44 | /*! 45 | * An exception for a modification that failed 46 | */ 47 | class NVM_CIM_API NvmExceptionUndoModifyFailed: public NvmExceptionLibError 48 | { 49 | public: 50 | 51 | NvmExceptionUndoModifyFailed(int errorCode); 52 | 53 | ~NvmExceptionUndoModifyFailed() throw () {} 54 | }; 55 | 56 | } // framework 57 | } // wbem 58 | 59 | #endif // _WBEM_FRAMEWORK_NVMEXCEPTION_UNDOMODIFYFAILED_H_ 60 | -------------------------------------------------------------------------------- /src/wbem/framework_interface/NvmIndicationService.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef SRC_WBEM_INDICATION_NVMINDICATIONSERVICE_H_ 29 | #define SRC_WBEM_INDICATION_NVMINDICATIONSERVICE_H_ 30 | 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | namespace wbem 37 | { 38 | namespace framework_interface 39 | { 40 | 41 | class NVM_CIM_API NvmIndicationService: public framework::IndicationService 42 | { 43 | public: 44 | NvmIndicationService(); 45 | virtual ~NvmIndicationService(); 46 | 47 | virtual void startIndicating(framework::CimomAdapter *pContext); 48 | virtual void stopIndicating(); 49 | 50 | static NvmIndicationService *getSingleton(); 51 | 52 | protected: 53 | static NvmIndicationService *m_pSingleton; 54 | int m_eventCallbackId; 55 | 56 | lib_interface::NvmApi *m_pApi; 57 | }; 58 | 59 | } 60 | } 61 | 62 | #endif /* SRC_WBEM_INDICATION_NVMINDICATIONSERVICE_H_ */ 63 | -------------------------------------------------------------------------------- /src/wbem/lib_interface/NvmContext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2015 2016, Intel Corporation 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * * Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of Intel Corporation nor the names of its contributors 13 | * may be used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 20 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef NVMCONTEXT_H_ 29 | #define NVMCONTEXT_H_ 30 | 31 | #include 32 | 33 | namespace wbem 34 | { 35 | namespace lib_interface 36 | { 37 | 38 | // pass through interface to library context 39 | static inline int createNvmContext() 40 | { 41 | return nvm_create_context(); 42 | } 43 | 44 | static inline int freeNvmContext() 45 | { 46 | return nvm_free_context(1); 47 | } 48 | 49 | } 50 | } 51 | 52 | #endif /* NVMCONTEXT_H_ */ 53 | -------------------------------------------------------------------------------- /src/wbem/mof/profile_registration.mof: -------------------------------------------------------------------------------- 1 | //================================== 2 | // Qualifiers requried by Windows 3 | //================================== 4 | Qualifier Implemented : boolean = true, 5 | Scope(method); 6 | Qualifier Dynamic : boolean = true, 7 | Scope(class); 8 | 9 | /* Instances */ 10 | [dynamic, provider("intelwbemprovider")] 11 | class RegisteredProfile : CIM_RegisteredProfile 12 | { 13 | }; 14 | 15 | /* Associations */ 16 | [dynamic, provider("intelwbemprovider")] 17 | class ElementConformsToProfile : CIM_ElementConformsToProfile 18 | { 19 | }; 20 | -------------------------------------------------------------------------------- /src/wbem/mof/sfcb_qualifiers.mof: -------------------------------------------------------------------------------- 1 | // SFCB has an incomplete set of qualifiers pre-defined. 2 | 3 | Qualifier Reference : string = null, 4 | Scope(property); 5 | 6 | Qualifier Structure : boolean = false, 7 | Scope(class, indication), 8 | Flavor(DisableOverride, ToSubclass); 9 | 10 | -------------------------------------------------------------------------------- /src/wbem/wbem_resources.rc: -------------------------------------------------------------------------------- 1 | // include the header 2 | #include 3 | #include 4 | #include 5 | 6 | // Define the version resource 7 | #define VS_VERSION_INFO 1 8 | 9 | #ifndef APSTUDIO_INVOKED 10 | 11 | #ifndef _MAC 12 | ///////////////////////////////////////////////////////////////////////////// 13 | // 14 | // Version 15 | // 16 | VS_VERSION_INFO VERSIONINFO 17 | FILEVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 18 | PRODUCTVERSION NVM_VERSION_MAJOR,NVM_VERSION_MINOR,NVM_VERSION_HOTFIX,NVM_VERSION_BUILDNUM 19 | FILEFLAGSMASK 0x3fL 20 | #ifdef RELEASE 21 | FILEFLAGS 0x0L 22 | #else 23 | FILEFLAGS VS_FF_DEBUG 24 | #endif 25 | FILEOS VOS_NT_WINDOWS32 26 | FILETYPE VFT_DLL 27 | FILESUBTYPE 0x0L 28 | BEGIN 29 | BLOCK "StringFileInfo" 30 | BEGIN 31 | BLOCK "040904b0" 32 | BEGIN 33 | VALUE "CompanyName", INTEL_COMPANY_NAME 34 | VALUE "FileDescription", "WBEM Library" 35 | VALUE "FileVersion", VERSION_STR 36 | VALUE "InternalName", "libixpdimm-cim.dll" 37 | VALUE "LegalCopyright", INTEL_COPYRIGHT_STRING 38 | VALUE "OriginalFilename", "libixpdimm-cim.dll" 39 | VALUE "ProductName", NVM_PRODUCT_NAME 40 | VALUE "ProductVersion", VERSION_STR 41 | END 42 | 43 | END 44 | BLOCK "VarFileInfo" 45 | BEGIN 46 | VALUE "Translation", 0x409, 1200 47 | END 48 | END 49 | 50 | #endif // !_MAC 51 | #endif // !APSTUDIO_INVOKED 52 | ///////////////////////////////////////////////////////////////////////////// --------------------------------------------------------------------------------