[haiku-commits] Re: haiku: hrev46864 - headers/private/kernel/arch/arm src/system/kernel/arch/arm src/system/kernel/arch/arm/paging/32bit src/system/kernel/arch/arm/paging

  • From: Pawel Dziepak <pdziepak@xxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Fri, 14 Feb 2014 05:38:12 +0100

2014-02-13 6:33 GMT+01:00  <kallisti5@xxxxxxxxxxx>:
>  static inline void
>  memory_write_barrier_inline(void)
>  {
> -       // TODO Only ArmV7+?
> -       asm volatile("dsb sy" : : : "memory");
> +       __sync_synchronize();
>  }

This can be relaxed for ARMv7 as it provides a proper write barrier (dmb st).

For ARMv5 (and earlier) __sync_synchronize() causes GCC to emit a call
to a helper functions which we don't have (and don't need) in the
kernel. On uniprocessor architectures memory_{full, read,
write}_barrier_inline() do not have to be anything more than just a
simple compiler barrier. #ifdef would be helpful.

Paweł

Other related posts: