zephyr/include/xen/events.h
Dmytro Firsov 01a9b117fe xenvm: arm64: add Xen Enlighten and event channel support
This commit adds support of Xen Enlighten page and initial support for
Xen event channels. It is needed for future Xen PV drivers
implementation.

Now enlighten page is mapped to the prepared memory area on
PRE_KERNEL_1 stage. In case of success event channel logic gets
inited and can be used ASAP after Zephyr start. Current implementation
allows to use only pre-defined event channels (PV console/XenBus) and
works only in single CPU mode (without VCPUOP_register_vcpu_info).
Event channel allocation will be implemented in future versions.

Signed-off-by: Dmytro Firsov <dmytro_firsov@epam.com>
2021-12-07 12:15:38 -05:00

29 lines
572 B
C

/*
* Copyright (c) 2021 EPAM Systems
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef __XEN_EVENTS_H__
#define __XEN_EVENTS_H__
#include <xen/public/event_channel.h>
#include <kernel.h>
typedef void (*evtchn_cb_t)(void *priv);
struct event_channel_handle {
evtchn_cb_t cb;
void *priv;
};
typedef struct event_channel_handle evtchn_handle_t;
void notify_evtchn(evtchn_port_t port);
int bind_event_channel(evtchn_port_t port, evtchn_cb_t cb, void *data);
int unbind_event_channel(evtchn_port_t port);
int xen_events_init(void);
#endif /* __XEN_EVENTS_H__ */