mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-25 02:41:45 +00:00
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>
This commit is contained in:
19
devicemodel/include/iothread.h
Normal file
19
devicemodel/include/iothread.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* 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
|
Reference in New Issue
Block a user