diff options
| author | bors <bors@rust-lang.org> | 2013-05-21 23:25:17 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-05-21 23:25:17 -0700 |
| commit | 8a4bffc7eee07d895e32db9a4a366c23995d260a (patch) | |
| tree | 47fe97e2908b4f8ff28a525c8275e15c9e510683 /src/rt | |
| parent | 15e44381af4f6d89fc62111a8425087ccab40665 (diff) | |
| parent | 499b02213d7de83d301918d6068c75bd08941ac7 (diff) | |
| download | rust-8a4bffc7eee07d895e32db9a4a366c23995d260a.tar.gz rust-8a4bffc7eee07d895e32db9a4a366c23995d260a.zip | |
auto merge of #6667 : crabtw/rust/arm-rt, r=brson
This fixes segmentation fault of new rt tests.
For example
```
use core::rt::test::*;
use core::rt::comm::*;
use core::cell::Cell;
fn main() {
do run_in_newsched_task {
let (port, chan) = oneshot::<~int>();
let port_cell = Cell(port);
do spawntask_immediately {
assert!(port_cell.take().recv() == ~10);
}
chan.send(~10);
}
}
```
Diffstat (limited to 'src/rt')
| -rw-r--r-- | src/rt/arch/arm/context.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/rt/arch/arm/context.cpp b/src/rt/arch/arm/context.cpp index 2c735e410fa..7d90668aad5 100644 --- a/src/rt/arch/arm/context.cpp +++ b/src/rt/arch/arm/context.cpp @@ -26,9 +26,11 @@ void context::call(void *f, void *arg, void *stack) // set up the stack uint32_t *sp = ( uint32_t *)stack; - //sp = align_down(sp); + sp = align_down(sp); // The final return address. 0 indicates the bottom of the stack - *--sp = 0; + // sp of arm eabi is 8-byte aligned + sp -= 2; + *sp = 0; regs.data[0] = ( uint32_t )arg; // r0 regs.data[13] = ( uint32_t )sp; //#52 sp, r13 |
