Re: [edk2] [PATCH v2 1/1] MdePkg: Move SMBIOS data into the IndustryStandard header.

2016-03-23 Thread Zeng, Star

On 2016/3/23 10:37, Zeng, Star wrote:

On 2016/3/22 22:53, Marvin Häuser wrote:

As the SMBIOS table types belong to the SMBIOS standard, they were
moved from the SMBIOS Protocol header into the SMBIOS
IndustryStandard header without the EFI_-prefix. Defines with the
EFI_-prefix have been kept in the Protocol header for
backwards-compatibility, resolving to the IndustryStandard defines.
The same has been done with the C types.

The SMBIOS table header structure had been duplicated -
SMBIOS_STRUCTURE in the IndustryStandard header and
EFI_SMBIOS_TABLE_HEADER in the Protocol file - and thus the
Protocol type was replaced with a typedef to the InudstryStandard's.
This doesn't only make it easier to maintain, but it also prevents
potential future issues as the Protocol type has been aligned, while
the standard and the IndustryStandard header declare it as
byte-packed.
This has worked well till now only because the members of the
structure do not require alignment yet.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser 


Reviewed-by: Star Zeng 


Pushed at bb7051eba96f87bbb6544cad9cd7390207b4dcc0.

Thanks for the contribution.

Star




---
  MdePkg/Include/IndustryStandard/SmBios.h |  84 +++-
  MdePkg/Include/Protocol/Smbios.h | 139 
  2 files changed, 133 insertions(+), 90 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h
b/MdePkg/Include/IndustryStandard/SmBios.h
index b7c54f2fac12..c66422fc3af4 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -51,6 +51,53 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED.
  //
  #define SMBIOS_3_0_TABLE_MAX_LENGTH 0x

+//
+// SMBIOS type macros which is according to SMBIOS 2.7 specification.
+//
+#define SMBIOS_TYPE_BIOS_INFORMATION 0
+#define SMBIOS_TYPE_SYSTEM_INFORMATION   1
+#define SMBIOS_TYPE_BASEBOARD_INFORMATION2
+#define SMBIOS_TYPE_SYSTEM_ENCLOSURE 3
+#define SMBIOS_TYPE_PROCESSOR_INFORMATION4
+#define SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION5
+#define SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6
+#define SMBIOS_TYPE_CACHE_INFORMATION7
+#define SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION   8
+#define SMBIOS_TYPE_SYSTEM_SLOTS 9
+#define SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION   10
+#define SMBIOS_TYPE_OEM_STRINGS  11
+#define SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12
+#define SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION13
+#define SMBIOS_TYPE_GROUP_ASSOCIATIONS   14
+#define SMBIOS_TYPE_SYSTEM_EVENT_LOG 15
+#define SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY16
+#define SMBIOS_TYPE_MEMORY_DEVICE17
+#define SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION   18
+#define SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS  19
+#define SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20
+#define SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21
+#define SMBIOS_TYPE_PORTABLE_BATTERY 22
+#define SMBIOS_TYPE_SYSTEM_RESET 23
+#define SMBIOS_TYPE_HARDWARE_SECURITY24
+#define SMBIOS_TYPE_SYSTEM_POWER_CONTROLS25
+#define SMBIOS_TYPE_VOLTAGE_PROBE26
+#define SMBIOS_TYPE_COOLING_DEVICE   27
+#define SMBIOS_TYPE_TEMPERATURE_PROBE28
+#define SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29
+#define SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS30
+#define SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE   31
+#define SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION  32
+#define SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION   33
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE34
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT  35
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36
+#define SMBIOS_TYPE_MEMORY_CHANNEL   37
+#define SMBIOS_TYPE_IPMI_DEVICE_INFORMATION  38
+#define SMBIOS_TYPE_SYSTEM_POWER_SUPPLY  39
+#define SMBIOS_TYPE_ADDITIONAL_INFORMATION   40
+#define SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
+#define SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
+
  ///
  /// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6,
chapter 3.3.43.
  /// Upper-level software that interprets the SMBIOS structure-table
should bypass an
@@ -64,6 +111,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND,
EITHER EXPRESS OR IMPLIED.
  ///
  #define SMBIOS_TYPE_END_OF_TABLE 0x007F

+#define SMBIOS_OEM_BEGIN 128
+#define SMBIOS_OEM_END   255
+
+///
+/// Types 0 through 127 (7Fh) are reserved for and defined by this
+/// 

