Skip to content
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion crates/drivers/bcm2835-aux-uart/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
use core::ops::Deref;

use tock_registers::{
interfaces::{Readable, Writeable},
interfaces::{
Readable,
Writeable,
},
register_structs,
registers::ReadWrite,
};
Expand Down
6 changes: 4 additions & 2 deletions crates/drivers/bcm2835-aux-uart/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

use core::convert::Infallible;

use embedded_hal_nb::nb;
use embedded_hal_nb::serial;
use embedded_hal_nb::{
nb,
serial,
};

// use sel4_driver_interfaces::HandleInterrupt;

Expand Down
16 changes: 13 additions & 3 deletions crates/drivers/pl011/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@

use core::ops::Deref;

use tock_registers::interfaces::{Readable, Writeable};
use tock_registers::registers::{ReadOnly, ReadWrite, WriteOnly};
use tock_registers::{register_bitfields, register_structs};
use tock_registers::{
interfaces::{
Readable,
Writeable,
},
register_bitfields,
register_structs,
registers::{
ReadOnly,
ReadWrite,
WriteOnly,
},
};

register_structs! {
#[allow(non_snake_case)]
Expand Down
6 changes: 4 additions & 2 deletions crates/drivers/pl011/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@

use core::convert::Infallible;

use embedded_hal_nb::nb;
use embedded_hal_nb::serial;
use embedded_hal_nb::{
nb,
serial,
};

use sel4_driver_interfaces::HandleInterrupt;

Expand Down
13 changes: 10 additions & 3 deletions crates/drivers/pl031/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

use core::ops::Deref;

use tock_registers::interfaces::Readable;
use tock_registers::registers::{ReadOnly, ReadWrite, WriteOnly};
use tock_registers::{register_bitfields, register_structs};
use tock_registers::{
interfaces::Readable,
register_bitfields,
register_structs,
registers::{
ReadOnly,
ReadWrite,
WriteOnly,
},
};

register_structs! {
#[allow(non_snake_case)]
Expand Down
6 changes: 5 additions & 1 deletion crates/drivers/pl031/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

#![no_std]

use rtcc::{DateTime, DateTimeAccess, NaiveDateTime};
use rtcc::{
DateTime,
DateTimeAccess,
NaiveDateTime,
};

mod device;

Expand Down
17 changes: 14 additions & 3 deletions crates/drivers/sp804/src/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,20 @@

use core::ops::Deref;

use tock_registers::interfaces::{ReadWriteable, Readable, Writeable};
use tock_registers::registers::{ReadOnly, ReadWrite, WriteOnly};
use tock_registers::{register_bitfields, register_structs};
use tock_registers::{
interfaces::{
ReadWriteable,
Readable,
Writeable,
},
register_bitfields,
register_structs,
registers::{
ReadOnly,
ReadWrite,
WriteOnly,
},
};

register_structs! {
#[allow(non_snake_case)]
Expand Down
22 changes: 17 additions & 5 deletions crates/drivers/sp804/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,28 @@

#![no_std]

use core::convert::Infallible;
use core::time::Duration;
use core::{
convert::Infallible,
time::Duration,
};
use tock_registers::interfaces::ReadWriteable;

use sel4_driver_interfaces::HandleInterrupt;
use sel4_driver_interfaces::timer::{Clock, ErrorType, Timer as TimerTrait};
use sel4_driver_interfaces::{
HandleInterrupt,
timer::{
Clock,
ErrorType,
Timer as TimerTrait,
},
};

mod device;

use device::{Control, Device, Timer};
use device::{
Control,
Device,
Timer,
};

pub struct Driver {
device: Device,
Expand Down
16 changes: 12 additions & 4 deletions crates/drivers/virtio/blk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@

#![no_std]

use core::convert::Infallible;
use core::ops::Deref;
use core::{
convert::Infallible,
ops::Deref,
};

use sel4_driver_interfaces::block::GetBlockDeviceLayout;
use virtio_drivers::device::blk::{SECTOR_SIZE, VirtIOBlk};
use virtio_drivers::{Hal, transport::Transport};
use virtio_drivers::{
Hal,
device::blk::{
SECTOR_SIZE,
VirtIOBlk,
},
transport::Transport,
};

pub struct GetBlockDeviceLayoutWrapper<T>(pub T);

Expand Down
25 changes: 19 additions & 6 deletions crates/drivers/virtio/hal-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,27 @@

#![no_std]

use core::alloc::Layout;
use core::ptr::{self, NonNull};
use core::{
alloc::Layout,
ptr::{
self,
NonNull,
},
};

use one_shot_mutex::sync::OneShotMutex;
use virtio_drivers::{BufferDirection, Hal, PAGE_SIZE, PhysAddr};

use sel4_abstract_allocator::basic::BasicAllocator;
use sel4_abstract_allocator::{ByRange, WithAlignmentBound};
use virtio_drivers::{
BufferDirection,
Hal,
PAGE_SIZE,
PhysAddr,
};

use sel4_abstract_allocator::{
ByRange,
WithAlignmentBound,
basic::BasicAllocator,
};
use sel4_immediate_sync_once_cell::ImmediateSyncOnceCell;
use sel4_shared_memory::SharedMemoryRef;

Expand Down
38 changes: 30 additions & 8 deletions crates/drivers/virtio/net/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,38 @@
extern crate alloc;

use alloc::rc::Rc;
use core::cell::RefCell;
use core::convert::Infallible;
use core::{
cell::RefCell,
convert::Infallible,
};

use log::trace;
use sel4_driver_interfaces::HandleInterrupt;
use sel4_driver_interfaces::net::{GetNetDeviceMeta, MacAddress};
use smoltcp::phy::{Device, DeviceCapabilities, Medium, RxToken, TxToken};
use smoltcp::time::Instant;
use virtio_drivers::device::net::{RxBuffer, VirtIONet};
use virtio_drivers::{Error, Hal, transport::Transport};
use sel4_driver_interfaces::{
HandleInterrupt,
net::{
GetNetDeviceMeta,
MacAddress,
},
};
use smoltcp::{
phy::{
Device,
DeviceCapabilities,
Medium,
RxToken,
TxToken,
},
time::Instant,
};
use virtio_drivers::{
Error,
Hal,
device::net::{
RxBuffer,
VirtIONet,
},
transport::Transport,
};

pub const NET_QUEUE_SIZE: usize = 16;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
#![no_std]
#![no_main]

use sel4_microkit::{Handler, Infallible, debug_println, protection_domain};
use sel4_microkit::{
Handler,
Infallible,
debug_println,
protection_domain,
};

#[protection_domain]
fn init() -> HandlerImpl {
Expand Down
8 changes: 5 additions & 3 deletions crates/examples/microkit/banscii/pds/artist/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
// SPDX-License-Identifier: BSD-2-Clause
//

use std::env;
use std::fs;
use std::path::PathBuf;
use std::{
env,
fs,
path::PathBuf,
};

use rsa::pkcs1::EncodeRsaPrivateKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@

#![no_std]

use serde::{Deserialize, Serialize};
use serde::{
Deserialize,
Serialize,
};

#[derive(Debug, Serialize, Deserialize)]
pub struct Request {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
// SPDX-License-Identifier: BSD-2-Clause
//

use rsa::RsaPrivateKey;
use rsa::pkcs1::DecodeRsaPrivateKey;
use rsa::pkcs1v15::{Signature, SigningKey};
use rsa::sha2::Sha256;
use rsa::signature::Signer;
use rsa::{
RsaPrivateKey,
pkcs1::DecodeRsaPrivateKey,
pkcs1v15::{
Signature,
SigningKey,
},
sha2::Sha256,
signature::Signer,
};

const PRIV_KEY_PEM: &str = include_str!(concat!(env!("OUT_DIR"), "/priv.pem"));

Expand Down
13 changes: 11 additions & 2 deletions crates/examples/microkit/banscii/pds/artist/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,21 @@ use alloc::vec;
use rsa::signature::SignatureEncoding;

use sel4_microkit::{
Channel, Handler, Infallible, MessageInfo, memory_region_symbol, protection_domain, var,
Channel,
Handler,
Infallible,
MessageInfo,
memory_region_symbol,
protection_domain,
var,
};
use sel4_microkit_simple_ipc as simple_ipc;
use sel4_shared_memory::{
SharedMemoryRef,
access::{ReadOnly, ReadWrite},
access::{
ReadOnly,
ReadWrite,
},
};

use banscii_artist_interface_types::*;
Expand Down
18 changes: 14 additions & 4 deletions crates/examples/microkit/banscii/pds/assistant/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@

extern crate alloc;

use alloc::vec;
use alloc::vec::Vec;

use ab_glyph::{Font, FontRef, Glyph, Point, PxScale, ScaleFont, point};
use alloc::{
vec,
vec::Vec,
};

use ab_glyph::{
Font,
FontRef,
Glyph,
Point,
PxScale,
ScaleFont,
point,
};

#[allow(unused_imports)]
use num_traits::Float;
Expand Down
Loading
Loading