* Fire up multiple processors

* Use IPIs to wake up secondary processors

* Much better exception information

* Modifications to show more information on fault

* WIP: Use real libstd

* Add TLS (not complete)

* Add random function, export getpid, cleanup

* Do not spin APs until new context

* Update rust

* Update rust

* Use rd/wrfsbase

* Implement TLS

* Implement compiler builtins and update rust

* Update rust

* Back to Redox libstd

* Update rust
This commit is contained in:
Jeremy Soller 2016-10-31 10:49:00 -06:00 committed by GitHub
parent 25dc44b348
commit 149b0297a4
54 changed files with 1121 additions and 380 deletions

View file

@ -15,7 +15,7 @@ use std::rc::Rc;
use event::EventQueue;
use netutils::{n16, n32, Ipv4, Ipv4Addr, Ipv4Header, Tcp, TcpHeader, Checksum, TCP_FIN, TCP_SYN, TCP_RST, TCP_PSH, TCP_ACK};
use syscall::data::Packet;
use syscall::error::{Error, Result, EACCES, EADDRINUSE, EBADF, EINVAL, EISCONN, EMSGSIZE, ENOTCONN, EWOULDBLOCK};
use syscall::error::{Error, Result, EACCES, EADDRINUSE, EBADF, EIO, EINVAL, EISCONN, EMSGSIZE, ENOTCONN, EWOULDBLOCK};
use syscall::flag::{EVENT_READ, O_CREAT, O_RDWR, O_NONBLOCK};
use syscall::scheme::SchemeMut;
@ -274,7 +274,7 @@ impl Tcpd {
let tcp = handle.create_tcp(TCP_ACK | TCP_PSH, buf.to_vec());
let ip = handle.create_ip(self.rng.gen(), tcp.to_bytes());
let result = self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys());
let result = self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO)));
if result.is_ok() {
handle.seq += buf.len() as u32;
}
@ -422,7 +422,7 @@ impl SchemeMut for Tcpd {
let tcp = handle.create_tcp(TCP_SYN, Vec::new());
let ip = handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys())?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO)))?;
handle.seq += 1;
}
@ -469,7 +469,7 @@ impl SchemeMut for Tcpd {
let tcp = new_handle.create_tcp(TCP_SYN | TCP_ACK, Vec::new());
let ip = new_handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys()).and(Ok(buf.len()))?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO))).and(Ok(buf.len()))?;
new_handle.seq += 1;
} else {
@ -506,7 +506,7 @@ impl SchemeMut for Tcpd {
let tcp = new_handle.create_tcp(TCP_SYN, Vec::new());
let ip = new_handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys()).and(Ok(buf.len()))?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO))).and(Ok(buf.len()))?;
} else {
return Err(Error::new(EINVAL));
}
@ -559,7 +559,7 @@ impl SchemeMut for Tcpd {
State::Established => {
let tcp = handle.create_tcp(TCP_ACK | TCP_PSH, buf.to_vec());
let ip = handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys())?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO)))?;
handle.seq += buf.len() as u32;
Ok(buf.len())
},
@ -611,7 +611,7 @@ impl SchemeMut for Tcpd {
let tcp = handle.create_tcp(TCP_FIN | TCP_ACK, Vec::new());
let ip = handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys())?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO)))?;
handle.seq += 1;
@ -622,7 +622,7 @@ impl SchemeMut for Tcpd {
let tcp = handle.create_tcp(TCP_FIN | TCP_ACK, Vec::new());
let ip = handle.create_ip(self.rng.gen(), tcp.to_bytes());
self.tcp_file.write(&ip.to_bytes()).map_err(|err| err.into_sys())?;
self.tcp_file.write(&ip.to_bytes()).map_err(|err| Error::new(err.raw_os_error().unwrap_or(EIO)))?;
handle.seq += 1;