From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 77EB521AEB0B0 for ; Thu, 10 Aug 2017 09:35:51 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Aug 2017 09:37:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,353,1498546800"; d="scan'208";a="135967997" Received: from orsmsx108.amr.corp.intel.com ([10.22.240.6]) by orsmga005.jf.intel.com with ESMTP; 10 Aug 2017 09:37:57 -0700 Received: from orsmsx114.amr.corp.intel.com ([169.254.8.13]) by ORSMSX108.amr.corp.intel.com ([169.254.2.204]) with mapi id 14.03.0319.002; Thu, 10 Aug 2017 09:37:57 -0700 From: "Steele, Kelly" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" Thread-Topic: [Patch 1/2] QuarkSocPkg/MemoryInit: Remove use of memset()/memcpy() Thread-Index: AQHTEUdQOL2RAUct60i+mrNKViRgfqJ9y3ig Date: Thu, 10 Aug 2017 16:37:56 +0000 Message-ID: References: <20170809193957.10644-1-michael.d.kinney@intel.com> <20170809193957.10644-2-michael.d.kinney@intel.com> In-Reply-To: <20170809193957.10644-2-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.22.254.139] MIME-Version: 1.0 Subject: Re: [Patch 1/2] QuarkSocPkg/MemoryInit: Remove use of memset()/memcpy() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Aug 2017 16:35:51 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed by: Kelly Steele -----Original Message----- From: Kinney, Michael D=20 Sent: August 09, 2017 12:40 To: edk2-devel@lists.01.org Cc: Steele, Kelly ; Gao, Liming Subject: [Patch 1/2] QuarkSocPkg/MemoryInit: Remove use of memset()/memcpy(= ) Map the use of memset() and memcpy() to the BaseMemoryLib functions ZeroMem= (), SetMem(), and CopyMem(). This fixes GCC build issues with this module. With the remap of the functions, the [BuildOptions] MSFT CC_FLAGS to enable= /Oi can also be removed, so the MSFT and GCC builds behave the same. Cc: Kelly Steele Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney --- QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf | 6 +----- QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/meminit_utils.h | 10 ++++++= +--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf= b/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf index 78821f59a3..05766133ed 100644 --- a/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf +++ b/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf @@ -1,7 +1,7 @@ ## @file # This is the Memory Initialization Driver for Quark # -# Copyright (c) 2= 013-2015 Intel Corporation. +# Copyright (c) 2013-2017 Intel Corporation. # # This program and the accompanying materials # are licensed and made ava= ilable under the terms and conditions of the BSD License @@ -74,7 +74,3 @@ =20 [Depex] TRUE - -[BuildOptions] - # /Oi option to use the intrinsic memset function in source code. - MSFT:*_*_*_CC_FLAGS =3D /Oi diff --git a/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/meminit_utils.h b= /QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/meminit_utils.h index 04c59f5af0..dcc40c7782 100644 --- a/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/meminit_utils.h +++ b/QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/meminit_utils.h @@ -1,6 +1,6 @@ /************************************************************************ * - * Copyright (c) 2013-2015 Intel Corporation. + * Copyright (c) 2013-2017 Intel Corporation. * * This program and the accompanying materials * are licensed and made available under the terms and conditions of the BS= D License @@ -90,8 +90,12 @@ void restore_timings(MRCParams_t *mrc_params);= void default_timings(MRCParams_t *mrc_params); =20 #ifndef SIM -void *memset(void *d, int c, size_t n); -void *memcpy(void *d, const void = *s, size_t n); +// +// Map memset() and memcpy() to BaseMemoryLib functions // #include=20 + #define memset(d,c,n) ((c) =3D=3D 0) ? ZeroMem=20 +((d), (n)) : SetMem ((d), (n), (c)) #define memcpy(d,s,n) CopyMem ((d),=20 +(s), (n)) #endif =20 #endif // _MEMINIT_UTILS_H_ -- 2.13.1.windows.2