summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormanuel <manuel@mausz.at>2012-03-27 13:42:57 +0200
committermanuel <manuel@mausz.at>2012-03-27 13:42:57 +0200
commit7fb872391351d87fb2a1b95cbfca320edc1f7bdd (patch)
tree90f766a3483a9290b9dec88c2c84009222787cfe
parentd517f3d39142615ec3db9925f4db848d52817ebf (diff)
downloadprogos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.tar.gz
progos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.tar.bz2
progos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.zip
pass args to setup_stack
-rw-r--r--userprog/process.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/userprog/process.c b/userprog/process.c
index af7e0b3..8b6b86a 100644
--- a/userprog/process.c
+++ b/userprog/process.c
@@ -32,8 +32,8 @@ struct lock filesys_lock;
32 32
33/* prototypes */ 33/* prototypes */
34static thread_func start_process NO_RETURN; 34static thread_func start_process NO_RETURN;
35static bool load (char *args, void (**eip) (void), void **esp); 35static bool load (const char *args, void (**eip) (void), void **esp);
36static bool setup_stack (void **esp); 36static bool setup_stack (void **esp, const char *args);
37static bool init_fd_table (struct fd_table * table); 37static bool init_fd_table (struct fd_table * table);
38 38
39/* Initialize the filesystem lock */ 39/* Initialize the filesystem lock */
@@ -354,7 +354,7 @@ static bool load_segment (struct file *file, off_t ofs, uint8_t *upage,
354 and its initial stack pointer into *ESP. 354 and its initial stack pointer into *ESP.
355 Returns true if successful, false otherwise. */ 355 Returns true if successful, false otherwise. */
356bool 356bool
357load (char *args, void (**eip) (void), void **esp) 357load (const char *args, void (**eip) (void), void **esp)
358{ 358{
359 struct thread *t = thread_current (); 359 struct thread *t = thread_current ();
360 struct Elf32_Ehdr ehdr; 360 struct Elf32_Ehdr ehdr;
@@ -457,7 +457,7 @@ load (char *args, void (**eip) (void), void **esp)
457 } 457 }
458 458
459 /* Set up stack. */ 459 /* Set up stack. */
460 if (!setup_stack (esp)) 460 if (!setup_stack (esp, args))
461 goto done; 461 goto done;
462 462
463 /* Start address. */ 463 /* Start address. */
@@ -589,7 +589,7 @@ load_segment (struct file *file, off_t ofs, uint8_t *upage,
589 You will implement this function in the Project 0. 589 You will implement this function in the Project 0.
590 Consider using `hex_dump` for debugging purposes */ 590 Consider using `hex_dump` for debugging purposes */
591static bool 591static bool
592setup_stack (void **esp) 592setup_stack (void **esp, const char *args)
593{ 593{
594 uint8_t *kpage = NULL; 594 uint8_t *kpage = NULL;
595 595