mirror of
https://github.com/rust-embedded/rust-raspberrypi-OS-tutorials.git
synced 2024-11-11 07:10:59 +00:00
More README fixes
This commit is contained in:
parent
99e937c4de
commit
b0452e3a1f
@ -277,8 +277,7 @@ Here is the implementation for the `PL011Uart`:
|
|||||||
|
|
||||||
```rust
|
```rust
|
||||||
fn register_and_enable_irq_handler(&'static self) -> Result<(), &'static str> {
|
fn register_and_enable_irq_handler(&'static self) -> Result<(), &'static str> {
|
||||||
use bsp::exception::asynchronous::irq_manager;
|
use exception::asynchronous::{irq_manager, IRQDescriptor};
|
||||||
use exception::asynchronous::{interface::IRQManager, IRQDescriptor};
|
|
||||||
|
|
||||||
let descriptor = IRQDescriptor {
|
let descriptor = IRQDescriptor {
|
||||||
name: Self::COMPATIBLE,
|
name: Self::COMPATIBLE,
|
||||||
@ -369,10 +368,8 @@ the the implementation of the trait's handling function:
|
|||||||
```rust
|
```rust
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
|
unsafe extern "C" fn current_elx_irq(_e: &mut ExceptionContext) {
|
||||||
use exception::asynchronous::interface::IRQManager;
|
|
||||||
|
|
||||||
let token = &exception::asynchronous::IRQContext::new();
|
let token = &exception::asynchronous::IRQContext::new();
|
||||||
bsp::exception::asynchronous::irq_manager().handle_pending_irqs(token);
|
exception::asynchronous::irq_manager().handle_pending_irqs(token);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -324,7 +324,7 @@ the first time, an instance of the newly introduced `NullConsole` is used as the
|
|||||||
`NullConsole` implements all the console traits, but does nothing. It discards outputs, and returns
|
`NullConsole` implements all the console traits, but does nothing. It discards outputs, and returns
|
||||||
dummy input. For example, should one of the printing macros be called before the UART driver has
|
dummy input. For example, should one of the printing macros be called before the UART driver has
|
||||||
been instantiated and registered, the kernel does not need to crash because the driver is not
|
been instantiated and registered, the kernel does not need to crash because the driver is not
|
||||||
brought up yet. Instead, it can just discards the output. With this new scheme of things, it is
|
brought up yet. Instead, it can just discard the output. With this new scheme of things, it is
|
||||||
possible to safely switch global references like the UART or the IRQ Manager at runtime.
|
possible to safely switch global references like the UART or the IRQ Manager at runtime.
|
||||||
|
|
||||||
That all the post-driver-init work has now been moved to callbacks is motivated by the idea that
|
That all the post-driver-init work has now been moved to callbacks is motivated by the idea that
|
||||||
@ -382,7 +382,7 @@ been turned on.
|
|||||||
fn kernel_init_mmio_va_allocator() {
|
fn kernel_init_mmio_va_allocator() {
|
||||||
let region = bsp::memory::mmu::virt_mmio_remap_region();
|
let region = bsp::memory::mmu::virt_mmio_remap_region();
|
||||||
|
|
||||||
page_alloc::kernel_mmio_va_allocator().lock(|allocator| allocator.initialize(region));
|
page_alloc::kernel_mmio_va_allocator().lock(|allocator| allocator.init(region));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user