forked from M-Labs/artiq
1
0
Fork 0

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"] #[path = "../runtime/rpc_queue.rs"]
mod rpc_queue; mod rpc_queue;
#[no_mangle]
#[lang = "panic_fmt"] #[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); println!("panic at {}:{}: {}", file, line, args);
send(&RunAborted); send(&RunAborted);
loop {} loop {}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,7 +16,7 @@ requirements:
- misoc 0.5.dev - misoc 0.5.dev
- llvm-or1k - llvm-or1k
- binutils-or1k-linux >=2.27 - binutils-or1k-linux >=2.27
- rust-core-or1k - rust-core-or1k 1.16.0 11
- cargo - cargo
run: 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 "" }} - 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 - misoc 0.5.dev
- llvm-or1k - llvm-or1k
- binutils-or1k-linux >=2.27 - binutils-or1k-linux >=2.27
- rust-core-or1k - rust-core-or1k 1.16.0 11
- cargo - cargo
run: 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 "" }} - 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 - jesd204b 0.2
- llvm-or1k - llvm-or1k
- binutils-or1k-linux >=2.27 - binutils-or1k-linux >=2.27
- rust-core-or1k - rust-core-or1k 1.16.0 11
- cargo - cargo
- numpy - numpy
run: run:

View File

@ -16,7 +16,7 @@ requirements:
- misoc 0.5.dev - misoc 0.5.dev
- llvm-or1k - llvm-or1k
- binutils-or1k-linux >=2.27 - binutils-or1k-linux >=2.27
- rust-core-or1k - rust-core-or1k 1.16.0 11
- cargo - cargo
run: 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 "" }} - 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: :: * Install Rust: ::
$ cd ~/artiq-dev $ 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 $ cd rust
$ git checkout artiq $ git checkout artiq
$ git submodule update --init $ 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 $ ../configure --prefix=/usr/local/rust-or1k --llvm-root=/usr/local/llvm-or1k --disable-manage-submodules
$ sudo make install -j4 $ 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 ." $ 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/" $ destdir="/usr/local/rust-or1k/lib/rustlib/or1k-unknown-none/lib/"
$ mkdir ../build-or1k $ mkdir ../build-or1k