smp_types.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_SMP_TYPES_H
  3. #define __LINUX_SMP_TYPES_H
  4. #include <linux/llist.h>
  5. enum {
  6. CSD_FLAG_LOCK = 0x01,
  7. IRQ_WORK_PENDING = 0x01,
  8. IRQ_WORK_BUSY = 0x02,
  9. IRQ_WORK_LAZY = 0x04, /* No IPI, wait for tick */
  10. IRQ_WORK_HARD_IRQ = 0x08, /* IRQ context on PREEMPT_RT */
  11. IRQ_WORK_CLAIMED = (IRQ_WORK_PENDING | IRQ_WORK_BUSY),
  12. CSD_TYPE_ASYNC = 0x00,
  13. CSD_TYPE_SYNC = 0x10,
  14. CSD_TYPE_IRQ_WORK = 0x20,
  15. CSD_TYPE_TTWU = 0x30,
  16. CSD_FLAG_TYPE_MASK = 0xF0,
  17. };
  18. /*
  19. * struct __call_single_node is the primary type on
  20. * smp.c:call_single_queue.
  21. *
  22. * flush_smp_call_function_queue() only reads the type from
  23. * __call_single_node::u_flags as a regular load, the above
  24. * (anonymous) enum defines all the bits of this word.
  25. *
  26. * Other bits are not modified until the type is known.
  27. *
  28. * CSD_TYPE_SYNC/ASYNC:
  29. * struct {
  30. * struct llist_node node;
  31. * unsigned int flags;
  32. * smp_call_func_t func;
  33. * void *info;
  34. * };
  35. *
  36. * CSD_TYPE_IRQ_WORK:
  37. * struct {
  38. * struct llist_node node;
  39. * atomic_t flags;
  40. * void (*func)(struct irq_work *);
  41. * };
  42. *
  43. * CSD_TYPE_TTWU:
  44. * struct {
  45. * struct llist_node node;
  46. * unsigned int flags;
  47. * };
  48. *
  49. */
  50. struct __call_single_node {
  51. struct llist_node llist;
  52. union {
  53. unsigned int u_flags;
  54. atomic_t a_flags;
  55. };
  56. #ifdef CONFIG_64BIT
  57. u16 src, dst;
  58. #endif
  59. };
  60. #endif /* __LINUX_SMP_TYPES_H */