target.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* Copyright (C) 2011-2015 Free Software Foundation, Inc.
  2. Contributed by Richard Henderson <rth@redhat.com>.
  3. This file is part of the GNU Transactional Memory Library (libitm).
  4. Libitm is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. Libitm is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  10. FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  11. more details.
  12. Under Section 7 of GPL version 3, you are granted additional
  13. permissions described in the GCC Runtime Library Exception, version
  14. 3.1, as published by the Free Software Foundation.
  15. You should have received a copy of the GNU General Public License and
  16. a copy of the GCC Runtime Library Exception along with this program;
  17. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  18. <http://www.gnu.org/licenses/>. */
  19. namespace GTM HIDDEN {
  20. typedef struct gtm_jmpbuf
  21. {
  22. unsigned long long vfp[8]; /* d8-d15 */
  23. unsigned long long iwmmxt[6]; /* cr10-cr15 */
  24. unsigned long gr[8]; /* r4-r11 */
  25. void *cfa;
  26. unsigned long pc;
  27. } gtm_jmpbuf;
  28. /* ??? The size of one line in hardware caches (in bytes). */
  29. #define HW_CACHELINE_SIZE 64
  30. static inline void
  31. cpu_relax (void)
  32. {
  33. /* ??? The kernel uses the condition
  34. #if __LINUX_ARM_ARCH__ == 6 || defined(CONFIG_ARM_ERRATA_754327)
  35. Given that we're actually just waiting, it doesn't seem like it
  36. hurts to simply use a full barrier all the time. */
  37. __sync_synchronize ();
  38. }
  39. } // namespace GTM