DM: VMcfg: build-in vm configurations

use *args_buildin[] to hold build-in VM configurations

Tracked-On: #1528
Acked-by: Yin Fengwei <fengwei.yin@intel.com>
Signed-off-by: Tao Yuhong <yuhong.tao@intel.com>
This commit is contained in:
yuhong.tao@intel.com 2018-08-23 21:54:05 +08:00 committed by wenlingz
parent 646cc8c4b2
commit ae5b32dcb3
3 changed files with 34 additions and 0 deletions

View File

@ -132,6 +132,8 @@ SRCS += core/timer.c
# arch # arch
SRCS += arch/x86/pm.c SRCS += arch/x86/pm.c
# vmcfg
SRCS += vmcfg/vmcfg.c
OBJS := $(patsubst %.c,$(DM_OBJDIR)/%.o,$(SRCS)) OBJS := $(patsubst %.c,$(DM_OBJDIR)/%.o,$(SRCS))

View File

@ -0,0 +1,19 @@
/*
* Copyright (C)2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef VMCFG_H
#define VMCFG_H
struct vmcfg_arg {
char **argv;
int argc;
int (*setup)(void);
int (*clean)(void);
};
extern struct vmcfg_arg **args_buildin;
extern int num_args_buildin;
#endif

13
devicemodel/vmcfg/vmcfg.c Normal file
View File

@ -0,0 +1,13 @@
/*
* Copyright (C)2018 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <vmcfg_config.h>
#include <vmcfg.h>
static struct vmcfg_arg *vmcfg_buildin_args[] = {
};
struct vmcfg_arg **args_buildin = vmcfg_buildin_args;
int num_args_buildin = sizeof(vmcfg_buildin_args) / sizeof(struct vmcfg_arg *);