Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pintos
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Project Purple Stallion
Pintos
Commits
01b774d9
Commit
01b774d9
authored
5 years ago
by
a2-stratford
Browse files
Options
Downloads
Patches
Plain Diff
Update process.c to standardise parameter names
parent
8f24f9f8
No related branches found
No related tags found
1 merge request
!5
Alex/6 implement populate stack process
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
userprog/process.c
+5
-5
5 additions, 5 deletions
userprog/process.c
with
5 additions
and
5 deletions
userprog/process.c
+
5
−
5
View file @
01b774d9
...
@@ -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_nam
e
,
void
(
**
eip
)
(
void
),
void
**
initial_stack_pointer
)
load
(
const
char
*
cmdlin
e
,
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_nam
e
);
file
=
filesys_open
(
cmdlin
e
);
if
(
file
==
NULL
)
if
(
file
==
NULL
)
{
{
printf
(
"load: %s: open failed
\n
"
,
file_nam
e
);
printf
(
"load: %s: open failed
\n
"
,
cmdlin
e
);
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
,
"
\177
ELF
\1\1\1
"
,
7
)
||
memcmp
(
ehdr
.
e_ident
,
"
\177
ELF
\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_nam
e
);
printf
(
"load: %s: error loading executable
\n
"
,
cmdlin
e
);
goto
done
;
goto
done
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment