Add data structures for shared executable files along with helper methods for them, w/ G

This commit is contained in:
sBubshait
2024-11-30 01:15:50 +00:00
parent 8047c65227
commit ba72345f96
3 changed files with 131 additions and 9 deletions

View File

@@ -23,6 +23,21 @@ struct page_entry {
struct hash_elem elem; /* An elem for the hash table. */
};
struct shared_file_entry {
struct file *file; /* Pointer to the file. */
struct hash pages;
int ref_count;
struct hash_elem elem;
};
struct shared_page_entry {
void *upage;
void *frame;
struct hash_elem elem;
};
unsigned page_hash (const struct hash_elem *e, void *aux);
bool page_less (const struct hash_elem *a_, const struct hash_elem *b_,
void *aux);