HV: replace merge_cmdline api with strncat_s

Add a standard string api strncat_s() to replace merge_cmdline() to make code
more readable.

Another change is that the multiboot cmdline will be appended to the end of
configured SOS bootargs instead of the beginning, this would enable a feature
that some kernel cmdline paramter items could be overriden by multiboot cmdline
since the later one would win if same parameters configured in kernel cmdline.

Tracked-On: #4885

Signed-off-by: Victor Sun <victor.sun@intel.com>
Reviewed-by: Yonghua Huang <yonghua.huang@intel.com>
Reviewed-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Victor Sun
2020-05-28 23:18:47 +08:00
committed by wenlingz
parent bad12039c6
commit 47d20f37e1
4 changed files with 73 additions and 69 deletions

View File

@@ -9,6 +9,7 @@
#define BOOTLOADER_SEED_MAX_ENTRIES 10U
#define BUP_MKHI_BOOTLOADER_SEED_LEN 64U
#define MAX_SEED_ARG_SIZE 1024U
/* Structure of seed info */
struct seed_info {

View File

@@ -39,7 +39,7 @@ 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);
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 */