Configure the number of pages in the board
This permits to have portable apps.
This commit is contained in:
committed by
Julien Cretin
parent
c1f2551d0d
commit
2d5fdd1034
@@ -349,7 +349,7 @@ index 348c746a5..5465c95f4 100644
|
||||
}
|
||||
}
|
||||
diff --git a/kernel/src/process.rs b/kernel/src/process.rs
|
||||
index c52754be3..ae6a58341 100644
|
||||
index c52754be3..26a7c47d3 100644
|
||||
--- a/kernel/src/process.rs
|
||||
+++ b/kernel/src/process.rs
|
||||
@@ -359,6 +359,15 @@ pub trait ProcessType {
|
||||
@@ -415,7 +415,7 @@ index c52754be3..ae6a58341 100644
|
||||
+ .mpu()
|
||||
+ .allocate_region(
|
||||
+ storage_location.address as *const u8,
|
||||
+ storage_location.size,
|
||||
+ storage_location.unallocated_size,
|
||||
+ storage_location.size,
|
||||
+ mpu::Permissions::ReadOnly,
|
||||
+ &mut mpu_config,
|
||||
@@ -439,10 +439,10 @@ index c52754be3..ae6a58341 100644
|
||||
// memory space just for kernel and grant state. We need to make
|
||||
// sure we allocate enough memory just for that.
|
||||
diff --git a/kernel/src/sched.rs b/kernel/src/sched.rs
|
||||
index 10626a2e1..8844bc6c3 100644
|
||||
index 10626a2e1..61401b04a 100644
|
||||
--- a/kernel/src/sched.rs
|
||||
+++ b/kernel/src/sched.rs
|
||||
@@ -118,6 +118,12 @@ pub enum SchedulingDecision {
|
||||
@@ -118,6 +118,13 @@ pub enum SchedulingDecision {
|
||||
TrySleep,
|
||||
}
|
||||
|
||||
@@ -450,12 +450,13 @@ index 10626a2e1..8844bc6c3 100644
|
||||
+pub struct StorageLocation {
|
||||
+ pub address: usize,
|
||||
+ pub size: usize,
|
||||
+ pub unallocated_size: usize,
|
||||
+}
|
||||
+
|
||||
/// Main object for the kernel. Each board will need to create one.
|
||||
pub struct Kernel {
|
||||
/// How many "to-do" items exist at any given time. These include
|
||||
@@ -127,6 +133,9 @@ pub struct Kernel {
|
||||
@@ -127,6 +134,9 @@ pub struct Kernel {
|
||||
/// This holds a pointer to the static array of Process pointers.
|
||||
processes: &'static [Option<&'static dyn process::ProcessType>],
|
||||
|
||||
@@ -465,7 +466,7 @@ index 10626a2e1..8844bc6c3 100644
|
||||
/// A counter which keeps track of how many process identifiers have been
|
||||
/// created. This is used to create new unique identifiers for processes.
|
||||
process_identifier_max: Cell<usize>,
|
||||
@@ -170,9 +179,17 @@ pub enum StoppedExecutingReason {
|
||||
@@ -170,9 +180,17 @@ pub enum StoppedExecutingReason {
|
||||
|
||||
impl Kernel {
|
||||
pub fn new(processes: &'static [Option<&'static dyn process::ProcessType>]) -> Kernel {
|
||||
@@ -483,7 +484,7 @@ index 10626a2e1..8844bc6c3 100644
|
||||
process_identifier_max: Cell::new(0),
|
||||
grant_counter: Cell::new(0),
|
||||
grants_finalized: Cell::new(false),
|
||||
@@ -900,4 +917,8 @@ impl Kernel {
|
||||
@@ -900,4 +918,8 @@ impl Kernel {
|
||||
|
||||
(return_reason, time_executed_us)
|
||||
}
|
||||
|
||||
@@ -31,10 +31,10 @@ index 5465c95f4..e596648f7 100644
|
||||
}
|
||||
}
|
||||
diff --git a/kernel/src/sched.rs b/kernel/src/sched.rs
|
||||
index 031159500..0cbfea929 100644
|
||||
index 61401b04a..e9a58c018 100644
|
||||
--- a/kernel/src/sched.rs
|
||||
+++ b/kernel/src/sched.rs
|
||||
@@ -118,10 +118,19 @@ pub enum SchedulingDecision {
|
||||
@@ -118,11 +118,20 @@ pub enum SchedulingDecision {
|
||||
TrySleep,
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ index 031159500..0cbfea929 100644
|
||||
pub struct StorageLocation {
|
||||
pub address: usize,
|
||||
pub size: usize,
|
||||
pub unallocated_size: usize,
|
||||
+ pub storage_type: StorageType,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user