Re: [edk2] [PATCH v2 1/1] MdePkg: Move SMBIOS data into the IndustryStandard header.

2016-03-22 Thread Zeng, Star

On 2016/3/22 22:53, Marvin Häuser wrote:

As the SMBIOS table types belong to the SMBIOS standard, they were
moved from the SMBIOS Protocol header into the SMBIOS
IndustryStandard header without the EFI_-prefix. Defines with the
EFI_-prefix have been kept in the Protocol header for
backwards-compatibility, resolving to the IndustryStandard defines.
The same has been done with the C types.

The SMBIOS table header structure had been duplicated -
SMBIOS_STRUCTURE in the IndustryStandard header and
EFI_SMBIOS_TABLE_HEADER in the Protocol file - and thus the
Protocol type was replaced with a typedef to the InudstryStandard's.
This doesn't only make it easier to maintain, but it also prevents
potential future issues as the Protocol type has been aligned, while
the standard and the IndustryStandard header declare it as
byte-packed.
This has worked well till now only because the members of the
structure do not require alignment yet.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser 


Reviewed-by: Star Zeng 


---
  MdePkg/Include/IndustryStandard/SmBios.h |  84 +++-
  MdePkg/Include/Protocol/Smbios.h | 139 
  2 files changed, 133 insertions(+), 90 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index b7c54f2fac12..c66422fc3af4 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -51,6 +51,53 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
  //
  #define SMBIOS_3_0_TABLE_MAX_LENGTH 0x

+//
+// SMBIOS type macros which is according to SMBIOS 2.7 specification.
+//
+#define SMBIOS_TYPE_BIOS_INFORMATION 0
+#define SMBIOS_TYPE_SYSTEM_INFORMATION   1
+#define SMBIOS_TYPE_BASEBOARD_INFORMATION2
+#define SMBIOS_TYPE_SYSTEM_ENCLOSURE 3
+#define SMBIOS_TYPE_PROCESSOR_INFORMATION4
+#define SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION5
+#define SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6
+#define SMBIOS_TYPE_CACHE_INFORMATION7
+#define SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION   8
+#define SMBIOS_TYPE_SYSTEM_SLOTS 9
+#define SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION   10
+#define SMBIOS_TYPE_OEM_STRINGS  11
+#define SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12
+#define SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION13
+#define SMBIOS_TYPE_GROUP_ASSOCIATIONS   14
+#define SMBIOS_TYPE_SYSTEM_EVENT_LOG 15
+#define SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY16
+#define SMBIOS_TYPE_MEMORY_DEVICE17
+#define SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION   18
+#define SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS  19
+#define SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20
+#define SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21
+#define SMBIOS_TYPE_PORTABLE_BATTERY 22
+#define SMBIOS_TYPE_SYSTEM_RESET 23
+#define SMBIOS_TYPE_HARDWARE_SECURITY24
+#define SMBIOS_TYPE_SYSTEM_POWER_CONTROLS25
+#define SMBIOS_TYPE_VOLTAGE_PROBE26
+#define SMBIOS_TYPE_COOLING_DEVICE   27
+#define SMBIOS_TYPE_TEMPERATURE_PROBE28
+#define SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29
+#define SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS30
+#define SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE   31
+#define SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION  32
+#define SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION   33
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE34
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT  35
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36
+#define SMBIOS_TYPE_MEMORY_CHANNEL   37
+#define SMBIOS_TYPE_IPMI_DEVICE_INFORMATION  38
+#define SMBIOS_TYPE_SYSTEM_POWER_SUPPLY  39
+#define SMBIOS_TYPE_ADDITIONAL_INFORMATION   40
+#define SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
+#define SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
+
  ///
  /// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 
3.3.43.
  /// Upper-level software that interprets the SMBIOS structure-table should 
bypass an
@@ -64,6 +111,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
  ///
  #define SMBIOS_TYPE_END_OF_TABLE 0x007F

+#define SMBIOS_OEM_BEGIN 128
+#define SMBIOS_OEM_END   255
+
+///
+/// Types 0 through 127 (7Fh) are reserved for and defined by this
+/// specification. Types 128 through 256 (80h to FFh) are available for 
system- and OEM-specific information.
+///
+typedef UINT8  

[edk2] [PATCH v2 1/1] MdePkg: Move SMBIOS data into the IndustryStandard header.

