Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Cleanup remaining userlib namespace imports #1857

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app/lpc55xpresso/app-sprot.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ start = true
[tasks.update_server]
name = "lpc55-update-server"
priority = 3
stacksize = 3000
stacksize = 3200
start = true
sections = {bootstate = "usbsram"}
uses = ["flash_controller", "hash_crypt"]
Expand Down Expand Up @@ -142,7 +142,7 @@ uses = ["flexcomm5", "iocon"]
start = true
stacksize = 1000
task-slots = ["gpio_driver", "syscon_driver"]
notifications = ["spi-irq"]
notifications = ["spi-irq", "timer"]
interrupts = {"flexcomm5.irq" = "spi-irq"}

[tasks.swd.config]
Expand All @@ -167,6 +167,8 @@ pins = [
# SCK
{ pin = { port = 0, pin = 7 }, alt = 3 },
{ name = "SD0_CARD_DET", pin = { port = 0, pin = 17 }, alt = 0, direction = "input" },
{ name = "SP_TO_ROT_JTAG_DETECT_L", pin = { port = 0, pin = 20 }, alt = 0, direction = "input" },
{ name = "ROT_TO_SP_RESET_L", pin = { port = 0, pin = 13 }, alt = 0, value = true, direction = "output", opendrain = "opendrain" },
]
spi_num = 5

