Ref asm&global_asm from core::arch.

This commit is contained in:
Yifan Wu 2022-01-21 10:11:07 -08:00
parent 2cad6d291e
commit f495dbb1e6
8 changed files with 10 additions and 5 deletions

View file

@ -1,4 +1,5 @@
use core::panic::PanicInfo;
use core::arch::asm;
use crate::sbi::shutdown;
use crate::task::current_kstack_top;

View file

@ -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;

View file

@ -14,6 +14,7 @@ use crate::config::{
TRAMPOLINE,
MMIO,
};
use core::arch::asm;
extern "C" {
fn stext();

View file

@ -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,

View file

@ -1,3 +1,5 @@
use core::arch::global_asm;
global_asm!(include_str!("switch.S"));
use super::TaskContext;

View file

@ -1,5 +1,6 @@
mod context;
use core::arch::{asm, global_asm};
use riscv::register::{
mtvec::TrapMode,
stvec,