Coverage Report

Created: 2017-10-25 09:10

/root/src/xen/xen/include/xen/notifier.h
Line
Count
Source (jump to first uncovered line)
1
/******************************************************************************
2
 * include/xen/notifier.h
3
 *
4
 * Routines to manage notifier chains for passing status changes to any
5
 * interested routines.
6
 *
7
 * Original code from Linux kernel 2.6.27 (Alan Cox <Alan.Cox@linux.org>)
8
 */
9
 
10
#ifndef __XEN_NOTIFIER_H__
11
#define __XEN_NOTIFIER_H__
12
13
#include <xen/types.h>
14
#include <xen/errno.h>
15
#include <xen/kernel.h>
16
#include <xen/list.h>
17
18
/*
19
 * Xen includes only one type of notifier chains inherited from Linux:
20
 *     Raw notifier chains: There are no restrictions on callbacks,
21
 *        registration, or unregistration.  All locking and protection
22
 *        must be provided by the caller.
23
 */
24
25
struct notifier_block {
26
    int (*notifier_call)(struct notifier_block *, unsigned long, void *);
27
    struct list_head chain;
28
    int priority;
29
};
30
31
struct notifier_head {
32
    struct notifier_block head;
33
};
34
35
#define NOTIFIER_INIT(name) { .head.chain = LIST_HEAD_INIT(name.head.chain) }
36
37
#define NOTIFIER_HEAD(name) \
38
    struct notifier_head name = NOTIFIER_INIT(name)
39
40
void notifier_chain_register(
41
    struct notifier_head *nh, struct notifier_block *nb);
42
void notifier_chain_unregister(
43
    struct notifier_head *nh, struct notifier_block *nb);
44
45
int notifier_call_chain(
46
    struct notifier_head *nh, unsigned long val, void *v,
47
    struct notifier_block **pcursor);
48
49
/* Notifier flag values: OR into @val passed to notifier_call_chain(). */
50
259
#define NOTIFY_FORWARD 0x0000 /* Call chain highest-priority-first */
51
33
#define NOTIFY_REVERSE 0x8000 /* Call chain lowest-priority-first */
52
53
/* Handler completion values */
54
525
#define NOTIFY_DONE      0x0000
55
462
#define NOTIFY_STOP_MASK 0x8000
56
#define NOTIFY_STOP      (NOTIFY_STOP_MASK|NOTIFY_DONE)
57
#define NOTIFY_BAD       (NOTIFY_STOP_MASK|EINVAL)
58
59
/* Encapsulate (negative) errno value. */
60
static inline int notifier_from_errno(int err)
61
0
{
62
0
    return NOTIFY_STOP_MASK | -err;
63
0
}
Unexecuted instantiation: core_parking.c:notifier_from_errno
Unexecuted instantiation: x2apic.c:notifier_from_errno
Unexecuted instantiation: mce_intel.c:notifier_from_errno
Unexecuted instantiation: mce.c:notifier_from_errno
Unexecuted instantiation: vpmu.c:notifier_from_errno
Unexecuted instantiation: mwait-idle.c:notifier_from_errno
Unexecuted instantiation: cpu_idle.c:notifier_from_errno
Unexecuted instantiation: power.c:notifier_from_errno
Unexecuted instantiation: sysctl.c:notifier_from_errno
Unexecuted instantiation: smpboot.c:notifier_from_errno
Unexecuted instantiation: setup.c:notifier_from_errno
Unexecuted instantiation: psr.c:notifier_from_errno
Unexecuted instantiation: platform_hypercall.c:notifier_from_errno
Unexecuted instantiation: percpu.c:notifier_from_errno
Unexecuted instantiation: nmi.c:notifier_from_errno
Unexecuted instantiation: microcode.c:notifier_from_errno
Unexecuted instantiation: msi.c:notifier_from_errno
Unexecuted instantiation: domain.c:notifier_from_errno
Unexecuted instantiation: io.c:notifier_from_errno
Unexecuted instantiation: cpufreq_misc_governors.c:notifier_from_errno
Unexecuted instantiation: cpufreq.c:notifier_from_errno
Unexecuted instantiation: tmem_xen.c:notifier_from_errno
Unexecuted instantiation: trace.c:notifier_from_errno
Unexecuted instantiation: timer.c:notifier_from_errno
Unexecuted instantiation: tasklet.c:notifier_from_errno
Unexecuted instantiation: stop_machine.c:notifier_from_errno
Unexecuted instantiation: schedule.c:notifier_from_errno
Unexecuted instantiation: sched_rt.c:notifier_from_errno
Unexecuted instantiation: sched_credit2.c:notifier_from_errno
Unexecuted instantiation: rcupdate.c:notifier_from_errno
Unexecuted instantiation: notifier.c:notifier_from_errno
Unexecuted instantiation: kexec.c:notifier_from_errno
Unexecuted instantiation: cpupool.c:notifier_from_errno
Unexecuted instantiation: cpu.c:notifier_from_errno
Unexecuted instantiation: hvm.c:notifier_from_errno
64
65
/* Restore (negative) errno value from notify return value. */
66
static inline int notifier_to_errno(int ret)
67
0
{
68
0
    return -(ret & ~NOTIFY_STOP_MASK);
69
0
}
Unexecuted instantiation: hvm.c:notifier_to_errno
Unexecuted instantiation: x2apic.c:notifier_to_errno
Unexecuted instantiation: mce_intel.c:notifier_to_errno
Unexecuted instantiation: mce.c:notifier_to_errno
Unexecuted instantiation: vpmu.c:notifier_to_errno
Unexecuted instantiation: mwait-idle.c:notifier_to_errno
Unexecuted instantiation: cpu_idle.c:notifier_to_errno
Unexecuted instantiation: power.c:notifier_to_errno
Unexecuted instantiation: sysctl.c:notifier_to_errno
Unexecuted instantiation: smpboot.c:notifier_to_errno
Unexecuted instantiation: setup.c:notifier_to_errno
Unexecuted instantiation: psr.c:notifier_to_errno
Unexecuted instantiation: platform_hypercall.c:notifier_to_errno
Unexecuted instantiation: percpu.c:notifier_to_errno
Unexecuted instantiation: nmi.c:notifier_to_errno
Unexecuted instantiation: microcode.c:notifier_to_errno
Unexecuted instantiation: msi.c:notifier_to_errno
Unexecuted instantiation: domain.c:notifier_to_errno
Unexecuted instantiation: io.c:notifier_to_errno
Unexecuted instantiation: cpufreq_misc_governors.c:notifier_to_errno
Unexecuted instantiation: cpufreq.c:notifier_to_errno
Unexecuted instantiation: tmem_xen.c:notifier_to_errno
Unexecuted instantiation: trace.c:notifier_to_errno
Unexecuted instantiation: timer.c:notifier_to_errno
Unexecuted instantiation: tasklet.c:notifier_to_errno
Unexecuted instantiation: stop_machine.c:notifier_to_errno
Unexecuted instantiation: schedule.c:notifier_to_errno
Unexecuted instantiation: sched_rt.c:notifier_to_errno
Unexecuted instantiation: sched_credit2.c:notifier_to_errno
Unexecuted instantiation: rcupdate.c:notifier_to_errno
Unexecuted instantiation: notifier.c:notifier_to_errno
Unexecuted instantiation: kexec.c:notifier_to_errno
Unexecuted instantiation: cpupool.c:notifier_to_errno
Unexecuted instantiation: cpu.c:notifier_to_errno
Unexecuted instantiation: core_parking.c:notifier_to_errno
70
71
#endif /* __XEN_NOTIFIER_H__ */