barrier.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __PARISC_BARRIER_H
  2. #define __PARISC_BARRIER_H
  3. /*
  4. ** This is simply the barrier() macro from linux/kernel.h but when serial.c
  5. ** uses tqueue.h uses smp_mb() defined using barrier(), linux/kernel.h
  6. ** hasn't yet been included yet so it fails, thus repeating the macro here.
  7. **
  8. ** PA-RISC architecture allows for weakly ordered memory accesses although
  9. ** none of the processors use it. There is a strong ordered bit that is
  10. ** set in the O-bit of the page directory entry. Operating systems that
  11. ** can not tolerate out of order accesses should set this bit when mapping
  12. ** pages. The O-bit of the PSW should also be set to 1 (I don't believe any
  13. ** of the processor implemented the PSW O-bit). The PCX-W ERS states that
  14. ** the TLB O-bit is not implemented so the page directory does not need to
  15. ** have the O-bit set when mapping pages (section 3.1). This section also
  16. ** states that the PSW Y, Z, G, and O bits are not implemented.
  17. ** So it looks like nothing needs to be done for parisc-linux (yet).
  18. ** (thanks to chada for the above comment -ggg)
  19. **
  20. ** The __asm__ op below simple prevents gcc/ld from reordering
  21. ** instructions across the mb() "call".
  22. */
  23. #define mb() __asm__ __volatile__("":::"memory") /* barrier() */
  24. #define rmb() mb()
  25. #define wmb() mb()
  26. #define smp_mb() mb()
  27. #define smp_rmb() mb()
  28. #define smp_wmb() mb()
  29. #define smp_read_barrier_depends() do { } while(0)
  30. #define read_barrier_depends() do { } while(0)
  31. #define set_mb(var, value) do { var = value; mb(); } while (0)
  32. #endif /* __PARISC_BARRIER_H */