mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-05-04 14:36:55 +00:00
The multiboot2 cmdline would be used as hypervisor cmdline, add parse logic for the case that hypervisor boot from multiboot2 protocol. Tracked-On: #4885 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
38 lines
768 B
C
38 lines
768 B
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#include <types.h>
|
|
#include <errno.h>
|
|
#include <boot.h>
|
|
#include <pgtable.h>
|
|
#include <dbg_cmd.h>
|
|
|
|
void parse_hv_cmdline(void)
|
|
{
|
|
const char *start = NULL, *end = NULL;
|
|
struct acrn_multiboot_info *mbi = &acrn_mbi;
|
|
|
|
if ((mbi->mi_flags & MULTIBOOT_INFO_HAS_CMDLINE) != 0U) {
|
|
start = mbi->mi_cmdline;
|
|
}
|
|
|
|
while ((start != NULL) && ((*start) != '\0')) {
|
|
while ((*start) == ' ')
|
|
start++;
|
|
if ((*start) != '\0') {
|
|
end = start + 1;
|
|
while ((*end != ' ') && ((*end) != '\0'))
|
|
end++;
|
|
|
|
if (!handle_dbg_cmd(start, (int32_t)(end - start))) {
|
|
/* if not handled by handle_dbg_cmd, it can be handled further */
|
|
}
|
|
start = end;
|
|
}
|
|
}
|
|
|
|
}
|