#include "main.h" #include "tlb.h" /* The VM system is composed of three segments: * text, data, and stack * * Before execution of the program starts, mipsi calls mt_vm_initialize * with the range of addresses that are valid for the text, data, * and stack segments. Any virtual address needs to be in the * ranges specified by this call. Any virtual address outside these * ranges can be considered an invalid address. Accesses to invalid * addresses should cause the system to print out an error message * and die. */ /* initialize the segments for the VM system */ void mt_vm_initialize(unsigned min_text_addr, unsigned max_text_addr, unsigned min_stack_addr, unsigned max_stack_addr, unsigned min_data_addr, unsigned max_data_addr) { } /* Convert the virtual page to a physical page and set the flags. * If a page fault occurs, handle it. */ PTE mt_tlb_translate_fault(unsigned long vpage) { unsigned flags,ppage; /* body goes here */ return TLB_MAKE_PTE(ppage,flags); } /* A write fault occured at this virtual page. The expected return * value is a new value for the protection flags for this virtual * page. */ unsigned long mt_tlb_write_fault(unsigned long vpage) { unsigned flags; /* body goes here */ return flags; }