forked from M-Labs/artiq
satman: use rust liballoc
This commit is contained in:
parent
d181989de9
commit
f6e9d571c2
|
@ -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
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue