aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-08-22 17:04:23 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-08-22 17:05:04 -0400
commitcf4e1c67d3af5b40408a6ef0c8c17959fd438662 (patch)
treef72e3deecbe9680c3118dd92c5e9baae9b8dbba5
parent8f30135db2d6f1c21a64b7815ffcb45958e5b211 (diff)
downloadlibrambutan-cf4e1c67d3af5b40408a6ef0c8c17959fd438662.tar.gz
librambutan-cf4e1c67d3af5b40408a6ef0c8c17959fd438662.zip
Revert "Re-work the constraints on delay_us(). Ask GCC to allocate a register"
This reverts commit 715a63dccb3a39d7d0502fb39b900c8302a60a87. It fails to build using the 2010 CodeSourcery toolchain, which is still the latest officially supported version. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/include/libmaple/delay.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/libmaple/include/libmaple/delay.h b/libmaple/include/libmaple/delay.h
index fbe7d1b..472a208 100644
--- a/libmaple/include/libmaple/delay.h
+++ b/libmaple/include/libmaple/delay.h
@@ -50,12 +50,12 @@ static inline void delay_us(uint32 us) {
/* fudge for function call overhead */
us--;
- asm volatile("1: subs %[us], #1 \n\t"
+ asm volatile(" mov r0, %[us] \n\t"
+ "1: subs r0, #1 \n\t"
" bhi 1b \n\t"
- : [us] "=r" (us)
- : "[us]" (us)
:
- );
+ : [us] "r" (us)
+ : "r0");
}
#ifdef __cplusplus