refine: remove redundant data type definition

remove data defination of mmio_addr_t, vaddr_t, paddr_t,
and ioport_t.

Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Zheng, Gen <gen.zheng@intel.com>
This commit is contained in:
Zheng, Gen
2018-04-13 14:51:25 +08:00
committed by Jack Ren
parent f80c706d8d
commit c92da5295b
14 changed files with 68 additions and 79 deletions

View File

@@ -617,7 +617,7 @@ static void start_cpus()
/* Broadcast IPIs to all other CPUs */
send_startup_ipi(INTR_CPU_STARTUP_ALL_EX_SELF,
-1U, ((paddr_t) cpu_secondary_reset));
-1U, ((uint64_t) cpu_secondary_reset));
/* Wait until global count is equal to expected CPU up count or
* configured time-out has expired

View File

@@ -778,7 +778,7 @@ static int vpic_master_handler(struct vm *vm, bool in, int port, int bytes,
}
static uint32_t vpic_master_io_read(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width)
struct vm *vm, uint16_t addr, size_t width)
{
uint32_t val = 0;
@@ -789,7 +789,7 @@ static uint32_t vpic_master_io_read(__unused struct vm_io_handler *hdlr,
}
static void vpic_master_io_write(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width, uint32_t v)
struct vm *vm, uint16_t addr, size_t width, uint32_t v)
{
uint32_t val = v;
@@ -817,7 +817,7 @@ static int vpic_slave_handler(struct vm *vm, bool in, int port, int bytes,
}
static uint32_t vpic_slave_io_read(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width)
struct vm *vm, uint16_t addr, size_t width)
{
uint32_t val = 0;
@@ -828,7 +828,7 @@ static uint32_t vpic_slave_io_read(__unused struct vm_io_handler *hdlr,
}
static void vpic_slave_io_write(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width, uint32_t v)
struct vm *vm, uint16_t addr, size_t width, uint32_t v)
{
uint32_t val = v;
@@ -879,7 +879,7 @@ static int vpic_elc_handler(struct vm *vm, bool in, int port, int bytes,
}
static uint32_t vpic_elc_io_read(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width)
struct vm *vm, uint16_t addr, size_t width)
{
uint32_t val = 0;
@@ -889,7 +889,7 @@ static uint32_t vpic_elc_io_read(__unused struct vm_io_handler *hdlr,
}
static void vpic_elc_io_write(__unused struct vm_io_handler *hdlr,
struct vm *vm, ioport_t addr, size_t width, uint32_t v)
struct vm *vm, uint16_t addr, size_t width, uint32_t v)
{
uint32_t val = v;

View File

@@ -158,10 +158,9 @@ union lapic_base_msr {
struct lapic_info {
int init_status;
struct {
paddr_t paddr;
vaddr_t vaddr;
uint64_t paddr;
void *vaddr;
} xapic;
};
static struct lapic_info lapic_info;
@@ -171,7 +170,7 @@ static inline uint32_t read_lapic_reg32(uint32_t offset)
if (offset < 0x20 || offset > 0x3ff)
return 0;
return mmio_read_long(lapic_info.xapic.vaddr + offset);
return mmio_read_long((uint64_t)lapic_info.xapic.vaddr + offset);
}
inline void write_lapic_reg32(uint32_t offset, uint32_t value)
@@ -179,7 +178,7 @@ inline void write_lapic_reg32(uint32_t offset, uint32_t value)
if (offset < 0x20 || offset > 0x3ff)
return;
mmio_write_long(value, lapic_info.xapic.vaddr + offset);
mmio_write_long(value, (uint64_t)lapic_info.xapic.vaddr + offset);
}
static void clear_lapic_isr(void)
@@ -205,7 +204,7 @@ static void map_lapic(void)
/* At some point we may need to translate this paddr to a vaddr. 1:1
* mapping for now.
*/
lapic_info.xapic.vaddr = lapic_info.xapic.paddr;
lapic_info.xapic.vaddr = (void *)lapic_info.xapic.paddr;
}
int early_init_lapic(void)
@@ -324,7 +323,7 @@ uint32_t get_cur_lapic_id(void)
int
send_startup_ipi(enum intr_cpu_startup_shorthand cpu_startup_shorthand,
uint32_t cpu_startup_dest, paddr_t cpu_startup_start_address)
uint32_t cpu_startup_dest, uint64_t cpu_startup_start_address)
{
union apic_icr icr;
uint8_t shorthand;
@@ -372,7 +371,7 @@ send_startup_ipi(enum intr_cpu_startup_shorthand cpu_startup_shorthand,
icr.value_32.lo_32 = 0;
icr.bits.shorthand = shorthand;
icr.bits.delivery_mode = INTR_LAPIC_ICR_STARTUP;
icr.bits.vector = ((paddr_t) cpu_startup_start_address) >> 12;
icr.bits.vector = ((uint64_t) cpu_startup_start_address) >> 12;
write_lapic_reg32(LAPIC_INT_COMMAND_REGISTER_0, icr.value_32.lo_32);
wait_for_delivery();

View File

@@ -208,14 +208,14 @@ static void deny_guest_io_access(struct vm *vm, uint32_t address, uint32_t nbyte
static uint32_t
default_io_read(__unused struct vm_io_handler *hdlr, __unused struct vm *vm,
ioport_t address, size_t width)
uint16_t address, size_t width)
{
uint32_t v = io_read(address, width);
return v;
}
static void default_io_write(__unused struct vm_io_handler *hdlr,
__unused struct vm *vm, ioport_t addr,
__unused struct vm *vm, uint16_t addr,
size_t width, uint32_t v)
{
io_write(v, addr, width);

View File

@@ -82,7 +82,7 @@ static uint64_t map_ioapic(
/* At some point we may need to translate this paddr to a vaddr.
* 1:1 mapping for now.
*/
return (vaddr_t) ioapic_paddr;
return ioapic_paddr;
}
static inline uint32_t