From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: zhichao.gao@intel.com) Received: from mga14.intel.com (mga14.intel.com []) by groups.io with SMTP; Sun, 05 May 2019 00:52:40 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2019 00:52:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,433,1549958400"; d="scan'208";a="155041593" Received: from fieedk001.ccr.corp.intel.com ([10.239.33.119]) by FMSMGA003.fm.intel.com with ESMTP; 05 May 2019 00:52:27 -0700 From: "Gao, Zhichao" To: devel@edk2.groups.io Cc: Jian J Wang , Hao Wu , Ray Ni , Star Zeng , Liming Gao , Sean Brogan , Michael Turner , Bret Barkelew Subject: [PATCH 4/4] MdeModulePkg/ResetUtilityLib: Replace the reset data difinition Date: Sun, 5 May 2019 15:50:46 +0800 Message-Id: <20190505075046.14464-5-zhichao.gao@intel.com> X-Mailer: git-send-email 2.21.0.windows.1 In-Reply-To: <20190505075046.14464-1-zhichao.gao@intel.com> References: <20190505075046.14464-1-zhichao.gao@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1772 Replace the definition of 'RESET_UTILITY_GUID_SPECIFIC_RESET_DATA' with 'RESET_DATA_WITH_NULL_STRING'. Cc: Jian J Wang Cc: Hao Wu Cc: Ray Ni Cc: Star Zeng Cc: Liming Gao Cc: Sean Brogan Cc: Michael Turner Cc: Bret Barkelew Signed-off-by: Zhichao Gao --- .../Library/ResetUtilityLib/ResetUtility.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c index 2b5af4b95a..c420e0e36a 100644 --- a/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c +++ b/MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c @@ -12,15 +12,7 @@ #include #include #include - -#pragma pack(1) -typedef struct { - CHAR16 NullTerminator; - GUID ResetSubtype; -} RESET_UTILITY_GUID_SPECIFIC_RESET_DATA; -#pragma pack() - -VERIFY_SIZE_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, 18); +#include /** This is a shorthand helper function to reset with reset type and a subtype @@ -46,11 +38,11 @@ ResetSystemWithSubtype ( IN CONST GUID *ResetSubtype ) { - RESET_UTILITY_GUID_SPECIFIC_RESET_DATA ResetData; + RESET_DATA_WITH_NULL_STRING ResetData; - ResetData.NullTerminator = CHAR_NULL; + ResetData.NullString = CHAR_NULL; CopyGuid ( - (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_UTILITY_GUID_SPECIFIC_RESET_DATA, ResetSubtype)), + (GUID *)((UINT8 *)&ResetData + OFFSET_OF (RESET_DATA_WITH_NULL_STRING, ResetGuid)), ResetSubtype ); -- 2.21.0.windows.1