From bbb6920a7507f4ab6fef5a3df8f4f21701c890c9 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 3 Jul 2018 21:34:50 +0800 Subject: [PATCH] HV: instr_emul: replace u_long with uint64_t Rflags is always 64-bit. Spell out the width explicitly and drop the unused typedef'ed u_long type. Signed-off-by: Junjie Mao --- hypervisor/arch/x86/guest/instr_emul.c | 6 +++--- hypervisor/arch/x86/guest/instr_emul_wrapper.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hypervisor/arch/x86/guest/instr_emul.c b/hypervisor/arch/x86/guest/instr_emul.c index 3a039f606..970e245b8 100644 --- a/hypervisor/arch/x86/guest/instr_emul.c +++ b/hypervisor/arch/x86/guest/instr_emul.c @@ -361,10 +361,10 @@ vie_update_register(struct vcpu *vcpu, enum vm_reg_name reg, * Return the status flags that would result from doing (x - y). */ #define GETCC(sz) \ -static u_long \ +static uint64_t \ getcc##sz(uint##sz##_t x, uint##sz##_t y) \ { \ - u_long rflags; \ + uint64_t rflags; \ \ __asm __volatile("sub %2,%1; pushfq; popq %0" : \ "=r" (rflags), "+r" (x) : "m" (y)); \ @@ -376,7 +376,7 @@ GETCC(16); GETCC(32); GETCC(64); -static u_long +static uint64_t getcc(int opsize, uint64_t x, uint64_t y) { ASSERT(opsize == 1 || opsize == 2 || opsize == 4 || opsize == 8, diff --git a/hypervisor/arch/x86/guest/instr_emul_wrapper.h b/hypervisor/arch/x86/guest/instr_emul_wrapper.h index f8ca34838..4273f7372 100644 --- a/hypervisor/arch/x86/guest/instr_emul_wrapper.h +++ b/hypervisor/arch/x86/guest/instr_emul_wrapper.h @@ -185,8 +185,6 @@ enum vm_reg_name { VM_REG_LAST }; -typedef unsigned long u_long; - int vm_get_register(struct vcpu *vcpu, int reg, uint64_t *retval); int vm_set_register(struct vcpu *vcpu, int reg, uint64_t val); int vm_get_seg_desc(struct vcpu *vcpu, int reg,