Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/artiq
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: b52ecda1d532
Choose a base ref
...
head repository: m-labs/artiq
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8be60cc22305
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Oct 7, 2016

  1. runtime: remove useless handshaking in analyzer.

    whitequark committed Oct 7, 2016
    Copy the full SHA
    4f11b07 View commit details
  2. Copy the full SHA
    8be60cc View commit details
Showing with 5 additions and 22 deletions.
  1. +1 −1 artiq/coredevice/comm_tcp.py
  2. +2 −19 artiq/runtime.rs/src/analyzer.rs
  3. +1 −1 artiq/runtime.rs/src/kernel.rs
  4. +1 −1 artiq/runtime/ksupport.c
2 changes: 1 addition & 1 deletion artiq/coredevice/comm_tcp.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,6 @@ def initialize_connection(host, port):
sock.settimeout(None)
set_keepalive(sock, 3, 2, 3)
logger.debug("connected to host %s on port %d", host, port)
sock.sendall(b"ARTIQ coredev\n")
return sock


@@ -44,6 +43,7 @@ def open(self):
if hasattr(self, "socket"):
return
self.socket = initialize_connection(self.host, self.port)
self.socket.sendall(b"ARTIQ coredev\n")

def close(self):
if not hasattr(self, "socket"):
21 changes: 2 additions & 19 deletions artiq/runtime.rs/src/analyzer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::io::{self, Read, Write};
use std::io::{self, Write};
use board::{self, csr};
use sched::{Waiter, Spawner};
use sched::{TcpListener, TcpStream, SocketAddr, IP_ANY};
@@ -68,19 +68,6 @@ fn worker(mut stream: TcpStream) -> io::Result<()> {
Ok(())
}

// TODO: remove this, it's pointless in analyzer
fn check_magic(stream: &mut TcpStream) -> io::Result<()> {
const MAGIC: &'static [u8] = b"ARTIQ coredev\n";

let mut magic: [u8; 14] = [0; 14];
try!(stream.read_exact(&mut magic));
if magic != MAGIC {
Err(io::Error::new(io::ErrorKind::InvalidData, "unrecognized magic"))
} else {
Ok(())
}
}

pub fn thread(waiter: Waiter, _spawner: Spawner) {
// verify that the hack above works
assert!(::core::mem::align_of::<Buffer>() == 64);
@@ -92,11 +79,7 @@ pub fn thread(waiter: Waiter, _spawner: Spawner) {
loop {
arm();

let (mut stream, addr) = listener.accept().expect("cannot accept client");
match check_magic(&mut stream) {
Ok(()) => (),
Err(_) => continue
}
let (stream, addr) = listener.accept().expect("cannot accept client");
info!("connection from {}", addr);

disarm();
2 changes: 1 addition & 1 deletion artiq/runtime.rs/src/kernel.rs
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ use board::csr;
use mailbox;

const KERNELCPU_EXEC_ADDRESS: usize = 0x40400000;
const KERNELCPU_LAST_ADDRESS: usize = (0x4fffffff - 1024*1024);
const KERNELCPU_LAST_ADDRESS: usize = 0x4fffffff;
const KSUPPORT_HEADER_SIZE: usize = 0x80;

pub unsafe fn start() {
2 changes: 1 addition & 1 deletion artiq/runtime/ksupport.c
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

#define KERNELCPU_EXEC_ADDRESS 0x40400000
#define KERNELCPU_PAYLOAD_ADDRESS 0x40420000
#define KERNELCPU_LAST_ADDRESS (0x4fffffff - 1024*1024)
#define KERNELCPU_LAST_ADDRESS 0x4fffffff
#define KSUPPORT_HEADER_SIZE 0x80

double round(double x);