Diff for /qemu/bsd-user/mmap.c between versions 1.1.1.3 and 1.1.1.4

version 1.1.1.3, 2018/04/24 17:42:44 version 1.1.1.4, 2018/04/24 18:33:03
Line 77  void mmap_unlock(void) Line 77  void mmap_unlock(void)
 void *qemu_vmalloc(size_t size)  void *qemu_vmalloc(size_t size)
 {  {
     void *p;      void *p;
     unsigned long addr;  
     mmap_lock();      mmap_lock();
     /* Use map and mark the pages as used.  */      /* Use map and mark the pages as used.  */
     p = mmap(NULL, size, PROT_READ | PROT_WRITE,      p = mmap(NULL, size, PROT_READ | PROT_WRITE,
              MAP_PRIVATE | MAP_ANON, -1, 0);               MAP_PRIVATE | MAP_ANON, -1, 0);
   
     addr = (unsigned long)p;      if (h2g_valid(p)) {
     if (addr == (target_ulong) addr) {  
         /* Allocated region overlaps guest address space.          /* Allocated region overlaps guest address space.
            This may recurse.  */             This may recurse.  */
           abi_ulong addr = h2g(p);
         page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),          page_set_flags(addr & TARGET_PAGE_MASK, TARGET_PAGE_ALIGN(addr + size),
                        PAGE_RESERVED);                         PAGE_RESERVED);
     }      }
Line 240  static int mmap_frag(abi_ulong real_star Line 239  static int mmap_frag(abi_ulong real_star
            possible while it is a shared mapping */             possible while it is a shared mapping */
         if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&          if ((flags & TARGET_BSD_MAP_FLAGMASK) == MAP_SHARED &&
             (prot & PROT_WRITE))              (prot & PROT_WRITE))
             return -EINVAL;              return -1;
   
         /* adjust protection to be able to read */          /* adjust protection to be able to read */
         if (!(prot1 & PROT_WRITE))          if (!(prot1 & PROT_WRITE))

Removed from v.1.1.1.3  
changed lines
  Added in v.1.1.1.4


unix.superglobalmegacorp.com