2016-03-22 Thread Marvin Häuser
As the SMBIOS table types belong to the SMBIOS standard, they were
moved from the SMBIOS Protocol header into the SMBIOS
IndustryStandard header without the EFI_-prefix. Defines with the
EFI_-prefix have been kept in the Protocol header for
backwards-compatibility, resolving to the IndustryStandard defines.
The same has been done with the C types.

The SMBIOS table header structure had been duplicated -
SMBIOS_STRUCTURE in the IndustryStandard header and
EFI_SMBIOS_TABLE_HEADER in the Protocol file - and thus the
Protocol type was replaced with a typedef to the InudstryStandard's.
This doesn't only make it easier to maintain, but it also prevents
potential future issues as the Protocol type has been aligned, while
the standard and the IndustryStandard header declare it as
byte-packed.
This has worked well till now only because the members of the
structure do not require alignment yet.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Marvin Haeuser 
---
 MdePkg/Include/IndustryStandard/SmBios.h |  84 +++-
 MdePkg/Include/Protocol/Smbios.h | 139 
 2 files changed, 133 insertions(+), 90 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h 
b/MdePkg/Include/IndustryStandard/SmBios.h
index b7c54f2fac12..c66422fc3af4 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -51,6 +51,53 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 //
 #define SMBIOS_3_0_TABLE_MAX_LENGTH 0x
 
+//
+// SMBIOS type macros which is according to SMBIOS 2.7 specification.
+//
+#define SMBIOS_TYPE_BIOS_INFORMATION 0
+#define SMBIOS_TYPE_SYSTEM_INFORMATION   1
+#define SMBIOS_TYPE_BASEBOARD_INFORMATION2
+#define SMBIOS_TYPE_SYSTEM_ENCLOSURE 3
+#define SMBIOS_TYPE_PROCESSOR_INFORMATION4
+#define SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION5
+#define SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6
+#define SMBIOS_TYPE_CACHE_INFORMATION7
+#define SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION   8
+#define SMBIOS_TYPE_SYSTEM_SLOTS 9
+#define SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION   10
+#define SMBIOS_TYPE_OEM_STRINGS  11
+#define SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12
+#define SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION13
+#define SMBIOS_TYPE_GROUP_ASSOCIATIONS   14
+#define SMBIOS_TYPE_SYSTEM_EVENT_LOG 15
+#define SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY16
+#define SMBIOS_TYPE_MEMORY_DEVICE17
+#define SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION   18
+#define SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS  19
+#define SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20
+#define SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21
+#define SMBIOS_TYPE_PORTABLE_BATTERY 22
+#define SMBIOS_TYPE_SYSTEM_RESET 23
+#define SMBIOS_TYPE_HARDWARE_SECURITY24
+#define SMBIOS_TYPE_SYSTEM_POWER_CONTROLS25
+#define SMBIOS_TYPE_VOLTAGE_PROBE26
+#define SMBIOS_TYPE_COOLING_DEVICE   27
+#define SMBIOS_TYPE_TEMPERATURE_PROBE28
+#define SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29
+#define SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS30
+#define SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE   31
+#define SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION  32
+#define SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION   33
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE34
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT  35
+#define SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36
+#define SMBIOS_TYPE_MEMORY_CHANNEL   37
+#define SMBIOS_TYPE_IPMI_DEVICE_INFORMATION  38
+#define SMBIOS_TYPE_SYSTEM_POWER_SUPPLY  39
+#define SMBIOS_TYPE_ADDITIONAL_INFORMATION   40
+#define SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
+#define SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
+
 ///
 /// Inactive type is added from SMBIOS 2.2. Reference SMBIOS 2.6, chapter 
3.3.43.
 /// Upper-level software that interprets the SMBIOS structure-table should 
bypass an 
@@ -64,6 +111,27 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER 
EXPRESS OR IMPLIED.
 ///
 #define SMBIOS_TYPE_END_OF_TABLE 0x007F
 
+#define SMBIOS_OEM_BEGIN 128
+#define SMBIOS_OEM_END   255
+
+///
+/// Types 0 through 127 (7Fh) are reserved for and defined by this
+/// specification. Types 128 through 256 (80h to FFh) are available for 
system- and OEM-specific information.  
+///
+typedef UINT8  SMBIOS_TYPE;
+
+///
+/// Specifies the structure's handle, a unique 16-bit number in the range 0