mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
minor cleanup in builder code for specifying swap regions
This commit is contained in:
parent
7f9b783027
commit
07e43d4459
1 changed files with 9 additions and 5 deletions
|
|
@ -114,6 +114,10 @@ impl From<&str> for CrateSpec {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct SwapSpec {
|
||||||
|
pub offchip_ram_offset: u32,
|
||||||
|
pub offchip_ram_len: u32,
|
||||||
|
}
|
||||||
pub(crate) struct Builder {
|
pub(crate) struct Builder {
|
||||||
loader: CrateSpec,
|
loader: CrateSpec,
|
||||||
loader_features: Vec<String>,
|
loader_features: Vec<String>,
|
||||||
|
|
@ -144,8 +148,8 @@ pub(crate) struct Builder {
|
||||||
dry_run: bool,
|
dry_run: bool,
|
||||||
/// when set to true, user selected packages are compiled but no image is created
|
/// when set to true, user selected packages are compiled but no image is created
|
||||||
no_image: bool,
|
no_image: bool,
|
||||||
/// when Some, specifies a swap region as offset, size
|
/// when Some, specifies a swap region
|
||||||
swap: Option<(u32, u32)>,
|
swap: Option<SwapSpec>,
|
||||||
change_target: bool,
|
change_target: bool,
|
||||||
baremetal: bool,
|
baremetal: bool,
|
||||||
sigblock_size: usize,
|
sigblock_size: usize,
|
||||||
|
|
@ -212,7 +216,7 @@ impl Builder {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_swap<'a>(&'a mut self, offset: u32, size: u32) -> &'a mut Builder {
|
pub fn set_swap<'a>(&'a mut self, offset: u32, size: u32) -> &'a mut Builder {
|
||||||
self.swap = Some((offset, size));
|
self.swap = Some(SwapSpec { offchip_ram_offset: offset, offchip_ram_len: size });
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1176,8 +1180,8 @@ impl Builder {
|
||||||
args.push(i);
|
args.push(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
let swap_spec = if let Some((offset, size)) = self.swap {
|
let swap_spec = if let Some(spec) = &self.swap {
|
||||||
format!("0x{:x}:0x{:x}", offset, size) // create-image requires a base decorator, but the argument into xtask does not.
|
format!("0x{:x}:0x{:x}", spec.offchip_ram_offset, spec.offchip_ram_len) // create-image requires a base decorator, but the argument into xtask does not.
|
||||||
} else {
|
} else {
|
||||||
String::new()
|
String::new()
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue