firmware: update for Rust 1.16.0.

This commit is contained in:
whitequark 2016-12-26 17:18:18 +00:00
parent f5f662200b
commit c45a170bb4
11 changed files with 23 additions and 23 deletions

View File

@ -112,8 +112,9 @@ macro_rules! println {
#[path = "../runtime/rpc_queue.rs"]
mod rpc_queue;
#[no_mangle]
#[lang = "panic_fmt"]
extern fn panic_fmt(args: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
pub extern fn panic_fmt(args: core::fmt::Arguments, file: &'static str, line: u32) -> ! {
println!("panic at {}:{}: {}", file, line, args);
send(&RunAborted);
loop {}

View File

@ -49,7 +49,7 @@ use any::TypeId;
use boxed::Box;
use cell;
use fmt::{self, Debug, Display};
use marker::{Send, Sync, Reflect};
use marker::{Send, Sync};
use mem::transmute;
use num;
use core::raw::TraitObject;
@ -57,7 +57,7 @@ use str;
use string::{self, String};
/// Base functionality for all errors in Rust.
pub trait Error: Debug + Display + Reflect {
pub trait Error: Debug + Display {
/// A short description of the error.
///
/// The description should not contain newlines or sentence-ending
@ -258,13 +258,13 @@ impl Error for fmt::Error {
}
}
impl<'a, T: ?Sized + Reflect> Error for cell::BorrowError<'a, T> {
impl Error for cell::BorrowError {
fn description(&self) -> &str {
"already mutably borrowed"
}
}
impl<'a, T: ?Sized + Reflect> Error for cell::BorrowMutError<'a, T> {
impl Error for cell::BorrowMutError {
fn description(&self) -> &str {
"already borrowed"
}

View File

@ -248,7 +248,7 @@
//! time and may call fewer or more syscalls/library functions.
use core::cmp;
use rustc_unicode::str as core_str;
use std_unicode::str as core_str;
use core::fmt;
use core::iter::{Iterator};
use core::marker::Sized;

View File

@ -1,11 +1,10 @@
#![feature(lang_items, asm, alloc, collections, libc, needs_panic_runtime,
question_mark, unicode, reflect_marker, raw, int_error_internals,
try_from, try_borrow, macro_reexport, allow_internal_unstable,
stmt_expr_attributes)]
unicode, raw, int_error_internals, try_from, macro_reexport,
allow_internal_unstable, stmt_expr_attributes)]
#![no_std]
#![needs_panic_runtime]
extern crate rustc_unicode;
extern crate std_unicode;
extern crate alloc_artiq;
extern crate alloc;
#[macro_use]

View File

@ -1,6 +1,5 @@
#![no_std]
#![feature(libc, const_fn, try_borrow, stmt_expr_attributes, repr_simd, asm,
lang_items)]
#![feature(libc, const_fn, stmt_expr_attributes, repr_simd, asm, lang_items)]
#[macro_use]
extern crate std_artiq as std;
@ -46,8 +45,9 @@ pub fn print_fmt(args: self::core::fmt::Arguments) {
let _ = Console.write_fmt(args);
}
#[no_mangle]
#[lang = "panic_fmt"]
extern fn panic_fmt(args: self::core::fmt::Arguments, file: &'static str, line: u32) -> ! {
pub extern fn panic_fmt(args: self::core::fmt::Arguments, file: &'static str, line: u32) -> ! {
let _ = write!(Console, "panic at {}:{}: {}\n", file, line, args);
let _ = write!(Console, "waiting for debugger...\n");
unsafe {

View File

@ -2,24 +2,24 @@ use core::ptr::{read_volatile, write_volatile};
use bsp::board;
const MAILBOX: *mut usize = board::mem::MAILBOX_BASE as *mut usize;
static mut last: usize = 0;
static mut LAST: usize = 0;
pub unsafe fn send(data: usize) {
last = data;
LAST = data;
write_volatile(MAILBOX, data)
}
pub fn acknowledged() -> bool {
unsafe {
let data = read_volatile(MAILBOX);
data == 0 || data != last
data == 0 || data != LAST
}
}
pub fn receive() -> usize {
unsafe {
let data = read_volatile(MAILBOX);
if data == last {
if data == LAST {
0
} else {
if data != 0 {

View File

@ -16,7 +16,7 @@ requirements:
- misoc 0.5.dev
- llvm-or1k
- binutils-or1k-linux >=2.27
- rust-core-or1k
- rust-core-or1k 1.16.0 11
- cargo
run:
- artiq {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_DESCRIBE_HASH")[1:]) if "GIT_DESCRIBE_TAG" in environ else "" }}

View File

@ -16,7 +16,7 @@ requirements:
- misoc 0.5.dev
- llvm-or1k
- binutils-or1k-linux >=2.27
- rust-core-or1k
- rust-core-or1k 1.16.0 11
- cargo
run:
- artiq {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_DESCRIBE_HASH")[1:]) if "GIT_DESCRIBE_TAG" in environ else "" }}

View File

@ -17,7 +17,7 @@ requirements:
- jesd204b 0.2
- llvm-or1k
- binutils-or1k-linux >=2.27
- rust-core-or1k
- rust-core-or1k 1.16.0 11
- cargo
- numpy
run:

View File

@ -16,7 +16,7 @@ requirements:
- misoc 0.5.dev
- llvm-or1k
- binutils-or1k-linux >=2.27
- rust-core-or1k
- rust-core-or1k 1.16.0 11
- cargo
run:
- artiq {{ "{tag} py_{number}+git{hash}".format(tag=environ.get("GIT_DESCRIBE_TAG"), number=environ.get("GIT_DESCRIBE_NUMBER"), hash=environ.get("GIT_DESCRIBE_HASH")[1:]) if "GIT_DESCRIBE_TAG" in environ else "" }}

View File

@ -61,7 +61,7 @@ and the ARTIQ kernels.
* Install Rust: ::
$ cd ~/artiq-dev
$ git clone https://github.com/m-labs/rust
$ git clone -b artiq-1.16.0 https://github.com/m-labs/rust
$ cd rust
$ git checkout artiq
$ git submodule update --init
@ -70,7 +70,7 @@ and the ARTIQ kernels.
$ ../configure --prefix=/usr/local/rust-or1k --llvm-root=/usr/local/llvm-or1k --disable-manage-submodules
$ sudo make install -j4
$ libs="libcore liballoc librustc_unicode libcollections liblibc_mini libunwind"
$ libs="libcore liballoc libstd_unicode libcollections liblibc_mini libunwind"
$ rustc="/usr/local/rust-or1k/bin/rustc --target or1k-unknown-none -g -C target-feature=+mul,+div,+ffl1,+cmov,+addc -C opt-level=s -L ."
$ destdir="/usr/local/rust-or1k/lib/rustlib/or1k-unknown-none/lib/"
$ mkdir ../build-or1k