public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Giri Mudusuru" <girim@apple.com>
To: devel@edk2.groups.io
Cc: Giri Mudusuru <girim@apple.com>,
	Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>,
	Andrew Fish <afish@apple.com>
Subject: [PATCH 1/2] MdePkg/IndustryStandard: Add SMBIOS anchor string & length defines.
Date: Fri, 28 Apr 2023 11:52:57 -0700	[thread overview]
Message-ID: <a17a5048ffa478f93d8b2f7c51a545aab8154d83.1682707884.git.girim@apple.com> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2318 bytes --]

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3805

Add SMBIOS spec defined anchor strings & length defines.

 - '_SM_' chapter 5.2.1 SMBIOS 2.1 (32-bit) Entry Point
 - '_SM3_' chapter 5.2.2 SMBIOS 3.0 (64-bit) Entry Point

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Andrew Fish <afish@apple.com>
Signed-off-by: Giri Mudusuru <girim@apple.com>
---
 MdePkg/Include/IndustryStandard/SmBios.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/MdePkg/Include/IndustryStandard/SmBios.h b/MdePkg/Include/IndustryStandard/SmBios.h
index 9cbdec1182..4c560e758b 100644
--- a/MdePkg/Include/IndustryStandard/SmBios.h
+++ b/MdePkg/Include/IndustryStandard/SmBios.h
@@ -48,6 +48,24 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 //
 #define SMBIOS_3_0_TABLE_MAX_LENGTH  0xFFFFFFFF
 
+///
+/// Reference SMBIOS 3.4, chapter 5.2.1 SMBIOS 2.1 (32-bit) Entry Point
+/// Table 1 – SMBIOS 2.1 (32-bit) Entry Point structure, offset 00h
+/// _SM_, specified as four ASCII characters (5F 53 4D 5F).
+///@{
+#define SMBIOS_ANCHOR_STRING         "_SM_"
+#define SMBIOS_ANCHOR_STRING_LENGTH  4
+///@}
+
+///
+/// Reference SMBIOS 3.4, chapter 5.2.2 SMBIOS 3.0 (64-bit) Entry Point
+/// Table 2 – SMBIOS 3.0 (64-bit) Entry Point structure, offset 00h
+/// _SM3_, specified as five ASCII characters (5F 53 4D 33 5F).
+///@{
+#define SMBIOS_3_0_ANCHOR_STRING         "_SM3_"
+#define SMBIOS_3_0_ANCHOR_STRING_LENGTH  5
+///@}
+
 //
 // SMBIOS type macros which is according to SMBIOS 3.3.0 specification.
 //
@@ -138,7 +156,7 @@ typedef UINT16 SMBIOS_HANDLE;
 ///
 #pragma pack(1)
 typedef struct {
-  UINT8     AnchorString[4];
+  UINT8     AnchorString[SMBIOS_ANCHOR_STRING_LENGTH];
   UINT8     EntryPointStructureChecksum;
   UINT8     EntryPointLength;
   UINT8     MajorVersion;
@@ -155,7 +173,7 @@ typedef struct {
 } SMBIOS_TABLE_ENTRY_POINT;
 
 typedef struct {
-  UINT8     AnchorString[5];
+  UINT8     AnchorString[SMBIOS_3_0_ANCHOR_STRING_LENGTH];
   UINT8     EntryPointStructureChecksum;
   UINT8     EntryPointLength;
   UINT8     MajorVersion;
-- 
2.39.2 (Apple Git-144)


             reply	other threads:[~2023-04-28 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-28 18:52 Giri Mudusuru [this message]
2023-04-28 18:52 ` [PATCH 2/2] ShellPkg/UefiShellDebug1CommandsLib: Replace hardcoded SMBIOS strings Giri Mudusuru
2023-05-04  7:57   ` 回复: " gaoliming
     [not found]   ` <175BE1BE3E9B8CC1.28444@groups.io>
2023-05-06  6:55     ` 回复: [edk2-devel] " gaoliming
2023-05-06 10:00       ` [edk2-devel] " Giri Mudusuru
2023-05-04  7:53 ` 回复: [PATCH 1/2] MdePkg/IndustryStandard: Add SMBIOS anchor string & length defines gaoliming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a17a5048ffa478f93d8b2f7c51a545aab8154d83.1682707884.git.girim@apple.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox