diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2023-05-18 10:56:10 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-05-24 12:16:37 +0000 |
commit | 1e45295236affdb54f3bd470573423ac54aabb52 (patch) | |
tree | c1947e68e7af613d3949463e02f8fe204725c3d2 /src/vendorcode/amd | |
parent | 9d475bf6de63f4e05bba39e4771e0d32c07c0c9b (diff) | |
download | coreboot-1e45295236affdb54f3bd470573423ac54aabb52.tar.gz coreboot-1e45295236affdb54f3bd470573423ac54aabb52.tar.bz2 coreboot-1e45295236affdb54f3bd470573423ac54aabb52.zip |
vc/amd/pi/amdlib.c: Use native coreboot code over compiler builtins
Compiler builtins depend on certain CPU features flags to be passed to
the compiler. This may have unwanted side effects as generating code
with FPU registers. Instead use native coreboot code.
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Change-Id: I4e92d103fa3a6c7a56e813a583b3262676969669
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75321
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
Diffstat (limited to 'src/vendorcode/amd')
-rw-r--r-- | src/vendorcode/amd/pi/Lib/amdlib.c | 6 | ||||
-rw-r--r-- | src/vendorcode/amd/pi/Makefile.inc | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/vendorcode/amd/pi/Lib/amdlib.c b/src/vendorcode/amd/pi/Lib/amdlib.c index cc742301d602..ec3b53b01709 100644 --- a/src/vendorcode/amd/pi/Lib/amdlib.c +++ b/src/vendorcode/amd/pi/Lib/amdlib.c @@ -45,6 +45,8 @@ #include <AGESA.h> #include <cpuRegisters.h> +#include <cpu/x86/mp.h> +#include <cpu/x86/cache.h> #include <Filecode.h> #include <Ids.h> #include <Porting.h> @@ -488,8 +490,8 @@ LibAmdCLFlush ( address32 = 0; hwcrSave = SetFsBase (Address); for (Index = 0; Index < Count; Index++){ - _mm_mfence (); - _mm_clflush_fs (&address32 [Index * 64]); + mfence(); + clflush(&address32 [Index * 64]); } RestoreHwcr (hwcrSave); } diff --git a/src/vendorcode/amd/pi/Makefile.inc b/src/vendorcode/amd/pi/Makefile.inc index e62abab9cd0b..b00e38b2e875 100644 --- a/src/vendorcode/amd/pi/Makefile.inc +++ b/src/vendorcode/amd/pi/Makefile.inc @@ -88,7 +88,6 @@ AGESA_INC += -I$(src)/commonlib/include AGESA_INC += -I$(src)/commonlib/bsd/include AGESA_INC += -I$(VBOOT_SOURCE)/firmware/include -AGESA_CFLAGS += -march=amdfam10 -mno-3dnow AGESA_CFLAGS += -Wno-pragma-pack AGESA_CFLAGS += -fno-strict-aliasing -D__LIBAGESA__ CFLAGS_x86_32 += $(AGESA_CFLAGS) |