diff options
author | Michael D Kinney <michael.d.kinney@intel.com> | 2017-08-09 12:19:46 -0700 |
---|---|---|
committer | Michael D Kinney <michael.d.kinney@intel.com> | 2017-08-10 09:44:17 -0700 |
commit | 8e8cc6881836705818ee9cd70bd48c01823ded62 (patch) | |
tree | bd731e837fdb66299041666a72d7da0c77e92653 /QuarkSocPkg/QuarkNorthCluster | |
parent | 95cc9a51e1057ace27ef09b5e19fa45d3e66ef2b (diff) | |
download | edk2-8e8cc6881836705818ee9cd70bd48c01823ded62.tar.gz edk2-8e8cc6881836705818ee9cd70bd48c01823ded62.tar.bz2 edk2-8e8cc6881836705818ee9cd70bd48c01823ded62.zip |
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 <kelly.steele@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
Reviewed-by: Kelly Steele <kelly.steele@intel.com>
Diffstat (limited to 'QuarkSocPkg/QuarkNorthCluster')
-rw-r--r-- | QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei/MemoryInitPei.inf | 6 | ||||
-rw-r--r-- | 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 <Library/BaseMemoryLib.h>
+#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_
|