home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / Linux / cache.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  973b  |  40 lines

  1. /* $Id: cache.h,v 1.2 2002/04/26 23:09:03 smilcke Exp $ */
  2.  
  3. #ifndef __LINUX_CACHE_H
  4. #define __LINUX_CACHE_H
  5.  
  6. #include <linux/config.h>
  7. #include <asm/cache.h>
  8.  
  9. #ifndef L1_CACHE_ALIGN
  10. #define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
  11. #endif
  12.  
  13. #ifndef SMP_CACHE_BYTES
  14. #define SMP_CACHE_BYTES L1_CACHE_BYTES
  15. #endif
  16.  
  17. #ifndef ____cacheline_aligned
  18. #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
  19. #endif
  20.  
  21. #ifndef ____cacheline_aligned_in_smp
  22. #ifdef CONFIG_SMP
  23. #define ____cacheline_aligned_in_smp ____cacheline_aligned
  24. #else
  25. #define ____cacheline_aligned_in_smp
  26. #endif /* CONFIG_SMP */
  27. #endif
  28.  
  29. #ifndef __cacheline_aligned
  30. #ifdef MODULE
  31. #define __cacheline_aligned ____cacheline_aligned
  32. #else
  33. #define __cacheline_aligned                    \
  34.   __attribute__((__aligned__(SMP_CACHE_BYTES),            \
  35.          __section__(".data.cacheline_aligned")))
  36. #endif
  37. #endif /* __cacheline_aligned */
  38.  
  39. #endif /* __LINUX_CACHE_H */
  40.