Skip to content

Commit a791ef9

Browse files
committed
domains: switch from milliseconds to micro
Signed-off-by: Krishnan Winter <krishnan.winter@unsw.edu.au>
1 parent 3b695ec commit a791ef9

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/manual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1150,7 +1150,7 @@ The `domain_schedule` element, by default, has a list of up to 128 `domain` chil
11501150
The `domain` element has the following attributes:
11511151

11521152
* `name`: Name of the domain.
1153-
* `length`: Length of time the domain will run each time it is active, in milliseconds on Aarch64 and Riscv64. On x86 this length is currently defined in ticks as we don't have a static definition of the timer frequency.
1153+
* `length`: Length of time the domain will run each time it is active, in microseconds on Aarch64 and Riscv64. On x86 this length is currently defined in ticks as we don't have a static definition of the timer frequency.
11541154

11551155
The `name` attribute of each `domain` element can be referenced in the `domain` attribute of a `protection_domain` element.
11561156

example/hello_domains/hello.system

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
-->
77
<system>
88
<domain_schedule>
9-
<domain name="domain_1" length="1000" />
10-
<domain name="domain_2" length="1000" />
11-
<domain name="domain_3" length="2000" />
9+
<domain name="domain_1" length="1000000" />
10+
<domain name="domain_2" length="1000000" />
11+
<domain name="domain_3" length="2000000" />
1212
</domain_schedule>
1313

1414
<protection_domain name="hello" domain="domain_1">
@@ -18,7 +18,7 @@
1818
<protection_domain name="hello_2" domain="domain_2">
1919
<program_image path="hello.elf" />
2020
</protection_domain>
21-
21+
2222
<protection_domain name="hello_3" domain="domain_3">
2323
<program_image path="hello.elf" />
2424
</protection_domain>

tool/microkit/src/capdl/builder.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub const SLOT_SIZE: u64 = 1 << SLOT_BITS;
107107
pub type FrameFill = Fill<ElfContent>;
108108
pub type CapDLNamedObject = NamedObject<FrameFill>;
109109

110-
const MS_IN_S: u64 = 1000;
110+
const US_IN_S: u64 = 1000000;
111111

112112
pub struct ExpectedAllocation {
113113
pub ut_idx: usize,
@@ -1127,12 +1127,12 @@ pub fn build_capdl_spec(
11271127

11281128
if system.domain_schedule.is_some() {
11291129
let mut domain_schedule: Vec<DomainSchedEntry> = Vec::new();
1130-
// We want to convert from the milliseconds that the user defines in the
1130+
// We want to convert from the microseconds that the user defines in the
11311131
// sdf to the kernel scheduler ticks. If we are on x86, we won't necessarily
11321132
// have a static definition of the timer frequency. We will express the
11331133
// domain timeslices in ticks.
11341134
let ticks_in_ms = if kernel_config.timer_freq.is_some() {
1135-
kernel_config.timer_freq.unwrap() / MS_IN_S
1135+
kernel_config.timer_freq.unwrap() / US_IN_S
11361136
} else {
11371137
1
11381138
};

0 commit comments

Comments
 (0)