Skip to content

Commit

Permalink
Remove #![feature(feature)] from protection domain crates
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Spinale <[email protected]>
  • Loading branch information
nspin committed Jan 11, 2024
1 parent 26f6f5b commit 938e0db
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 36 deletions.
7 changes: 4 additions & 3 deletions crates/examples/microkit/banscii/pds/artist/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(never_type)]

extern crate alloc;

Expand All @@ -16,7 +15,9 @@ use sel4_externally_shared::{
access::{ReadOnly, ReadWrite},
ExternallySharedRef, ExternallySharedRefExt,
};
use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;

use banscii_artist_interface_types::*;
Expand Down Expand Up @@ -54,7 +55,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn protected(
&mut self,
Expand Down
7 changes: 4 additions & 3 deletions crates/examples/microkit/banscii/pds/assistant/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(never_type)]

extern crate alloc;

Expand All @@ -21,7 +20,9 @@ use sel4_externally_shared::{
access::{ReadOnly, ReadWrite},
ExternallySharedRef, ExternallySharedRefExt,
};
use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;

use banscii_artist_interface_types as artist;
Expand Down Expand Up @@ -63,7 +64,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
match channel {
Expand Down
7 changes: 4 additions & 3 deletions crates/examples/microkit/banscii/pds/pl011-driver/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

#![no_std]
#![no_main]
#![feature(never_type)]

use heapless::Deque;

use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;

use banscii_pl011_driver_core::Driver;
Expand All @@ -37,7 +38,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
match channel {
Expand Down
5 changes: 2 additions & 3 deletions crates/examples/microkit/hello/pds/hello/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

#![no_std]
#![no_main]
#![feature(never_type)]

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

#[protection_domain]
fn init() -> HandlerImpl {
Expand All @@ -19,5 +18,5 @@ fn init() -> HandlerImpl {
struct HandlerImpl;

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#![no_std]
#![no_main]
#![feature(never_type)]

use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;

use microkit_http_server_example_pl031_driver_core::Driver;
Expand All @@ -29,7 +30,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn protected(
&mut self,
Expand Down
13 changes: 8 additions & 5 deletions crates/examples/microkit/http-server/pds/server/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ use sel4_async_network::{DhcpOverrides, ManagedInterface};
use sel4_async_single_threaded_executor::{LocalPool, LocalSpawner};
use sel4_async_time::{Instant, TimerManager};
use sel4_bounce_buffer_allocator::Basic;
use sel4_microkit::{Channel, Handler, Infallible};
use sel4_shared_ring_buffer_block_io::SharedRingBufferBlockIO;

use crate::{DeviceImpl, TimerClient};

pub(crate) enum Never {}

pub(crate) struct HandlerImpl {
timer_driver_channel: sel4_microkit::Channel,
net_driver_channel: sel4_microkit::Channel,
Expand All @@ -34,12 +37,12 @@ pub(crate) struct HandlerImpl {
shared_timers: TimerManager,
shared_network: ManagedInterface,
local_pool: LocalPool,
fut: LocalBoxFuture<'static, !>,
fut: LocalBoxFuture<'static, Never>,
}

impl HandlerImpl {
#[allow(clippy::too_many_arguments)]
pub(crate) fn new<T: Future<Output = !> + 'static>(
pub(crate) fn new<T: Future<Output = Never> + 'static>(
timer_driver_channel: sel4_microkit::Channel,
net_driver_channel: sel4_microkit::Channel,
block_driver_channel: sel4_microkit::Channel,
Expand Down Expand Up @@ -133,10 +136,10 @@ impl HandlerImpl {
}
}

impl sel4_microkit::Handler for HandlerImpl {
type Error = !;
impl Handler for HandlerImpl {
type Error = Infallible;

fn notified(&mut self, channel: sel4_microkit::Channel) -> Result<(), Self::Error> {
fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
self.react(
channel == self.timer_driver_channel,
channel == self.net_driver_channel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(never_type)]

extern crate alloc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

#![no_std]
#![no_main]
#![feature(never_type)]

use core::time::Duration;

use sel4_microkit::{memory_region_symbol, protection_domain, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;

use microkit_http_server_example_sp804_driver_core::Driver;
Expand All @@ -36,7 +37,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
match channel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(never_type)]

extern crate alloc;

Expand All @@ -24,7 +23,9 @@ use virtio_drivers::{
};

use sel4_externally_shared::{ExternallySharedRef, ExternallySharedRefExt};
use sel4_microkit::{memory_region_symbol, protection_domain, var, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, var, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;
use sel4_shared_ring_buffer::{roles::Use, RingBuffers};
use sel4_shared_ring_buffer_block_io_types::{
Expand Down Expand Up @@ -102,7 +103,7 @@ struct PendingEntry {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
match channel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#![no_std]
#![no_main]
#![feature(never_type)]

use core::ptr::NonNull;

Expand All @@ -19,7 +18,9 @@ use virtio_drivers::{
};

use sel4_externally_shared::{ExternallySharedRef, ExternallySharedRefExt};
use sel4_microkit::{memory_region_symbol, protection_domain, var, Channel, Handler, MessageInfo};
use sel4_microkit::{
memory_region_symbol, protection_domain, var, Channel, Handler, Infallible, MessageInfo,
};
use sel4_microkit_message::MessageInfoExt as _;
use sel4_shared_ring_buffer::{roles::Use, RingBuffers};

Expand Down Expand Up @@ -95,7 +96,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, channel: Channel) -> Result<(), Self::Error> {
match channel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

#![no_std]
#![no_main]
#![feature(never_type)]

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

const SERVER: Channel = Channel::new(0);

Expand All @@ -21,7 +20,7 @@ fn init() -> impl Handler {
struct HandlerImpl {}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, _channel: Channel) -> Result<(), Self::Error> {
debug_println!("TEST_PASS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@

#![no_std]
#![no_main]
#![feature(never_type)]

use sel4_microkit::{protection_domain, Channel, DeferredAction, DeferredActionSlot, Handler};
use sel4_microkit::{
protection_domain, Channel, DeferredAction, DeferredActionSlot, Handler, Infallible,
};

const CLIENT: Channel = Channel::new(0);

Expand All @@ -24,7 +25,7 @@ struct HandlerImpl {
}

impl Handler for HandlerImpl {
type Error = !;
type Error = Infallible;

fn notified(&mut self, _channel: Channel) -> Result<(), Self::Error> {
self.deferred_action.defer(CLIENT.defer_notify()).unwrap();
Expand Down

0 comments on commit 938e0db

Please sign in to comment.