Re: [U-Boot] [PATCH 12/20] x86: Add an mfence macro

2015-04-28 Thread Bin Meng
Hi Simon,

On Tue, Apr 28, 2015 at 6:48 AM, Simon Glass  wrote:
> Provide access to this x86 instruction from C code.
>
> Signed-off-by: Simon Glass 
> ---
>
>  arch/x86/include/asm/cpu.h | 5 +
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
> index c839291..37aa6b9 100644
> --- a/arch/x86/include/asm/cpu.h
> +++ b/arch/x86/include/asm/cpu.h
> @@ -151,6 +151,11 @@ static inline int flag_is_changeable_p(uint32_t flag)
> return ((f1^f2) & flag) != 0;
>  }
>
> +static inline void mfence(void)
> +{
> +   __asm__ __volatile__("mfence\t\n" : : : "memory");

Do we need "\t\n"?

> +}
> +
>  /**
>   * cpu_enable_paging_pae() - Enable PAE-paging
>   *
> --

Regards,
Bin
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 12/20] x86: Add an mfence macro

2015-04-27 Thread Simon Glass
Provide access to this x86 instruction from C code.

Signed-off-by: Simon Glass 
---

 arch/x86/include/asm/cpu.h | 5 +
 1 file changed, 5 insertions(+)

diff --git a/arch/x86/include/asm/cpu.h b/arch/x86/include/asm/cpu.h
index c839291..37aa6b9 100644
--- a/arch/x86/include/asm/cpu.h
+++ b/arch/x86/include/asm/cpu.h
@@ -151,6 +151,11 @@ static inline int flag_is_changeable_p(uint32_t flag)
return ((f1^f2) & flag) != 0;
 }
 
+static inline void mfence(void)
+{
+   __asm__ __volatile__("mfence\t\n" : : : "memory");
+}
+
 /**
  * cpu_enable_paging_pae() - Enable PAE-paging
  *
-- 
2.2.0.rc0.207.ga3a616c

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot