Skip to content

Commit

Permalink
deobjectification.
Browse files Browse the repository at this point in the history
  • Loading branch information
pnkfelix committed Nov 17, 2019
1 parent 52f4871 commit 71c6e53
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions tock/kernel/src/lib.rs
Expand Up @@ -2579,7 +2579,7 @@ use crate::syscall::{self, Syscall, UserspaceKernelBoundary};
use crate::tbfheader; use crate::tbfheader;
use core::cmp::max; use core::cmp::max;


pub fn load_processes<C: Chip>(chip: &'static C) { unsafe { Process::create(chip); } } pub fn load_processes<C: Chip>(_: &'static C) { unsafe { process_create::<C>(); } }


pub trait ProcessType { pub trait ProcessType {
unsafe fn process_detail_fmt(&self, writer: &mut dyn Write) { loop { } } unsafe fn process_detail_fmt(&self, writer: &mut dyn Write) { loop { } }
Expand Down Expand Up @@ -2684,15 +2684,8 @@ impl<C: Chip> ProcessType for Process<'a, C> {


fn exceeded_check(size: usize, allocated: usize) -> &'static str { loop { } } fn exceeded_check(size: usize, allocated: usize) -> &'static str { loop { } }


impl<C: 'static + Chip> Process<'a, C> { fn process_create<C: 'static + Chip>() {
#[allow(clippy::cast_ptr_alignment)] let _: &'static dyn ProcessType = None::<&mut Process<C>>.unwrap();
crate unsafe fn create(
chip: &'static C,
) -> &'static dyn ProcessType {
let mut process: &mut Process<C> = None.unwrap();

process
}
} }


impl<C: 'static + Chip> Process<'a, C> { impl<C: 'static + Chip> Process<'a, C> {
Expand Down

0 comments on commit 71c6e53

Please sign in to comment.