blob: 82bd18b48c88dcb3a58ac5c572996b2338010941 [file] [log] [blame]
Oleksandr Andrushchenkob22ce842020-08-06 12:42:49 +03001/* SPDX-License-Identifier: GPL-2.0
2 *
3 * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
4 * (C) 2005 - Grzegorz Milos - Intel Reseach Cambridge
5 * (C) 2020 - EPAM Systems Inc.
6 *
7 * File: events.h
8 * Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
9 * Changes: Grzegorz Milos (gm281@cam.ac.uk)
10 *
11 * Date: Jul 2003, changes Jun 2005
12 *
13 * Description: Deals with events on the event channels
14 */
15#ifndef _EVENTS_H_
16#define _EVENTS_H_
17
18#include <asm/xen/hypercall.h>
19#include <xen/interface/event_channel.h>
20
21void init_events(void);
22void fini_events(void);
23
24int do_event(evtchn_port_t port, struct pt_regs *regs);
25void unbind_evtchn(evtchn_port_t port);
26void unbind_all_ports(void);
27int evtchn_alloc_unbound(domid_t pal,
28 void (*handler)(evtchn_port_t, struct pt_regs *, void *),
29 void *data, evtchn_port_t *port);
30
31/* Send notification via event channel */
32static inline int notify_remote_via_evtchn(evtchn_port_t port)
33{
34 struct evtchn_send op;
35
36 op.port = port;
37 return HYPERVISOR_event_channel_op(EVTCHNOP_send, &op);
38}
39
40void eventchn_poll(void);
41
42#endif /* _EVENTS_H_ */