refactor: unsafe only in adapter + libkos; forbid(unsafe_code) everywhere else; libkos Window (volatile, bounds-checked MMIO/DMA/shared mem), entry!, thread::spawn; MapRegion returns pages; kernel const-built (with_cores/install_platform); newtype addrs
This commit is contained in:
@@ -2,24 +2,10 @@
|
||||
mod tests;
|
||||
|
||||
use core::future::Future;
|
||||
use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker};
|
||||
|
||||
fn noop_raw_waker() -> RawWaker {
|
||||
fn no_op(_: *const ()) {}
|
||||
fn clone(_: *const ()) -> RawWaker { noop_raw_waker() }
|
||||
RawWaker::new(
|
||||
core::ptr::null(),
|
||||
&RawWakerVTable::new(clone, no_op, no_op, no_op),
|
||||
)
|
||||
}
|
||||
|
||||
fn noop_waker() -> Waker {
|
||||
unsafe { Waker::from_raw(noop_raw_waker()) }
|
||||
}
|
||||
use core::task::{Context, Poll, Waker};
|
||||
|
||||
pub fn block_on<F: Future>(future: F) -> F::Output {
|
||||
let waker = noop_waker();
|
||||
let mut cx = Context::from_waker(&waker);
|
||||
let mut cx = Context::from_waker(Waker::noop());
|
||||
let mut future = core::pin::pin!(future);
|
||||
|
||||
loop {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#![no_std]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
pub mod codec;
|
||||
pub mod executor;
|
||||
|
||||
Reference in New Issue
Block a user