From 05a48cf9c6710908b6bff7fcc78ba475e88739f6 Mon Sep 17 00:00:00 2001 From: Themis Demetriades Date: Sun, 1 Dec 2024 23:36:55 +0000 Subject: [PATCH] refactor: page fault exception handler follows code style --- src/userprog/exception.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/userprog/exception.c b/src/userprog/exception.c index 1fcbe61..2e812ec 100644 --- a/src/userprog/exception.c +++ b/src/userprog/exception.c @@ -148,17 +148,18 @@ page_fault (struct intr_frame *f) if (user && not_present) { - if (try_alloc_new_page (fault_addr, f->esp)) + if (try_alloc_new_page (fault_addr, f->esp)) return; } else { if (try_alloc_new_page (fault_addr, thread_current ()->curr_esp)) return; - f->eip = (void *)f->eax; + + f->eip = (void *)f->eax; f->eax = 0xffffffff; return; - } + } /* To implement virtual memory, delete the rest of the function body, and replace it with code that brings in the page to