arm.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * Copyright (c) 2003 Hewlett-Packard Development Company, L.P.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy
  5. * of this software and associated documentation files (the "Software"), to deal
  6. * in the Software without restriction, including without limitation the rights
  7. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. * copies of the Software, and to permit persons to whom the Software is
  9. * furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  20. * SOFTWARE.
  21. */
  22. #ifndef AO_ASSUME_WINDOWS98
  23. /* CAS is always available */
  24. # define AO_ASSUME_WINDOWS98
  25. #endif
  26. #include "common32_defs.h"
  27. /* FIXME: Do _InterlockedOps really have a full memory barrier? */
  28. /* (MSDN WinCE docs say nothing about it.) */
  29. #include "../test_and_set_t_is_ao_t.h"
  30. /* AO_test_and_set_full() is emulated using CAS. */
  31. /* Some ARM slide set, if it has been read correctly, claims that Loads */
  32. /* followed by either a Load or a Store are ordered, but nothing else. */
  33. /* It is assumed that Windows interrupt handlers clear the LL/SC flag. */
  34. /* Unaligned accesses are not guaranteed to be atomic. */
  35. #include "../all_aligned_atomic_load_store.h"
  36. /* If only a single processor is used, we can define AO_UNIPROCESSOR. */
  37. #ifdef AO_UNIPROCESSOR
  38. AO_INLINE void AO_nop_full(void)
  39. {
  40. AO_compiler_barrier();
  41. }
  42. # define AO_HAVE_nop_full
  43. #else
  44. /* AO_nop_full() is emulated using AO_test_and_set_full(). */
  45. #endif
  46. #if _M_ARM >= 6
  47. /* ARMv6 is the first architecture providing support for simple LL/SC. */
  48. /* #include "../standard_ao_double_t.h" */
  49. /* TODO: implement double-wide operations (similar to x86). */
  50. #else /* _M_ARM < 6 */
  51. /* TODO: implement AO_test_and_set_full using SWP. */
  52. #endif /* _M_ARM < 6 */
  53. #define AO_T_IS_INT