mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 17:46:15 +00:00
DM: ioc code cleanup
- make ioc_init/ioc_deinit take struct vmctx as argument - ioc_init return int instead of pointer to struct ioc_dev - add ioc_dev in vmctx to track ioc_dev - remove the atkbdc.h included in vmmapi.h Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Liu, Yuan1 <yuan1.liu@intel.com> Reviewed-by: Jason Chen CJ <jason.cj.chen@intel.com> Reviewed-by: Wang Yu <yu1.wang@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com> Acked-by: Eddie Dong <Eddie.dong@intel.com>
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "ioc.h"
|
||||
#include "vmmapi.h"
|
||||
|
||||
/* For debugging log to a file */
|
||||
static int ioc_debug;
|
||||
@@ -1051,8 +1052,8 @@ ioc_parse(const char *opts)
|
||||
/*
|
||||
* IOC mediator main entry.
|
||||
*/
|
||||
struct ioc_dev *
|
||||
ioc_init(void)
|
||||
int
|
||||
ioc_init(struct vmctx *ctx)
|
||||
{
|
||||
int i;
|
||||
struct ioc_dev *ioc;
|
||||
@@ -1161,7 +1162,9 @@ ioc_init(void)
|
||||
(void *)ioc) < 0)
|
||||
goto work_err;
|
||||
|
||||
return ioc;
|
||||
ctx->ioc_dev = ioc;
|
||||
return 0;
|
||||
|
||||
work_err:
|
||||
pthread_mutex_destroy(&ioc->rx_mtx);
|
||||
pthread_cond_destroy(&ioc->rx_cond);
|
||||
@@ -1179,15 +1182,17 @@ alloc_err:
|
||||
ioc_err:
|
||||
IOC_LOG_DEINIT;
|
||||
DPRINTF("%s", "ioc mediator startup failed!!\r\n");
|
||||
return NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Called by DM in main entry.
|
||||
*/
|
||||
void
|
||||
ioc_deinit(struct ioc_dev *ioc)
|
||||
ioc_deinit(struct vmctx *ctx)
|
||||
{
|
||||
struct ioc_dev *ioc = ctx->ioc_dev;
|
||||
|
||||
if (!ioc) {
|
||||
DPRINTF("%s", "ioc deinit parameter is NULL\r\n");
|
||||
return;
|
||||
@@ -1199,4 +1204,6 @@ ioc_deinit(struct ioc_dev *ioc)
|
||||
free(ioc->pool);
|
||||
free(ioc);
|
||||
IOC_LOG_DEINIT;
|
||||
|
||||
ctx->ioc_dev = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user