Update syscall handling of invalid pointers by preloading pages using the helper try_fetch_page

This commit is contained in:
sBubshait
2024-11-29 18:55:28 +00:00
parent d047a3c242
commit 8047c65227
3 changed files with 30 additions and 13 deletions

View File

@@ -1,6 +1,8 @@
#ifndef USERPROG_EXCEPTION_H
#define USERPROG_EXCEPTION_H
#include <stdbool.h>
/* Page fault error code bits that describe the cause of the exception. */
#define PF_P 0x1 /* 0: not-present page. 1: access rights violation. */
#define PF_W 0x2 /* 0: read, 1: write. */
@@ -8,5 +10,7 @@
void exception_init (void);
void exception_print_stats (void);
bool
try_fetch_page (void *upage, bool write);
#endif /* userprog/exception.h */