Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenSK
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
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
koenigl2
OpenSK
Commits
88920035
Commit
88920035
authored
4 years ago
by
Julien Cretin
Browse files
Options
Downloads
Patches
Plain Diff
Permit the app to read the storage
parent
892f950c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
patches/tock/01-persistent-storage.patch
+36
-0
36 additions, 0 deletions
patches/tock/01-persistent-storage.patch
with
36 additions
and
0 deletions
patches/tock/01-persistent-storage.patch
+
36
−
0
View file @
88920035
...
...
@@ -277,3 +277,39 @@ index 5abd2d84..5a726fdb 100644
+ }
+ }
+}
diff --git a/kernel/src/process.rs b/kernel/src/process.rs
index eb00f274..35c19d15 100644
--- a/kernel/src/process.rs
+++ b/kernel/src/process.rs
@@ -1604,6 +1604,31 @@
impl<C: 'static + Chip> Process<'a, C> {
return Ok((None, 0));
}
+ // Allocate MPU region for storage.
+ const STORAGE_PTR: usize = 0xc0000;
+ const STORAGE_LEN: usize = 0x40000;
+ if chip
+ .mpu()
+ .allocate_region(
+ STORAGE_PTR as *const u8,
+ STORAGE_LEN,
+ STORAGE_LEN,
+ mpu::Permissions::ReadOnly,
+ &mut mpu_config,
+ )
+ .is_none()
+ {
+ if config::CONFIG.debug_load_processes {
+ debug!(
+ "[!] flash=[{:#010X}:{:#010X}] process={:?} - couldn't allocate flash region",
+ STORAGE_PTR,
+ STORAGE_PTR + STORAGE_LEN,
+ process_name
+ );
+ }
+ return Ok((None, 0));
+ }
+
// Determine how much space we need in the application's
// memory space just for kernel and grant state. We need to make
// sure we allocate enough memory just for that.
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