events.h 899 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef _ASM_ARM_XEN_EVENTS_H
  2. #define _ASM_ARM_XEN_EVENTS_H
  3. #include <asm/ptrace.h>
  4. enum ipi_vector {
  5. XEN_PLACEHOLDER_VECTOR,
  6. /* Xen IPIs go here */
  7. XEN_NR_IPIS,
  8. };
  9. static inline int xen_irqs_disabled(struct pt_regs *regs)
  10. {
  11. return raw_irqs_disabled_flags(regs->ARM_cpsr);
  12. }
  13. /*
  14. * We cannot use xchg because it does not support 8-byte
  15. * values. However it is safe to use {ldr,dtd}exd directly because all
  16. * platforms which Xen can run on support those instructions.
  17. */
  18. static inline xen_ulong_t xchg_xen_ulong(xen_ulong_t *ptr, xen_ulong_t val)
  19. {
  20. xen_ulong_t oldval;
  21. unsigned int tmp;
  22. wmb();
  23. asm volatile("@ xchg_xen_ulong\n"
  24. "1: ldrexd %0, %H0, [%3]\n"
  25. " strexd %1, %2, %H2, [%3]\n"
  26. " teq %1, #0\n"
  27. " bne 1b"
  28. : "=&r" (oldval), "=&r" (tmp)
  29. : "r" (val), "r" (ptr)
  30. : "memory", "cc");
  31. return oldval;
  32. }
  33. #endif /* _ASM_ARM_XEN_EVENTS_H */