Ref asm&global_asm from core::arch.
This commit is contained in:
parent
2cad6d291e
commit
f495dbb1e6
8 changed files with 10 additions and 5 deletions
|
@ -1,4 +1,5 @@
|
|||
use core::panic::PanicInfo;
|
||||
use core::arch::asm;
|
||||
use crate::sbi::shutdown;
|
||||
use crate::task::current_kstack_top;
|
||||
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
#![no_std]
|
||||
#![no_main]
|
||||
#![feature(global_asm)]
|
||||
#![feature(asm)]
|
||||
#![feature(panic_info_message)]
|
||||
#![feature(alloc_error_handler)]
|
||||
|
||||
|
@ -10,6 +8,8 @@ extern crate alloc;
|
|||
#[macro_use]
|
||||
extern crate bitflags;
|
||||
|
||||
use core::arch::global_asm;
|
||||
|
||||
#[macro_use]
|
||||
mod console;
|
||||
mod lang_items;
|
||||
|
|
|
@ -14,6 +14,7 @@ use crate::config::{
|
|||
TRAMPOLINE,
|
||||
MMIO,
|
||||
};
|
||||
use core::arch::asm;
|
||||
|
||||
extern "C" {
|
||||
fn stext();
|
||||
|
|
|
@ -14,7 +14,7 @@ const SBI_SHUTDOWN: usize = 8;
|
|||
fn sbi_call(which: usize, arg0: usize, arg1: usize, arg2: usize) -> usize {
|
||||
let mut ret;
|
||||
unsafe {
|
||||
asm!(
|
||||
core::arch::asm!(
|
||||
"ecall",
|
||||
inlateout("x10") arg0 => ret,
|
||||
in("x11") arg1,
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
use core::arch::global_asm;
|
||||
|
||||
global_asm!(include_str!("switch.S"));
|
||||
|
||||
use super::TaskContext;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
mod context;
|
||||
|
||||
use core::arch::{asm, global_asm};
|
||||
use riscv::register::{
|
||||
mtvec::TrapMode,
|
||||
stvec,
|
||||
|
|
|
@ -1 +1 @@
|
|||
nightly-2021-10-15
|
||||
nightly-2022-01-19
|
||||
|
|
|
@ -25,7 +25,7 @@ const SYSCALL_SEMAPHORE_DOWN: usize = 1022;
|
|||
fn syscall(id: usize, args: [usize; 3]) -> isize {
|
||||
let mut ret: isize;
|
||||
unsafe {
|
||||
asm!(
|
||||
core::arch::asm!(
|
||||
"ecall",
|
||||
inlateout("x10") args[0] => ret,
|
||||
in("x11") args[1],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue