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: fdcb27ccff73
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: 1e392cca648c
Choose a head ref
  • 2 commits
  • 17 files changed
  • 1 contributor

Commits on Sep 29, 2016

  1. Rust: use generated CSR functions.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    3263def View commit details
  2. runtime: remove "test mode" functionality.

    whitequark committed Sep 29, 2016
    Copy the full SHA
    1e392cc View commit details
15 changes: 15 additions & 0 deletions artiq/runtime.rs/src/board.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use core::{cmp, ptr, str};

include!(concat!(env!("BUILDINC_DIRECTORY"), "/generated/mem.rs"));
include!(concat!(env!("BUILDINC_DIRECTORY"), "/generated/csr.rs"));

pub fn ident(buf: &mut [u8]) -> &str {
unsafe {
let len = ptr::read_volatile(csr::IDENTIFIER_MEM_BASE);
let len = cmp::min(len as usize, buf.len());
for i in 0..len {
buf[i] = ptr::read_volatile(csr::IDENTIFIER_MEM_BASE.offset(1 + i as isize)) as u8
}
str::from_utf8_unchecked(&buf[..len])
}
}
4 changes: 2 additions & 2 deletions artiq/runtime.rs/src/buffer_logger.rs
Original file line number Diff line number Diff line change
@@ -48,9 +48,9 @@ impl Log for BufferLogger {
fn log(&self, record: &LogRecord) {
if self.enabled(record.metadata()) {
use core::fmt::Write;
writeln!(self.buffer.borrow_mut(), "{}({}): {}",
writeln!(self.buffer.borrow_mut(), "{:>5}({}): {}",
record.level(), record.location().module_path(), record.args()).unwrap();
println!("{}({}): {}",
println!("{:>5}({}): {}",
record.level(), record.location().module_path(), record.args());
}
}
1 change: 1 addition & 0 deletions artiq/runtime.rs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ extern crate byteorder;
use std::prelude::v1::*;
use buffer_logger::BufferLogger;

pub mod board;
pub mod io;
pub mod buffer_logger;
pub mod session;
11 changes: 1 addition & 10 deletions artiq/runtime.rs/src/session/mod.rs
Original file line number Diff line number Diff line change
@@ -68,16 +68,7 @@ fn handle_request(stream: &mut ::io::TcpStream,

match try!(read_request(stream)) {
Request::Ident => {
let mut ident: [u8; 256];
let ident = unsafe {
extern { fn get_ident(ident: *mut u8); }

ident = ::core::mem::uninitialized();
get_ident(ident.as_mut_ptr());
&ident[..ident.iter().position(|&c| c == 0).unwrap()]
};

write_reply(stream, Reply::Ident(str::from_utf8(ident).unwrap()))
write_reply(stream, Reply::Ident(::board::ident(&mut [0; 64])))
}

Request::Log => {
6 changes: 3 additions & 3 deletions artiq/runtime/Makefile
Original file line number Diff line number Diff line change
@@ -4,10 +4,10 @@ include $(MISOC_DIRECTORY)/software/common.mak
PYTHON ?= python3.5

OBJECTS := isr.o clock.o rtiocrg.o flash_storage.o mailbox.o \
session.o log.o analyzer.o moninj.o net_server.o bridge_ctl.o \
ksupport_data.o kloader.o test_mode.o main.o
session.o log.o analyzer.o moninj.o net_server.o \
ksupport_data.o kloader.o main.o
OBJECTS_KSUPPORT := ksupport.o artiq_personality.o mailbox.o \
bridge.o rtio.o dds.o i2c.o
rtio.o dds.o i2c.o

CFLAGS += -I$(LIBALLOC_DIRECTORY) \
-I$(MISOC_DIRECTORY)/software/include/dyld \
131 changes: 0 additions & 131 deletions artiq/runtime/bridge.c

This file was deleted.

6 changes: 0 additions & 6 deletions artiq/runtime/bridge.h

This file was deleted.

106 changes: 0 additions & 106 deletions artiq/runtime/bridge_ctl.c

This file was deleted.

15 changes: 0 additions & 15 deletions artiq/runtime/bridge_ctl.h

This file was deleted.

5 changes: 0 additions & 5 deletions artiq/runtime/kloader.c
Original file line number Diff line number Diff line change
@@ -26,11 +26,6 @@ static void start_kernel_cpu(struct msg_load_request *msg)
kernel_cpu_reset_write(0);
}

void kloader_start_bridge()
{
start_kernel_cpu(NULL);
}

static int load_or_start_kernel(const void *library, int run_kernel)
{
static struct dyld_info library_info;
1 change: 0 additions & 1 deletion artiq/runtime/kloader.h
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@ int kloader_load_library(const void *code);
void kloader_filter_backtrace(struct artiq_backtrace_item *backtrace,
size_t *backtrace_size);

void kloader_start_bridge(void);
int kloader_start_startup_kernel(void);
int kloader_start_idle_kernel(void);
void kloader_start_kernel(void);
6 changes: 0 additions & 6 deletions artiq/runtime/ksupport.c
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
#include "kloader.h"
#include "mailbox.h"
#include "messages.h"
#include "bridge.h"
#include "artiq_personality.h"
#include "rtio.h"
#include "dds.h"
@@ -377,11 +376,6 @@ int main(void)
.error = NULL
};

if(request == NULL) {
bridge_main();
while(1);
}

if(request->library != NULL) {
if(!dyld_load(request->library, KERNELCPU_PAYLOAD_ADDRESS,
resolve_runtime_export, request->library_info,
Loading