cpu/x86/mp.h: Implement a pre-SSE2 mfence
Taken from the Linux Kernel. Tested: Qemu using '-cpu pentium3' now boots. Change-Id: I376f86f4d7992344dd68374ba67ad3580070f4d8 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59766 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
@@ -13,7 +13,11 @@ struct bus;
|
|||||||
|
|
||||||
static inline void mfence(void)
|
static inline void mfence(void)
|
||||||
{
|
{
|
||||||
__asm__ __volatile__("mfence\t\n": : :"memory");
|
/* mfence came with the introduction of SSE2. */
|
||||||
|
if (CONFIG(SSE2))
|
||||||
|
__asm__ __volatile__("mfence\t\n": : :"memory");
|
||||||
|
else
|
||||||
|
__asm__ __volatile__("lock; addl $0,0(%%esp)": : : "memory");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The sequence of the callbacks are in calling order. */
|
/* The sequence of the callbacks are in calling order. */
|
||||||
|
Reference in New Issue
Block a user