Add missing constants

master
Jiajie Chen 6 years ago
parent 48c40497ac
commit 9b6e963b19

@ -24,7 +24,7 @@ pub unsafe fn has_started(cpu_id: usize) -> bool {
} }
pub unsafe fn start_others(hart_mask: usize) { pub unsafe fn start_others(hart_mask: usize) {
for cpu_id in 0..MAX_CPU_NUM { for cpu_id in 0..32 {
if (hart_mask >> cpu_id) & 1 != 0 { if (hart_mask >> cpu_id) & 1 != 0 {
write_volatile(&mut STARTED[cpu_id], true); write_volatile(&mut STARTED[cpu_id], true);
} }

@ -43,6 +43,11 @@ lazy_static! {
pub static ref STDOUT: Arc<Stdout> = Arc::new(Stdout::default()); pub static ref STDOUT: Arc<Stdout> = Arc::new(Stdout::default());
} }
const TCGETS: u32 = 0x5401;
const TIOCGPGRP: u32 = 0x540F;
const TIOCSPGRP: u32 = 0x5410;
const TIOCGWINSZ: u32 = 0x5413;
// TODO: better way to provide default impl? // TODO: better way to provide default impl?
macro_rules! impl_inode { macro_rules! impl_inode {
() => { () => {
@ -59,7 +64,7 @@ macro_rules! impl_inode {
fn get_entry(&self, _id: usize) -> Result<String> { Err(FsError::NotDir) } fn get_entry(&self, _id: usize) -> Result<String> { Err(FsError::NotDir) }
fn io_control(&self, cmd: u32, data: u32) -> Result<()> { fn io_control(&self, cmd: u32, data: u32) -> Result<()> {
match cmd { match cmd {
TIOCGWINSZ => { TCGETS | TIOCGWINSZ | TIOCGPGRP | TIOCSPGRP => {
// pretend to be tty // pretend to be tty
Ok(()) Ok(())
}, },

Loading…
Cancel
Save