diff options
| author | manuel <manuel@mausz.at> | 2012-03-27 13:42:57 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-27 13:42:57 +0200 |
| commit | 7fb872391351d87fb2a1b95cbfca320edc1f7bdd (patch) | |
| tree | 90f766a3483a9290b9dec88c2c84009222787cfe /userprog | |
| parent | d517f3d39142615ec3db9925f4db848d52817ebf (diff) | |
| download | progos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.tar.gz progos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.tar.bz2 progos-7fb872391351d87fb2a1b95cbfca320edc1f7bdd.zip | |
pass args to setup_stack
Diffstat (limited to 'userprog')
| -rw-r--r-- | userprog/process.c | 10 |
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 */ |
| 34 | static thread_func start_process NO_RETURN; | 34 | static thread_func start_process NO_RETURN; |
| 35 | static bool load (char *args, void (**eip) (void), void **esp); | 35 | static bool load (const char *args, void (**eip) (void), void **esp); |
| 36 | static bool setup_stack (void **esp); | 36 | static bool setup_stack (void **esp, const char *args); |
| 37 | static bool init_fd_table (struct fd_table * table); | 37 | static 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. */ |
| 356 | bool | 356 | bool |
| 357 | load (char *args, void (**eip) (void), void **esp) | 357 | load (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 */ |
| 591 | static bool | 591 | static bool |
| 592 | setup_stack (void **esp) | 592 | setup_stack (void **esp, const char *args) |
| 593 | { | 593 | { |
| 594 | uint8_t *kpage = NULL; | 594 | uint8_t *kpage = NULL; |
| 595 | 595 | ||
