mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-01-13 11:33:58 +00:00
HV: treewide: drop debug-only helpers in release build
There are multiple helpers for collecting info to be printed on the ACRN uart
console. They are unreachable code in release builds in which the uart console
is removed.
To define a precise boundary for safety-related activities, this patch wraps the
declarations and definitions to these helpers with "#ifdef HV_DEBUG" so that
these unreachable APIs will be dropped in release builds.
v1 -> v2:
* Fix coding style: no empty lines between #ifdef and the wrapped code.
* Also drop get_rte_info() in ioapic.c, which is solely used by
get_ioapic_info().
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
@@ -36,7 +36,6 @@ enum {
|
||||
struct vhm_request;
|
||||
|
||||
int32_t acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req);
|
||||
void get_req_info(char *str, int str_max);
|
||||
|
||||
/*
|
||||
* VCPU related APIs
|
||||
@@ -130,6 +129,11 @@ int copy_to_gva(struct vcpu *vcpu, void *h_ptr, uint64_t gva,
|
||||
uint32_t size, uint32_t *err_code);
|
||||
|
||||
uint32_t create_guest_init_gdt(struct vm *vm, uint32_t *limit);
|
||||
|
||||
#ifdef HV_DEBUG
|
||||
void get_req_info(char *str, int str_max);
|
||||
#endif /* HV_DEBUG */
|
||||
|
||||
#endif /* !ASSEMBLER */
|
||||
|
||||
#endif /* GUEST_H*/
|
||||
|
||||
@@ -53,5 +53,8 @@ bool vioapic_get_rte(struct vm *vm, int pin, void *rte);
|
||||
int vioapic_mmio_access_handler(struct vcpu *vcpu, struct mem_io *mmio,
|
||||
void *handler_private_data);
|
||||
|
||||
#ifdef HV_DEBUG
|
||||
void get_vioapic_info(char *str, int str_max, int vmid);
|
||||
#endif /* HV_DEBUG */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user