Expand Down Expand Up @@ -208,7 +210,7 @@ pins = [
[tasks.attest]
name = "task-attest"
priority = 5
max-sizes = {flash = 33904, ram = 16384}
max-sizes = {flash = 34336, ram = 16384}
stacksize = 12304
start = true
extern-regions = ["dice_alias", "dice_certs"]
Expand Down
9 changes: 5 additions & 4 deletions drv/lpc55-swd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ use idol_runtime::{
};
use lpc55_pac as device;
use ringbuf::*;
use userlib::{
hl, set_timer_relative, sys_set_timer, task_slot, RecvMessage, TaskId,
UnwrapLite,
};
// use userlib::{
// hl, set_timer_relative, sys_set_timer, task_slot, RecvMessage, TaskId,
// UnwrapLite,
// };
use userlib::*;

#[derive(Copy, Clone, PartialEq)]
enum Trace {
Expand Down
2 changes: 1 addition & 1 deletion drv/lpc55-syscon-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#![no_std]

use userlib::*;
use userlib::{sys_send, FromPrimitive};
use zerocopy::AsBytes;

/// Peripheral numbering.
Expand Down
5 changes: 4 additions & 1 deletion drv/lpc55-update-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ use stage0_handoff::{
HandoffData, HandoffDataLoadError, ImageVersion, RotBootState,
RotBootStateV2,
};
use userlib::*;
use userlib::{
sys_irq_control, sys_recv_notification, task_slot, ImageHeader,
RecvMessage, UnwrapLite, CABOOSE_MAGIC, HEADER_MAGIC,
};
use zerocopy::{AsBytes, FromBytes};

mod images;
Expand Down
5 changes: 4 additions & 1 deletion drv/lpc55-usart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ use core::ops::Deref;
use drv_lpc55_syscon_api::*;
use lib_lpc55_usart::{Usart, Write};
use lpc55_pac as device;
use userlib::*;
use userlib::{
sys_borrow_info, sys_borrow_read, sys_irq_control, sys_recv_open,
sys_reply, task_slot, LeaseAttributes, TaskId, UnwrapLite,
};
use zerocopy::AsBytes;

task_slot!(SYSCON, syscon_driver);
Expand Down
2 changes: 1 addition & 1 deletion drv/meanwell-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![no_std]

use derive_idol_err::IdolError;
use userlib::*;
use userlib::{sys_send, FromPrimitive};

#[derive(Copy, Clone, Debug, FromPrimitive, IdolError, counters::Count)]
pub enum MeanwellError {
Expand Down
4 changes: 3 additions & 1 deletion drv/meanwell/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
use drv_meanwell_api::MeanwellError;
use idol_runtime::NotificationHandler;
use idol_runtime::RequestError;
use userlib::*;
use userlib::{
set_timer_relative, sys_get_timer, sys_set_timer, task_slot, RecvMessage,
};

use drv_stm32xx_sys_api as sys_api;

Expand Down
4 changes: 3 additions & 1 deletion drv/medusa-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ use drv_medusa_seq_api::{MedusaError, RailName};
use drv_sidecar_front_io::phy_smi::PhyOscState;
use idol_runtime::{NotificationHandler, RequestError};
use ringbuf::{ringbuf, ringbuf_entry};
use userlib::*;
use userlib::{
sys_get_timer, sys_set_timer, task_slot, RecvMessage, UnwrapLite,
};

task_slot!(I2C, i2c_driver);
task_slot!(FRONT_IO, front_io);
Expand Down
2 changes: 1 addition & 1 deletion drv/monorail-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use derive_idol_err::IdolError;
use hubpack::SerializedSize;
use serde::{Deserialize, Serialize};
use userlib::*;
use userlib::{sys_send, FromPrimitive, ToPrimitive};

pub use vsc85xx::{
tesla::{TeslaSerdes6gObConfig, TeslaSerdes6gPatch},
Expand Down
2 changes: 1 addition & 1 deletion drv/onewire/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#![no_std]

use userlib::*;
use userlib::FromPrimitive;

/// 1-wire commands. Most devices support more commands, but these commands
/// are supported by all devices.
Expand Down
5 changes: 4 additions & 1 deletion drv/psc-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ use drv_psc_seq_api::PowerState;
use drv_stm32xx_sys_api as sys_api;
use sys_api::{Edge, IrqControl, OutputType, PinSet, Pull, Speed};
use task_jefe_api::Jefe;
use userlib::*;
use userlib::{
hl, sys_get_timer, sys_recv_notification, sys_set_timer, task_slot,
UnwrapLite,
};

use ringbuf::{ringbuf, ringbuf_entry};

Expand Down
2 changes: 1 addition & 1 deletion drv/sbrmi-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use derive_idol_err::IdolError;
use drv_i2c_devices::sbrmi;
use userlib::*;
use userlib::{sys_send, FromPrimitive};

#[derive(Copy, Clone, Debug, FromPrimitive, IdolError, counters::Count)]
pub enum SbrmiError {
Expand Down
2 changes: 1 addition & 1 deletion drv/sbrmi/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use drv_i2c_devices::sbrmi::{CpuidResult, Sbrmi};
use drv_sbrmi_api::SbrmiError;
use idol_runtime::{NotificationHandler, RequestError};
use ringbuf::*;
use userlib::*;
use userlib::{task_slot, RecvMessage};
use zerocopy::FromBytes;

include!(concat!(env!("OUT_DIR"), "/i2c_config.rs"));
Expand Down
1 change: 0 additions & 1 deletion drv/sidecar-mainboard-i2c-emulator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

use drv_i2c_api::*;
use ringbuf::*;
use userlib::*;

#[derive(Copy, Clone, PartialEq)]
enum Trace {
Expand Down
2 changes: 1 addition & 1 deletion drv/sidecar-seq-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub use drv_sidecar_mainboard_controller::{

use hubpack::SerializedSize;
use serde::{Deserialize, Serialize};
use userlib::*;
use userlib::{sys_send, FromPrimitive};
use zerocopy::AsBytes;

#[derive(
Expand Down
5 changes: 4 additions & 1 deletion drv/sidecar-seq-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ use idol_runtime::{
ClientError, Leased, NotificationHandler, RequestError, R, W,
};
use ringbuf::*;
use userlib::*;
use userlib::{
hl, sys_get_timer, sys_set_timer, task_slot, FromPrimitive, RecvMessage,
UnwrapLite,
};

task_slot!(I2C, i2c_driver);
task_slot!(MAINBOARD, mainboard);
Expand Down
2 changes: 1 addition & 1 deletion drv/sp-ctrl-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#![no_std]

use derive_idol_err::IdolError;
use userlib::*;
use userlib::{sys_send, FromPrimitive};

#[derive(Copy, Clone, Debug, FromPrimitive, Eq, PartialEq, IdolError)]
#[repr(u32)]
Expand Down
2 changes: 1 addition & 1 deletion drv/spi-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use derive_idol_err::IdolError;
use gateway_messages::SpiError as GwSpiError;
use hubpack::SerializedSize;
use serde::{Deserialize, Serialize};
use userlib::*;
use userlib::{sys_send, FromPrimitive};

#[derive(
Copy,
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32fx-rcc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ use stm32f3::stm32f303 as device;
#[cfg(feature = "stm32f4")]
use stm32f4::stm32f407 as device;

use userlib::*;
use userlib::{hl, FromPrimitive};
use zerocopy::AsBytes;

#[derive(FromPrimitive)]
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32fx-usart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use stm32f4::stm32f407 as device;
#[cfg(feature = "stm32f3")]
use stm32f3::stm32f303 as device;

use userlib::*;
use userlib::{hl, sys_irq_control, task_slot, FromPrimitive, LeaseAttributes};
use zerocopy::AsBytes;

task_slot!(RCC, rcc_driver);
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32g0-usart/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use stm32g0::stm32g070 as device;
#[cfg(feature = "g0b1")]
use stm32g0::stm32g0b1 as device;

use userlib::*;
use userlib::{hl, sys_irq_control, task_slot, FromPrimitive, LeaseAttributes};

task_slot!(SYS, sys);

Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-fmc-demo-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use sys_api::{Alternate, OutputType, Peripheral, Port, Pull, Speed};
use task_net_api::{
LargePayloadBehavior, Net, RecvError, SendError, SocketName,
};
use userlib::*;
use userlib::{sys_recv_notification, task_slot, RecvMessage};

cfg_if::cfg_if! {
if #[cfg(feature = "h743")] {
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-hash-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#![no_main]

// use core::convert::TryInto;
use userlib::*;
use userlib::{task_slot, RecvMessage};

use drv_stm32h7_hash::Hash;
use drv_stm32xx_sys_api as sys_api;
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-hash/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use drv_hash_api::HashError;
use stm32h7::stm32h753 as device;

use core::mem::size_of;
use userlib::*;
use userlib::{hl, sys_irq_control, sys_recv_notification};
use zerocopy::AsBytes;

enum State {
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-rng/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use stm32h7::stm32h743 as device;
#[cfg(feature = "h753")]
use stm32h7::stm32h753 as device;

use userlib::*;
use userlib::{hl, task_slot, RecvMessage};

task_slot!(SYS, sys);

Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-spi-server-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use stm32h7::stm32h743 as device;
#[cfg(feature = "h753")]
use stm32h7::stm32h753 as device;

use userlib::*;
use userlib::{sys_irq_control, sys_recv_notification, TaskId, UnwrapLite};

use drv_stm32h7_spi as spi_core;
use drv_stm32xx_sys_api as sys_api;
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32h7-spi-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use idol_runtime::{
LeaseBufReader, LeaseBufWriter, Leased, LenLimit, NotificationHandler,
RequestError, R, W,
};
use userlib::*;
use userlib::{task_slot, RecvMessage};

use drv_stm32h7_spi_server_core::SpiServerCore;
use drv_stm32xx_sys_api as sys_api;
Expand Down
5 changes: 4 additions & 1 deletion drv/stm32h7-sprot-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ use idol_runtime::{NotificationHandler, RequestError};
use ringbuf::*;
use static_cell::ClaimOnceCell;
use sys_api::IrqControl;
use userlib::*;
use userlib::{
hl, set_timer_relative, sys_get_timer, sys_recv_notification,
sys_set_timer, task_slot, RecvMessage, UnwrapLite,
};

cfg_if::cfg_if! {
// Select local vs server SPI communication
Expand Down
5 changes: 4 additions & 1 deletion drv/stm32h7-update-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ use idol_runtime::{
};
use ringbuf::*;
use stm32h7::stm32h753 as device;
use userlib::*;
use userlib::{
sys_irq_control, sys_recv_notification, ImageHeader, RecvMessage,
CABOOSE_MAGIC, HEADER_MAGIC,
};
use zerocopy::AsBytes;

// Internally we deal with flash blocks in groups of u32 words.
Expand Down
5 changes: 4 additions & 1 deletion drv/stm32xx-i2c-server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ use drv_stm32xx_sys_api::{Mode, OutputType, PinSet, Pull, Speed, Sys};

use fixedmap::*;
use ringbuf::*;
use userlib::*;
use userlib::{
hl, sys_get_timer, sys_irq_control, sys_recv_notification, sys_set_timer,
task_slot, FromPrimitive, LeaseAttributes,
};

task_slot!(SYS, sys);

Expand Down
6 changes: 3 additions & 3 deletions drv/stm32xx-i2c/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub mod max7358;
pub mod pca9548;

use ringbuf::*;
use userlib::*;
use userlib::{hl, sys_irq_status, IrqStatus};

use drv_stm32xx_sys_api as sys_api;

Expand Down Expand Up @@ -885,7 +885,7 @@ impl I2cController<'_> {

#[rustfmt::skip]
i2c.oar1.modify(|_, w| { w
.oa1en().clear_bit() // own-address disable
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: Zed editor did these format fixes automatically, so they're kind of "slipping in" on the side.

.oa1en().clear_bit() // own-address disable
});

#[rustfmt::skip]
Expand All @@ -898,7 +898,7 @@ impl I2cController<'_> {
i2c.cr1.modify(|_, w| { w
.gcen().clear_bit() // disable General Call
.nostretch().clear_bit() // enable clock stretching
.sbc().clear_bit() // disable byte control
.sbc().clear_bit() // disable byte control
.errie().clear_bit() // \
.tcie().clear_bit() // |
.stopie().clear_bit() // | disable
Expand Down
2 changes: 1 addition & 1 deletion drv/stm32xx-i2c/src/ltc4306.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::*;
use bitfield::bitfield;
use drv_i2c_api::{ResponseCode, Segment};
use ringbuf::*;
use userlib::*;
use userlib::FromPrimitive;

pub struct Ltc4306;

Expand Down
2 changes: 1 addition & 1 deletion drv/stm32xx-i2c/src/max7358.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::*;
use bitfield::bitfield;
use drv_i2c_api::{ResponseCode, Segment};
use ringbuf::*;
use userlib::*;
use userlib::FromPrimitive;

pub struct Max7358;

Expand Down
2 changes: 1 addition & 1 deletion drv/stm32xx-sys-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cfg_if::cfg_if! {
}

use derive_idol_err::IdolError;
use userlib::*;
use userlib::{sys_send, FromPrimitive};
use zerocopy::AsBytes;

pub use drv_stm32xx_gpio_common::{
Expand Down
Loading