summaryrefslogtreecommitdiff
path: root/src/util/check-stack
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-25 20:43:44 -0700
committerKeith Packard <keithp@keithp.com>2011-08-25 20:49:11 -0700
commit9513be7f9d3d0b0ec29f6487fa9dc8f1ac24d0de (patch)
tree6cfa006884cab18f56e95c79c3268df4817885f1 /src/util/check-stack
parent3bfe8df44b575ca430ffaa051e20faa955a06c03 (diff)
altos: Restructure altos build to prepare for multi-arch support
Split out sources into separate directories: core: architecture and product independent bits cc1111: cc1111-specific code drivers: architecture independent drivers product: product-specific sources and Makefile fragments util: scripts for building stuff This should have no effect on the built products, but testing is encouraged Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/util/check-stack')
-rwxr-xr-xsrc/util/check-stack13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/check-stack b/src/util/check-stack
new file mode 100755
index 00000000..1e8044e0
--- /dev/null
+++ b/src/util/check-stack
@@ -0,0 +1,13 @@
+#!/bin/sh
+HEADER=$1
+MEM=$2
+
+HEADER_STACK=`awk '/#define AO_STACK_START/ {print strtonum($3)}' $HEADER`
+MEM_STACK=`awk '/Stack starts at/ {print strtonum ($4)}' $MEM`
+
+if [ "$HEADER_STACK" -lt "$MEM_STACK" ]; then
+ echo $MEM_STACK | awk '{ printf ("Set AO_STACK_START to at least 0x%x\n", $1); }'
+ exit 1
+else
+ exit 0
+fi