Skip to content

Fix build: Use the new rust asm! available in rustc 1.63.0-nightly #43

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use core::prelude::v1::*;
use core::marker::PhantomData;
use core::arch::asm;

/// Helper struct that automatically restores interrupts
/// on drop.
Expand All @@ -22,15 +23,15 @@ pub fn without_interrupts<F, T>(f: F) -> T
impl DisableInterrupts {
#[inline(always)]
pub fn new() -> DisableInterrupts {
unsafe { llvm_asm!("CLI") }
unsafe { asm!("cli") }
DisableInterrupts(PhantomData)
}
}

impl Drop for DisableInterrupts {
#[inline(always)]
fn drop(&mut self) {
unsafe { llvm_asm!("SEI") }
unsafe { asm!("sei") }
}
}

4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
//! Definitions of register addresses and bits within those registers

#![feature(llvm_asm)]
#![feature(const_fn)]
#![feature(asm_experimental_arch)]
#![feature(associated_type_defaults)]
#![feature(lang_items)]
#![feature(unwind_attributes)]
#![feature(proc_macro_hygiene)]

#![no_std]
Expand Down