Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Shetty Yttehs
OSKernel2024-MikuOS
Commits
0064a4a0
Commit
0064a4a0
authored
3 months ago
by
Shetty Yttehs
Browse files
Options
Download
Patches
Plain Diff
chore: make clippy happy
parent
6421be85
main
comm
doc
ext4-fs
fs
miku-fs
mm
process
refactor-mm
submit
test-env
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/src/mm/page_table/mod.rs
+4
-5
kernel/src/mm/page_table/mod.rs
with
4 additions
and
5 deletions
+4
-5
kernel/src/mm/page_table/mod.rs
+
4
−
5
View file @
0064a4a0
...
...
@@ -12,11 +12,10 @@ pub fn translate_ptr(satp: usize, ptr: *const u8) -> Option<*const u8> {
let
page_table
=
PageTable
::
from_satp
(
satp
);
let
va
=
VirtAddr
(
ptr
as
usize
);
let
offset
=
va
.page_offset
();
if
let
Some
(
pte
)
=
page_table
.translate
(
va
.to_vpn_floor
())
{
Some
((
pte
.ppn
()
.0
+
offset
)
as
*
const
u8
)
}
else
{
None
}
page_table
.translate
(
va
.to_vpn_floor
())
.map
(|
pte
|
{
let
pa
=
pte
.ppn
()
.to_pa
();
(
pa
.0
+
offset
)
as
*
const
u8
})
}
pub
fn
translate_bype_buffer
(
satp
:
usize
,
ptr
:
*
const
u8
,
len
:
usize
)
->
Vec
<&
'static
mut
[
u8
]
>
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets