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

Update process.c to standardise parameter names

parent 8f24f9f8
No related branches found
No related tags found
1 merge request!5Alex/6 implement populate stack process
...@@ -223,7 +223,7 @@ static bool load_segment (struct file *file, off_t ofs, uint8_t *upage, ...@@ -223,7 +223,7 @@ static bool load_segment (struct file *file, off_t ofs, uint8_t *upage,
and its initial stack pointer into *initial_stack_pointer. and its initial stack pointer into *initial_stack_pointer.
Returns true if successful, false otherwise. */ Returns true if successful, false otherwise. */
bool bool
load (const char *file_name, void (**eip) (void), void **initial_stack_pointer) load (const char *cmdline, void (**eip) (void), void **initial_stack_pointer)
{ {
struct thread *t = thread_current (); struct thread *t = thread_current ();
struct Elf32_Ehdr ehdr; struct Elf32_Ehdr ehdr;
...@@ -239,16 +239,16 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer) ...@@ -239,16 +239,16 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer)
process_activate (); process_activate ();
/* Open executable file. */ /* Open executable file. */
file = filesys_open (file_name); file = filesys_open (cmdline);
if (file == NULL) if (file == NULL)
{ {
printf ("load: %s: open failed\n", file_name); printf ("load: %s: open failed\n", cmdline);
goto done; goto done;
} }
/* Read and verify executable header. */ /* Read and verify executable header. */
if (file_read (file, &ehdr, sizeof ehdr) != sizeof ehdr if (cmdline (file, &ehdr, sizeof ehdr) != sizeof ehdr
|| memcmp (ehdr.e_ident, "\177ELF\1\1\1", 7) || memcmp (ehdr.e_ident, "\177ELF\1\1\1", 7)
|| ehdr.e_type != 2 || ehdr.e_type != 2
|| ehdr.e_machine != 3 || ehdr.e_machine != 3
...@@ -256,7 +256,7 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer) ...@@ -256,7 +256,7 @@ load (const char *file_name, void (**eip) (void), void **initial_stack_pointer)
|| ehdr.e_phentsize != sizeof (struct Elf32_Phdr) || ehdr.e_phentsize != sizeof (struct Elf32_Phdr)
|| ehdr.e_phnum > 1024) || ehdr.e_phnum > 1024)
{ {
printf ("load: %s: error loading executable\n", file_name); printf ("load: %s: error loading executable\n", cmdline);
goto done; goto done;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment