xen: arm: use vaddr_t more widely.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
This commit is contained in:
Ian Campbell committed 2013-02-22 12:14:53 +00:00
1 parent 482b00b90e
commit d923f41efe
3 files changed
+13 -11

No files matched your search

+9 -7
View File
@@ -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);
+1 -1
View File
@@ -26,7 +26,7 @@
typedef struct
{
struct hsr_dabt dabt;
uint32_t gva;
vaddr_t gva;
paddr_t gpa;
} mmio_info_t;
+3 -3
View File
@@ -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 )
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.