satman: use rust liballoc

This commit is contained in:
Sebastien Bourdeauducq 2017-02-03 12:23:38 +08:00
parent d181989de9
commit f6e9d571c2
2 changed files with 4 additions and 6 deletions

View File

@ -7,8 +7,7 @@ RUSTOUT := cargo/or1k-unknown-none/debug
LDFLAGS += --gc-sections \ LDFLAGS += --gc-sections \
-L../libcompiler-rt \ -L../libcompiler-rt \
-L../libbase \ -L../libbase
-L../liballoc
all: satman.bin satman.fbi all: satman.bin satman.fbi
@ -24,7 +23,7 @@ satman.elf: $(RUSTOUT)/libsatman.a
-T $(SATMAN_DIRECTORY)/satman.ld \ -T $(SATMAN_DIRECTORY)/satman.ld \
-o $@ \ -o $@ \
$^ \ $^ \
-lbase-nofloat -lcompiler-rt -lalloc -lbase-nofloat -lcompiler-rt
@chmod -x $@ @chmod -x $@
%.o: $(SATMAN_DIRECTORY)/%.c %.o: $(SATMAN_DIRECTORY)/%.c

View File

@ -49,7 +49,6 @@ extern {
fn uart_init(); fn uart_init();
fn uart_isr(); fn uart_isr();
fn alloc_give(ptr: *mut u8, length: usize);
static mut _fheap: u8; static mut _fheap: u8;
static mut _eheap: u8; static mut _eheap: u8;
} }
@ -60,8 +59,8 @@ pub unsafe extern fn main() -> i32 {
irq::set_ie(true); irq::set_ie(true);
uart_init(); uart_init();
alloc_give(&mut _fheap as *mut u8, alloc_artiq::seed(&mut _fheap as *mut u8,
&_eheap as *const u8 as usize - &_fheap as *const u8 as usize); &_eheap as *const u8 as usize - &_fheap as *const u8 as usize);
static mut LOG_BUFFER: [u8; 65536] = [0; 65536]; static mut LOG_BUFFER: [u8; 65536] = [0; 65536];
logger_artiq::BufferLogger::new(&mut LOG_BUFFER[..]).register(startup); logger_artiq::BufferLogger::new(&mut LOG_BUFFER[..]).register(startup);