acrn-hypervisor/devicemodel/include/iothread.h
Conghui 4fd0a1900a dm: support iothread
Supply a decidate thread, which can moniter a set of fds with epoll,
when the data is ready, call the corresponding callback.

This iothread will be created automatically with the first successful
call to iothread_add,  and will be destroyed in iothread_deinit if it
was created.

Note, currenlty only support one iothread.

Tracked-On: #7940
Signed-off-by: Conghui <conghui.chen@intel.com>
Acked-by: Wang, Yu1 <yu1.wang@intel.com>
2022-08-02 11:14:54 +08:00

20 lines
349 B
C

/* Copyright (C) 2022 Intel Corporation.
*
* SPDX-License-Identifier: BSD-3-Clause
*
*/
#ifndef _iothread_CTX_H_
#define _iothread_CTX_H_
struct iothread_mevent {
void (*run)(void *);
void *arg;
};
int iothread_add(int fd, struct iothread_mevent *aevt);
int iothread_del(int fd);
int iothread_init(void);
void iothread_deinit(void);
#endif