Cheng C Yang | 3e3269a | 2019-12-02 15:11:30 +0800 | [diff] [blame] | 1 | /* |
| 2 | // Copyright (c) 2019 Intel Corporation |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #pragma once |
| 18 | |
| 19 | #include <array> |
| 20 | |
| 21 | static constexpr uint16_t smbiosAgentId = 0x0101; |
| 22 | static constexpr int smbiosDirIndex = 0; |
| 23 | static constexpr int firstAgentIndex = 1; |
| 24 | static constexpr uint8_t maxDirEntries = 4; |
| 25 | static constexpr uint32_t pageMask = 0xf000; |
| 26 | static constexpr uint8_t smbiosAgentVersion = 1; |
| 27 | static constexpr uint32_t defaultTimeout = 20000; |
| 28 | static constexpr uint32_t smbiosTableVersion = 15; |
| 29 | static constexpr uint32_t smbiosSMMemoryOffset = 0; |
| 30 | static constexpr uint32_t smbiosSMMemorySize = 1024 * 1024; |
| 31 | static constexpr uint32_t smbiosTableTimestamp = 0x45464748; |
| 32 | static constexpr uint32_t smbiosTableStorageSize = 64 * 1024; |
| 33 | static constexpr const char* smbiosPath = "/var/lib/smbios"; |
Cheng C Yang | eecaf82 | 2019-12-19 00:34:23 +0800 | [diff] [blame^] | 34 | static constexpr uint16_t mdrSMBIOSSize = 32 * 1024; |
Cheng C Yang | 3e3269a | 2019-12-02 15:11:30 +0800 | [diff] [blame] | 35 | |
| 36 | enum class DirDataRequestEnum |
| 37 | { |
| 38 | dirDataNotRequested = 0x00, |
| 39 | dirDataRequested = 0x01 |
| 40 | }; |
| 41 | |
| 42 | enum class FlagStatus |
| 43 | { |
| 44 | flagIsInvalid = 0, |
| 45 | flagIsValid = 1, |
| 46 | flagIsLocked = 2 |
| 47 | }; |
| 48 | |
| 49 | typedef enum |
| 50 | { |
| 51 | biosType = 0, |
| 52 | systemType = 1, |
| 53 | baseboardType = 2, |
| 54 | chassisType = 3, |
| 55 | processorsType = 4, |
| 56 | memoryControllerType = 5, |
| 57 | memoryModuleInformationType = 6, |
| 58 | cacheType = 7, |
| 59 | portConnectorType = 8, |
| 60 | systemSlots = 9, |
| 61 | onBoardDevicesType = 10, |
| 62 | oemStringsType = 11, |
| 63 | systemCconfigurationOptionsType = 12, |
| 64 | biosLanguageType = 13, |
| 65 | groupAssociatonsType = 14, |
| 66 | systemEventLogType = 15, |
| 67 | physicalMemoryArrayType = 16, |
| 68 | memoryDeviceType = 17, |
| 69 | } SmbiosType; |