mspec.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. *
  3. * This file is subject to the terms and conditions of the GNU General Public
  4. * License. See the file "COPYING" in the main directory of this archive
  5. * for more details.
  6. *
  7. * Copyright (c) 2001-2008 Silicon Graphics, Inc. All rights reserved.
  8. */
  9. #ifndef _ASM_IA64_SN_MSPEC_H
  10. #define _ASM_IA64_SN_MSPEC_H
  11. #define FETCHOP_VAR_SIZE 64 /* 64 byte per fetchop variable */
  12. #define FETCHOP_LOAD 0
  13. #define FETCHOP_INCREMENT 8
  14. #define FETCHOP_DECREMENT 16
  15. #define FETCHOP_CLEAR 24
  16. #define FETCHOP_STORE 0
  17. #define FETCHOP_AND 24
  18. #define FETCHOP_OR 32
  19. #define FETCHOP_CLEAR_CACHE 56
  20. #define FETCHOP_LOAD_OP(addr, op) ( \
  21. *(volatile long *)((char*) (addr) + (op)))
  22. #define FETCHOP_STORE_OP(addr, op, x) ( \
  23. *(volatile long *)((char*) (addr) + (op)) = (long) (x))
  24. #ifdef __KERNEL__
  25. /*
  26. * Each Atomic Memory Operation (amo, formerly known as fetchop)
  27. * variable is 64 bytes long. The first 8 bytes are used. The
  28. * remaining 56 bytes are unaddressable due to the operation taking
  29. * that portion of the address.
  30. *
  31. * NOTE: The amo structure _MUST_ be placed in either the first or second
  32. * half of the cache line. The cache line _MUST NOT_ be used for anything
  33. * other than additional amo entries. This is because there are two
  34. * addresses which reference the same physical cache line. One will
  35. * be a cached entry with the memory type bits all set. This address
  36. * may be loaded into processor cache. The amo will be referenced
  37. * uncached via the memory special memory type. If any portion of the
  38. * cached cache-line is modified, when that line is flushed, it will
  39. * overwrite the uncached value in physical memory and lead to
  40. * inconsistency.
  41. */
  42. struct amo {
  43. u64 variable;
  44. u64 unused[7];
  45. };
  46. #endif /* __KERNEL__ */
  47. #endif /* _ASM_IA64_SN_MSPEC_H */