From e4d1c321ad82950c099f81c0738ef913f11423bd Mon Sep 17 00:00:00 2001 From: Mingqiang Chi Date: Mon, 8 Jul 2019 15:02:50 +0800 Subject: [PATCH] hv:fix "no prototype for non-static function" change some APIs to static or include header file Tracked-On: #861 Signed-off-by: Mingqiang Chi --- hypervisor/arch/x86/guest/pm.c | 1 + hypervisor/arch/x86/seed/seed_abl.c | 1 + hypervisor/arch/x86/vmx.c | 1 + hypervisor/boot/cmdline.c | 1 + hypervisor/boot/guest/vboot_info.c | 1 + hypervisor/common/hypercall.c | 1 + hypervisor/common/trusty_hypercall.c | 1 + hypervisor/debug/console.c | 7 ++++--- hypervisor/debug/dbg_cmd.c | 1 + hypervisor/debug/dump.c | 1 + hypervisor/debug/hypercall.c | 1 + hypervisor/debug/npk_log.c | 1 + hypervisor/debug/shell.c | 1 + hypervisor/debug/trace.c | 1 + hypervisor/dm/vuart.c | 4 ++-- hypervisor/lib/stack_protector.c | 1 + hypervisor/release/console.c | 1 + 17 files changed, 21 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/guest/pm.c b/hypervisor/arch/x86/guest/pm.c index 5819f0618..b4523b129 100644 --- a/hypervisor/arch/x86/guest/pm.c +++ b/hypervisor/arch/x86/guest/pm.c @@ -10,6 +10,7 @@ #include #include #include +#include int32_t validate_pstate(const struct acrn_vm *vm, uint64_t perf_ctl) { diff --git a/hypervisor/arch/x86/seed/seed_abl.c b/hypervisor/arch/x86/seed/seed_abl.c index bb85881fe..37133c60d 100644 --- a/hypervisor/arch/x86/seed/seed_abl.c +++ b/hypervisor/arch/x86/seed/seed_abl.c @@ -9,6 +9,7 @@ #include #include #include +#include "seed_abl.h" #define ABL_SEED_LEN 32U struct abl_seed_info { diff --git a/hypervisor/arch/x86/vmx.c b/hypervisor/arch/x86/vmx.c index 850e32cb9..bc6e049ae 100644 --- a/hypervisor/arch/x86/vmx.c +++ b/hypervisor/arch/x86/vmx.c @@ -10,6 +10,7 @@ #include #include #include +#include /** * @pre addr != NULL && addr is 4KB-aligned diff --git a/hypervisor/boot/cmdline.c b/hypervisor/boot/cmdline.c index c1b446b18..0353dd6f3 100644 --- a/hypervisor/boot/cmdline.c +++ b/hypervisor/boot/cmdline.c @@ -10,6 +10,7 @@ #include #include #include +#include #define ACRN_DBG_PARSE 6 diff --git a/hypervisor/boot/guest/vboot_info.c b/hypervisor/boot/guest/vboot_info.c index c10e9023c..61e5315b0 100644 --- a/hypervisor/boot/guest/vboot_info.c +++ b/hypervisor/boot/guest/vboot_info.c @@ -19,6 +19,7 @@ #include #include #include +#include #define ACRN_DBG_BOOT 6U diff --git a/hypervisor/common/hypercall.c b/hypervisor/common/hypercall.c index 2ff382e21..e2159e2c3 100644 --- a/hypervisor/common/hypercall.c +++ b/hypervisor/common/hypercall.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include diff --git a/hypervisor/common/trusty_hypercall.c b/hypervisor/common/trusty_hypercall.c index 46f2c9b6a..ce86af1a4 100644 --- a/hypervisor/common/trusty_hypercall.c +++ b/hypervisor/common/trusty_hypercall.c @@ -5,6 +5,7 @@ */ #include +#include #include #include diff --git a/hypervisor/debug/console.c b/hypervisor/debug/console.c index 815a24c14..28e529c0e 100644 --- a/hypervisor/debug/console.c +++ b/hypervisor/debug/console.c @@ -13,6 +13,7 @@ #include #include #include +#include struct hv_timer console_timer; @@ -54,7 +55,7 @@ struct acrn_vuart *vm_console_vuart(struct acrn_vm *vm) * @pre vu != NULL * @pre vu->active == true */ -void vuart_console_rx_chars(struct acrn_vuart *vu) +static void vuart_console_rx_chars(struct acrn_vuart *vu) { char ch = -1; @@ -76,7 +77,7 @@ void vuart_console_rx_chars(struct acrn_vuart *vu) /** * @pre vu != NULL */ -void vuart_console_tx_chars(struct acrn_vuart *vu) +static void vuart_console_tx_chars(struct acrn_vuart *vu) { char c; @@ -85,7 +86,7 @@ void vuart_console_tx_chars(struct acrn_vuart *vu) } } -struct acrn_vuart *vuart_console_active(void) +static struct acrn_vuart *vuart_console_active(void) { struct acrn_vm *vm = NULL; struct acrn_vuart *vu = NULL; diff --git a/hypervisor/debug/dbg_cmd.c b/hypervisor/debug/dbg_cmd.c index 9e2d30e49..8e859c1f5 100644 --- a/hypervisor/debug/dbg_cmd.c +++ b/hypervisor/debug/dbg_cmd.c @@ -8,6 +8,7 @@ #include #include #include +#include #define MAX_PORT 0x10000 /* port 0 - 64K */ #define DEFAULT_UART_PORT 0x3F8 diff --git a/hypervisor/debug/dump.c b/hypervisor/debug/dump.c index 6ae70eb04..909c1f824 100644 --- a/hypervisor/debug/dump.c +++ b/hypervisor/debug/dump.c @@ -12,6 +12,7 @@ #include #include #include +#include #define CALL_TRACE_HIERARCHY_MAX 20U #define DUMP_STACK_SIZE 0x200U diff --git a/hypervisor/debug/hypercall.c b/hypervisor/debug/hypercall.c index 4c906fd18..992a66533 100644 --- a/hypervisor/debug/hypercall.c +++ b/hypervisor/debug/hypercall.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include diff --git a/hypervisor/debug/npk_log.c b/hypervisor/debug/npk_log.c index dfbeda04e..d44a84581 100644 --- a/hypervisor/debug/npk_log.c +++ b/hypervisor/debug/npk_log.c @@ -10,6 +10,7 @@ #include #include #include +#include static int32_t npk_log_setup_ref; static bool npk_log_enabled; diff --git a/hypervisor/debug/shell.c b/hypervisor/debug/shell.c index aeb514c0d..a5912008b 100644 --- a/hypervisor/debug/shell.c +++ b/hypervisor/debug/shell.c @@ -19,6 +19,7 @@ #include #include #include +#include #define TEMP_STR_SIZE 60U #define MAX_STR_SIZE 256U diff --git a/hypervisor/debug/trace.c b/hypervisor/debug/trace.c index c5d6cd1d7..9377dcf69 100644 --- a/hypervisor/debug/trace.c +++ b/hypervisor/debug/trace.c @@ -6,6 +6,7 @@ #include #include +#include #define TRACE_CUSTOM 0xFCU #define TRACE_FUNC_ENTER 0xFDU diff --git a/hypervisor/dm/vuart.c b/hypervisor/dm/vuart.c index 2fe7840c6..4452a692f 100644 --- a/hypervisor/dm/vuart.c +++ b/hypervisor/dm/vuart.c @@ -128,7 +128,7 @@ static uint8_t vuart_intr_reason(const struct acrn_vuart *vu) return ret; } -struct acrn_vuart *find_vuart_by_port(struct acrn_vm *vm, uint16_t offset) +static struct acrn_vuart *find_vuart_by_port(struct acrn_vm *vm, uint16_t offset) { uint8_t i; struct acrn_vuart *vu, *ret_vu = NULL; @@ -537,7 +537,7 @@ static void vuart_setup_connection(struct acrn_vm *vm, } } -void vuart_deinit_connect(struct acrn_vuart *vu) +static void vuart_deinit_connect(struct acrn_vuart *vu) { struct acrn_vuart *t_vu = vu->target_vu; diff --git a/hypervisor/lib/stack_protector.c b/hypervisor/lib/stack_protector.c index b03a16d5b..4314f4a17 100644 --- a/hypervisor/lib/stack_protector.c +++ b/hypervisor/lib/stack_protector.c @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-3-Clause */ #include +#include void __stack_chk_fail(void) { diff --git a/hypervisor/release/console.c b/hypervisor/release/console.c index 25da22f4b..8db625463 100644 --- a/hypervisor/release/console.c +++ b/hypervisor/release/console.c @@ -6,6 +6,7 @@ #include #include +#include size_t console_write(__unused const char *str, __unused size_t len) {