ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/vm_alloc.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/vm_alloc.cpp (file contents):
Revision 1.6 by gbeauche, 2002-02-11T14:28:02Z vs.
Revision 1.7 by gbeauche, 2002-03-16T10:51:17Z

# Line 96 | Line 96 | void * vm_acquire(size_t size)
96                  return VM_MAP_FAILED;
97   #else
98   #ifdef HAVE_MMAP_VM
99 <        if ((addr = mmap(next_address, size, VM_PAGE_DEFAULT, map_flags, zero_fd, 0)) == MAP_FAILED)
99 >        if ((addr = mmap((caddr_t)next_address, size, VM_PAGE_DEFAULT, map_flags, zero_fd, 0)) == MAP_FAILED)
100                  return VM_MAP_FAILED;
101          
102          next_address = (char *)addr + size;
# Line 132 | Line 132 | int vm_acquire_fixed(void * addr, size_t
132                  return -1;
133   #else
134   #ifdef HAVE_MMAP_VM
135 <        if (mmap(addr, size, VM_PAGE_DEFAULT, map_flags | MAP_FIXED, zero_fd, 0) == MAP_FAILED)
135 >        if (mmap((caddr_t)addr, size, VM_PAGE_DEFAULT, map_flags | MAP_FIXED, zero_fd, 0) == MAP_FAILED)
136                  return -1;
137          
138          // Since I don't know the standard behavior of mmap(), zero-fill here
# Line 166 | Line 166 | int vm_release(void * addr, size_t size)
166                  return -1;
167   #else
168   #ifdef HAVE_MMAP_VM
169 <        if (munmap(addr, size) != 0)
169 >        if (munmap((caddr_t)addr, size) != 0)
170                  return -1;
171   #else
172          free(addr);
# Line 186 | Line 186 | int vm_protect(void * addr, size_t size,
186          return ret_code == KERN_SUCCESS ? 0 : -1;
187   #else
188   #ifdef HAVE_MMAP_VM
189 <        int ret_code = mprotect(addr, size, prot);
189 >        int ret_code = mprotect((caddr_t)addr, size, prot);
190          return ret_code == 0 ? 0 : -1;
191   #else
192          // Unsupported

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines