Files
pintos_22/src/vm/mmap.h

25 lines
673 B
C

#ifndef VM_MMAP_H
#define VM_MMAP_H
#include <hash.h>
#include "threads/thread.h"
#include "filesys/file.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. */
};
bool mmap_init (void);
struct mmap_entry *mmap_insert (struct file *file, void *upage);
void mmap_destroy (void);
#endif /* vm/mmap.h */