Skip to content

Commit 6406f56

Browse files
committed
hiffy: Remove 'rng' feature.
Fixup app.toml files for boards that were still enabling this feature.
1 parent 3e05573 commit 6406f56

File tree

9 files changed

+8
-48
lines changed

9 files changed

+8
-48
lines changed

Cargo.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/demo-stm32h7-nucleo/app-h743.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ notifications = ["socket"]
120120

121121
[tasks.hiffy]
122122
name = "task-hiffy"
123-
features = ["h743", "stm32h7", "i2c", "gpio", "spi", "rng"]
123+
features = ["h743", "stm32h7", "i2c", "gpio", "spi"]
124124
priority = 4
125125
max-sizes = {flash = 32768, ram = 32768 }
126126
stacksize = 2048
127127
start = true
128-
task-slots = ["sys", "i2c_driver", "rng_driver"]
128+
task-slots = ["sys", "i2c_driver"]
129129

130130
[tasks.idle]
131131
name = "task-idle"

app/gimletlet/app.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ inherit = "base-gimletlet2.toml"
55
features = ["dump"]
66

77
[tasks.hiffy]
8-
features = ["h753", "stm32h7", "i2c", "gpio", "qspi", "rng", "hash", "sprot"]
9-
task-slots = ["hash_driver", "hf", "i2c_driver", "rng_driver", "sprot", "sys", "update_server", "user_leds"]
8+
features = ["h753", "stm32h7", "i2c", "gpio", "qspi", "hash", "sprot"]
9+
task-slots = ["hash_driver", "hf", "i2c_driver", "sprot", "sys", "update_server", "user_leds"]
1010

1111
[tasks.jefe]
1212
features = ["dump"]

app/lpc55xpresso/app-sprot.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ request_reset = ["update_server"]
3939
[tasks.hiffy]
4040
name = "task-hiffy"
4141
priority = 5
42-
features = ["lpc55", "gpio", "rng"]
42+
features = ["lpc55", "gpio"]
4343
max-sizes = {flash = 32768, ram = 16384 }
4444
stacksize = 2048
4545
start = true
46-
task-slots = ["gpio_driver", "rng_driver", "update_server"]
46+
task-slots = ["gpio_driver", "update_server"]
4747

4848
[tasks.idle]
4949
name = "task-idle"

app/lpc55xpresso/app.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ request_reset = ["update_server"]
3232
[tasks.hiffy]
3333
name = "task-hiffy"
3434
priority = 5
35-
features = ["lpc55", "gpio", "rng"]
35+
features = ["lpc55", "gpio"]
3636
max-sizes = {flash = 32768, ram = 16384 }
3737
stacksize = 2048
3838
start = true
39-
task-slots = ["gpio_driver", "rng_driver", "update_server"]
39+
task-slots = ["gpio_driver", "update_server"]
4040

4141
[tasks.idle]
4242
name = "task-idle"

task/hiffy/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ drv-gimlet-hf-api = { path = "../../drv/gimlet-hf-api", optional = true }
99
drv-hash-api = { path = "../../drv/hash-api", optional = true }
1010
drv-i2c-api = { path = "../../drv/i2c-api" }
1111
drv-lpc55-gpio-api = { path = "../../drv/lpc55-gpio-api", optional = true }
12-
drv-rng-api = { path = "../../drv/rng-api", optional = true }
1312
drv-sp-ctrl-api = { path = "../../drv/sp-ctrl-api", optional = true }
1413
drv-spi-api = { path = "../../drv/spi-api" }
1514
drv-sprot-api = { path = "../../drv/sprot-api", optional = true }
@@ -57,7 +56,6 @@ g031 = ["stm32g0", "drv-stm32xx-i2c/g031", "build-i2c/g031"]
5756
g030 = ["stm32g0", "drv-stm32xx-i2c/g030", "build-i2c/g030"]
5857
micro = ["no-ipc-counters"]
5958
panic-messages = ["userlib/panic-messages"]
60-
rng = ["drv-rng-api"]
6159
spctrl = ["drv-sp-ctrl-api"]
6260

6361
# This section is here to discourage RLS/rust-analyzer from doing test builds,

task/hiffy/src/common.rs

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -998,32 +998,3 @@ pub(crate) fn hash_finalize_sha256(
998998
rval[..hash::SHA256_SZ].copy_from_slice(&sha256sum);
999999
Ok(hash::SHA256_SZ)
10001000
}
1001-
1002-
#[cfg(feature = "rng")]
1003-
task_slot!(RNG, rng_driver);
1004-
1005-
#[cfg(feature = "rng")]
1006-
pub(crate) fn rng_fill(
1007-
stack: &[Option<u32>],
1008-
_data: &[u8],
1009-
rval: &mut [u8],
1010-
) -> Result<usize, Failure> {
1011-
use drv_rng_api::Rng;
1012-
1013-
if stack.is_empty() {
1014-
return Err(Failure::Fault(Fault::MissingParameters));
1015-
}
1016-
if stack.len() > 1 {
1017-
return Err(Failure::Fault(Fault::BadParameter(2)));
1018-
}
1019-
1020-
let frame = &stack[stack.len() - 1..];
1021-
let count =
1022-
frame[0].ok_or(Failure::Fault(Fault::MissingParameters))? as usize;
1023-
if count > rval.len() {
1024-
return Err(Failure::Fault(Fault::AccessOutOfBounds));
1025-
}
1026-
1027-
func_err(Rng::from(RNG.get_task_id()).fill(&mut rval[0..count]))?;
1028-
Ok(count)
1029-
}

task/hiffy/src/lpc55.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,6 @@ pub enum Functions {
6565
(drv_lpc55_gpio_api::Pin, drv_lpc55_gpio_api::Direction),
6666
u32,
6767
),
68-
#[cfg(feature = "rng")]
69-
Rng(usize, drv_rng_api::RngError),
7068
#[cfg(feature = "spi")]
7169
SpiRead((Task, u8, usize, usize), drv_spi_api::SpiError),
7270
#[cfg(feature = "spi")]
@@ -364,8 +362,6 @@ pub(crate) static HIFFY_FUNCS: &[Function] = &[
364362
gpio_configure,
365363
#[cfg(feature = "gpio")]
366364
gpio_direction,
367-
#[cfg(feature = "rng")]
368-
crate::common::rng_fill,
369365
#[cfg(feature = "spi")]
370366
spi_read,
371367
#[cfg(feature = "spi")]

task/hiffy/src/stm32h7.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ pub enum Functions {
128128
HashUpdate(u32, drv_hash_api::HashError),
129129
#[cfg(feature = "hash")]
130130
HashFinalize((), drv_hash_api::HashError),
131-
#[cfg(feature = "rng")]
132-
Rng(usize, drv_rng_api::RngError),
133131
}
134132

135133
#[cfg(feature = "i2c")]
@@ -578,8 +576,6 @@ pub(crate) static HIFFY_FUNCS: &[Function] = &[
578576
hash_update,
579577
#[cfg(feature = "hash")]
580578
hash_finalize_sha256,
581-
#[cfg(feature = "rng")]
582-
crate::common::rng_fill,
583579
];
584580

585581
//

0 commit comments

Comments
 (0)