From 7fb872391351d87fb2a1b95cbfca320edc1f7bdd Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 13:42:57 +0200 Subject: pass args to setup_stack --- userprog/process.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'userprog/process.c') 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; /* prototypes */ static thread_func start_process NO_RETURN; -static bool load (char *args, void (**eip) (void), void **esp); -static bool setup_stack (void **esp); +static bool load (const char *args, void (**eip) (void), void **esp); +static bool setup_stack (void **esp, const char *args); static bool init_fd_table (struct fd_table * table); /* Initialize the filesystem lock */ @@ -354,7 +354,7 @@ static bool load_segment (struct file *file, off_t ofs, uint8_t *upage, and its initial stack pointer into *ESP. Returns true if successful, false otherwise. */ bool -load (char *args, void (**eip) (void), void **esp) +load (const char *args, void (**eip) (void), void **esp) { struct thread *t = thread_current (); struct Elf32_Ehdr ehdr; @@ -457,7 +457,7 @@ load (char *args, void (**eip) (void), void **esp) } /* Set up stack. */ - if (!setup_stack (esp)) + if (!setup_stack (esp, args)) goto done; /* Start address. */ @@ -589,7 +589,7 @@ load_segment (struct file *file, off_t ofs, uint8_t *upage, You will implement this function in the Project 0. Consider using `hex_dump` for debugging purposes */ static bool -setup_stack (void **esp) +setup_stack (void **esp, const char *args) { uint8_t *kpage = NULL; -- cgit v1.2.3