mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-04-29 12:14:13 +00:00
Previously the VM kernel bootargs for pre-launched VMs and direct boot mode of SOS VM are built-in hypervisor binary so end users have no way to change it. Now we provide another option that the multiboot module string could be used as bootargs also. This would bring convenience to end users when they use GRUB as bootloader because the bootargs could be configurable in GRUB menu. The usage is if there is any string follows configured kernel_mod_tag in module string, the string will be used as new kernel bootargs instead of built-in kernel bootargs. If there is no string follows kernel_mod_tag, then the built-in bootargs will be the default kernel bootargs. Please note kernel_mod_tag must be the first word in module string in any case, it is used to specify the module for which VM. Tracked-On: #4885 Signed-off-by: Victor Sun <victor.sun@intel.com> Reviewed-by: Yin Fengwei <fengwei.yin@intel.com> Reviewed-by: Eddie Dong <eddie.dong@intel.com>
51 lines
1.3 KiB
C
51 lines
1.3 KiB
C
/*
|
|
* Copyright (C) 2018 Intel Corporation. All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
#ifndef RTL_H
|
|
#define RTL_H
|
|
|
|
#include <types.h>
|
|
|
|
union u_qword {
|
|
struct {
|
|
uint32_t low;
|
|
uint32_t high;
|
|
} dwords;
|
|
|
|
uint64_t qword;
|
|
|
|
};
|
|
|
|
/* MACRO related to string */
|
|
#define ULONG_MAX ((uint64_t)(~0UL)) /* 0xFFFFFFFF */
|
|
#define LONG_MAX (ULONG_MAX >> 1U) /* 0x7FFFFFFF */
|
|
#define LONG_MIN (~LONG_MAX) /* 0x80000000 */
|
|
|
|
static inline bool is_space(char c)
|
|
{
|
|
return ((c == ' ') || (c == '\t'));
|
|
}
|
|
|
|
static inline bool is_eol(char c)
|
|
{
|
|
return ((c == 0x0d) || (c == 0x0a) || (c == '\0'));
|
|
}
|
|
|
|
/* Function prototypes */
|
|
int32_t strcmp(const char *s1_arg, const char *s2_arg);
|
|
int32_t strncmp(const char *s1_arg, const char *s2_arg, size_t n_arg);
|
|
int32_t strncpy_s(char *d, size_t dmax, const char *s, size_t slen);
|
|
char *strchr(char *s_arg, char ch);
|
|
size_t strnlen_s(const char *str_arg, size_t maxlen_arg);
|
|
void *memset(void *base, uint8_t v, size_t n);
|
|
int32_t memcpy_s(void *d, size_t dmax, const void *s, size_t slen);
|
|
int64_t strtol_deci(const char *nptr);
|
|
uint64_t strtoul_hex(const char *nptr);
|
|
char *strstr_s(const char *str1, size_t maxlen1, const char *str2, size_t maxlen2);
|
|
int32_t strncat_s(char *dest, size_t dmax, const char *src, size_t slen);
|
|
|
|
#endif /* RTL_H */
|