From ee6f9813e1d8df5b24bb7ef8182efe54e1740597 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Sat, 1 Nov 2014 10:23:03 +0100 Subject: AGESA f12: Add "const" modifiers Apply commit 283ba78415 to f12 (literally, plus one adaptation). Change-Id: Ied7891806e269320caf968cae3de3dc792c5f8fd Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/7312 Tested-by: build bot (Jenkins) Reviewed-by: Edward O'Callaghan Reviewed-by: Bruce Griffith --- src/vendorcode/amd/agesa/f12/AGESA.h | 4 +- .../amd/agesa/f12/Legacy/Proc/Dispatcher.c | 2 +- src/vendorcode/amd/agesa/f12/Lib/amdlib.c | 60 +++++++++++----------- src/vendorcode/amd/agesa/f12/Lib/amdlib.h | 44 ++++++++-------- .../GNB/Modules/GnbPcieConfig/PcieInputParser.c | 14 ++--- .../GNB/Modules/GnbPcieConfig/PcieInputParser.h | 6 +-- 6 files changed, 65 insertions(+), 65 deletions(-) (limited to 'src/vendorcode') diff --git a/src/vendorcode/amd/agesa/f12/AGESA.h b/src/vendorcode/amd/agesa/f12/AGESA.h index 9f618079f3..9660f35965 100644 --- a/src/vendorcode/amd/agesa/f12/AGESA.h +++ b/src/vendorcode/amd/agesa/f12/AGESA.h @@ -825,8 +825,8 @@ typedef struct { * @li @b Bit31 - last descriptor in topology */ IN UINT32 SocketId; ///< Socket Id - IN PCIe_PORT_DESCRIPTOR *PciePortList; ///< Pointer to array of PCIe port descriptors or NULL (Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST). - IN PCIe_DDI_DESCRIPTOR *DdiLinkList; ///< Pointer to array DDI link descriptors (Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST). + IN CONST PCIe_PORT_DESCRIPTOR *PciePortList; ///< Pointer to array of PCIe port descriptors or NULL (Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST). + IN CONST PCIe_DDI_DESCRIPTOR *DdiLinkList; ///< Pointer to array DDI link descriptors (Last element of array must be terminated with DESCRIPTOR_TERMINATE_LIST). IN VOID *Reserved; ///< Reserved for future use } PCIe_COMPLEX_DESCRIPTOR; diff --git a/src/vendorcode/amd/agesa/f12/Legacy/Proc/Dispatcher.c b/src/vendorcode/amd/agesa/f12/Legacy/Proc/Dispatcher.c index 865c84fab4..cbbd4910c8 100644 --- a/src/vendorcode/amd/agesa/f12/Legacy/Proc/Dispatcher.c +++ b/src/vendorcode/amd/agesa/f12/Legacy/Proc/Dispatcher.c @@ -84,7 +84,7 @@ AmdAgesaDispatcher ( DISPATCH_TABLE *Entry; UINT32 ImageStart; UINT32 ImageEnd; - AMD_IMAGE_HEADER* AltImagePtr; + CONST AMD_IMAGE_HEADER* AltImagePtr; Status = AGESA_UNSUPPORTED; ImageEntry = NULL; diff --git a/src/vendorcode/amd/agesa/f12/Lib/amdlib.c b/src/vendorcode/amd/agesa/f12/Lib/amdlib.c index f88eb984c9..1ca9b552b8 100644 --- a/src/vendorcode/amd/agesa/f12/Lib/amdlib.c +++ b/src/vendorcode/amd/agesa/f12/Lib/amdlib.c @@ -90,8 +90,8 @@ VOID STATIC LibAmdGetDataFromPtr ( IN ACCESS_WIDTH AccessWidth, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, OUT UINT32 *TemData, OUT UINT32 *TempDataMask ); @@ -504,7 +504,7 @@ VOID LibAmdIoWrite ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -542,8 +542,8 @@ VOID LibAmdIoRMW ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -574,8 +574,8 @@ VOID LibAmdIoPoll ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ) @@ -641,7 +641,7 @@ VOID LibAmdMemWrite ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -679,8 +679,8 @@ VOID LibAmdMemRMW ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -711,8 +711,8 @@ VOID LibAmdMemPoll ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ) @@ -792,7 +792,7 @@ VOID LibAmdPciWrite ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -844,8 +844,8 @@ VOID LibAmdPciRMW ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { @@ -876,8 +876,8 @@ VOID LibAmdPciPoll ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ) @@ -976,7 +976,7 @@ LibAmdPciWriteBits ( IN PCI_ADDR Address, IN UINT8 Highbit, IN UINT8 Lowbit, - IN UINT32 *Value, + IN CONST UINT32 *Value, IN AMD_CONFIG_PARAMS *StdHeader ) { @@ -1112,13 +1112,13 @@ LibAmdMemFill ( VOID LibAmdMemCopy ( IN VOID *Destination, - IN VOID *Source, + IN CONST VOID *Source, IN UINTN CopyLength, IN OUT AMD_CONFIG_PARAMS *StdHeader ) { UINT8 *Dest; - UINT8 *SourcePtr; + CONST UINT8 *SourcePtr; ASSERT (StdHeader != NULL); Dest = Destination; SourcePtr = Source; @@ -1138,7 +1138,7 @@ LibAmdMemCopy ( */ BOOLEAN LibAmdVerifyImageChecksum ( - IN VOID *ImagePtr + IN CONST VOID *ImagePtr ) { // Assume ImagePtr points to the binary start ($AMD) @@ -1175,19 +1175,19 @@ LibAmdVerifyImageChecksum ( * @retval NULL if image not found * @retval pointer to image header */ -VOID * +CONST VOID * LibAmdLocateImage ( - IN VOID *StartAddress, - IN VOID *EndAddress, + IN CONST VOID *StartAddress, + IN CONST VOID *EndAddress, IN UINT32 Alignment, - IN CHAR8 ModuleSignature[8] + IN CONST CHAR8 ModuleSignature[8] ) { - UINT8 *CurrentPtr; + CONST UINT8 *CurrentPtr; AMD_MODULE_HEADER *ModuleHeaderPtr; - UINT64 *SearchStr; - UINT64 *InputStr; + CONST UINT64 *SearchStr; + CONST UINT64 *InputStr; CurrentPtr = StartAddress; InputStr = (UINT64 *)ModuleSignature; @@ -1252,8 +1252,8 @@ VOID STATIC LibAmdGetDataFromPtr ( IN ACCESS_WIDTH AccessWidth, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, OUT UINT32 *TemData, OUT UINT32 *TempDataMask ) diff --git a/src/vendorcode/amd/agesa/f12/Lib/amdlib.h b/src/vendorcode/amd/agesa/f12/Lib/amdlib.h index 63cd659f58..5225dce640 100644 --- a/src/vendorcode/amd/agesa/f12/Lib/amdlib.h +++ b/src/vendorcode/amd/agesa/f12/Lib/amdlib.h @@ -185,7 +185,7 @@ VOID LibAmdIoWrite ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -193,8 +193,8 @@ VOID LibAmdIoRMW ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -202,8 +202,8 @@ VOID LibAmdIoPoll ( IN ACCESS_WIDTH AccessWidth, IN UINT16 IoAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -221,7 +221,7 @@ VOID LibAmdMemWrite ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -229,8 +229,8 @@ VOID LibAmdMemRMW ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -238,8 +238,8 @@ VOID LibAmdMemPoll ( IN ACCESS_WIDTH AccessWidth, IN UINT64 MemAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -257,7 +257,7 @@ VOID LibAmdPciWrite ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Value, + IN CONST VOID *Value, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -265,8 +265,8 @@ VOID LibAmdPciRMW ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -274,8 +274,8 @@ VOID LibAmdPciPoll ( IN ACCESS_WIDTH AccessWidth, IN PCI_ADDR PciAddress, - IN VOID *Data, - IN VOID *DataMask, + IN CONST VOID *Data, + IN CONST VOID *DataMask, IN UINT64 Delay, IN OUT AMD_CONFIG_PARAMS *StdHeader ); @@ -294,7 +294,7 @@ LibAmdPciWriteBits ( IN PCI_ADDR Address, IN UINT8 Highbit, IN UINT8 Lowbit, - IN UINT32 *Value, + IN CONST UINT32 *Value, IN AMD_CONFIG_PARAMS *StdHeader ); @@ -324,17 +324,17 @@ LibAmdMemFill ( VOID LibAmdMemCopy ( IN VOID *Destination, - IN VOID *Source, + IN CONST VOID *Source, IN UINTN CopyLength, IN OUT AMD_CONFIG_PARAMS *StdHeader ); -VOID * +CONST VOID * LibAmdLocateImage ( - IN VOID *StartAddress, - IN VOID *EndAddress, + IN CONST VOID *StartAddress, + IN CONST VOID *EndAddress, IN UINT32 Alignment, - IN CHAR8 ModuleSignature[8] + IN CONST CHAR8 ModuleSignature[8] ); UINT32 @@ -344,7 +344,7 @@ LibAmdGetPackageType ( BOOLEAN LibAmdVerifyImageChecksum ( - IN VOID *ImagePtr + IN CONST VOID *ImagePtr ); UINT8 diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.c b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.c index c6d9d47807..5398ca1041 100644 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.c +++ b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.c @@ -73,7 +73,7 @@ */ UINTN PcieInputParserGetLengthOfDdiEnginesList ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ); /*----------------------------------------------------------------------------------------*/ @@ -88,7 +88,7 @@ PcieInputParserGetLengthOfDdiEnginesList ( */ UINTN PcieInputParserGetNumberOfComplexes ( - IN PCIe_COMPLEX_DESCRIPTOR *ComplexList + IN CONST PCIe_COMPLEX_DESCRIPTOR *ComplexList ) { UINTN Result; @@ -113,11 +113,11 @@ PcieInputParserGetNumberOfComplexes ( */ UINTN PcieInputParserGetLengthOfPcieEnginesList ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ) { UINTN Result; - PCIe_PORT_DESCRIPTOR *PciePortList; + CONST PCIe_PORT_DESCRIPTOR *PciePortList; Result = 0; if (Complex != NULL) { PciePortList = Complex->PciePortList; @@ -140,11 +140,11 @@ PcieInputParserGetLengthOfPcieEnginesList ( */ UINTN PcieInputParserGetLengthOfDdiEnginesList ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ) { UINTN Result; - PCIe_DDI_DESCRIPTOR *DdiLinkList; + CONST PCIe_DDI_DESCRIPTOR *DdiLinkList; Result = 0; if (Complex != NULL) { DdiLinkList = Complex->DdiLinkList; @@ -168,7 +168,7 @@ PcieInputParserGetLengthOfDdiEnginesList ( */ UINTN PcieInputParserGetNumberOfEngines ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ) { UINTN Result; diff --git a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.h b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.h index d10c383f78..ed2e33ac69 100644 --- a/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.h +++ b/src/vendorcode/amd/agesa/f12/Proc/GNB/Modules/GnbPcieConfig/PcieInputParser.h @@ -48,12 +48,12 @@ UINTN PcieInputParserGetNumberOfComplexes ( - IN PCIe_COMPLEX_DESCRIPTOR *ComplexList + IN CONST PCIe_COMPLEX_DESCRIPTOR *ComplexList ); UINTN PcieInputParserGetNumberOfEngines ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ); @@ -77,7 +77,7 @@ PcieInputParserGetComplexDescriptorOfSocket ( UINTN PcieInputParserGetLengthOfPcieEnginesList ( - IN PCIe_COMPLEX_DESCRIPTOR *Complex + IN CONST PCIe_COMPLEX_DESCRIPTOR *Complex ); #endif -- cgit v1.2.3