usbfuzz-afl/qemu_mode/qemu/contrib/libvhost-user/libvhost-user.c
/* Translate qemu virtual address to our virtual address.  */
Translate qemu virtual address to our virtual address.
Translate qemu virtual address to our virtual address .
static void *
qva_to_va(VuDev *dev, uint64_t qemu_addr)
{
    int i;
    for (i = 0; i < dev->nregions; i++) {
        VuDevRegion *r = &dev->regions[i];
        if ((qemu_addr >= r->qva) && (qemu_addr < (r->qva + r->size))) {
            return (void *)(uintptr_t)
                qemu_addr - r->qva + r->mmap_addr + r->mmap_offset;
        }
    }
    return NULL;
}
static void * qva_to_va ( VuDev * dev , uint64_t qemu_addr ) { int i ; for ( i = 0 ; i < dev -> nregions ; i ++ ) { VuDevRegion * r = & dev -> regions [ i ] ; if ( ( qemu_addr >= r -> qva ) && ( qemu_addr < ( r -> qva + r -> size ) ) ) { return ( void * ) ( uintptr_t ) qemu_addr - r -> qva + r -> mmap_addr + r -> mmap_offset ; } } return NULL ; }
Translate qemu virtual address to our virtual address.
Translate qemu virtual address to our virtual address .
/* Find matching memory region.  */