From f6e9d571c2766ee4dbb3eb3740ed374a9b0e80e7 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 3 Feb 2017 12:23:38 +0800 Subject: [PATCH] satman: use rust liballoc --- artiq/firmware/satman/Makefile | 5 ++--- artiq/firmware/satman/lib.rs | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/artiq/firmware/satman/Makefile b/artiq/firmware/satman/Makefile index 2144befe3..15169bf7c 100644 --- a/artiq/firmware/satman/Makefile +++ b/artiq/firmware/satman/Makefile @@ -7,8 +7,7 @@ RUSTOUT := cargo/or1k-unknown-none/debug LDFLAGS += --gc-sections \ -L../libcompiler-rt \ - -L../libbase \ - -L../liballoc + -L../libbase all: satman.bin satman.fbi @@ -24,7 +23,7 @@ satman.elf: $(RUSTOUT)/libsatman.a -T $(SATMAN_DIRECTORY)/satman.ld \ -o $@ \ $^ \ - -lbase-nofloat -lcompiler-rt -lalloc + -lbase-nofloat -lcompiler-rt @chmod -x $@ %.o: $(SATMAN_DIRECTORY)/%.c diff --git a/artiq/firmware/satman/lib.rs b/artiq/firmware/satman/lib.rs index 71c3bc063..c51060a66 100644 --- a/artiq/firmware/satman/lib.rs +++ b/artiq/firmware/satman/lib.rs @@ -49,7 +49,6 @@ extern { fn uart_init(); fn uart_isr(); - fn alloc_give(ptr: *mut u8, length: usize); static mut _fheap: u8; static mut _eheap: u8; } @@ -60,8 +59,8 @@ pub unsafe extern fn main() -> i32 { irq::set_ie(true); uart_init(); - alloc_give(&mut _fheap as *mut u8, - &_eheap as *const u8 as usize - &_fheap as *const u8 as usize); + alloc_artiq::seed(&mut _fheap as *mut u8, + &_eheap as *const u8 as usize - &_fheap as *const u8 as usize); static mut LOG_BUFFER: [u8; 65536] = [0; 65536]; logger_artiq::BufferLogger::new(&mut LOG_BUFFER[..]).register(startup);