Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
redox-os
kernel
Commits
7a3b453f
Verified
Commit
7a3b453f
authored
1 year ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Declare __usercopy_{start,end} as functions.
parent
4d2cd6ce
No related branches found
No related tags found
1 merge request
!238
Demand paging
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/arch/x86_64/paging/mod.rs
+2
-5
2 additions, 5 deletions
src/arch/x86_64/paging/mod.rs
src/lib.rs
+1
-1
1 addition, 1 deletion
src/lib.rs
with
3 additions
and
6 deletions
src/arch/x86_64/paging/mod.rs
+
2
−
5
View file @
7a3b453f
...
@@ -19,6 +19,7 @@ pub use super::CurrentRmmArch as RmmA;
...
@@ -19,6 +19,7 @@ pub use super::CurrentRmmArch as RmmA;
pub
type
PageMapper
=
rmm
::
PageMapper
<
RmmA
,
crate
::
arch
::
rmm
::
LockedAllocator
>
;
pub
type
PageMapper
=
rmm
::
PageMapper
<
RmmA
,
crate
::
arch
::
rmm
::
LockedAllocator
>
;
use
crate
::
context
::
memory
::{
AccessMode
,
try_correcting_page_tables
,
PfError
};
use
crate
::
context
::
memory
::{
AccessMode
,
try_correcting_page_tables
,
PfError
};
use
crate
::
interrupt
::
InterruptStack
;
use
crate
::
interrupt
::
InterruptStack
;
use
crate
::
kernel_executable_offsets
::{
__usercopy_end
,
__usercopy_start
};
pub
use
crate
::
rmm
::
KernelMapper
;
pub
use
crate
::
rmm
::
KernelMapper
;
pub
mod
entry
;
pub
mod
entry
;
...
@@ -145,11 +146,7 @@ pub struct Segv;
...
@@ -145,11 +146,7 @@ pub struct Segv;
pub
fn
page_fault_handler
(
stack
:
&
mut
InterruptStack
,
code
:
PageFaultError
,
faulting_address
:
VirtualAddress
)
->
Result
<
(),
Segv
>
{
pub
fn
page_fault_handler
(
stack
:
&
mut
InterruptStack
,
code
:
PageFaultError
,
faulting_address
:
VirtualAddress
)
->
Result
<
(),
Segv
>
{
let
faulting_page
=
Page
::
containing_address
(
faulting_address
);
let
faulting_page
=
Page
::
containing_address
(
faulting_address
);
extern
"C"
{
let
usercopy_region
=
__usercopy_start
()
..
__usercopy_end
();
static
__usercopy_start
:
u8
;
static
__usercopy_end
:
u8
;
}
let
usercopy_region
=
unsafe
{
(
&
__usercopy_start
as
*
const
u8
as
usize
)
..
(
&
__usercopy_end
as
*
const
u8
as
usize
)
};
// TODO: Most likely not necessary, but maybe also check that cr2 is not too close to USER_END.
// TODO: Most likely not necessary, but maybe also check that cr2 is not too close to USER_END.
let
address_is_user
=
faulting_address
.kind
()
==
TableKind
::
User
;
let
address_is_user
=
faulting_address
.kind
()
==
TableKind
::
User
;
...
...
This diff is collapsed.
Click to expand it.
src/lib.rs
+
1
−
1
View file @
7a3b453f
...
@@ -294,5 +294,5 @@ macro_rules! linker_offsets(
...
@@ -294,5 +294,5 @@ macro_rules! linker_offsets(
}
}
);
);
pub
mod
kernel_executable_offsets
{
pub
mod
kernel_executable_offsets
{
linker_offsets!
(
__text_start
,
__text_end
,
__rodata_start
,
__rodata_end
,
__data_start
,
__data_end
,
__bss_start
,
__bss_end
,
__tdata_start
,
__tdata_end
,
__tbss_start
,
__tbss_end
);
linker_offsets!
(
__text_start
,
__text_end
,
__rodata_start
,
__rodata_end
,
__data_start
,
__data_end
,
__bss_start
,
__bss_end
,
__tdata_start
,
__tdata_end
,
__tbss_start
,
__tbss_end
,
__usercopy_start
,
__usercopy_end
);
}
}
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