mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-24 10:26:25 +04:00
Bump to rust nightly-2022-01-01, feature global_asm,asm->stable
This commit is contained in:
parent
95b0581394
commit
0d5b0f9f37
@ -1,5 +1,6 @@
|
|||||||
use crate::trap::TrapContext;
|
use crate::trap::TrapContext;
|
||||||
use crate::config::*;
|
use crate::config::*;
|
||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
#[repr(align(4096))]
|
#[repr(align(4096))]
|
||||||
#[derive(Copy, Clone)]
|
#[derive(Copy, Clone)]
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
#![feature(global_asm)]
|
|
||||||
#![feature(asm)]
|
|
||||||
#![feature(panic_info_message)]
|
#![feature(panic_info_message)]
|
||||||
|
|
||||||
|
use core::arch::global_asm;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
mod console;
|
mod console;
|
||||||
mod lang_items;
|
mod lang_items;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#![allow(unused)]
|
#![allow(unused)]
|
||||||
|
|
||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
const SBI_SET_TIMER: usize = 0;
|
const SBI_SET_TIMER: usize = 0;
|
||||||
const SBI_CONSOLE_PUTCHAR: usize = 1;
|
const SBI_CONSOLE_PUTCHAR: usize = 1;
|
||||||
const SBI_CONSOLE_GETCHAR: usize = 2;
|
const SBI_CONSOLE_GETCHAR: usize = 2;
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
global_asm!(include_str!("switch.S"));
|
|
||||||
|
|
||||||
use super::TaskContext;
|
use super::TaskContext;
|
||||||
|
use core::arch::global_asm;
|
||||||
|
|
||||||
|
global_asm!(include_str!("switch.S"));
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub fn __switch(
|
pub fn __switch(
|
||||||
|
@ -18,6 +18,7 @@ use crate::task::{
|
|||||||
suspend_current_and_run_next,
|
suspend_current_and_run_next,
|
||||||
};
|
};
|
||||||
use crate::timer::set_next_trigger;
|
use crate::timer::set_next_trigger;
|
||||||
|
use core::arch::global_asm;
|
||||||
|
|
||||||
global_asm!(include_str!("trap.S"));
|
global_asm!(include_str!("trap.S"));
|
||||||
|
|
||||||
@ -61,4 +62,4 @@ pub fn trap_handler(cx: &mut TrapContext) -> &mut TrapContext {
|
|||||||
cx
|
cx
|
||||||
}
|
}
|
||||||
|
|
||||||
pub use context::TrapContext;
|
pub use context::TrapContext;
|
||||||
|
@ -1 +1 @@
|
|||||||
nightly-2021-12-15
|
nightly-2022-01-01
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![feature(asm)]
|
|
||||||
#![feature(linkage)]
|
#![feature(linkage)]
|
||||||
#![feature(panic_info_message)]
|
#![feature(panic_info_message)]
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
use core::arch::asm;
|
||||||
|
|
||||||
const SYSCALL_WRITE: usize = 64;
|
const SYSCALL_WRITE: usize = 64;
|
||||||
const SYSCALL_EXIT: usize = 93;
|
const SYSCALL_EXIT: usize = 93;
|
||||||
const SYSCALL_YIELD: usize = 124;
|
const SYSCALL_YIELD: usize = 124;
|
||||||
@ -31,4 +33,4 @@ pub fn sys_yield() -> isize {
|
|||||||
|
|
||||||
pub fn sys_get_time() -> isize {
|
pub fn sys_get_time() -> isize {
|
||||||
syscall(SYSCALL_GET_TIME, [0, 0, 0])
|
syscall(SYSCALL_GET_TIME, [0, 0, 0])
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user