Index: arch/ia64/src/ivt.S
===================================================================
--- arch/ia64/src/ivt.S	(revision 75d57210e43cbf13ea5866aace7462ee46124f8e)
+++ arch/ia64/src/ivt.S	(revision 73838ed8e5c99d4b785497a5fa7d0909fded4f9f)
@@ -29,4 +29,329 @@
 
 
+
+dump_gregs:
+mov r16 = REG_DUMP;;
+st8 [r16] = r0;;
+add r16 = 8,r16 ;;
+st8 [r16] = r1;;
+add r16 = 8,r16 ;;
+st8 [r16] = r2;;
+add r16 = 8,r16 ;;
+st8 [r16] = r3;;
+add r16 = 8,r16 ;;
+st8 [r16] = r4;;
+add r16 = 8,r16 ;;
+st8 [r16] = r5;;
+add r16 = 8,r16 ;;
+st8 [r16] = r6;;
+add r16 = 8,r16 ;;
+st8 [r16] = r7;;
+add r16 = 8,r16 ;;
+st8 [r16] = r8;;
+add r16 = 8,r16 ;;
+st8 [r16] = r9;;
+add r16 = 8,r16 ;;
+st8 [r16] = r10;;
+add r16 = 8,r16 ;;
+st8 [r16] = r11;;
+add r16 = 8,r16 ;;
+st8 [r16] = r12;;
+add r16 = 8,r16 ;;
+st8 [r16] = r13;;
+add r16 = 8,r16 ;;
+st8 [r16] = r14;;
+add r16 = 8,r16 ;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+
+bsw.1;;
+mov r15 = r16;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r17;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r18;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r19;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r20;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r21;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r22;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r23;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r24;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r25;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r26;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r27;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r28;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r29;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r30;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+bsw.1;;
+mov r15 = r31;;
+bsw.0;;
+st8 [r16] = r15;;
+add r16 = 8,r16 ;;
+
+
+st8 [r16] = r32;;
+add r16 = 8,r16 ;;
+st8 [r16] = r33;;
+add r16 = 8,r16 ;;
+st8 [r16] = r34;;
+add r16 = 8,r16 ;;
+st8 [r16] = r35;;
+add r16 = 8,r16 ;;
+st8 [r16] = r36;;
+add r16 = 8,r16 ;;
+st8 [r16] = r37;;
+add r16 = 8,r16 ;;
+st8 [r16] = r38;;
+add r16 = 8,r16 ;;
+st8 [r16] = r39;;
+add r16 = 8,r16 ;;
+st8 [r16] = r40;;
+add r16 = 8,r16 ;;
+st8 [r16] = r41;;
+add r16 = 8,r16 ;;
+st8 [r16] = r42;;
+add r16 = 8,r16 ;;
+st8 [r16] = r43;;
+add r16 = 8,r16 ;;
+st8 [r16] = r44;;
+add r16 = 8,r16 ;;
+st8 [r16] = r45;;
+add r16 = 8,r16 ;;
+st8 [r16] = r46;;
+add r16 = 8,r16 ;;
+st8 [r16] = r47;;
+add r16 = 8,r16 ;;
+st8 [r16] = r48;;
+add r16 = 8,r16 ;;
+st8 [r16] = r49;;
+add r16 = 8,r16 ;;
+st8 [r16] = r50;;
+add r16 = 8,r16 ;;
+st8 [r16] = r51;;
+add r16 = 8,r16 ;;
+st8 [r16] = r52;;
+add r16 = 8,r16 ;;
+st8 [r16] = r53;;
+add r16 = 8,r16 ;;
+st8 [r16] = r54;;
+add r16 = 8,r16 ;;
+st8 [r16] = r55;;
+add r16 = 8,r16 ;;
+st8 [r16] = r56;;
+add r16 = 8,r16 ;;
+st8 [r16] = r57;;
+add r16 = 8,r16 ;;
+st8 [r16] = r58;;
+add r16 = 8,r16 ;;
+st8 [r16] = r59;;
+add r16 = 8,r16 ;;
+st8 [r16] = r60;;
+add r16 = 8,r16 ;;
+st8 [r16] = r61;;
+add r16 = 8,r16 ;;
+st8 [r16] = r62;;
+add r16 = 8,r16 ;;
+st8 [r16] = r63;;
+add r16 = 8,r16 ;;
+
+
+
+st8 [r16] = r64;;
+add r16 = 8,r16 ;;
+st8 [r16] = r65;;
+add r16 = 8,r16 ;;
+st8 [r16] = r66;;
+add r16 = 8,r16 ;;
+st8 [r16] = r67;;
+add r16 = 8,r16 ;;
+st8 [r16] = r68;;
+add r16 = 8,r16 ;;
+st8 [r16] = r69;;
+add r16 = 8,r16 ;;
+st8 [r16] = r70;;
+add r16 = 8,r16 ;;
+st8 [r16] = r71;;
+add r16 = 8,r16 ;;
+st8 [r16] = r72;;
+add r16 = 8,r16 ;;
+st8 [r16] = r73;;
+add r16 = 8,r16 ;;
+st8 [r16] = r74;;
+add r16 = 8,r16 ;;
+st8 [r16] = r75;;
+add r16 = 8,r16 ;;
+st8 [r16] = r76;;
+add r16 = 8,r16 ;;
+st8 [r16] = r77;;
+add r16 = 8,r16 ;;
+st8 [r16] = r78;;
+add r16 = 8,r16 ;;
+st8 [r16] = r79;;
+add r16 = 8,r16 ;;
+st8 [r16] = r80;;
+add r16 = 8,r16 ;;
+st8 [r16] = r81;;
+add r16 = 8,r16 ;;
+st8 [r16] = r82;;
+add r16 = 8,r16 ;;
+st8 [r16] = r83;;
+add r16 = 8,r16 ;;
+st8 [r16] = r84;;
+add r16 = 8,r16 ;;
+st8 [r16] = r85;;
+add r16 = 8,r16 ;;
+st8 [r16] = r86;;
+add r16 = 8,r16 ;;
+st8 [r16] = r87;;
+add r16 = 8,r16 ;;
+st8 [r16] = r88;;
+add r16 = 8,r16 ;;
+st8 [r16] = r89;;
+add r16 = 8,r16 ;;
+st8 [r16] = r90;;
+add r16 = 8,r16 ;;
+st8 [r16] = r91;;
+add r16 = 8,r16 ;;
+st8 [r16] = r92;;
+add r16 = 8,r16 ;;
+st8 [r16] = r93;;
+add r16 = 8,r16 ;;
+st8 [r16] = r94;;
+add r16 = 8,r16 ;;
+st8 [r16] = r95;;
+add r16 = 8,r16 ;;
+
+
+
+st8 [r16] = r96;;
+add r16 = 8,r16 ;;
+st8 [r16] = r97;;
+add r16 = 8,r16 ;;
+st8 [r16] = r98;;
+add r16 = 8,r16 ;;
+st8 [r16] = r99;;
+add r16 = 8,r16 ;;
+st8 [r16] = r100;;
+add r16 = 8,r16 ;;
+st8 [r16] = r101;;
+add r16 = 8,r16 ;;
+st8 [r16] = r102;;
+add r16 = 8,r16 ;;
+st8 [r16] = r103;;
+add r16 = 8,r16 ;;
+st8 [r16] = r104;;
+add r16 = 8,r16 ;;
+st8 [r16] = r105;;
+add r16 = 8,r16 ;;
+st8 [r16] = r106;;
+add r16 = 8,r16 ;;
+st8 [r16] = r107;;
+add r16 = 8,r16 ;;
+st8 [r16] = r108;;
+add r16 = 8,r16 ;;
+st8 [r16] = r109;;
+add r16 = 8,r16 ;;
+st8 [r16] = r110;;
+add r16 = 8,r16 ;;
+st8 [r16] = r111;;
+add r16 = 8,r16 ;;
+st8 [r16] = r112;;
+add r16 = 8,r16 ;;
+st8 [r16] = r113;;
+add r16 = 8,r16 ;;
+st8 [r16] = r114;;
+add r16 = 8,r16 ;;
+st8 [r16] = r115;;
+add r16 = 8,r16 ;;
+st8 [r16] = r116;;
+add r16 = 8,r16 ;;
+st8 [r16] = r117;;
+add r16 = 8,r16 ;;
+st8 [r16] = r118;;
+add r16 = 8,r16 ;;
+st8 [r16] = r119;;
+add r16 = 8,r16 ;;
+st8 [r16] = r120;;
+add r16 = 8,r16 ;;
+st8 [r16] = r121;;
+add r16 = 8,r16 ;;
+st8 [r16] = r122;;
+add r16 = 8,r16 ;;
+st8 [r16] = r123;;
+add r16 = 8,r16 ;;
+st8 [r16] = r124;;
+add r16 = 8,r16 ;;
+st8 [r16] = r125;;
+add r16 = 8,r16 ;;
+st8 [r16] = r126;;
+add r16 = 8,r16 ;;
+st8 [r16] = r127;;
+add r16 = 8,r16 ;;
+
+
+
+br.ret.sptk.many b0;;
+
+
+
+
+
 .macro Handler o h
 .org IVT + \o
@@ -36,5 +361,7 @@
 .macro Handler2 o 
 .org IVT + \o
-mov r12 = \o
+br.call.sptk.many b0 = dump_gregs;;
+mov r16 = \o ;;
+bsw.1;;
 br universal_handler;;
 .endm
@@ -72,5 +399,6 @@
 Handler2 0x5200
 Handler2 0x5300
-Handler 0x5400 general_exception
+#Handler 0x5400 general_exception
+Handler2 0x5400
 Handler2 0x5500
 Handler2 0x5600
@@ -127,3 +455,7 @@
 
 .align 32768
-.byte 0
+.global REG_DUMP
+
+REG_DUMP:
+.space 128*8
+
