summaryrefslogtreecommitdiffstats
path: root/src/build/debug/simics-debug-framework.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/build/debug/simics-debug-framework.py')
-rwxr-xr-xsrc/build/debug/simics-debug-framework.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/build/debug/simics-debug-framework.py b/src/build/debug/simics-debug-framework.py
index ff7bf0844..44fb49c51 100755
--- a/src/build/debug/simics-debug-framework.py
+++ b/src/build/debug/simics-debug-framework.py
@@ -485,6 +485,19 @@ except:
# See src/include/arch/ppc.H for the definitions of the magic args.
# Hostboot magic args should range 7000..7999.
def magic_instruction_callback(user_arg, cpu, arg):
+ # Disable our handler if someone tells us to
+ if( os.environ.has_key('HB_DISABLE_MAGIC')
+ and (os.environ['HB_DISABLE_MAGIC'] == '1') ):
+ print 'Skipping HB magic (disabled)', arg
+ return;
+
+ # Disable our handler if we aren't inside HB part of IPL
+ # If HB is running then HRMOR==128MB (ignoring high bits)
+ # 0x40000000=1GB, 0x8000000=128MB
+ if( (getHRMOR() % 0x40000000) != 0x8000000 ):
+ print 'Skipping HB magic (outside of HB)', arg
+ return;
+
if arg == 7006: # MAGIC_SHUTDOWN
# KernelMisc::shutdown()
print "KernelMisc::shutdown() called."
@@ -650,6 +663,5 @@ rc = os.system( "rm -f tracBINARY" )
# Register the magic instruction hap handler (a callback).
SIM_hap_add_callback_range( "Core_Magic_Instruction", magic_instruction_callback, None, 7000, 7999 )
-
# Run the registration automatically whenever this script is loaded.
register_hb_debug_framework_tools()
OpenPOWER on IntegriCloud