Add mmap module in vm defining mmap_entry structure and some helper functions
This commit is contained in:
1
src/vm/mmap.c
Normal file
1
src/vm/mmap.c
Normal file
@@ -0,0 +1 @@
|
||||
#include "mmap.h"
|
||||
18
src/vm/mmap.h
Normal file
18
src/vm/mmap.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef VM_MMAP_H
|
||||
#define VM_MMAP_H
|
||||
|
||||
#include <hash.h>
|
||||
|
||||
/* A mapping identifier type. */
|
||||
typedef unsigned mapid_t;
|
||||
|
||||
/* A structure to represent a memory mapped file. */
|
||||
struct mmap_entry {
|
||||
mapid_t mapping; /* The mapping identifier of the mapped file. */
|
||||
struct file *file; /* A pointer to the file that is being mapped. */
|
||||
void *upage; /* The start address of the file data in the user VM. */
|
||||
|
||||
struct hash_elem elem; /* An elem for the hash table. */
|
||||
};
|
||||
|
||||
#endif /* vm/mmap.h */
|
||||
Reference in New Issue
Block a user