Fix u540 serial print and fix sys_accept

master
Jiajie Chen 6 years ago
parent 7fd9130024
commit fffc330f47

@ -27,6 +27,11 @@ fn putchar(c: u8) {
} else if cfg!(feature = "m_mode") {
(super::BBL.mcall_console_putchar)(c);
} else {
if cfg!(feature = "board_u540") {
if c == b'\n' {
sbi::console_putchar(b'\r' as usize);
}
}
sbi::console_putchar(c as usize);
}
}

@ -407,18 +407,6 @@ pub fn sys_accept(fd: usize, addr: *mut SockAddr, addr_len: *mut u32) -> SysResu
// open multiple sockets for each connection
let mut proc = process();
if !addr.is_null() {
proc.memory_set.check_mut_ptr(addr_len)?;
let max_addr_len = unsafe { *addr_len } as usize;
if max_addr_len < size_of::<SockAddr>() {
debug!("length too short {}", max_addr_len);
return Err(SysError::EINVAL);
}
proc.memory_set.check_mut_ptr(addr)?;
}
let wrapper = proc.get_socket_mut(fd)?;
if let SocketType::Tcp(tcp_state) = wrapper.socket_type.clone() {
if let Some(endpoint) = tcp_state.local_endpoint {

Loading…
Cancel
Save