HV: handle integral issue report by MISRA-C

The main focus on: constant suffix U/UL; parameters cast like
uint32 to a uint16 variable; unify some APIs interface,
consist with the callers.

also modify some places to unify code style

Signed-off-by: Minggui Cao <minggui.cao@intel.com>
This commit is contained in:
Minggui Cao
2018-07-12 11:47:49 +08:00
committed by lijinxia
parent 7706e5cef4
commit 2f2d108b1e
16 changed files with 113 additions and 120 deletions

View File

@@ -11,8 +11,8 @@
#define VM_RESUME 0
#define VM_LAUNCH 1
#define ACRN_DBG_PTIRQ 6
#define ACRN_DBG_IRQ 6
#define ACRN_DBG_PTIRQ 6U
#define ACRN_DBG_IRQ 6U
#ifndef ASSEMBLER
@@ -39,14 +39,14 @@ int32_t acrn_insert_request_wait(struct vcpu *vcpu, struct vhm_request *req);
/*
* VCPU related APIs
*/
#define ACRN_REQUEST_EXCP 0
#define ACRN_REQUEST_EVENT 1
#define ACRN_REQUEST_EXTINT 2
#define ACRN_REQUEST_NMI 3
#define ACRN_REQUEST_TMR_UPDATE 4
#define ACRN_REQUEST_EPT_FLUSH 5
#define ACRN_REQUEST_TRP_FAULT 6
#define ACRN_REQUEST_VPID_FLUSH 7 /* flush vpid tlb */
#define ACRN_REQUEST_EXCP 0U
#define ACRN_REQUEST_EVENT 1U
#define ACRN_REQUEST_EXTINT 2U
#define ACRN_REQUEST_NMI 3U
#define ACRN_REQUEST_TMR_UPDATE 4U
#define ACRN_REQUEST_EPT_FLUSH 5U
#define ACRN_REQUEST_TRP_FAULT 6U
#define ACRN_REQUEST_VPID_FLUSH 7U /* flush vpid tlb */
#define E820_MAX_ENTRIES 32U
@@ -69,13 +69,6 @@ struct vm_lu_mem_map {
uint64_t size; /* Size of map */
};
enum vm_cpu_mode {
CPU_MODE_REAL,
CPU_MODE_PROTECTED,
CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */
CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
};
/* Use # of paging level to identify paging mode */
enum vm_paging_mode {
PAGING_MODE_0_LEVEL = 0, /* Flat */

View File

@@ -87,6 +87,13 @@ enum vcpu_state {
VCPU_UNKNOWN_STATE,
};
enum vm_cpu_mode {
CPU_MODE_REAL,
CPU_MODE_PROTECTED,
CPU_MODE_COMPATIBILITY, /* IA-32E mode (CS.L = 0) */
CPU_MODE_64BIT, /* IA-32E mode (CS.L = 1) */
};
struct cpu_regs {
uint64_t rax;
uint64_t rbx;
@@ -202,7 +209,7 @@ struct vcpu_arch {
uint32_t exception;
/* The error number for the exception. */
int error;
uint32_t error;
} exception_info;
uint8_t lapic_mask;