Skip to content

Commit

Permalink
[config] Fix the format for config file
Browse files Browse the repository at this point in the history
  • Loading branch information
Azure-stars committed Oct 23, 2024
1 parent 34c44eb commit ed2162b
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 32 deletions.
4 changes: 2 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ fn gen_kernel_config(arch: &str) -> Result<()> {
let key_name = key.to_uppercase().replace('-', "_");
match value {
toml_edit::Value::Integer(i) => {
writeln!(f, "pub const {}: usize = {};", key_name, i)?;
writeln!(f, "pub(crate) const {}: usize = {};", key_name, i)?;
}
toml_edit::Value::String(s) => {
writeln!(f, "pub const {}: &str = \"{}\";", key_name, s)?;
writeln!(f, "pub(crate) const {}: &str = \"{}\";", key_name, s)?;
}
_ => {
panic!("Unsupported value type");
Expand Down
15 changes: 5 additions & 10 deletions configs/aarch64.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# The base address of the user space.
user_space_base = 0x1000
user-space-base = 0x1000
# The size of the user space.
user_space_size = 0x7fff_ffff_f000

# The base address of the user heap.
user_heap_base = 0x3fc0_0000
# The size of the user heap.
user_heap_size = 0x40_0000
user-space-size = 0x7fff_ffff_f000

# The highest address of the user stack.
user_stack_top = 0x7fff_0000_0000
user-stack-top = 0x7fff_0000_0000
# The size of the user stack.
user_stack_size = 0x1_0000
user-stack-size = 0x1_0000

# The size of the kernel stack.
kernel_stack_size = 0x40000
kernel-stack-size = 0x40000
15 changes: 5 additions & 10 deletions configs/riscv64.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# The base address of the user space.
user_space_base = 0x1000
user-space-base = 0x1000
# The size of the user space.
user_space_size = 0x3f_ffff_f000

# The base address of the user heap.
user_heap_base = 0x3fc0_0000
# The size of the user heap.
user_heap_size = 0x40_0000
user-space-size = 0x3f_ffff_f000

# The highest address of the user stack.
user_stack_top = 0x4_0000_0000
user-stack-top = 0x4_0000_0000
# The size of the user stack.
user_stack_size = 0x1_0000
user-stack-size = 0x1_0000

# The size of the kernel stack.
kernel_stack_size = 0x40000
kernel-stack-size = 0x40000
15 changes: 5 additions & 10 deletions configs/x86_64.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
# The base address of the user space.
user_space_base = 0x1000
user-space-base = 0x1000
# The size of the user space.
user_space_size = 0x7fff_ffff_f000

# The base address of the user heap.
user_heap_base = 0x3fc0_0000
# The size of the user heap.
user_heap_size = 0x40_0000
user-space-size = 0x7fff_ffff_f000

# The highest address of the user stack.
user_stack_top = 0x7fff_0000_0000
user-stack-top = 0x7fff_0000_0000
# The size of the user stack.
user_stack_size = 0x1_0000
user-stack-size = 0x1_0000

# The size of the kernel stack.
kernel_stack_size = 0x40000
kernel-stack-size = 0x40000

0 comments on commit ed2162b

Please sign in to comment.