vfs: mmap support
. libc: add vfs_mmap, a way for vfs to initiate mmap()s. This is a good special case to have as vfs is a slightly different client from regular user processes. It doesn't do it for itself, and has the dev & inode info already so the callback to VFS for the lookup isn't necessary. So it has different info to have to give to VM. . libc: also add minix_mmap64() that accepts a 64-bit offset, even though our off_t is still 32 bit now. . On exec() time, try to mmap() in the executable if available. (It is not yet available in this commit.) . To support mmap(), add do_vm_call that allows VM to lookup (to ino+dev), do i/o from and close FD's on behalf of other processes. Change-Id: I831551e45a6781c74313c450eb9c967a68505932
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#define NCALLS 117 /* number of system calls allowed */
|
||||
#define NCALLS 118 /* number of system calls allowed */
|
||||
|
||||
/* In case it isn't obvious enough: this list is sorted numerically. */
|
||||
#define EXIT 1
|
||||
@@ -107,6 +107,8 @@
|
||||
#define CLOCK_GETTIME 115 /* clock_gettime() */
|
||||
#define CLOCK_SETTIME 116 /* clock_settime() */
|
||||
|
||||
#define VFS_VMCALL 117
|
||||
|
||||
#define TASK_REPLY 121 /* to VFS: reply code from drivers, not
|
||||
* really a standalone call.
|
||||
*/
|
||||
|
||||
@@ -1005,6 +1005,7 @@
|
||||
# define VMV_DEV m10_i4
|
||||
# define VMV_INO m10_l1
|
||||
# define VMV_FD m10_l2
|
||||
# define VMV_SIZE_PAGES m10_l3
|
||||
|
||||
#define VM_REMAP (VM_RQ_BASE+33)
|
||||
# define VMRE_D m1_i1
|
||||
@@ -1075,8 +1076,10 @@
|
||||
|
||||
#define VMPPARAM_CLEAR 1 /* values for VMPCTL_PARAM */
|
||||
|
||||
#define VM_VFS_MMAP (VM_RQ_BASE+46)
|
||||
|
||||
/* Total. */
|
||||
#define NR_VM_CALLS 46
|
||||
#define NR_VM_CALLS 47
|
||||
#define VM_CALL_MASK_SIZE BITMAP_CHUNKS(NR_VM_CALLS)
|
||||
|
||||
/* not handled as a normal VM call, thus at the end of the reserved rage */
|
||||
@@ -1086,8 +1089,8 @@
|
||||
|
||||
/* Basic vm calls allowed to every process. */
|
||||
#define VM_BASIC_CALLS \
|
||||
VM_MMAP, VM_MUNMAP, VM_MAP_PHYS, VM_UNMAP_PHYS, \
|
||||
VM_INFO, VM_MAPCACHEPAGE
|
||||
VM_MMAP, VM_VFS_REPLY, VM_MUNMAP, VM_MAP_PHYS, VM_UNMAP_PHYS, \
|
||||
VM_INFO
|
||||
|
||||
/*===========================================================================*
|
||||
* Messages for IPC server *
|
||||
|
||||
@@ -26,6 +26,14 @@ int vm_forgetblock(u64_t id);
|
||||
void vm_forgetblocks(void);
|
||||
int vm_yield_block_get_block(u64_t yieldid, u64_t getid, void *mem,
|
||||
vir_bytes len);
|
||||
int minix_vfs_mmap(endpoint_t who, u32_t offset, u32_t len,
|
||||
u32_t dev, u32_t ino, u16_t fd, u32_t vaddr, u16_t clearend, u16_t
|
||||
flags);
|
||||
|
||||
/* minix vfs mmap flags */
|
||||
#define MVM_LENMASK 0x0FFF
|
||||
#define MVM_FLAGSMASK 0xF000
|
||||
#define MVM_WRITABLE 0x8000
|
||||
|
||||
/* Invalid ID with special meaning for the vm_yield_block_get_block
|
||||
* interface.
|
||||
|
||||
Reference in New Issue
Block a user