From abd273ce0a9ae9267f8b0a144ea9b56d8912f9b5 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 19 Jun 2012 23:31:28 +0200 Subject: add dynamic stack growing --- vm/page.h | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'vm/page.h') diff --git a/vm/page.h b/vm/page.h index 29159fb..9cea048 100644 --- a/vm/page.h +++ b/vm/page.h @@ -8,32 +8,33 @@ /* supplemental page table entry */ struct page_table_entry { - void *uvaddr; - bool loaded; + void *upage; /* virtual address of page */ + bool loaded; /* indicates if page is loaded */ enum - { - PAGE_SEGMENT, - PAGE_MEMORY_MAPPED_FILE, - } type; + { + PAGE_SEGMENT, + PAGE_MEMORY_MAPPED_FILE, + } type; /* type of page */ union - { - struct segment { - struct file *file; - off_t ofs; - uint32_t read_bytes; - uint32_t zero_bytes; - bool writable; - } segment; - }; + /* structure needed for lazy loading of data segments */ + struct segment + { + struct file *file; + off_t ofs; + uint32_t read_bytes; + uint32_t zero_bytes; + bool writable; + } segment; + }; - struct hash_elem elem; + struct hash_elem elem; /* Hash element. */ }; void page_table_init (struct hash *ht); void page_table_free (struct hash *ht); -struct page_table_entry *page_table_fetch (struct hash *ht, void *uvaddr); +struct page_table_entry *page_table_fetch (struct hash *ht, void *upage); bool page_table_insert_segment (struct file *file, off_t ofs, uint8_t *upage, uint32_t read_bytes, uint32_t zero_bytes, bool writable); bool page_load (struct page_table_entry *pte); -- cgit v1.2.3