mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-25 11:18:27 +08:00
firmware use Rust 0.18.0.
This commit is contained in:
parent
fe05aede78
commit
db494967c5
@ -81,6 +81,13 @@ pub extern fn __rust_allocate(mut size: usize, align: usize) -> *mut u8 {
|
||||
ptr::null_mut()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn __rust_allocate_zeroed(size: usize, align: usize) -> *mut u8 {
|
||||
let ptr = __rust_allocate(size, align);
|
||||
unsafe { ptr::write_bytes(ptr, 0, size); }
|
||||
ptr
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn __rust_deallocate(ptr: *mut u8, _old_size: usize, _align: usize) {
|
||||
unsafe {
|
||||
|
@ -7,6 +7,11 @@ pub extern "C" fn __rust_allocate(_size: usize, _align: usize) -> *mut u8 {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern fn __rust_allocate_zeroed(_size: usize, _align: usize) -> *mut u8 {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
#[no_mangle]
|
||||
pub extern "C" fn __rust_deallocate(_ptr: *mut u8, _old_size: usize, _align: usize) {
|
||||
unimplemented!()
|
||||
|
@ -2,8 +2,6 @@
|
||||
|
||||
#[macro_use]
|
||||
extern crate std_artiq as std;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate board;
|
||||
extern crate byteorder;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![no_std]
|
||||
#![feature(untagged_unions, ptr_unaligned)]
|
||||
#![feature(untagged_unions)]
|
||||
|
||||
use core::{mem, ptr, fmt, slice, str, convert};
|
||||
use elf::*;
|
||||
|
@ -248,7 +248,6 @@
|
||||
//! time and may call fewer or more syscalls/library functions.
|
||||
|
||||
use core::cmp;
|
||||
use std_unicode::str as core_str;
|
||||
use core::fmt;
|
||||
use core::iter::{Iterator};
|
||||
use core::marker::Sized;
|
||||
@ -1529,7 +1528,7 @@ impl<R: Read> Iterator for Chars<R> {
|
||||
Ok(..) => buf[0],
|
||||
Err(e) => return Some(Err(CharsError::Other(e))),
|
||||
};
|
||||
let width = core_str::utf8_char_width(first_byte);
|
||||
let width = ::core::str::utf8_char_width(first_byte);
|
||||
if width == 1 { return Some(Ok(first_byte as char)) }
|
||||
if width == 0 { return Some(Err(CharsError::NotUtf8)) }
|
||||
let mut buf = [first_byte, 0, 0, 0];
|
||||
|
@ -1,6 +1,6 @@
|
||||
#![feature(lang_items, asm, alloc, collections, needs_panic_runtime,
|
||||
unicode, raw, int_error_internals, try_from, macro_reexport,
|
||||
allow_internal_unstable, stmt_expr_attributes)]
|
||||
allow_internal_unstable, stmt_expr_attributes, str_internals)]
|
||||
#![no_std]
|
||||
#![needs_panic_runtime]
|
||||
|
||||
|
@ -1,7 +1,8 @@
|
||||
#![no_std]
|
||||
#![feature(compiler_builtins_lib, repr_simd, lang_items, const_fn)]
|
||||
#![feature(compiler_builtins_lib, alloc, oom, repr_simd, lang_items, const_fn)]
|
||||
|
||||
extern crate compiler_builtins;
|
||||
extern crate alloc;
|
||||
extern crate cslice;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
@ -168,6 +169,9 @@ pub extern fn main() -> i32 {
|
||||
alloc_artiq::seed(&mut _fheap as *mut u8,
|
||||
&_eheap as *const u8 as usize - &_fheap as *const u8 as usize);
|
||||
|
||||
fn oom() -> ! { panic!("out of memory") }
|
||||
alloc::oom::set_oom_handler(oom);
|
||||
|
||||
static mut LOG_BUFFER: [u8; 65536] = [0; 65536];
|
||||
logger_artiq::BufferLogger::new(&mut LOG_BUFFER[..]).register(startup);
|
||||
0
|
||||
|
@ -36,7 +36,7 @@ def get_argparser():
|
||||
parser.add_argument("-t", "--target", metavar="TARGET",
|
||||
type=str, default="kc705_dds",
|
||||
help="Target to build, one of: "
|
||||
"kc705_dds kc705_drtio_satellite")
|
||||
"kc705_dds kc705_drtio_master kc705_drtio_satellite")
|
||||
parser.add_argument("-c", "--config", metavar="TARGET_CFG",
|
||||
type=str, default="openocd-kc705.cfg",
|
||||
help="OpenOCD configuration file corresponding to the development board")
|
||||
@ -53,7 +53,7 @@ def main():
|
||||
args = get_argparser().parse_args()
|
||||
init_logger(args)
|
||||
|
||||
if args.target == "kc705_dds":
|
||||
if args.target == "kc705_dds" or args.target == "kc705_drtio_master":
|
||||
firmware = "runtime"
|
||||
elif args.target == "kc705_drtio_satellite":
|
||||
firmware = "satman"
|
||||
|
@ -20,7 +20,7 @@ requirements:
|
||||
- binutils-or1k-linux >=2.27
|
||||
- llvm-or1k
|
||||
- llvmlite-artiq 0.12.0.dev py35_30
|
||||
- rust-core-or1k 1.17.0 12
|
||||
- rust-core-or1k 1.18.0 13
|
||||
- cargo 0.11.0
|
||||
- openocd >=0.10
|
||||
- lit
|
||||
|
@ -62,7 +62,7 @@ and the ARTIQ kernels.
|
||||
|
||||
$ cd ~/artiq-dev
|
||||
$ git clone --recursive https://github.com/m-labs/artiq
|
||||
|
||||
|
||||
Add ``-b release-X`` to the ``git clone`` command if you are building a stable branch of ARTIQ (the default will fetch the development ``master`` branch).
|
||||
|
||||
* Install OpenRISC binutils (or1k-linux-...): ::
|
||||
@ -99,13 +99,15 @@ and the ARTIQ kernels.
|
||||
* Install Rust: ::
|
||||
|
||||
$ cd ~/artiq-dev
|
||||
$ git clone -b artiq-1.16.0 https://github.com/m-labs/rust
|
||||
$ git clone -b artiq-1.18.0 https://github.com/m-labs/rust
|
||||
$ cd rust
|
||||
$ git submodule update --init
|
||||
$ mkdir build
|
||||
$ cd build
|
||||
$ ../configure --prefix=/usr/local/rust-or1k --llvm-root=/usr/local/llvm-or1k --disable-manage-submodules
|
||||
$ sudo make install -j4
|
||||
$ sudo mkdir /usr/local/rust-or1k
|
||||
$ sudo chown $USER.$USER /usr/local/rust-or1k
|
||||
$ make install
|
||||
|
||||
$ 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 ."
|
||||
|
Loading…
Reference in New Issue
Block a user