Skip to content

Commit

Permalink
Import asm!() and global_asm!() for latest nightly
Browse files Browse the repository at this point in the history
Since the 19th of December, these two macros are not exported from the
prelude any longer, and must be imported from core::arch instead.

See rust-lang/rust#87228
  • Loading branch information
linkmauve committed Dec 19, 2021
1 parent 9b6bb19 commit 974326d
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions luma_core/src/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! Contains functions for the L1, L2, Data and Instruction caches.

use crate::{mfspr, mtspr, processor};
use core::arch::{asm, global_asm};

global_asm!(include_str!("../asm/cache.S"));

Expand Down
2 changes: 2 additions & 0 deletions luma_core/src/integer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Contains functions for integer instructions.

use core::arch::asm;

/// (`cntlzw`) PowerPC Integer Instruction
#[inline(always)]
pub fn cntlzw(value: u32) -> u32 {
Expand Down
2 changes: 2 additions & 0 deletions luma_core/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Contains functions for basic I/O.

use core::arch::asm;

/// Read a 32-bit value from an address.
#[inline(always)]
pub fn read32(address: u32) -> u32 {
Expand Down
2 changes: 2 additions & 0 deletions luma_core/src/loadstore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Contains functions for load and store instructions.

use core::arch::asm;

/// (`lhbrx`) PowerPC Load Instruction
#[inline(always)]
pub fn lhbrx(base: u32, index: u32) -> u16 {
Expand Down
2 changes: 2 additions & 0 deletions luma_core/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Contains functions for system instructions.

use core::arch::asm;

/// PowerPC NOP Instruction
#[inline(always)]
pub fn ppc_nop() {
Expand Down
2 changes: 2 additions & 0 deletions luma_core/src/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
//!
//! Contains functions for register instructions.

use core::arch::asm;

/// (`mfspr`) PowerPC Register Instruction
#[macro_export]
macro_rules! mfspr {
Expand Down
1 change: 1 addition & 0 deletions luma_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
alloc_error_handler
)]

use core::arch::global_asm;
use core::{alloc::Layout, panic::PanicInfo};
use linked_list_allocator::LockedHeap;
#[allow(unused_imports)]
Expand Down

0 comments on commit 974326d

Please sign in to comment.