summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2017-11-03 11:44:10 -0600
committerAaron Durbin <adurbin@chromium.org>2017-11-04 02:58:28 +0000
commite3f7d44d3b11d4a87b3eff3d9b3c6aa077fdf36c (patch)
tree81fd7c3e18566e23ab882b5b50faf2c899096bfb
parent7b2d1ae299040932152229b3059b52b295810171 (diff)
soc/amd/common: remove use of LibAmdMemFill()
memset() exists for a reason. There's 0 reason to duplicate the functionality but add extraneous parameters that do nothing. This is just poor coding practices. Remove LibAmdMemFill() usage. BUG=b:62240746 Change-Id: I18028b38421efa9c4c7c0412a04479638cc9218b Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/22312 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com> Reviewed-by: Patrick Georgi <pgeorgi@google.com> Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
-rw-r--r--src/soc/amd/common/agesawrapper.c47
-rw-r--r--src/soc/amd/common/heapmanager.c5
2 files changed, 12 insertions, 40 deletions
diff --git a/src/soc/amd/common/agesawrapper.c b/src/soc/amd/common/agesawrapper.c
index 26c48f33b3..0ca47df154 100644
--- a/src/soc/amd/common/agesawrapper.c
+++ b/src/soc/amd/common/agesawrapper.c
@@ -22,6 +22,7 @@
#include <heapManager.h>
#include <agesawrapper.h>
#include <BiosCallOuts.h>
+#include <string.h>
void __attribute__((weak)) OemPostParams(AMD_POST_PARAMS *PostParams) {}
@@ -47,15 +48,8 @@ AGESA_STATUS agesawrapper_amdinitreset(void)
AMD_INTERFACE_PARAMS AmdParamStruct;
AMD_RESET_PARAMS AmdResetParams;
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
-
- LibAmdMemFill (&AmdResetParams,
- 0,
- sizeof(AMD_RESET_PARAMS),
- &(AmdResetParams.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
+ memset(&AmdResetParams, 0, sizeof(AmdResetParams));
AmdParamStruct.AgesaFunctionName = AMD_INIT_RESET;
AmdParamStruct.AllocationMethod = ByHost;
@@ -84,10 +78,7 @@ AGESA_STATUS agesawrapper_amdinitearly(void)
AMD_INTERFACE_PARAMS AmdParamStruct;
AMD_EARLY_PARAMS *AmdEarlyParamsPtr;
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
AmdParamStruct.AgesaFunctionName = AMD_INIT_EARLY;
AmdParamStruct.AllocationMethod = PreMemHeap;
@@ -115,10 +106,7 @@ AGESA_STATUS agesawrapper_amdinitpost(void)
AMD_INTERFACE_PARAMS AmdParamStruct;
AMD_POST_PARAMS *PostParams;
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
AmdParamStruct.AgesaFunctionName = AMD_INIT_POST;
AmdParamStruct.AllocationMethod = PreMemHeap;
@@ -183,10 +171,7 @@ AGESA_STATUS agesawrapper_amdinitenv(void)
AMD_INTERFACE_PARAMS AmdParamStruct;
AMD_ENV_PARAMS *EnvParam;
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
AmdParamStruct.AgesaFunctionName = AMD_INIT_ENV;
AmdParamStruct.AllocationMethod = PostMemDram;
@@ -251,10 +236,7 @@ AGESA_STATUS agesawrapper_amdinitmid(void)
/* Enable MMIO on AMD CPU Address Map Controller */
amd_initcpuio ();
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
AmdParamStruct.AgesaFunctionName = AMD_INIT_MID;
AmdParamStruct.AllocationMethod = PostMemDram;
@@ -289,10 +271,7 @@ AGESA_STATUS agesawrapper_amdinitlate(void)
AMD_INTERFACE_PARAMS AmdParamStruct;
AMD_LATE_PARAMS *AmdLateParams;
- LibAmdMemFill (&AmdParamStruct,
- 0,
- sizeof(AMD_INTERFACE_PARAMS),
- &(AmdParamStruct.StdHeader));
+ memset(&AmdParamStruct, 0, sizeof(AmdParamStruct));
AmdParamStruct.AgesaFunctionName = AMD_INIT_LATE;
AmdParamStruct.AllocationMethod = PostMemDram;
@@ -341,10 +320,7 @@ AGESA_STATUS agesawrapper_amdlaterunaptask (
AGESA_STATUS Status;
AP_EXE_PARAMS ApExeParams;
- LibAmdMemFill (&ApExeParams,
- 0,
- sizeof(AP_EXE_PARAMS),
- &(ApExeParams.StdHeader));
+ memset(&ApExeParams, 0, sizeof(ApExeParams));
ApExeParams.StdHeader.AltImageBasePtr = 0;
ApExeParams.StdHeader.CalloutPtr = &GetBiosCallout;
@@ -367,10 +343,7 @@ AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus)
AGESA_STATUS Status;
EVENT_PARAMS AmdEventParams;
- LibAmdMemFill (&AmdEventParams,
- 0,
- sizeof(EVENT_PARAMS),
- &(AmdEventParams.StdHeader));
+ memset(&AmdEventParams, 0, sizeof(AmdEventParams));
AmdEventParams.StdHeader.AltImageBasePtr = 0;
AmdEventParams.StdHeader.CalloutPtr = &GetBiosCallout;
diff --git a/src/soc/amd/common/heapmanager.c b/src/soc/amd/common/heapmanager.c
index fdf7f65880..5e4fbb4166 100644
--- a/src/soc/amd/common/heapmanager.c
+++ b/src/soc/amd/common/heapmanager.c
@@ -239,9 +239,8 @@ AGESA_STATUS agesa_DeallocateBuffer (UINT32 Func, UINTN Data, VOID *ConfigPtr)
PrevNodePtr->NextNodeOffset = AllocNodePtr->NextNodeOffset;
/* Zero out the buffer, and clear the BufferHandle */
- LibAmdMemFill((UINT8 *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0,
- AllocNodePtr->BufferSize,
- &(AllocParams->StdHeader));
+ memset((UINT8 *)AllocNodePtr + sizeof(BIOS_BUFFER_NODE), 0,
+ AllocNodePtr->BufferSize);
AllocNodePtr->BufferHandle = 0;
AllocNodePtr->BufferSize += sizeof(BIOS_BUFFER_NODE);