HV:treewide: Clean up -1U or -1UL

According to C99 standard, -1 integer constant with 'U/UL'
suffix has no type.

To explicit the integer constant:
Update -1U or -1UL as ~0U or ~0UL, or invalid number according
to usage case.

V1-->V2:
	Update parameter name and type of send_startup_ipi since
	the second parameter is used as pcpu_id;
	Update related comments for code clearity.
V2-->V3:
	Update comments of struct acrn_irqline;
	rename  cpu_startup_dest as dest_pcpu_id in the second
	parameter of send_startup_ipi.

Tracked-on: ccm0001001-247033
Signed-off-by: Xiangyang Wu <xiangyang.wu@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
Xiangyang Wu
2018-07-06 16:08:33 +08:00
committed by lijinxia
parent de5bb50545
commit 49d1dc1534
9 changed files with 18 additions and 15 deletions

View File

@@ -713,9 +713,12 @@ void start_cpus()
*/
expected_up = phys_cpu_num;
/* Broadcast IPIs to all other CPUs */
/* Broadcast IPIs to all other CPUs,
* In this case, INTR_CPU_STARTUP_ALL_EX_SELF decides broadcasting
* IPIs, INVALID_CPU_ID is parameter value to destination pcpu_id.
*/
send_startup_ipi(INTR_CPU_STARTUP_ALL_EX_SELF,
-1U, startup_paddr);
INVALID_CPU_ID, startup_paddr);
/* Wait until global count is equal to expected CPU up count or
* configured time-out has expired

View File

@@ -483,7 +483,7 @@ vlapic_set_intr_ready(struct vlapic *vlapic, uint32_t vector, bool level)
static inline int
lvt_off_to_idx(uint32_t offset)
{
uint32_t index = -1U;
uint32_t index = ~0U;
switch (offset) {
case APIC_OFFSET_CMCI_LVT:

View File

@@ -352,7 +352,7 @@ uint8_t get_cur_lapic_id(void)
int
send_startup_ipi(enum intr_cpu_startup_shorthand cpu_startup_shorthand,
uint32_t cpu_startup_dest, uint64_t cpu_startup_start_address)
uint16_t dest_pcpu_id, uint64_t cpu_startup_start_address)
{
union apic_icr icr;
uint8_t shorthand;
@@ -368,7 +368,7 @@ send_startup_ipi(enum intr_cpu_startup_shorthand cpu_startup_shorthand,
if (cpu_startup_shorthand == INTR_CPU_STARTUP_USE_DEST) {
shorthand = INTR_LAPIC_ICR_USE_DEST_ARRAY;
icr.x_bits.dest_field = per_cpu(lapic_id, cpu_startup_dest);
icr.x_bits.dest_field = per_cpu(lapic_id, dest_pcpu_id);
} else { /* Use destination shorthand */
shorthand = INTR_LAPIC_ICR_ALL_EX_SELF;
icr.value_32.hi_32 = 0;

View File

@@ -1280,10 +1280,10 @@ static void init_exec_ctrl(struct vcpu *vcpu)
* that support the 1-setting of the "virtual-interrupt
* delivery" VM-execution control
*/
exec_vmwrite64(VMX_EOI_EXIT0_FULL, -1UL);
exec_vmwrite64(VMX_EOI_EXIT1_FULL, -1UL);
exec_vmwrite64(VMX_EOI_EXIT2_FULL, -1UL);
exec_vmwrite64(VMX_EOI_EXIT3_FULL, -1UL);
exec_vmwrite64(VMX_EOI_EXIT0_FULL, ~0UL);
exec_vmwrite64(VMX_EOI_EXIT1_FULL, ~0UL);
exec_vmwrite64(VMX_EOI_EXIT2_FULL, ~0UL);
exec_vmwrite64(VMX_EOI_EXIT3_FULL, ~0UL);
}
}