Zephyr Project API
3.7.0
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
10
#include <
zephyr/xen/public/event_channel.h
>
11
12
#include <
zephyr/kernel.h
>
13
14
typedef
void (*
evtchn_cb_t
)(
void
*priv);
15
16
struct
event_channel_handle
{
17
evtchn_cb_t
cb
;
18
void
*
priv
;
19
};
20
typedef
struct
event_channel_handle
evtchn_handle_t
;
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
*/
26
int
evtchn_status
(
evtchn_status_t
*status);
27
int
evtchn_close
(
evtchn_port_t
port);
28
int
evtchn_set_priority
(
evtchn_port_t
port,
uint32_t
priority);
29
void
notify_evtchn
(
evtchn_port_t
port);
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
*/
37
int
alloc_unbound_event_channel
(
domid_t
remote_dom);
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
*/
47
int
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
*/
60
int
bind_interdomain_event_channel
(
domid_t
remote_dom,
evtchn_port_t
remote_port,
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
*/
71
int
bind_event_channel
(
evtchn_port_t
port,
evtchn_cb_t
cb
,
void
*
data
);
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
*/
79
int
unbind_event_channel
(
evtchn_port_t
port);
80
int
get_missed_events
(
evtchn_port_t
port);
81
82
int
xen_events_init
(
void
);
83
84
#endif
/* __XEN_EVENTS_H__ */
event_channel.h
evtchn_port_t
uint32_t evtchn_port_t
Definition
event_channel.h:74
notify_evtchn
void notify_evtchn(evtchn_port_t port)
evtchn_cb_t
void(* evtchn_cb_t)(void *priv)
Definition
events.h:14
get_missed_events
int get_missed_events(evtchn_port_t port)
alloc_unbound_event_channel
int alloc_unbound_event_channel(domid_t remote_dom)
bind_event_channel
int bind_event_channel(evtchn_port_t port, evtchn_cb_t cb, void *data)
unbind_event_channel
int unbind_event_channel(evtchn_port_t port)
bind_interdomain_event_channel
int bind_interdomain_event_channel(domid_t remote_dom, evtchn_port_t remote_port, evtchn_cb_t cb, void *data)
xen_events_init
int xen_events_init(void)
kernel.h
Public kernel APIs.
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
event_channel_handle
Definition
events.h:16
event_channel_handle::priv
void * priv
Definition
events.h:18
event_channel_handle::cb
evtchn_cb_t cb
Definition
events.h:17
evtchn_close
Definition
event_channel.h:127
evtchn_set_priority
Definition
event_channel.h:207
evtchn_status
Definition
event_channel.h:151
data
static fdata_t data[2]
Definition
test_fifo_contexts.c:15
domid_t
uint16_t domid_t
Definition
xen.h:217
include
zephyr
xen
events.h
Generated on Sun Sep 15 2024 17:01:30 for Zephyr Project API by
1.9.8