0001
0002 #ifndef _XEN_MULTICALLS_H
0003 #define _XEN_MULTICALLS_H
0004
0005 #include <trace/events/xen.h>
0006
0007 #include "xen-ops.h"
0008
0009
0010 struct multicall_space
0011 {
0012 struct multicall_entry *mc;
0013 void *args;
0014 };
0015
0016
0017 struct multicall_space __xen_mc_entry(size_t args);
0018
0019 DECLARE_PER_CPU(unsigned long, xen_mc_irq_flags);
0020
0021
0022
0023 static inline void xen_mc_batch(void)
0024 {
0025 unsigned long flags;
0026
0027
0028 local_irq_save(flags);
0029 trace_xen_mc_batch(paravirt_get_lazy_mode());
0030 __this_cpu_write(xen_mc_irq_flags, flags);
0031 }
0032
0033 static inline struct multicall_space xen_mc_entry(size_t args)
0034 {
0035 xen_mc_batch();
0036 return __xen_mc_entry(args);
0037 }
0038
0039
0040 void xen_mc_flush(void);
0041
0042
0043 static inline void xen_mc_issue(unsigned mode)
0044 {
0045 trace_xen_mc_issue(mode);
0046
0047 if ((paravirt_get_lazy_mode() & mode) == 0)
0048 xen_mc_flush();
0049
0050
0051 local_irq_restore(this_cpu_read(xen_mc_irq_flags));
0052 }
0053
0054
0055 void xen_mc_callback(void (*fn)(void *), void *data);
0056
0057
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067 struct multicall_space xen_mc_extend_args(unsigned long op, size_t arg_size);
0068
0069 #endif