checkstack.py should not match pushaw on stack usage check.
[seabios.git] / tools / checkstack.py
index 680c0335d2c3dbca81047a8ec6ffb51413f067d5..aa38ea8e842e7f94362ce786b277e2b9febf83d4 100755 (executable)
@@ -7,14 +7,14 @@
 # This file may be distributed under the terms of the GNU GPLv3 license.
 
 # Usage:
-#   objdump -m i386 -M i8086 -M suffix -d out/rom16.o | tools/checkstack.py
+#   objdump -m i386 -M i8086 -M suffix -d out/rom16.reloc.o | tools/checkstack.py
 
 import sys
 import re
 
 # List of functions we can assume are never called.
-#IGNORE = ['screenc', 'BX_PANIC', '__dprintf']
-IGNORE = ['screenc', 'BX_PANIC']
+#IGNORE = ['panic', '__dprintf', '__send_disk_op']
+IGNORE = ['panic', '__send_disk_op']
 
 # Find out maximum stack usage for a function
 def calcmaxstack(funcs, funcaddr):
@@ -42,7 +42,7 @@ re_asm = re.compile(
     + r'):\t.*\t(addr32 )?(?P<insn>.+?)[ ]*((?P<calladdr>' + hex_s
     + r') <(?P<ref>.*)>)?$')
 re_usestack = re.compile(
-    r'^(push.*)|(sub.* [$](?P<num>0x' + hex_s + r'),%esp)$')
+    r'^(push[f]?[lw])|(sub.* [$](?P<num>0x' + hex_s + r'),%esp)$')
 
 def calc():
     # funcs[funcaddr] = [funcname, basicstackusage, maxstackusage