From b80de180c2ebd7bde5ce4da43d5e0f0c260c25e7 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 16 May 2022 15:29:53 +0200 Subject: vendorcode/amd/agesa/fam16kb: Fix improper use of .data AGESA has a lot of code in the .data section which is for initialized data, that in fact should be .rodata. This adds the 'CONST' keyword everywhere it is needed. TEST: See in the .elf file (e.g. using readelf) that there is nothing in .data section. Change-Id: Ie8817434ee0bc6c195eabe090f195512c0043ae5 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64400 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons Reviewed-by: Stefan Reinauer --- src/vendorcode/amd/agesa/f16kb/Include/OptionMemory.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/vendorcode/amd/agesa/f16kb/Include') diff --git a/src/vendorcode/amd/agesa/f16kb/Include/OptionMemory.h b/src/vendorcode/amd/agesa/f16kb/Include/OptionMemory.h index 23b510908a..aa6c76e7b6 100644 --- a/src/vendorcode/amd/agesa/f16kb/Include/OptionMemory.h +++ b/src/vendorcode/amd/agesa/f16kb/Include/OptionMemory.h @@ -127,7 +127,7 @@ typedef BOOLEAN OPTION_MEM_FEATURE_MAIN ( typedef BOOLEAN MEM_NB_CONSTRUCTOR ( IN OUT MEM_NB_BLOCK *NBPtr, IN OUT MEM_DATA_STRUCT *MemPtr, - IN MEM_FEAT_BLOCK_NB *FeatPtr, + CONST IN MEM_FEAT_BLOCK_NB *FeatPtr, IN MEM_SHARED_DATA *mmSharedPtr, ///< Pointer to Memory scratchpad IN UINT8 NodeID ); @@ -250,7 +250,7 @@ typedef struct _MEM_NB_SUPPORT { UINT16 MemNBSupportVersion; ///< Version of northbridge support. MEM_NB_CONSTRUCTOR *MemConstructNBBlock; ///< NorthBridge block constructor. MEM_INITIALIZER *MemNInitDefaults; ///< Default value initialization for MEM_DATA_STRUCT. - MEM_FEAT_BLOCK_NB *MemFeatBlock; ///< Memory feature block. + CONST MEM_FEAT_BLOCK_NB *MemFeatBlock; ///< Memory feature block. MEM_RESUME_CONSTRUCTOR *MemS3ResumeConstructNBBlock; ///< S3 memory initialization northbridge block constructor. MEM_IDENDIMM_CONSTRUCTOR *MemIdentifyDimmConstruct; ///< Constructor for address to dimm identification. } MEM_NB_SUPPORT; @@ -270,7 +270,7 @@ typedef struct _MEM_FEAT_TRAIN_SEQ { UINT16 OptMemTrainingSequenceListVersion; ///< Version of main feature block. OPTION_MEM_FEATURE_NB *TrainingSequence; ///< Training Sequence function. OPTION_MEM_FEATURE_NB *TrainingSequenceEnabled; ///< Enable function. - MEM_TECH_FEAT_BLOCK *MemTechFeatBlock; ///< Memory feature block. + CONST MEM_TECH_FEAT_BLOCK *MemTechFeatBlock; ///< Memory feature block. } MEM_FEAT_TRAIN_SEQ; /** @@ -297,7 +297,7 @@ typedef struct _MEM_PSC_TABLE_BLOCK { typedef BOOLEAN MEM_PSC_FLOW ( IN OUT MEM_NB_BLOCK *NBPtr, - IN MEM_PSC_TABLE_BLOCK *EntryOfTables + CONST IN MEM_PSC_TABLE_BLOCK *EntryOfTables ); /** @@ -305,7 +305,7 @@ typedef BOOLEAN MEM_PSC_FLOW ( * specific configuration. */ typedef struct _MEM_PSC_FLOW_BLOCK { - MEM_PSC_TABLE_BLOCK *EntryOfTables; ///