Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __LINUX_SMP_TYPES_H
0003 #define __LINUX_SMP_TYPES_H
0004 
0005 #include <linux/llist.h>
0006 
0007 enum {
0008     CSD_FLAG_LOCK       = 0x01,
0009 
0010     IRQ_WORK_PENDING    = 0x01,
0011     IRQ_WORK_BUSY       = 0x02,
0012     IRQ_WORK_LAZY       = 0x04, /* No IPI, wait for tick */
0013     IRQ_WORK_HARD_IRQ   = 0x08, /* IRQ context on PREEMPT_RT */
0014 
0015     IRQ_WORK_CLAIMED    = (IRQ_WORK_PENDING | IRQ_WORK_BUSY),
0016 
0017     CSD_TYPE_ASYNC      = 0x00,
0018     CSD_TYPE_SYNC       = 0x10,
0019     CSD_TYPE_IRQ_WORK   = 0x20,
0020     CSD_TYPE_TTWU       = 0x30,
0021 
0022     CSD_FLAG_TYPE_MASK  = 0xF0,
0023 };
0024 
0025 /*
0026  * struct __call_single_node is the primary type on
0027  * smp.c:call_single_queue.
0028  *
0029  * flush_smp_call_function_queue() only reads the type from
0030  * __call_single_node::u_flags as a regular load, the above
0031  * (anonymous) enum defines all the bits of this word.
0032  *
0033  * Other bits are not modified until the type is known.
0034  *
0035  * CSD_TYPE_SYNC/ASYNC:
0036  *  struct {
0037  *      struct llist_node node;
0038  *      unsigned int flags;
0039  *      smp_call_func_t func;
0040  *      void *info;
0041  *  };
0042  *
0043  * CSD_TYPE_IRQ_WORK:
0044  *  struct {
0045  *      struct llist_node node;
0046  *      atomic_t flags;
0047  *      void (*func)(struct irq_work *);
0048  *  };
0049  *
0050  * CSD_TYPE_TTWU:
0051  *  struct {
0052  *      struct llist_node node;
0053  *      unsigned int flags;
0054  *  };
0055  *
0056  */
0057 
0058 struct __call_single_node {
0059     struct llist_node   llist;
0060     union {
0061         unsigned int    u_flags;
0062         atomic_t    a_flags;
0063     };
0064 #ifdef CONFIG_64BIT
0065     u16 src, dst;
0066 #endif
0067 };
0068 
0069 #endif /* __LINUX_SMP_TYPES_H */