vendorcode/amd/pi/00730F01/Lib/amdlib.c: Remove optimize attribute

Remove '__attribute__((optimize("Os")))' as it is unlikely to be
necessary as it is not used in other families that have the same
code and only hides deeper issues.

Change-Id: Ica890812ebc2fb659b9c3e46b40cf3f6534b3cf2
Signed-off-by: Bruce Griffith <Bruce.Griffith@se-eng.com>
Reviewed-on: http://review.coreboot.org/7689
Reviewed-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
This commit is contained in:
Bruce Griffith 2014-12-11 02:44:11 -07:00
parent 0f0d497217
commit 84c3c568b9
1 changed files with 35 additions and 31 deletions

View File

@ -52,6 +52,10 @@
CODE_GROUP (G1_PEICC) CODE_GROUP (G1_PEICC)
RDATA_GROUP (G1_PEICC) RDATA_GROUP (G1_PEICC)
#if !defined(AMDLIB_OPTIMIZE)
#define AMDLIB_OPTIMIZE
#endif
#define FILECODE LIB_AMDLIB_FILECODE #define FILECODE LIB_AMDLIB_FILECODE
BOOLEAN BOOLEAN
@ -89,7 +93,7 @@ ReadNumberOfCpuCores(
void void
); );
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT8 UINT8
ReadIo8 ( ReadIo8 (
IN UINT16 Address IN UINT16 Address
@ -98,7 +102,7 @@ ReadIo8 (
return __inbyte (Address); return __inbyte (Address);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT16 UINT16
ReadIo16 ( ReadIo16 (
IN UINT16 Address IN UINT16 Address
@ -107,7 +111,7 @@ ReadIo16 (
return __inword (Address); return __inword (Address);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT32 UINT32
ReadIo32 ( ReadIo32 (
IN UINT16 Address IN UINT16 Address
@ -116,7 +120,7 @@ ReadIo32 (
return __indword (Address); return __indword (Address);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
WriteIo8 ( WriteIo8 (
IN UINT16 Address, IN UINT16 Address,
@ -126,7 +130,7 @@ WriteIo8 (
__outbyte (Address, Data); __outbyte (Address, Data);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
WriteIo16 ( WriteIo16 (
IN UINT16 Address, IN UINT16 Address,
@ -136,7 +140,7 @@ WriteIo16 (
__outword (Address, Data); __outword (Address, Data);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
WriteIo32 ( WriteIo32 (
IN UINT16 Address, IN UINT16 Address,
@ -146,7 +150,7 @@ WriteIo32 (
__outdword (Address, Data); __outdword (Address, Data);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
STATIC STATIC
UINT64 SetFsBase ( UINT64 SetFsBase (
UINT64 address UINT64 address
@ -159,7 +163,7 @@ UINT64 SetFsBase (
return hwcr; return hwcr;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
STATIC STATIC
VOID VOID
RestoreHwcr ( RestoreHwcr (
@ -170,7 +174,7 @@ RestoreHwcr (
__writemsr (0xC0010015, value); __writemsr (0xC0010015, value);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT8 UINT8
Read64Mem8 ( Read64Mem8 (
IN UINT64 Address IN UINT64 Address
@ -187,7 +191,7 @@ Read64Mem8 (
return dataRead; return dataRead;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT16 UINT16
Read64Mem16 ( Read64Mem16 (
IN UINT64 Address IN UINT64 Address
@ -204,7 +208,7 @@ Read64Mem16 (
return dataRead; return dataRead;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT32 UINT32
Read64Mem32 ( Read64Mem32 (
IN UINT64 Address IN UINT64 Address
@ -221,7 +225,7 @@ Read64Mem32 (
return dataRead; return dataRead;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
Write64Mem8 ( Write64Mem8 (
IN UINT64 Address, IN UINT64 Address,
@ -239,7 +243,7 @@ Write64Mem8 (
} }
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
Write64Mem16 ( Write64Mem16 (
IN UINT64 Address, IN UINT64 Address,
@ -257,7 +261,7 @@ Write64Mem16 (
} }
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
Write64Mem32 ( Write64Mem32 (
IN UINT64 Address, IN UINT64 Address,
@ -275,7 +279,7 @@ Write64Mem32 (
} }
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdReadCpuReg ( LibAmdReadCpuReg (
IN UINT8 RegNum, IN UINT8 RegNum,
@ -308,7 +312,7 @@ LibAmdReadCpuReg (
} }
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdWriteCpuReg ( LibAmdWriteCpuReg (
IN UINT8 RegNum, IN UINT8 RegNum,
@ -339,7 +343,7 @@ LibAmdWriteCpuReg (
} }
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdWriteBackInvalidateCache ( LibAmdWriteBackInvalidateCache (
void void
@ -348,7 +352,7 @@ LibAmdWriteBackInvalidateCache (
__wbinvd (); __wbinvd ();
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdHDTBreakPoint ( LibAmdHDTBreakPoint (
void void
@ -358,7 +362,7 @@ LibAmdHDTBreakPoint (
__debugbreak (); // do you really need icebp? If so, go back to asm code __debugbreak (); // do you really need icebp? If so, go back to asm code
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT8 UINT8
LibAmdBitScanForward ( LibAmdBitScanForward (
IN UINT32 value IN UINT32 value
@ -371,7 +375,7 @@ LibAmdBitScanForward (
return (UINT8) Index; return (UINT8) Index;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT8 UINT8
LibAmdBitScanReverse ( LibAmdBitScanReverse (
IN UINT32 value IN UINT32 value
@ -384,7 +388,7 @@ LibAmdBitScanReverse (
return (UINT8) Index; return (UINT8) Index;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdMsrRead ( LibAmdMsrRead (
IN UINT32 MsrAddress, IN UINT32 MsrAddress,
@ -398,7 +402,7 @@ LibAmdMsrRead (
*Value = __readmsr (MsrAddress); *Value = __readmsr (MsrAddress);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdMsrWrite ( LibAmdMsrWrite (
IN UINT32 MsrAddress, IN UINT32 MsrAddress,
@ -409,7 +413,7 @@ LibAmdMsrWrite (
__writemsr (MsrAddress, *Value); __writemsr (MsrAddress, *Value);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
void LibAmdCpuidRead ( void LibAmdCpuidRead (
IN UINT32 CpuidFcnAddress, IN UINT32 CpuidFcnAddress,
OUT CPUID_DATA* Value, OUT CPUID_DATA* Value,
@ -419,7 +423,7 @@ void LibAmdCpuidRead (
__cpuid ((int *)Value, CpuidFcnAddress); __cpuid ((int *)Value, CpuidFcnAddress);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT64 UINT64
ReadTSC ( ReadTSC (
void void
@ -428,7 +432,7 @@ ReadTSC (
return __rdtsc (); return __rdtsc ();
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdSimNowEnterDebugger ( LibAmdSimNowEnterDebugger (
void void
@ -444,7 +448,7 @@ LibAmdSimNowEnterDebugger (
((VOID (*)(VOID)) (size_t) opcode) (); // call the function ((VOID (*)(VOID)) (size_t) opcode) (); // call the function
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
IdsOutPort ( IdsOutPort (
IN UINT32 Addr, IN UINT32 Addr,
@ -455,7 +459,7 @@ IdsOutPort (
__outdword ((UINT16) Addr, Value); __outdword ((UINT16) Addr, Value);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
StopHere ( StopHere (
void void
@ -465,7 +469,7 @@ StopHere (
while (x); while (x);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdCLFlush ( LibAmdCLFlush (
IN UINT64 Address, IN UINT64 Address,
@ -485,7 +489,7 @@ LibAmdCLFlush (
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
LibAmdFinit( LibAmdFinit(
void void
@ -1367,7 +1371,7 @@ LibAmdAccessWidth (
return Width; return Width;
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
VOID VOID
CpuidRead ( CpuidRead (
IN UINT32 CpuidFcnAddress, IN UINT32 CpuidFcnAddress,
@ -1377,7 +1381,7 @@ CpuidRead (
__cpuid ((int *)Value, CpuidFcnAddress); __cpuid ((int *)Value, CpuidFcnAddress);
} }
__attribute__((optimize("Os"))) AMDLIB_OPTIMIZE
UINT8 UINT8
ReadNumberOfCpuCores( ReadNumberOfCpuCores(
void void