Refactor frame to add spacing and exception for indentation to follow pintos styling

This commit is contained in:
sBubshait
2024-12-06 18:27:50 +00:00
parent d039b59b7c
commit 5fbabdcec9
2 changed files with 8 additions and 5 deletions

View File

@@ -181,11 +181,11 @@ page_fault (struct intr_frame *f)
/* If the page fault occurred in kernel mode, then we intentionally indicate /* If the page fault occurred in kernel mode, then we intentionally indicate
a fault (for get_user() etc). */ a fault (for get_user() etc). */
if (!user) if (!user)
{ {
f->eip = (void *)f->eax; f->eip = (void *)f->eax;
f->eax = 0xffffffff; f->eax = 0xffffffff;
return; return;
} }
/* To implement virtual memory, delete the rest of the function /* To implement virtual memory, delete the rest of the function

View File

@@ -241,6 +241,7 @@ frame_owner_insert (void *frame, struct thread *owner)
struct frame_owner *frame_owner = malloc (sizeof (struct frame_owner)); struct frame_owner *frame_owner = malloc (sizeof (struct frame_owner));
if (frame_owner == NULL) if (frame_owner == NULL)
return false; return false;
frame_owner->owner = owner; frame_owner->owner = owner;
list_push_back (&frame_metadata->owners, &frame_owner->elem); list_push_back (&frame_metadata->owners, &frame_owner->elem);
return true; return true;
@@ -263,6 +264,7 @@ frame_owner_remove (void *frame, struct thread *owner)
{ {
struct frame_owner *frame_owner struct frame_owner *frame_owner
= list_entry (oe, struct frame_owner, elem); = list_entry (oe, struct frame_owner, elem);
oe = list_next (oe); oe = list_next (oe);
if (frame_owner->owner == owner) if (frame_owner->owner == owner)
{ {
@@ -284,6 +286,7 @@ frame_metadata_find (void *frame)
struct hash_elem *e = hash_find (&frame_table, &key_metadata.hash_elem); struct hash_elem *e = hash_find (&frame_table, &key_metadata.hash_elem);
if (e == NULL) if (e == NULL)
return NULL; return NULL;
return hash_entry (e, struct frame_metadata, hash_elem); return hash_entry (e, struct frame_metadata, hash_elem);
} }