Skip to content
Snippets Groups Projects
Commit 5eef1694 authored by a2-stratford's avatar a2-stratford
Browse files

Updated names, added dependencies

parent 103bbeb9
No related branches found
No related tags found
1 merge request!5Alex/6 implement populate stack process
/*
* populates_stack.c --implements function for populating the program stack
*
*
* Authored by Alex Stratford
*/
#include "threads/vaddr.h"
#include "userprog/argument_parsing.h" #include "userprog/argument_parsing.h"
...@@ -40,6 +48,7 @@ void populate_stack(void* stackPointer, int argc, char** argv) { ...@@ -40,6 +48,7 @@ void populate_stack(void* stackPointer, int argc, char** argv) {
(*(int *)(*stackPointer)) = 0; (*(int *)(*stackPointer)) = 0;
} }
// Adds the move value to the stack pointer
int move_stack_pointer(void* stackPointer, int moveValue) { int move_stack_pointer(void* stackPointer, int moveValue) {
*stackPointer = *stackPointer + moveValue; *stackPointer = *stackPointer + moveValue;
return *stackPointer; return *stackPointer;
......
...@@ -456,6 +456,7 @@ setup_stack (void **initialStackPointer, char **argv, int argc) ...@@ -456,6 +456,7 @@ setup_stack (void **initialStackPointer, char **argv, int argc)
success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true); success = install_page (((uint8_t *) PHYS_BASE) - PGSIZE, kpage, true);
if (success) { if (success) {
*initialStackPointer = PHYS_BASE - 12; *initialStackPointer = PHYS_BASE - 12;
arr[]
} else } else
palloc_free_page (kpage); palloc_free_page (kpage);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment