Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Shen, Siran
Pintos
Commits
008875c5
Commit
008875c5
authored
Dec 11, 2020
by
Pan Taixi
Browse files
more load details
parent
ff66395c
Pipeline
#192263
failed with stages
in 5 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/vm/page.c
View file @
008875c5
...
...
@@ -49,11 +49,12 @@ bool spmtpt_entry_init(struct spmt_pt_entry *entry, void *upage, bool writable,
return
false
;
}
lock_acquire
(
&
e
->
modify_lock
);
e
->
upage
=
entry
->
upage
;
e
->
status
=
entry
->
status
;
e
->
t
=
t
;
e
->
is_dirty
=
false
;
e
->
writable
=
writable
||
e
->
writable
;
e
->
writable
=
writable
||
entry
->
writable
;
e
->
page_read_bytes
=
entry
->
page_read_bytes
;
e
->
page_zero_bytes
=
entry
->
page_zero_bytes
;
e
->
current_offset
=
entry
->
current_offset
;
lock_release
(
&
e
->
modify_lock
);
return
true
;
}
...
...
@@ -249,6 +250,8 @@ bool load_page_lazy(struct file *file, off_t ofs, uint8_t *upage,
struct
spmt_pt_entry
*
e
=
(
struct
spmt_pt_entry
*
)
malloc
(
sizeof
(
struct
spmt_pt_entry
));
spmtpt_fill_in_load_details
(
e
,
page_read_bytes
,
page_zero_bytes
,
current_offset
,
file
);
// There must not be any identical entry
if
(
!
spmtpt_entry_init
(
e
,
upage
,
writable
,
IN_FILE
,
t
))
{
spmtpt_entry_free
(
&
e
->
t
->
spmt_pt
,
e
);
...
...
@@ -256,8 +259,6 @@ bool load_page_lazy(struct file *file, off_t ofs, uint8_t *upage,
return
false
;
}
spmtpt_fill_in_load_details
(
e
,
page_read_bytes
,
page_zero_bytes
,
current_offset
,
file
);
*
entry
=
e
;
return
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment