Skip to content

Commit ae5b32d

Browse files
taoyuhongwenlingz
authored andcommitted
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>
1 parent 646cc8c commit ae5b32d

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

devicemodel/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ SRCS += core/timer.c
132132
# arch
133133
SRCS += arch/x86/pm.c
134134

135+
# vmcfg
136+
SRCS += vmcfg/vmcfg.c
135137

136138
OBJS := $(patsubst %.c,$(DM_OBJDIR)/%.o,$(SRCS))
137139

devicemodel/include/vmcfg.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
* Copyright (C)2018 Intel Corporation
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
6+
#ifndef VMCFG_H
7+
#define VMCFG_H
8+
9+
struct vmcfg_arg {
10+
char **argv;
11+
int argc;
12+
int (*setup)(void);
13+
int (*clean)(void);
14+
};
15+
16+
extern struct vmcfg_arg **args_buildin;
17+
extern int num_args_buildin;
18+
19+
#endif

devicemodel/vmcfg/vmcfg.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* Copyright (C)2018 Intel Corporation
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
6+
#include <vmcfg_config.h>
7+
#include <vmcfg.h>
8+
9+
static struct vmcfg_arg *vmcfg_buildin_args[] = {
10+
};
11+
12+
struct vmcfg_arg **args_buildin = vmcfg_buildin_args;
13+
int num_args_buildin = sizeof(vmcfg_buildin_args) / sizeof(struct vmcfg_arg *);

0 commit comments

Comments
 (0)