Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
events.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021 EPAM Systems
3 * Copyright (c) 2022 Arm Limited (or its affiliates). All rights reserved.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 */
7#ifndef __XEN_EVENTS_H__
8#define __XEN_EVENTS_H__
9
11
12#include <zephyr/kernel.h>
13
14typedef void (*evtchn_cb_t)(void *priv);
15
18 void *priv;
19};
21
22/*
23 * Following functions just wrap Xen hypercalls, detailed description
24 * of parameters and return values are located in include/xen/public/event_channel.h
25 */
30
31/*
32 * Allocate event-channel between caller and remote domain
33 *
34 * @param remote_dom - remote domain domid
35 * @return - local event channel port on success, negative on error
36 */
38
39#ifdef CONFIG_XEN_DOM0
40/*
41 * Allocate event-channel between remote domains. Can be used only from Dom0.
42 *
43 * @param dom - first remote domain domid (may be DOMID_SELF)
44 * @param remote_dom - second remote domain domid
45 * @return - local event channel port on success, negative on error
46 */
47int alloc_unbound_event_channel_dom0(domid_t dom, domid_t remote_dom);
48#endif /* CONFIG_XEN_DOM0 */
49
50/*
51 * Allocate local event channel, binded to remote port and attach specified callback
52 * to it
53 *
54 * @param remote_dom - remote domain domid
55 * @param remote_port - remote domain event channel port number
56 * @param cb - callback, attached to locat port
57 * @param data - private data, that will be passed to cb
58 * @return - local event channel port on success, negative on error
59 */
61 evtchn_cb_t cb, void *data);
62
63/*
64 * Bind user-defined handler to specified event-channel
65 *
66 * @param port - event channel number
67 * @param cb - pointer to event channel handler
68 * @param data - private data, that will be passed to handler as parameter
69 * @return - zero on success
70 */
72
73/*
74 * Unbind handler from event channel, substitute it with empty callback
75 *
76 * @param port - event channel number to unbind
77 * @return - zero on success
78 */
81
83
84#endif /* __XEN_EVENTS_H__ */
uint32_t evtchn_port_t
Definition: event_channel.h:74
void notify_evtchn(evtchn_port_t port)
void(* evtchn_cb_t)(void *priv)
Definition: events.h:14
int get_missed_events(evtchn_port_t port)
int alloc_unbound_event_channel(domid_t remote_dom)
int bind_event_channel(evtchn_port_t port, evtchn_cb_t cb, void *data)
int unbind_event_channel(evtchn_port_t port)
int bind_interdomain_event_channel(domid_t remote_dom, evtchn_port_t remote_port, evtchn_cb_t cb, void *data)
int xen_events_init(void)
Public kernel APIs.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
Definition: events.h:16
void * priv
Definition: events.h:18
evtchn_cb_t cb
Definition: events.h:17
Definition: event_channel.h:127
Definition: event_channel.h:207
Definition: event_channel.h:151
uint16_t domid_t
Definition: xen.h:217