From 52f5bd2669916c54845eda8829b2f129b6088896 Mon Sep 17 00:00:00 2001 From: Jeff Fan Date: Tue, 12 Jul 2016 11:10:27 +0800 Subject: [PATCH] MdePkg/BaseSynchronizationLib: spin lock alignment is 32 at least Some processor may return small cache line size, we should return 32 bytes at least for spin lock alignment. Cc: Liming Gao Cc: Michael Kinney Cc: Jiewen Yao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan Reviewed-by: Jiewen Yao --- .../Ia32/InternalGetSpinLockProperties.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/InternalGetSpinLockProperties.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/InternalGetSpinLockProperties.c index 49f05fb18a..60f5c7f36b 100644 --- a/MdePkg/Library/BaseSynchronizationLib/Ia32/InternalGetSpinLockProperties.c +++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/InternalGetSpinLockProperties.c @@ -55,6 +55,10 @@ InternalGetSpinLockProperties ( } } + if (CacheLineSize < 32) { + CacheLineSize = 32; + } + return CacheLineSize; } -- 2.39.2