auto merge of #6249 : crabtw/rust/arm, r=brson

It uses the private field of TCB head to store stack limit. I tested on my Raspberry PI. A simple hello world program ran without any problem. However, for a more complex program, it segfaulted as #6231.
This commit is contained in:
bors 2013-05-17 18:19:27 -07:00
commit d68c0279ea
5 changed files with 42 additions and 1 deletions

View file

@ -64,7 +64,7 @@ pub fn get_target_strs(target_os: session::os) -> target_strs::t {
target_triple: match target_os {
session::os_macos => ~"arm-apple-darwin",
session::os_win32 => ~"arm-pc-mingw32",
session::os_linux => ~"arm-unknown-linux",
session::os_linux => ~"arm-unknown-linux-gnueabihf",
session::os_android => ~"arm-linux-androideabi",
session::os_freebsd => ~"arm-unknown-freebsd"
},

View file

@ -15,13 +15,21 @@
record_sp_limit:
mrc p15, #0, r3, c13, c0, #3
#if __ANDROID__
add r3, r3, #252
#elif __linux__
add r3, r3, #4
#endif
str r0, [r3]
mov pc, lr
get_sp_limit:
mrc p15, #0, r3, c13, c0, #3
#if __ANDROID__
add r3, r3, #252
#elif __linux__
add r3, r3, #4
#endif
ldr r0, [r3]
mov pc, lr

View file

@ -146,6 +146,9 @@
#ifdef __mips__
#define RED_ZONE_SIZE RZ_MAC_32
#endif
#ifdef __arm__
#define RED_ZONE_SIZE RZ_LINUX_32
#endif
#endif
#ifdef __APPLE__
#ifdef __i386__