Commit b35d9bde authored by Stefan Lankes's avatar Stefan Lankes

use llvm_asm instead of asm to support the latest nightly compiler

parent 87bf8921
Pipeline #315019 failed with stages
in 2 minutes and 52 seconds
......@@ -14,9 +14,9 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "cc"
version = "1.0.48"
version = "1.0.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52a465a666ca3d838ebbf08b241383421412fe7ebb463527bba275526d89f76"
checksum = "f9a06fb2e53271d7c279ec1efea6ab691c35a2ae67ec0d91d7acec0caf13b518"
[[package]]
name = "eduos-rs"
......@@ -27,9 +27,9 @@ dependencies = [
[[package]]
name = "raw-cpuid"
version = "7.0.3"
version = "8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf"
checksum = "0cee2c7710d96f9f90f56824fca5438b301dc0fb49ece4cf9dfa044e54067e10"
dependencies = [
"bitflags",
"cc",
......@@ -62,9 +62,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]]
name = "x86"
version = "0.28.0"
version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f705f7554f555fa2d0fea9e3b53f5fd8b4b67270f48aac96a4146a19b5bf7db1"
checksum = "c146cbc47471e076987378c159a7aa8fa434680c6fbddca59fe6f40f1591c819"
dependencies = [
"bit_field",
"bitflags",
......
......@@ -7,7 +7,7 @@ authors = ["Stefan Lankes <slankes@eonerc.rwth-aachen.de>"]
[dependencies]
[target.'cfg(target_arch = "x86_64")'.dependencies.x86]
version = "0.28.*"
version = "0.34.*"
default-features = false
# The development profile, used for `cargo build`.
......
......@@ -23,19 +23,19 @@ const KERNEL_CODE_SELECTOR: SegmentSelector = SegmentSelector::new(1, Ring::Ring
/// Enable Interrupts
pub fn irq_enable() {
unsafe { asm!("sti" ::: "memory" : "volatile") };
unsafe { llvm_asm!("sti" ::: "memory" : "volatile") };
}
/// Disable Interrupts
pub fn irq_disable() {
unsafe { asm!("cli" ::: "memory" : "volatile") };
unsafe { llvm_asm!("cli" ::: "memory" : "volatile") };
}
/// Determines, if the interrupt flags (IF) is set
pub fn is_irq_enabled() -> bool {
let rflags: u64;
unsafe { asm!("pushf; pop $0": "=r"(rflags) :: "memory" : "volatile") };
unsafe { llvm_asm!("pushf; pop $0": "=r"(rflags) :: "memory" : "volatile") };
if (rflags & (1u64 << 9)) != 0 {
return true;
}
......
......@@ -8,7 +8,7 @@ use x86::io::*;
#[inline(always)]
pub fn mb() {
unsafe {
asm!("mfence" ::: "memory" : "volatile");
llvm_asm!("mfence" ::: "memory" : "volatile");
}
}
......@@ -18,7 +18,7 @@ pub fn msb(value: u64) -> Option<u64> {
if value > 0 {
let ret: u64;
unsafe {
asm!("bsr $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
llvm_asm!("bsr $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
}
Some(ret)
} else {
......@@ -32,7 +32,7 @@ pub fn lsb(value: u64) -> Option<u64> {
if value > 0 {
let ret: u64;
unsafe {
asm!("bsf $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
llvm_asm!("bsf $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
}
Some(ret)
} else {
......@@ -42,13 +42,13 @@ pub fn lsb(value: u64) -> Option<u64> {
pub fn halt() {
unsafe {
asm!("hlt" :::: "volatile");
llvm_asm!("hlt" :::: "volatile");
}
}
pub fn pause() {
unsafe {
asm!("pause" :::: "volatile");
llvm_asm!("pause" :::: "volatile");
}
}
......
......@@ -16,7 +16,7 @@ extern "C" {
#[naked]
pub unsafe extern "C" fn _start() {
// be sure that rsp is a valid stack pointer
asm!("mov $0, %rsp" :: "r"(BOOT_STACK.top()) :: "volatile");
llvm_asm!("mov $0, %rsp" :: "r"(BOOT_STACK.top()) :: "volatile");
main();
......
......@@ -12,7 +12,7 @@ pub extern "C" fn switch(_old_stack: *mut usize, _new_stack: usize) {
// rsi = new_stack => stack pointer of the new task
unsafe {
asm!(
llvm_asm!(
// store context
"pushfq\n\t\
push %rax\n\t\
......
#![feature(asm, const_fn, lang_items)]
#![feature(llvm_asm, const_fn, lang_items)]
#![feature(allocator_api)]
#![feature(naked_functions)]
#![feature(abi_x86_interrupt)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment