drop the minix_ prefixes for mmap and munmap
also cleanup of various minix-specific changes, cleanup of mmap-related testing. Change-Id: I289a4fc50cf8a13df4a6082038d860853a4bd024
This commit is contained in:
@@ -570,7 +570,7 @@ static int m_block_ioctl(devminor_t minor, unsigned long request,
|
||||
size -= l;
|
||||
}
|
||||
size = rounddown(size, PAGE_SIZE);
|
||||
r = minix_munmap((void *) a, size);
|
||||
r = munmap((void *) a, size);
|
||||
if(r != OK) {
|
||||
printf("memory: WARNING: munmap failed: %d\n", r);
|
||||
}
|
||||
@@ -586,7 +586,7 @@ static int m_block_ioctl(devminor_t minor, unsigned long request,
|
||||
|
||||
/* Try to allocate a piece of memory for the RAM disk. */
|
||||
if(ramdev_size > 0 &&
|
||||
(mem = minix_mmap(NULL, ramdev_size, PROT_READ|PROT_WRITE,
|
||||
(mem = mmap(NULL, ramdev_size, PROT_READ|PROT_WRITE,
|
||||
MAP_PREALLOC|MAP_ANON, -1, 0)) == MAP_FAILED) {
|
||||
printf("MEM: failed to get memory for ramdisk\n");
|
||||
return(ENOMEM);
|
||||
|
||||
@@ -68,7 +68,7 @@ uds_open(devminor_t UNUSED(orig_minor), int access,
|
||||
* in use. We use mmap instead of malloc to allow the memory to be
|
||||
* actually freed later.
|
||||
*/
|
||||
if ((buf = minix_mmap(NULL, UDS_BUF, PROT_READ | PROT_WRITE,
|
||||
if ((buf = mmap(NULL, UDS_BUF, PROT_READ | PROT_WRITE,
|
||||
MAP_ANON | MAP_PRIVATE, -1, 0)) == MAP_FAILED)
|
||||
return ENOMEM;
|
||||
|
||||
@@ -166,7 +166,7 @@ uds_close(devminor_t minor)
|
||||
uds_clear_fds(minor, &uds_fd_table[minor].ancillary_data);
|
||||
|
||||
/* Release the memory for the ring buffer. */
|
||||
minix_munmap(uds_fd_table[minor].buf, UDS_BUF);
|
||||
munmap(uds_fd_table[minor].buf, UDS_BUF);
|
||||
|
||||
/* Set the socket back to its original UDS_FREE state. */
|
||||
memset(&uds_fd_table[minor], '\0', sizeof(uds_fd_t));
|
||||
|
||||
@@ -404,7 +404,7 @@ vnd_ioctl(devminor_t UNUSED(minor), unsigned long request, endpoint_t endpt,
|
||||
* of malloc to allow the memory to be actually freed later.
|
||||
*/
|
||||
if (r == OK) {
|
||||
state.buf = minix_mmap(NULL, VND_BUF_SIZE, PROT_READ |
|
||||
state.buf = mmap(NULL, VND_BUF_SIZE, PROT_READ |
|
||||
PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
|
||||
if (state.buf == MAP_FAILED)
|
||||
r = ENOMEM;
|
||||
@@ -432,7 +432,7 @@ vnd_ioctl(devminor_t UNUSED(minor), unsigned long request, endpoint_t endpt,
|
||||
}
|
||||
|
||||
if (r != OK) {
|
||||
minix_munmap(state.buf, VND_BUF_SIZE);
|
||||
munmap(state.buf, VND_BUF_SIZE);
|
||||
close(state.fd);
|
||||
state.fd = -1;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ vnd_ioctl(devminor_t UNUSED(minor), unsigned long request, endpoint_t endpt,
|
||||
* allow reuse until the device has been closed by the other
|
||||
* users.
|
||||
*/
|
||||
minix_munmap(state.buf, VND_BUF_SIZE);
|
||||
munmap(state.buf, VND_BUF_SIZE);
|
||||
close(state.fd);
|
||||
state.fd = -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user