mirror of
https://github.com/rcore-os/rCore.git
synced 2024-11-21 23:56:18 +04:00
Merge pull request #46 from Jackey-Huo/dev
HTIF interface read enabled for rocket-chip
This commit is contained in:
commit
2a4747abaa
@ -29,7 +29,14 @@ impl Stdin {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
#[cfg(not(feature = "board_k210"))]
|
||||
#[cfg(feature = "board_rocket_chip")]
|
||||
loop {
|
||||
let c = crate::arch::io::getchar();
|
||||
if c != '\0' && c as u8 != 254 {
|
||||
return c;
|
||||
}
|
||||
}
|
||||
#[cfg(not(any(feature = "board_k210", feature = "board_rocket_chip")))]
|
||||
loop {
|
||||
let mut buf_lock = self.buf.lock();
|
||||
match buf_lock.pop_front() {
|
||||
@ -41,7 +48,12 @@ impl Stdin {
|
||||
}
|
||||
}
|
||||
pub fn can_read(&self) -> bool {
|
||||
self.buf.lock().len() > 0
|
||||
// Currently, rocket-chip implementation rely on htif interface, the serial interrupt DO
|
||||
// NOT work, so return true always
|
||||
#[cfg(feature = "board_rocket_chip")]
|
||||
return true;
|
||||
#[cfg(not(feature = "board_rocket_chip"))]
|
||||
return self.buf.lock().len() > 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ use crate::fs::ROOT_INODE;
|
||||
use crate::process::*;
|
||||
use alloc::string::String;
|
||||
use alloc::vec::Vec;
|
||||
use crate::arch::io;
|
||||
|
||||
#[cfg(not(feature = "run_cmdline"))]
|
||||
pub fn add_user_shell() {
|
||||
@ -44,6 +45,7 @@ pub fn add_user_shell() {
|
||||
let inode = ROOT_INODE.lookup(&cmdline).unwrap();
|
||||
processor().manager().add(Thread::new_user(
|
||||
&inode,
|
||||
"/busybox",
|
||||
cmdline.split(' ').map(|s| s.into()).collect(),
|
||||
Vec::new(),
|
||||
));
|
||||
|
0
tools/addr2line.py
Normal file → Executable file
0
tools/addr2line.py
Normal file → Executable file
Loading…
Reference in New Issue
Block a user