From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 578E921B06E9B for ; Wed, 9 Aug 2017 12:37:46 -0700 (PDT) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP; 09 Aug 2017 12:40:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,349,1498546800"; d="scan'208";a="138372459" Received: from mdkinney-mobl1.amr.corp.intel.com ([10.254.74.194]) by fmsmga006.fm.intel.com with ESMTP; 09 Aug 2017 12:40:04 -0700 From: Michael D Kinney To: edk2-devel@lists.01.org Cc: Kelly Steele , Liming Gao Date: Wed, 9 Aug 2017 12:39:56 -0700 Message-Id: <20170809193957.10644-2-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.13.1.windows.2 In-Reply-To: <20170809193957.10644-1-michael.d.kinney@intel.com> References: <20170809193957.10644-1-michael.d.kinney@intel.com> Subject: [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: Wed, 09 Aug 2017 19:37:46 -0000 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) 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 BSD License @@ -74,7 +74,3 @@ [Depex] TRUE - -[BuildOptions] - # /Oi option to use the intrinsic memset function in source code. - MSFT:*_*_*_CC_FLAGS = /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 BSD License @@ -90,8 +90,12 @@ void restore_timings(MRCParams_t *mrc_params); void default_timings(MRCParams_t *mrc_params); #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 +#define memset(d,c,n) ((c) == 0) ? ZeroMem ((d), (n)) : SetMem ((d), (n), (c)) +#define memcpy(d,s,n) CopyMem ((d), (s), (n)) #endif #endif // _MEMINIT_UTILS_H_ -- 2.13.1.windows.2