[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] xen: arm: use vaddr_t more widely.
commit d923f41efe228e8eff417c400a45fe927b57c371 Author: Ian Campbell <ian.campbell@xxxxxxxxxx> AuthorDate: Fri Feb 22 08:58:01 2013 +0000 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Fri Feb 22 12:14:53 2013 +0000 xen: arm: use vaddr_t more widely. Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Acked-by: Tim Deegan <tim@xxxxxxx> --- xen/arch/arm/guestcopy.c | 16 +++++++++------- xen/arch/arm/io.h | 2 +- xen/include/asm-arm/mm.h | 6 +++--- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/xen/arch/arm/guestcopy.c b/xen/arch/arm/guestcopy.c index c47558f..d146cd6 100644 --- a/xen/arch/arm/guestcopy.c +++ b/xen/arch/arm/guestcopy.c @@ -8,7 +8,7 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len) { /* XXX needs to handle faults */ - unsigned offset = ((unsigned long)to & ~PAGE_MASK); + unsigned offset = (vaddr_t)to & ~PAGE_MASK; while ( len ) { @@ -17,7 +17,7 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len) void *p; unsigned size = min(len, (unsigned)PAGE_SIZE - offset); - rc = gvirt_to_maddr((uint32_t) to, &g); + rc = gvirt_to_maddr((vaddr_t) to, &g); if ( rc ) return rc; @@ -38,7 +38,7 @@ unsigned long raw_copy_to_guest(void *to, const void *from, unsigned len) unsigned long raw_clear_guest(void *to, unsigned len) { /* XXX needs to handle faults */ - unsigned offset = ((unsigned long)to & ~PAGE_MASK); + unsigned offset = (vaddr_t)to & ~PAGE_MASK; while ( len ) { @@ -47,7 +47,7 @@ unsigned long raw_clear_guest(void *to, unsigned len) void *p; unsigned size = min(len, (unsigned)PAGE_SIZE - offset); - rc = gvirt_to_maddr((uint32_t) to, &g); + rc = gvirt_to_maddr((vaddr_t) to, &g); if ( rc ) return rc; @@ -66,19 +66,21 @@ unsigned long raw_clear_guest(void *to, unsigned len) unsigned long raw_copy_from_guest(void *to, const void __user *from, unsigned len) { + unsigned offset = (vaddr_t)from & ~PAGE_MASK; + while ( len ) { int rc; paddr_t g; void *p; - unsigned size = min(len, (unsigned)(PAGE_SIZE - ((unsigned)from & (~PAGE_MASK)))); + unsigned size = min(len, (unsigned)(PAGE_SIZE - offset)); - rc = gvirt_to_maddr((uint32_t) from & PAGE_MASK, &g); + rc = gvirt_to_maddr((vaddr_t) from & PAGE_MASK, &g); if ( rc ) return rc; p = map_domain_page(g>>PAGE_SHIFT); - p += ((unsigned long)from & (~PAGE_MASK)); + p += ((vaddr_t)from & (~PAGE_MASK)); memcpy(to, p, size); diff --git a/xen/arch/arm/io.h b/xen/arch/arm/io.h index 4b0b985..661dce1 100644 --- a/xen/arch/arm/io.h +++ b/xen/arch/arm/io.h @@ -26,7 +26,7 @@ typedef struct { struct hsr_dabt dabt; - uint32_t gva; + vaddr_t gva; paddr_t gpa; } mmio_info_t; diff --git a/xen/include/asm-arm/mm.h b/xen/include/asm-arm/mm.h index 261a173..19e5bc2 100644 --- a/xen/include/asm-arm/mm.h +++ b/xen/include/asm-arm/mm.h @@ -181,8 +181,8 @@ void* early_ioremap(paddr_t start, size_t len, unsigned attributes); static inline paddr_t virt_to_maddr(const void *va) { - uint64_t par = va_to_par((uint32_t)va); - return (par & PADDR_MASK & PAGE_MASK) | ((unsigned long) va & ~PAGE_MASK); + uint64_t par = va_to_par((vaddr_t)va); + return (par & PADDR_MASK & PAGE_MASK) | ((vaddr_t) va & ~PAGE_MASK); } static inline void *maddr_to_virt(paddr_t ma) @@ -192,7 +192,7 @@ static inline void *maddr_to_virt(paddr_t ma) return (void *)(unsigned long) ma + XENHEAP_VIRT_START; } -static inline int gvirt_to_maddr(uint32_t va, paddr_t *pa) +static inline int gvirt_to_maddr(vaddr_t va, paddr_t *pa) { uint64_t par = gva_to_ma_par(va); if ( par & PAR_F ) -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |