HV: prototyping non-static function

Includes header file of non-static function, and declare the
in-file use function static.

Signed-off-by: Yang, Yu-chu <yu-chu.yang@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Yang, Yu-chu 2018-07-12 13:14:13 -07:00 committed by lijinxia
parent 8925eb5647
commit 90b342bd53
18 changed files with 24 additions and 16 deletions

View File

@ -3,6 +3,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
#include <hypervisor.h> #include <hypervisor.h>
#include <reboot.h>
int warm_reboot(void) int warm_reboot(void)
{ {

View File

@ -44,7 +44,7 @@ static uint64_t find_next_table(uint32_t table_offset, void *table_base)
return sub_table_addr; return sub_table_addr;
} }
void free_ept_mem(void *pml4_addr) static void free_ept_mem(void *pml4_addr)
{ {
void *pdpt_addr; void *pdpt_addr;
void *pde_addr; void *pde_addr;

View File

@ -189,7 +189,8 @@ static void pm1ab_io_write(__unused struct vm_io_handler *hdlr,
io_write(v, addr, width); io_write(v, addr, width);
} }
void register_gas_io_handler(struct vm *vm, struct acpi_generic_address *gas) static void
register_gas_io_handler(struct vm *vm, struct acpi_generic_address *gas)
{ {
uint8_t io_len[5] = {0, 1, 2, 4, 8}; uint8_t io_len[5] = {0, 1, 2, 4, 8};
struct vm_io_range gas_io; struct vm_io_range gas_io;

View File

@ -62,7 +62,7 @@ static inline const char *pinstate_str(bool asserted)
return (asserted) ? "asserted" : "deasserted"; return (asserted) ? "asserted" : "deasserted";
} }
struct vioapic * static struct vioapic *
vm_ioapic(struct vm *vm) vm_ioapic(struct vm *vm)
{ {
return (struct vioapic *)vm->arch_vm.virt_ioapic; return (struct vioapic *)vm->arch_vm.virt_ioapic;

View File

@ -35,6 +35,7 @@
#include "instr_emul.h" #include "instr_emul.h"
#include "vlapic_priv.h" #include "vlapic_priv.h"
#include "vlapic.h"
#define VLAPIC_VERBOS 0 #define VLAPIC_VERBOS 0
#define PRIO(x) ((x) >> 4) #define PRIO(x) ((x) >> 4)
@ -1709,7 +1710,7 @@ vlapic_enabled(struct vlapic *vlapic)
} }
} }
void static void
vlapic_set_tmr(struct vlapic *vlapic, uint32_t vector, bool level) vlapic_set_tmr(struct vlapic *vlapic, uint32_t vector, bool level)
{ {
struct lapic_regs *lapic; struct lapic_regs *lapic;
@ -1739,7 +1740,7 @@ vlapic_apicv_batch_set_tmr(struct vlapic *vlapic)
} }
} }
void static void
vlapic_apicv_set_tmr(struct vlapic *vlapic, uint32_t vector, bool level) vlapic_apicv_set_tmr(struct vlapic *vlapic, uint32_t vector, bool level)
{ {
if (vlapic->ops.apicv_set_tmr != NULL) { if (vlapic->ops.apicv_set_tmr != NULL) {

View File

@ -51,7 +51,7 @@ static void enable_msr_interception(uint8_t *bitmap, uint32_t msr)
} }
/* not used now just leave it for some cases it may be used as API*/ /* not used now just leave it for some cases it may be used as API*/
void disable_msr_interception(uint8_t *bitmap, uint32_t msr) static void disable_msr_interception(uint8_t *bitmap, uint32_t msr)
{ {
uint8_t *read_map; uint8_t *read_map;
uint8_t *write_map; uint8_t *write_map;

View File

@ -929,7 +929,7 @@ static void vpic_elc_io_write(__unused struct vm_io_handler *hdlr,
} }
} }
void vpic_register_io_handler(struct vm *vm) static void vpic_register_io_handler(struct vm *vm)
{ {
struct vm_io_range master_range = { struct vm_io_range master_range = {
.flags = IO_ATTR_RW, .flags = IO_ATTR_RW,

View File

@ -407,7 +407,7 @@ void setup_ioapic_irq(void)
ASSERT(nr_gsi <= NR_MAX_GSI, "GSI table overflow"); ASSERT(nr_gsi <= NR_MAX_GSI, "GSI table overflow");
} }
void dump_ioapic(void) static void dump_ioapic(void)
{ {
uint32_t irq; uint32_t irq;
@ -457,7 +457,7 @@ void resume_ioapic(void)
} }
#ifdef HV_DEBUG #ifdef HV_DEBUG
void get_rte_info(struct ioapic_rte *rte, bool *mask, bool *irr, static void get_rte_info(struct ioapic_rte *rte, bool *mask, bool *irr,
bool *phys, uint32_t *delmode, bool *level, uint32_t *vector, uint32_t *dest) bool *phys, uint32_t *delmode, bool *level, uint32_t *vector, uint32_t *dest)
{ {
*mask = ((rte->lo_32 & IOAPIC_RTE_INTMASK) == IOAPIC_RTE_INTMSET); *mask = ((rte->lo_32 & IOAPIC_RTE_INTMASK) == IOAPIC_RTE_INTMSET);

View File

@ -398,7 +398,7 @@ void dispatch_exception(struct intr_excp_ctx *ctx)
cpu_dead(pcpu_id); cpu_dead(pcpu_id);
} }
void handle_spurious_interrupt(uint32_t vector) static void handle_spurious_interrupt(uint32_t vector)
{ {
send_lapic_eoi(); send_lapic_eoi();

View File

@ -61,7 +61,7 @@ void setup_notification(void)
dev_to_vector(notification_node)); dev_to_vector(notification_node));
} }
void cleanup_notification(void) static void cleanup_notification(void)
{ {
if (notification_node != NULL) if (notification_node != NULL)
unregister_handler_common(notification_node); unregister_handler_common(notification_node);

View File

@ -246,7 +246,7 @@ void exec_vmwrite64(unsigned int field_full, uint64_t value)
asm volatile ("movw %%cs, %%ax" : "=a"(sel)); \ asm volatile ("movw %%cs, %%ax" : "=a"(sel)); \
} }
uint32_t get_cs_access_rights(void) static uint32_t get_cs_access_rights(void)
{ {
uint32_t usable_ar; uint32_t usable_ar;
uint16_t sel_value; uint16_t sel_value;

View File

@ -175,7 +175,7 @@ probe_table(uint64_t address, const char *sig)
return 1; return 1;
} }
void *get_acpi_tbl(const char *sig) static void *get_acpi_tbl(const char *sig)
{ {
struct acpi_table_rsdp *rsdp; struct acpi_table_rsdp *rsdp;
struct acpi_table_rsdt *rsdt; struct acpi_table_rsdt *rsdt;

View File

@ -403,7 +403,7 @@ int64_t hcall_notify_req_finish(uint64_t vmid, uint64_t vcpu_id)
return 0; return 0;
} }
int64_t _set_vm_memmap(struct vm *vm, struct vm *target_vm, static int64_t _set_vm_memmap(struct vm *vm, struct vm *target_vm,
struct vm_set_memmap *memmap) struct vm_set_memmap *memmap)
{ {
uint64_t hpa, base_paddr; uint64_t hpa, base_paddr;

View File

@ -309,7 +309,7 @@ done:
return reg; return reg;
} }
void vuart_register_io_handler(struct vm *vm) static void vuart_register_io_handler(struct vm *vm)
{ {
struct vm_io_range range = { struct vm_io_range range = {
.flags = IO_ATTR_RW, .flags = IO_ATTR_RW,

View File

@ -242,6 +242,7 @@ struct stack_canary {
uint8_t reserved[40]; uint8_t reserved[40];
uint64_t canary; uint64_t canary;
}; };
void __stack_chk_fail(void);
#endif #endif
extern struct cpuinfo_x86 boot_cpu_data; extern struct cpuinfo_x86 boot_cpu_data;
@ -263,6 +264,8 @@ bool is_vapic_intr_delivery_supported(void);
bool is_vapic_virt_reg_supported(void); bool is_vapic_virt_reg_supported(void);
bool cpu_has_cap(uint32_t bit); bool cpu_has_cap(uint32_t bit);
void load_cpu_state_data(void); void load_cpu_state_data(void);
void bsp_boot_init(void);
void cpu_secondary_init(void);
void start_cpus(); void start_cpus();
void stop_cpus(); void stop_cpus();

View File

@ -72,6 +72,7 @@ int quick_handler_nolock(struct irq_desc *desc, void *handler_data);
int init_default_irqs(uint16_t cpu); int init_default_irqs(uint16_t cpu);
void dispatch_exception(struct intr_excp_ctx *ctx);
void dispatch_interrupt(struct intr_excp_ctx *ctx); void dispatch_interrupt(struct intr_excp_ctx *ctx);
void setup_notification(void); void setup_notification(void);

View File

@ -5,6 +5,7 @@
*/ */
#include <rtl.h> #include <rtl.h>
#include <hkdf.h>
int hkdf_sha256(uint8_t *out_key, size_t out_len, int hkdf_sha256(uint8_t *out_key, size_t out_len,
const uint8_t *secret, size_t secret_len, const uint8_t *secret, size_t secret_len,

View File

@ -364,7 +364,7 @@ size_t strnlen_s(const char *str, size_t maxlen)
return count; return count;
} }
char hexdigit(int decimal_val) static char hexdigit(int decimal_val)
{ {
static const char hexdigits[] = { '0', '1', '2', '3', '4', '5', '6', static const char hexdigits[] = { '0', '1', '2', '3', '4', '5', '6',
'7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };