Skip to content

Commit 5b06d17

Browse files
yliu80jren1
authored andcommitted
IOC mediator: boot IOC device from the main entry
Add "-i" in the DM boot command line for booting IOC mediator. NOTE: currently only ioc_init will be called in the main entry, ioc_deinit hasn't be called so far. The DM plans to add one virtual devices list inside of struct vmctx in the near furture, and virtual devices data structure will add one common deinit callbacks which will be called during VM exits. Will support ioc_deinit once that patch merged. Signed-off-by: Liu Yuan <yuan1.liu@intel.com> Reviewed-by: Wang Yu <yu1.wang@intel.com> Reviewed-by: Liu Shuo <shuo.a.liu@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent fd5472b commit 5b06d17

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

devicemodel/core/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
#include "version.h"
6565
#include "sw_load.h"
6666
#include "monitor.h"
67+
#include "ioc.h"
6768

6869
#define GUEST_NIO_PORT 0x488 /* guest upcalls via i/o port */
6970

@@ -155,6 +156,7 @@ usage(int code)
155156
" -r: ramdisk image path\n"
156157
" -B: bootargs for kernel\n"
157158
" -v: version\n"
159+
" -i: ioc boot parameters\n"
158160
" --vsbl: vsbl file path\n"
159161
" --part_info: guest partition info file path\n"
160162
" --enable_trusty: enable trusty for guest\n",
@@ -604,7 +606,7 @@ main(int argc, char *argv[])
604606
if (signal(SIGINT, sig_handler_term) == SIG_ERR)
605607
fprintf(stderr, "cannot register handler for SIGINT\n");
606608

607-
optstr = "abehuwxACHIMPSWYvk:r:B:p:g:c:s:m:l:U:G:";
609+
optstr = "abehuwxACHIMPSWYvk:r:B:p:g:c:s:m:l:U:G:i:";
608610
while ((c = getopt_long(argc, argv, optstr, long_options,
609611
&option_idx)) != -1) {
610612
switch (c) {
@@ -633,6 +635,11 @@ main(int argc, char *argv[])
633635
case 'g':
634636
gdb_port = atoi(optarg);
635637
break;
638+
639+
case 'i':
640+
ioc_parse(optarg);
641+
break;
642+
636643
case 'l':
637644
if (lpc_device_parse(optarg) != 0) {
638645
errx(EX_USAGE,
@@ -782,6 +789,7 @@ main(int argc, char *argv[])
782789
pci_irq_init(ctx);
783790
atkbdc_init(ctx);
784791
ioapic_init(ctx);
792+
ioc_init();
785793

786794
vrtc_init(ctx, rtc_localtime);
787795
sci_init(ctx);

0 commit comments

Comments
 (0)