Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Miosix 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
Avionics
Software Development
Miosix Kernel
Commits
394650fb
Commit
394650fb
authored
5 months ago
by
Federico
Browse files
Options
Downloads
Patches
Plain Diff
Comment MPU configuration
parent
280328b6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
+8
-0
8 additions, 0 deletions
miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
with
8 additions
and
0 deletions
miosix/arch/cpu/armv7m/interfaces-impl/userspace_impl.h
+
8
−
0
View file @
394650fb
...
@@ -120,6 +120,9 @@ inline void MPUConfiguration::IRQenable()
...
@@ -120,6 +120,9 @@ inline void MPUConfiguration::IRQenable()
MPU
->
RASR
=
regValues
[
1
];
MPU
->
RASR
=
regValues
[
1
];
MPU
->
RBAR
=
regValues
[
2
];
MPU
->
RBAR
=
regValues
[
2
];
MPU
->
RASR
=
regValues
[
3
];
MPU
->
RASR
=
regValues
[
3
];
// Set bit 0 of CONTROL register to switch thread mode to unprivileged. When
// we'll return from the interrupt the MPU will check the access permissions
// for unprivileged processes which only allow access to regions 6 and 7
__set_CONTROL
(
3
);
__set_CONTROL
(
3
);
#endif //__MPU_PRESENT==1
#endif //__MPU_PRESENT==1
}
}
...
@@ -127,6 +130,11 @@ inline void MPUConfiguration::IRQenable()
...
@@ -127,6 +130,11 @@ inline void MPUConfiguration::IRQenable()
inline
void
MPUConfiguration
::
IRQdisable
()
inline
void
MPUConfiguration
::
IRQdisable
()
{
{
#if __MPU_PRESENT==1
#if __MPU_PRESENT==1
// Clear bit 0 of CONTROL register to switch thread mode to privileged. When
// we'll return from the interrupt the MPU will check the access permissions
// for privileged processes which includes the default memory map as we set
// MPU_CTRL_PRIVDEFENA at boot plus additional regions to set constraints
// such as cacheability. Thus we never truly disable the MPU.
__set_CONTROL
(
2
);
__set_CONTROL
(
2
);
#endif //__MPU_PRESENT==1
#endif //__MPU_PRESENT==1
}
}
...
...
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