Skip to content

Import asm!() and global_asm!() for latest nightly #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8 changes: 1 addition & 7 deletions luma_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@
//! **NOTE**: This is currently in a very experimental state and is subject to change.
#![no_std]
#![allow(unused_attributes)]
#![feature(
global_asm,
asm,
asm_experimental_arch,
box_into_boxed_slice,
allocator_api
)]
#![feature(asm_experimental_arch, box_into_boxed_slice, allocator_api)]

extern crate alloc;

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
9 changes: 2 additions & 7 deletions luma_runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,9 @@
//!
//! **NOTE**: This is currently in a very experimental state and is subject to change.
#![no_std]
#![feature(
global_asm,
asm_experimental_arch,
lang_items,
llvm_asm,
alloc_error_handler
)]
#![feature(asm_experimental_arch, lang_items, alloc_error_handler)]

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