Aufgrund einer Wartung wird GitLab am 28.09. zwischen 10:00 und 11:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 28.09. between 10:00 and 11:00 am.

Commit 8a6ac20c authored by Stefan Lankes's avatar Stefan Lankes

use llvm_asm instead of asm to support the latest nightly compiler

parent 3b18d91b
Pipeline #326007 failed with stages
in 1 minute and 17 seconds
...@@ -20,12 +20,12 @@ name = "eduos-rs" ...@@ -20,12 +20,12 @@ name = "eduos-rs"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
"x86 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)", "x86 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[[package]] [[package]]
name = "raw-cpuid" name = "raw-cpuid"
version = "7.0.3" version = "8.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
...@@ -61,21 +61,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" ...@@ -61,21 +61,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]] [[package]]
name = "x86" name = "x86"
version = "0.28.0" version = "0.34.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [ dependencies = [
"bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "raw-cpuid 8.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
[metadata] [metadata]
"checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0" "checksum bit_field 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a165d606cf084741d4ac3a28fb6e9b1eb0bd31f6cd999098cfddb0b2ab381dc0"
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
"checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c" "checksum cc 1.0.46 (registry+https://github.com/rust-lang/crates.io-index)" = "0213d356d3c4ea2c18c40b037c3be23cd639825c18f25ee670ac7813beeef99c"
"checksum raw-cpuid 7.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b4a349ca83373cfa5d6dbb66fd76e58b2cca08da71a5f6400de0a0a6a9bceeaf" "checksum raw-cpuid 8.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0cee2c7710d96f9f90f56824fca5438b301dc0fb49ece4cf9dfa044e54067e10"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" "checksum spin 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
"checksum x86 0.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f705f7554f555fa2d0fea9e3b53f5fd8b4b67270f48aac96a4146a19b5bf7db1" "checksum x86 0.34.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c146cbc47471e076987378c159a7aa8fa434680c6fbddca59fe6f40f1591c819"
...@@ -8,7 +8,7 @@ authors = ["Stefan Lankes <slankes@eonerc.rwth-aachen.de>"] ...@@ -8,7 +8,7 @@ authors = ["Stefan Lankes <slankes@eonerc.rwth-aachen.de>"]
spin = "0.5.2" # Spinlocks. spin = "0.5.2" # Spinlocks.
[target.'cfg(target_arch = "x86_64")'.dependencies.x86] [target.'cfg(target_arch = "x86_64")'.dependencies.x86]
version = "0.28.*" version = "0.34.*"
default-features = false default-features = false
# The development profile, used for `cargo build`. # The development profile, used for `cargo build`.
......
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
/// Enable Interrupts /// Enable Interrupts
pub fn irq_enable() { pub fn irq_enable() {
unsafe { asm!("sti" ::: "memory" : "volatile") }; unsafe { llvm_asm!("sti" ::: "memory" : "volatile") };
} }
/// Disable Interrupts /// Disable Interrupts
pub fn irq_disable() { pub fn irq_disable() {
unsafe { asm!("cli" ::: "memory" : "volatile") }; unsafe { llvm_asm!("cli" ::: "memory" : "volatile") };
} }
/// Determines, if the interrupt flags (IF) is set /// Determines, if the interrupt flags (IF) is set
pub fn is_irq_enabled() -> bool { pub fn is_irq_enabled() -> bool {
let rflags: u64; 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 { if (rflags & (1u64 << 9)) != 0 {
return true; return true;
} }
......
...@@ -9,7 +9,7 @@ pub fn msb(value: u64) -> Option<u64> { ...@@ -9,7 +9,7 @@ pub fn msb(value: u64) -> Option<u64> {
if value > 0 { if value > 0 {
let ret: u64; let ret: u64;
unsafe { unsafe {
asm!("bsr $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile"); llvm_asm!("bsr $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
} }
Some(ret) Some(ret)
} else { } else {
...@@ -23,7 +23,7 @@ pub fn lsb(value: u64) -> Option<u64> { ...@@ -23,7 +23,7 @@ pub fn lsb(value: u64) -> Option<u64> {
if value > 0 { if value > 0 {
let ret: u64; let ret: u64;
unsafe { unsafe {
asm!("bsf $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile"); llvm_asm!("bsf $1, $0" : "=r"(ret) : "r"(value) : "cc" : "volatile");
} }
Some(ret) Some(ret)
} else { } else {
...@@ -33,13 +33,13 @@ pub fn lsb(value: u64) -> Option<u64> { ...@@ -33,13 +33,13 @@ pub fn lsb(value: u64) -> Option<u64> {
pub fn halt() { pub fn halt() {
unsafe { unsafe {
asm!("hlt" :::: "volatile"); llvm_asm!("hlt" :::: "volatile");
} }
} }
pub fn pause() { pub fn pause() {
unsafe { unsafe {
asm!("pause" :::: "volatile"); llvm_asm!("pause" :::: "volatile");
} }
} }
......
...@@ -18,7 +18,7 @@ extern "C" { ...@@ -18,7 +18,7 @@ extern "C" {
#[naked] #[naked]
pub unsafe extern "C" fn _start() { pub unsafe extern "C" fn _start() {
// be sure that rsp is a valid stack pointer // 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(); main();
......
...@@ -12,7 +12,7 @@ pub extern "C" fn switch(_old_stack: *mut usize, _new_stack: usize) { ...@@ -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 // rsi = new_stack => stack pointer of the new task
unsafe { unsafe {
asm!( llvm_asm!(
// store context // store context
"pushfq\n\t\ "pushfq\n\t\
push %rax\n\t\ push %rax\n\t\
......
#![feature(asm, const_fn, lang_items)] #![feature(llvm_asm, const_fn, lang_items)]
#![feature(allocator_api)] #![feature(allocator_api)]
#![feature(naked_functions)] #![feature(naked_functions)]
#![no_std] #![no_std]
......
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