Skip to content

Commit ca58186

Browse files
tool: fix cpu error message
Signed-off-by: Ivan Velickovic <[email protected]>
1 parent 119044f commit ca58186

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

tool/microkit/src/sdf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ impl ProtectionDomain {
556556
node,
557557
format!(
558558
"cpu core must be less than {}, got {}",
559-
config.num_cores, cpu
559+
config.num_cores, cpu.0
560560
),
561561
));
562562
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright 2025, UNSW
4+
5+
SPDX-License-Identifier: BSD-2-Clause
6+
-->
7+
<system>
8+
<protection_domain name="test" cpu="10">
9+
<program_image path="test" />
10+
</protection_domain>
11+
</system>

tool/microkit/tests/test.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,15 @@ mod protection_domain {
525525
"Error: size must be > 0 on element 'ioport':",
526526
)
527527
}
528+
529+
#[test]
530+
fn test_invalid_cpu() {
531+
check_error(
532+
&DEFAULT_AARCH64_KERNEL_CONFIG,
533+
"pd_invalid_cpu.system",
534+
"Error: cpu core must be less than 1, got 10 on element 'protection_domain':",
535+
)
536+
}
528537
}
529538

530539
#[cfg(test)]

0 commit comments

Comments
 (0)