From 06ff7268f67d1345fd115fda0879d781eac2d6b1 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sat, 5 Jul 2014 15:24:50 +1000 Subject: AGESA: Fix error status code return type to enum from UINT32 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AGESA correctly uses the enum AGESA_STATUS type whereas boards use a mess of UINT32 typecasts. Also no need to shout VOID. We are not that careful on changing all cases of VOID->void or whitespace issues as these files will get merged with follow-ups. Change-Id: I16ccfcc73cda6b917c7ff5fd42ee2cd04e7dc0dd Signed-off-by: Edward O'Callaghan Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/6182 Tested-by: build bot (Jenkins) --- src/mainboard/supermicro/h8qgi/agesawrapper.c | 50 +++++++++++++-------------- src/mainboard/supermicro/h8qgi/agesawrapper.h | 20 +++++------ src/mainboard/supermicro/h8scm/agesawrapper.c | 50 +++++++++++++-------------- src/mainboard/supermicro/h8scm/agesawrapper.h | 20 +++++------ 4 files changed, 70 insertions(+), 70 deletions(-) (limited to 'src/mainboard/supermicro') diff --git a/src/mainboard/supermicro/h8qgi/agesawrapper.c b/src/mainboard/supermicro/h8qgi/agesawrapper.c index ba23b4d318..8ee89a7a83 100644 --- a/src/mainboard/supermicro/h8qgi/agesawrapper.c +++ b/src/mainboard/supermicro/h8qgi/agesawrapper.c @@ -78,7 +78,7 @@ VOID *AcpiAlib = NULL; */ extern VOID OemCustomizeInitEarly(IN OUT AMD_EARLY_PARAMS *InitEarly); -static UINT32 agesawrapper_amdinitcpuio(VOID) +static AGESA_STATUS agesawrapper_amdinitcpuio(void) { AGESA_STATUS Status; UINT32 PciData; @@ -169,10 +169,10 @@ static UINT32 agesawrapper_amdinitcpuio(VOID) } Status = AGESA_SUCCESS; - return (UINT32)Status; + return Status; } -UINT32 agesawrapper_amdinitmmio(VOID) +AGESA_STATUS agesawrapper_amdinitmmio(void) { AGESA_STATUS Status; UINT64 MsrReg; @@ -199,10 +199,10 @@ UINT32 agesawrapper_amdinitmmio(VOID) LibAmdMsrWrite(0x20D, &MsrReg, &StdHeader); Status = AGESA_SUCCESS; - return (UINT32)Status; + return Status; } -UINT32 agesawrapper_amdinitreset(VOID) +UINT32 agesawrapper_amdinitreset(void) { AGESA_STATUS status = AGESA_SUCCESS; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -228,7 +228,7 @@ UINT32 agesawrapper_amdinitreset(VOID) AmdParamStruct.StdHeader.ImageBasePtr = 0; status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } AmdResetParams.HtConfig.Depth = 0; @@ -241,10 +241,10 @@ UINT32 agesawrapper_amdinitreset(VOID) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitearly(VOID) +AGESA_STATUS agesawrapper_amdinitearly(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -265,7 +265,7 @@ UINT32 agesawrapper_amdinitearly(VOID) AmdParamStruct.StdHeader.ImageBasePtr = 0; status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } AmdEarlyParamsPtr = (AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr; @@ -280,10 +280,10 @@ UINT32 agesawrapper_amdinitearly(VOID) printk(BIOS_DEBUG, "BSP Frequency: %uMHz\n", (unsigned int)TscRateInMhz); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitpost(VOID) +AGESA_STATUS agesawrapper_amdinitpost(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -305,7 +305,7 @@ UINT32 agesawrapper_amdinitpost(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } PostParams = (AMD_POST_PARAMS *)AmdParamStruct.NewStructPtr; status = AmdInitPost(PostParams); @@ -321,10 +321,10 @@ UINT32 agesawrapper_amdinitpost(VOID) FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, &AmdParamStruct.StdHeader); printk(BIOS_DEBUG, "BSP Frequency: %uMHz\n", (unsigned int)TscRateInMhz); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitenv(VOID) +AGESA_STATUS agesawrapper_amdinitenv(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -344,7 +344,7 @@ UINT32 agesawrapper_amdinitenv(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } EnvParams = (AMD_ENV_PARAMS *)AmdParamStruct.NewStructPtr; status = AmdInitEnv(EnvParams); @@ -352,7 +352,7 @@ UINT32 agesawrapper_amdinitenv(VOID) agesawrapper_amdreadeventlog(EnvParams->StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } VOID * agesawrapper_getlateinitptr(int pick) @@ -382,7 +382,7 @@ VOID * agesawrapper_getlateinitptr(int pick) return NULL; } -UINT32 agesawrapper_amdinitmid(VOID) +AGESA_STATUS agesawrapper_amdinitmid(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -404,17 +404,17 @@ UINT32 agesawrapper_amdinitmid(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } status = AmdInitMid((AMD_MID_PARAMS *)AmdParamStruct.NewStructPtr); if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitlate(VOID) +AGESA_STATUS agesawrapper_amdinitlate(void) { AGESA_STATUS Status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -460,14 +460,14 @@ UINT32 agesawrapper_amdinitlate(VOID) * AmdReleaseStruct (&AmdLateParams); */ - return (UINT32)Status; + return Status; } /** * @param[in] UINTN ApicIdOfCore, * @param[in] AP_EXE_PARAMS *LaunchApParams */ -UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) +AGESA_STATUS agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { AGESA_STATUS Status; AMD_LATE_PARAMS AmdLateParams; @@ -490,7 +490,7 @@ UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) ASSERT(Status <= AGESA_UNSUPPORTED); } - return (UINT32)Status; + return Status; } /** @@ -1152,7 +1152,7 @@ static void interpret_agesa_eventlog(EVENT_PARAMS *event) /** * @param HeapStatus -the current HeapStatus */ -UINT32 agesawrapper_amdreadeventlog(UINT8 HeapStatus) +AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus) { printk(BIOS_DEBUG, "enter in %s\n", __func__); AGESA_STATUS Status; @@ -1185,5 +1185,5 @@ UINT32 agesawrapper_amdreadeventlog(UINT8 HeapStatus) } printk(BIOS_DEBUG, "exit %s \n", __func__); - return (UINT32)Status; + return Status; } diff --git a/src/mainboard/supermicro/h8qgi/agesawrapper.h b/src/mainboard/supermicro/h8qgi/agesawrapper.h index 51e438d497..c99714de25 100644 --- a/src/mainboard/supermicro/h8qgi/agesawrapper.h +++ b/src/mainboard/supermicro/h8qgi/agesawrapper.h @@ -68,16 +68,16 @@ enum { *--------------------------------------------------------------------------------------- */ -UINT32 agesawrapper_amdinitreset (void); -UINT32 agesawrapper_amdinitearly (void); -UINT32 agesawrapper_amdinitenv (void); -UINT32 agesawrapper_amdinitlate (void); -UINT32 agesawrapper_amdinitpost (void); -UINT32 agesawrapper_amdinitmid (void); -UINT32 agesawrapper_amdreadeventlog (UINT8 HeapStatus); -UINT32 agesawrapper_amdinitmmio (void); +AGESA_STATUS agesawrapper_amdinitreset(void); +AGESA_STATUS agesawrapper_amdinitearly(void); +AGESA_STATUS agesawrapper_amdinitenv(void); +AGESA_STATUS agesawrapper_amdinitlate(void); +AGESA_STATUS agesawrapper_amdinitpost(void); +AGESA_STATUS agesawrapper_amdinitmid(void); +AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus); +AGESA_STATUS agesawrapper_amdinitmmio(void); void *agesawrapper_getlateinitptr (int pick); -UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr); +AGESA_STATUS agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr); -static inline UINT32 agesawrapper_amdS3Save(void) { return 0; } +static inline AGESA_STATUS agesawrapper_amdS3Save(void) { return 0; } #endif diff --git a/src/mainboard/supermicro/h8scm/agesawrapper.c b/src/mainboard/supermicro/h8scm/agesawrapper.c index ad9969639b..c52197bffd 100644 --- a/src/mainboard/supermicro/h8scm/agesawrapper.c +++ b/src/mainboard/supermicro/h8scm/agesawrapper.c @@ -78,7 +78,7 @@ VOID *AcpiAlib = NULL; */ extern VOID OemCustomizeInitEarly(IN OUT AMD_EARLY_PARAMS *InitEarly); -static UINT32 agesawrapper_amdinitcpuio(VOID) +static AGESA_STATUS agesawrapper_amdinitcpuio(void) { AGESA_STATUS Status; UINT32 PciData; @@ -169,10 +169,10 @@ static UINT32 agesawrapper_amdinitcpuio(VOID) } Status = AGESA_SUCCESS; - return (UINT32)Status; + return Status; } -UINT32 agesawrapper_amdinitmmio(VOID) +AGESA_STATUS agesawrapper_amdinitmmio(void) { AGESA_STATUS Status; UINT64 MsrReg; @@ -199,10 +199,10 @@ UINT32 agesawrapper_amdinitmmio(VOID) LibAmdMsrWrite(0x20D, &MsrReg, &StdHeader); Status = AGESA_SUCCESS; - return (UINT32)Status; + return Status; } -UINT32 agesawrapper_amdinitreset(VOID) +UINT32 agesawrapper_amdinitreset(void) { AGESA_STATUS status = AGESA_SUCCESS; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -228,7 +228,7 @@ UINT32 agesawrapper_amdinitreset(VOID) AmdParamStruct.StdHeader.ImageBasePtr = 0; status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } AmdResetParams.HtConfig.Depth = 0; @@ -241,10 +241,10 @@ UINT32 agesawrapper_amdinitreset(VOID) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitearly(VOID) +AGESA_STATUS agesawrapper_amdinitearly(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -265,7 +265,7 @@ UINT32 agesawrapper_amdinitearly(VOID) AmdParamStruct.StdHeader.ImageBasePtr = 0; status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } AmdEarlyParamsPtr = (AMD_EARLY_PARAMS *)AmdParamStruct.NewStructPtr; @@ -280,10 +280,10 @@ UINT32 agesawrapper_amdinitearly(VOID) printk(BIOS_DEBUG, "BSP Frequency: %uMHz\n", (unsigned int)TscRateInMhz); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitpost(VOID) +AGESA_STATUS agesawrapper_amdinitpost(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -305,7 +305,7 @@ UINT32 agesawrapper_amdinitpost(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } PostParams = (AMD_POST_PARAMS *)AmdParamStruct.NewStructPtr; status = AmdInitPost(PostParams); @@ -321,10 +321,10 @@ UINT32 agesawrapper_amdinitpost(VOID) FamilySpecificServices->GetTscRate (FamilySpecificServices, &TscRateInMhz, &AmdParamStruct.StdHeader); printk(BIOS_DEBUG, "BSP Frequency: %uMHz\n", (unsigned int)TscRateInMhz); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitenv(VOID) +AGESA_STATUS agesawrapper_amdinitenv(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -344,7 +344,7 @@ UINT32 agesawrapper_amdinitenv(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } EnvParams = (AMD_ENV_PARAMS *)AmdParamStruct.NewStructPtr; status = AmdInitEnv(EnvParams); @@ -352,7 +352,7 @@ UINT32 agesawrapper_amdinitenv(VOID) agesawrapper_amdreadeventlog(EnvParams->StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } VOID * agesawrapper_getlateinitptr(int pick) @@ -382,7 +382,7 @@ VOID * agesawrapper_getlateinitptr(int pick) return NULL; } -UINT32 agesawrapper_amdinitmid(VOID) +AGESA_STATUS agesawrapper_amdinitmid(void) { AGESA_STATUS status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -404,17 +404,17 @@ UINT32 agesawrapper_amdinitmid(VOID) status = AmdCreateStruct(&AmdParamStruct); if (status != AGESA_SUCCESS) { - return (UINT32)status; + return status; } status = AmdInitMid((AMD_MID_PARAMS *)AmdParamStruct.NewStructPtr); if (status != AGESA_SUCCESS) agesawrapper_amdreadeventlog(AmdParamStruct.StdHeader.HeapStatus); AmdReleaseStruct(&AmdParamStruct); - return (UINT32)status; + return status; } -UINT32 agesawrapper_amdinitlate(VOID) +AGESA_STATUS agesawrapper_amdinitlate(void) { AGESA_STATUS Status; AMD_INTERFACE_PARAMS AmdParamStruct; @@ -460,14 +460,14 @@ UINT32 agesawrapper_amdinitlate(VOID) * AmdReleaseStruct (&AmdLateParams); */ - return (UINT32)Status; + return Status; } /** * @param[in] UINTN ApicIdOfCore, * @param[in] AP_EXE_PARAMS *LaunchApParams */ -UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) +AGESA_STATUS agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) { AGESA_STATUS Status; AMD_LATE_PARAMS AmdLateParams; @@ -490,7 +490,7 @@ UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr) ASSERT(Status <= AGESA_UNSUPPORTED); } - return (UINT32)Status; + return Status; } /** @@ -1152,7 +1152,7 @@ static void interpret_agesa_eventlog(EVENT_PARAMS *event) /** * @param HeapStatus -the current HeapStatus */ -UINT32 agesawrapper_amdreadeventlog(UINT8 HeapStatus) +AGESA_STATUS agesawrapper_amdreadeventlog(UINT8 HeapStatus) { printk(BIOS_DEBUG, "enter in %s\n", __func__); AGESA_STATUS Status; @@ -1185,5 +1185,5 @@ UINT32 agesawrapper_amdreadeventlog(UINT8 HeapStatus) } printk(BIOS_DEBUG, "exit %s \n", __func__); - return (UINT32)Status; + return Status; } diff --git a/src/mainboard/supermicro/h8scm/agesawrapper.h b/src/mainboard/supermicro/h8scm/agesawrapper.h index 51e438d497..c99714de25 100644 --- a/src/mainboard/supermicro/h8scm/agesawrapper.h +++ b/src/mainboard/supermicro/h8scm/agesawrapper.h @@ -68,16 +68,16 @@ enum { *--------------------------------------------------------------------------------------- */ -UINT32 agesawrapper_amdinitreset (void); -UINT32 agesawrapper_amdinitearly (void); -UINT32 agesawrapper_amdinitenv (void); -UINT32 agesawrapper_amdinitlate (void); -UINT32 agesawrapper_amdinitpost (void); -UINT32 agesawrapper_amdinitmid (void); -UINT32 agesawrapper_amdreadeventlog (UINT8 HeapStatus); -UINT32 agesawrapper_amdinitmmio (void); +AGESA_STATUS agesawrapper_amdinitreset(void); +AGESA_STATUS agesawrapper_amdinitearly(void); +AGESA_STATUS agesawrapper_amdinitenv(void); +AGESA_STATUS agesawrapper_amdinitlate(void); +AGESA_STATUS agesawrapper_amdinitpost(void); +AGESA_STATUS agesawrapper_amdinitmid(void); +AGESA_STATUS agesawrapper_amdreadeventlog (UINT8 HeapStatus); +AGESA_STATUS agesawrapper_amdinitmmio(void); void *agesawrapper_getlateinitptr (int pick); -UINT32 agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr); +AGESA_STATUS agesawrapper_amdlaterunaptask (UINT32 Func, UINT32 Data, VOID *ConfigPtr); -static inline UINT32 agesawrapper_amdS3Save(void) { return 0; } +static inline AGESA_STATUS agesawrapper_amdS3Save(void) { return 0; } #endif -- cgit v1.2.3