Index: tools/amd64/gencontext.c
===================================================================
--- tools/amd64/gencontext.c	(revision e09d68ab5aa5fe4f5aa0dde9fa751a6fb3d7f2a0)
+++ tools/amd64/gencontext.c	(revision cd925289a666c0714536473e45783e1a8687a246)
@@ -1,6 +1,6 @@
 #include <stdio.h>
+#include <stdint.h>
 
-
-typedef long long __u64;
+typedef uint64_t __u64;
 typedef __u64 ipl_t;
 typedef __u64 __address;
@@ -28,17 +28,17 @@
 	fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__);	
 
-	fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
-	fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
-	fprintf(f,"#define OFFSET_RBX 0x%x\n",((int)&pctx->rbx) - (int )pctx);
-	fprintf(f,"#define OFFSET_RBP 0x%x\n",((int)&pctx->rbp) - (int )pctx);
-	fprintf(f,"#define OFFSET_R12 0x%x\n",((int)&pctx->r12) - (int )pctx);
-	fprintf(f,"#define OFFSET_R13 0x%x\n",((int)&pctx->r13) - (int )pctx);
-	fprintf(f,"#define OFFSET_R14 0x%x\n",((int)&pctx->r14) - (int )pctx);
-	fprintf(f,"#define OFFSET_R15 0x%x\n",((int)&pctx->r15) - (int )pctx);
-	fprintf(f,"#define OFFSET_IPL 0x%x\n",((int)&pctx->ipl) - (int )pctx);
+	fprintf(f,"#define OFFSET_SP  0x%x\n", ((int) &pctx->sp) - (int) pctx);
+	fprintf(f,"#define OFFSET_PC  0x%x\n", ((int) &pctx->pc) - (int) pctx);
+	fprintf(f,"#define OFFSET_RBX 0x%x\n", ((int) &pctx->rbx) - (int) pctx);
+	fprintf(f,"#define OFFSET_RBP 0x%x\n", ((int) &pctx->rbp) - (int) pctx);
+	fprintf(f,"#define OFFSET_R12 0x%x\n", ((int) &pctx->r12) - (int) pctx);
+	fprintf(f,"#define OFFSET_R13 0x%x\n", ((int) &pctx->r13) - (int) pctx);
+	fprintf(f,"#define OFFSET_R14 0x%x\n", ((int) &pctx->r14) - (int) pctx);
+	fprintf(f,"#define OFFSET_R15 0x%x\n", ((int) &pctx->r15) - (int) pctx);
+	fprintf(f,"#define OFFSET_IPL 0x%x\n", ((int) &pctx->ipl) - (int) pctx);
 
 	fprintf(f, "\n");
 
-#define ifpr(big,nm) fprintf(f, "#define IOFFSET_" #big " 0x%x\n", ((int)&ipctx->nm) - (int) ipctx)
+#define ifpr(big, nm) fprintf(f, "#define IOFFSET_" #big " 0x%x\n", ((int) &ipctx->nm) - (int) ipctx)
 	
 	ifpr(RAX, rax);
Index: tools/mips32/gencontext.c
===================================================================
--- tools/mips32/gencontext.c	(revision e09d68ab5aa5fe4f5aa0dde9fa751a6fb3d7f2a0)
+++ tools/mips32/gencontext.c	(revision cd925289a666c0714536473e45783e1a8687a246)
@@ -1,5 +1,6 @@
 #include <stdio.h>
+#include <stdint.h>
 
-typedef unsigned int __u32;
+typedef uint32_t __u32;
 typedef __u32 ipl_t;
 typedef __u32 __address;
@@ -28,53 +29,53 @@
 	fprintf(f,"/* struct context */\n");
 
-	fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
-	fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
-	fprintf(f,"#define OFFSET_S0  0x%x\n",((int)&pctx->s0) - (int )pctx);
-	fprintf(f,"#define OFFSET_S1  0x%x\n",((int)&pctx->s1) - (int )pctx);
-	fprintf(f,"#define OFFSET_S2  0x%x\n",((int)&pctx->s2) - (int )pctx);
-	fprintf(f,"#define OFFSET_S3  0x%x\n",((int)&pctx->s3) - (int )pctx);
-	fprintf(f,"#define OFFSET_S4  0x%x\n",((int)&pctx->s4) - (int )pctx);
-	fprintf(f,"#define OFFSET_S5  0x%x\n",((int)&pctx->s5) - (int )pctx);
-	fprintf(f,"#define OFFSET_S6  0x%x\n",((int)&pctx->s6) - (int )pctx);
-	fprintf(f,"#define OFFSET_S7  0x%x\n",((int)&pctx->s7) - (int )pctx);
-	fprintf(f,"#define OFFSET_S8  0x%x\n",((int)&pctx->s8) - (int )pctx);
-	fprintf(f,"#define OFFSET_GP  0x%x\n",((int)&pctx->gp) - (int )pctx);
+	fprintf(f,"#define OFFSET_SP      0x%x\n", ((int) &pctx->sp) - (int) pctx);
+	fprintf(f,"#define OFFSET_PC      0x%x\n", ((int) &pctx->pc) - (int) pctx);
+	fprintf(f,"#define OFFSET_S0      0x%x\n", ((int) &pctx->s0) - (int) pctx);
+	fprintf(f,"#define OFFSET_S1      0x%x\n", ((int) &pctx->s1) - (int) pctx);
+	fprintf(f,"#define OFFSET_S2      0x%x\n", ((int) &pctx->s2) - (int) pctx);
+	fprintf(f,"#define OFFSET_S3      0x%x\n", ((int) &pctx->s3) - (int) pctx);
+	fprintf(f,"#define OFFSET_S4      0x%x\n", ((int) &pctx->s4) - (int) pctx);
+	fprintf(f,"#define OFFSET_S5      0x%x\n", ((int) &pctx->s5) - (int) pctx);
+	fprintf(f,"#define OFFSET_S6      0x%x\n", ((int) &pctx->s6) - (int) pctx);
+	fprintf(f,"#define OFFSET_S7      0x%x\n", ((int) &pctx->s7) - (int) pctx);
+	fprintf(f,"#define OFFSET_S8      0x%x\n", ((int) &pctx->s8) - (int) pctx);
+	fprintf(f,"#define OFFSET_GP      0x%x\n", ((int) &pctx->gp) - (int) pctx);
 
 	fprintf(f,"\n\n/* struct register_dump */\n");
-	fprintf(f,"#define EOFFSET_AT  0x%x\n",((int)&edmp->at) - (int )edmp);
-	fprintf(f,"#define EOFFSET_V0  0x%x\n",((int)&edmp->v0) - (int )edmp);
-	fprintf(f,"#define EOFFSET_V1  0x%x\n",((int)&edmp->v1) - (int )edmp);
-	fprintf(f,"#define EOFFSET_A0  0x%x\n",((int)&edmp->a0) - (int )edmp);
-	fprintf(f,"#define EOFFSET_A1  0x%x\n",((int)&edmp->a1) - (int )edmp);
-	fprintf(f,"#define EOFFSET_A2  0x%x\n",((int)&edmp->a2) - (int )edmp);
-	fprintf(f,"#define EOFFSET_A3  0x%x\n",((int)&edmp->a3) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T0  0x%x\n",((int)&edmp->t0) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T1  0x%x\n",((int)&edmp->t1) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T2  0x%x\n",((int)&edmp->t2) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T3  0x%x\n",((int)&edmp->t3) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T4  0x%x\n",((int)&edmp->t4) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T5  0x%x\n",((int)&edmp->t5) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T6  0x%x\n",((int)&edmp->t6) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T7  0x%x\n",((int)&edmp->t7) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S0  0x%x\n",((int)&edmp->s0) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S1  0x%x\n",((int)&edmp->s1) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S2  0x%x\n",((int)&edmp->s2) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S3  0x%x\n",((int)&edmp->s3) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S4  0x%x\n",((int)&edmp->s4) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S5  0x%x\n",((int)&edmp->s5) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S6  0x%x\n",((int)&edmp->s6) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S7  0x%x\n",((int)&edmp->s7) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T8  0x%x\n",((int)&edmp->t8) - (int )edmp);
-	fprintf(f,"#define EOFFSET_T9  0x%x\n",((int)&edmp->t9) - (int )edmp);
-	fprintf(f,"#define EOFFSET_GP  0x%x\n",((int)&edmp->gp) - (int )edmp);
-	fprintf(f,"#define EOFFSET_SP  0x%x\n",((int)&edmp->sp) - (int )edmp);
-	fprintf(f,"#define EOFFSET_S8  0x%x\n",((int)&edmp->s8) - (int )edmp);
-	fprintf(f,"#define EOFFSET_RA  0x%x\n",((int)&edmp->ra) - (int )edmp);
-	fprintf(f,"#define EOFFSET_LO  0x%x\n",((int)&edmp->lo) - (int )edmp);
-	fprintf(f,"#define EOFFSET_HI  0x%x\n",((int)&edmp->hi) - (int )edmp);
-	fprintf(f,"#define EOFFSET_STATUS  0x%x\n",((int)&edmp->status) - (int )edmp);
-	fprintf(f,"#define EOFFSET_EPC  0x%x\n",((int)&edmp->epc) - (int )edmp);
+	fprintf(f,"#define EOFFSET_AT     0x%x\n", ((int) &edmp->at) - (int) edmp);
+	fprintf(f,"#define EOFFSET_V0     0x%x\n", ((int) &edmp->v0) - (int) edmp);
+	fprintf(f,"#define EOFFSET_V1     0x%x\n", ((int) &edmp->v1) - (int) edmp);
+	fprintf(f,"#define EOFFSET_A0     0x%x\n", ((int) &edmp->a0) - (int) edmp);
+	fprintf(f,"#define EOFFSET_A1     0x%x\n", ((int) &edmp->a1) - (int) edmp);
+	fprintf(f,"#define EOFFSET_A2     0x%x\n", ((int) &edmp->a2) - (int) edmp);
+	fprintf(f,"#define EOFFSET_A3     0x%x\n", ((int) &edmp->a3) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T0     0x%x\n", ((int) &edmp->t0) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T1     0x%x\n", ((int) &edmp->t1) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T2     0x%x\n", ((int) &edmp->t2) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T3     0x%x\n", ((int) &edmp->t3) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T4     0x%x\n", ((int) &edmp->t4) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T5     0x%x\n", ((int) &edmp->t5) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T6     0x%x\n", ((int) &edmp->t6) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T7     0x%x\n", ((int) &edmp->t7) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S0     0x%x\n", ((int) &edmp->s0) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S1     0x%x\n", ((int) &edmp->s1) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S2     0x%x\n", ((int) &edmp->s2) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S3     0x%x\n", ((int) &edmp->s3) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S4     0x%x\n", ((int) &edmp->s4) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S5     0x%x\n", ((int) &edmp->s5) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S6     0x%x\n", ((int) &edmp->s6) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S7     0x%x\n", ((int) &edmp->s7) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T8     0x%x\n", ((int) &edmp->t8) - (int) edmp);
+	fprintf(f,"#define EOFFSET_T9     0x%x\n", ((int) &edmp->t9) - (int) edmp);
+	fprintf(f,"#define EOFFSET_GP     0x%x\n", ((int) &edmp->gp) - (int) edmp);
+	fprintf(f,"#define EOFFSET_SP     0x%x\n", ((int) &edmp->sp) - (int) edmp);
+	fprintf(f,"#define EOFFSET_S8     0x%x\n", ((int) &edmp->s8) - (int) edmp);
+	fprintf(f,"#define EOFFSET_RA     0x%x\n", ((int) &edmp->ra) - (int) edmp);
+	fprintf(f,"#define EOFFSET_LO     0x%x\n", ((int) &edmp->lo) - (int) edmp);
+	fprintf(f,"#define EOFFSET_HI     0x%x\n", ((int) &edmp->hi) - (int) edmp);
+	fprintf(f,"#define EOFFSET_STATUS 0x%x\n", ((int) &edmp->status) - (int) edmp);
+	fprintf(f,"#define EOFFSET_EPC    0x%x\n", ((int) &edmp->epc) - (int) edmp);
 
-	fprintf(f,"#define REGISTER_SPACE  %d\n",sizeof(*edmp));
+	fprintf(f,"#define REGISTER_SPACE %d\n", sizeof(*edmp));
 
 	fclose(f);
Index: tools/ppc32/gencontext.c
===================================================================
--- tools/ppc32/gencontext.c	(revision e09d68ab5aa5fe4f5aa0dde9fa751a6fb3d7f2a0)
+++ tools/ppc32/gencontext.c	(revision cd925289a666c0714536473e45783e1a8687a246)
@@ -1,5 +1,7 @@
 #include <stdio.h>
+#include <stdint.h>
 
-typedef unsigned int __u32;
+typedef uint32_t __u32;
+typedef uint64_t __u64;
 typedef __u32 ipl_t;
 typedef __u32 __address;
@@ -7,4 +9,5 @@
 #define __ppc32_TYPES_H__
 #include "../../arch/ppc32/include/context.h"
+#include "../../arch/ppc32/include/fpu_context.h"
 
 #define FILENAME "../../arch/ppc32/include/context_offset.h"
@@ -14,4 +17,5 @@
 	FILE *f;
 	struct context *pctx = NULL;
+	struct fpu_context *fpctx = NULL;
 	
 
@@ -26,28 +30,50 @@
 	fprintf(f,"/* struct context */\n");
 
-	fprintf(f,"#define OFFSET_SP   0x%x\n", ((int) &pctx->sp) - (int) pctx);
-	fprintf(f,"#define OFFSET_PC   0x%x\n", ((int) &pctx->pc) - (int) pctx);
-	fprintf(f,"#define OFFSET_R2   0x%x\n", ((int) &pctx->r2) - (int) pctx);
-	fprintf(f,"#define OFFSET_R13  0x%x\n", ((int) &pctx->r13) - (int) pctx);
-	fprintf(f,"#define OFFSET_R14  0x%x\n", ((int) &pctx->r14) - (int) pctx);
-	fprintf(f,"#define OFFSET_R15  0x%x\n", ((int) &pctx->r15) - (int) pctx);
-	fprintf(f,"#define OFFSET_R16  0x%x\n", ((int) &pctx->r16) - (int) pctx);
-	fprintf(f,"#define OFFSET_R17  0x%x\n", ((int) &pctx->r17) - (int) pctx);
-	fprintf(f,"#define OFFSET_R18  0x%x\n", ((int) &pctx->r18) - (int) pctx);
-	fprintf(f,"#define OFFSET_R19  0x%x\n", ((int) &pctx->r19) - (int) pctx);
-	fprintf(f,"#define OFFSET_R20  0x%x\n", ((int) &pctx->r20) - (int) pctx);
-	fprintf(f,"#define OFFSET_R21  0x%x\n", ((int) &pctx->r21) - (int) pctx);
-	fprintf(f,"#define OFFSET_R22  0x%x\n", ((int) &pctx->r22) - (int) pctx);
-	fprintf(f,"#define OFFSET_R23  0x%x\n", ((int) &pctx->r23) - (int) pctx);
-	fprintf(f,"#define OFFSET_R24  0x%x\n", ((int) &pctx->r24) - (int) pctx);
-	fprintf(f,"#define OFFSET_R25  0x%x\n", ((int) &pctx->r25) - (int) pctx);
-	fprintf(f,"#define OFFSET_R26  0x%x\n", ((int) &pctx->r26) - (int) pctx);
-	fprintf(f,"#define OFFSET_R27  0x%x\n", ((int) &pctx->r27) - (int) pctx);
-	fprintf(f,"#define OFFSET_R28  0x%x\n", ((int) &pctx->r28) - (int) pctx);
-	fprintf(f,"#define OFFSET_R29  0x%x\n", ((int) &pctx->r29) - (int) pctx);
-	fprintf(f,"#define OFFSET_R30  0x%x\n", ((int) &pctx->r30) - (int) pctx);
-	fprintf(f,"#define OFFSET_R31  0x%x\n", ((int) &pctx->r31) - (int) pctx);
-	fprintf(f,"#define OFFSET_CR   0x%x\n", ((int) &pctx->cr) - (int) pctx);
+	fprintf(f,"#define OFFSET_SP    0x%x\n", ((int) &pctx->sp) - (int) pctx);
+	fprintf(f,"#define OFFSET_PC    0x%x\n", ((int) &pctx->pc) - (int) pctx);
+	fprintf(f,"#define OFFSET_R2    0x%x\n", ((int) &pctx->r2) - (int) pctx);
+	fprintf(f,"#define OFFSET_R13   0x%x\n", ((int) &pctx->r13) - (int) pctx);
+	fprintf(f,"#define OFFSET_R14   0x%x\n", ((int) &pctx->r14) - (int) pctx);
+	fprintf(f,"#define OFFSET_R15   0x%x\n", ((int) &pctx->r15) - (int) pctx);
+	fprintf(f,"#define OFFSET_R16   0x%x\n", ((int) &pctx->r16) - (int) pctx);
+	fprintf(f,"#define OFFSET_R17   0x%x\n", ((int) &pctx->r17) - (int) pctx);
+	fprintf(f,"#define OFFSET_R18   0x%x\n", ((int) &pctx->r18) - (int) pctx);
+	fprintf(f,"#define OFFSET_R19   0x%x\n", ((int) &pctx->r19) - (int) pctx);
+	fprintf(f,"#define OFFSET_R20   0x%x\n", ((int) &pctx->r20) - (int) pctx);
+	fprintf(f,"#define OFFSET_R21   0x%x\n", ((int) &pctx->r21) - (int) pctx);
+	fprintf(f,"#define OFFSET_R22   0x%x\n", ((int) &pctx->r22) - (int) pctx);
+	fprintf(f,"#define OFFSET_R23   0x%x\n", ((int) &pctx->r23) - (int) pctx);
+	fprintf(f,"#define OFFSET_R24   0x%x\n", ((int) &pctx->r24) - (int) pctx);
+	fprintf(f,"#define OFFSET_R25   0x%x\n", ((int) &pctx->r25) - (int) pctx);
+	fprintf(f,"#define OFFSET_R26   0x%x\n", ((int) &pctx->r26) - (int) pctx);
+	fprintf(f,"#define OFFSET_R27   0x%x\n", ((int) &pctx->r27) - (int) pctx);
+	fprintf(f,"#define OFFSET_R28   0x%x\n", ((int) &pctx->r28) - (int) pctx);
+	fprintf(f,"#define OFFSET_R29   0x%x\n", ((int) &pctx->r29) - (int) pctx);
+	fprintf(f,"#define OFFSET_R30   0x%x\n", ((int) &pctx->r30) - (int) pctx);
+	fprintf(f,"#define OFFSET_R31   0x%x\n", ((int) &pctx->r31) - (int) pctx);
+	fprintf(f,"#define OFFSET_CR    0x%x\n", ((int) &pctx->cr) - (int) pctx);
+	
+	fprintf(f,"\n");
 
+	fprintf(f,"#define OFFSET_FR14  0x%x\n", ((int) &fpctx->fr14) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR15  0x%x\n", ((int) &fpctx->fr15) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR16  0x%x\n", ((int) &fpctx->fr16) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR17  0x%x\n", ((int) &fpctx->fr17) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR18  0x%x\n", ((int) &fpctx->fr18) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR19  0x%x\n", ((int) &fpctx->fr19) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR20  0x%x\n", ((int) &fpctx->fr20) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR21  0x%x\n", ((int) &fpctx->fr21) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR22  0x%x\n", ((int) &fpctx->fr22) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR23  0x%x\n", ((int) &fpctx->fr23) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR24  0x%x\n", ((int) &fpctx->fr24) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR25  0x%x\n", ((int) &fpctx->fr25) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR26  0x%x\n", ((int) &fpctx->fr26) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR27  0x%x\n", ((int) &fpctx->fr27) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR28  0x%x\n", ((int) &fpctx->fr28) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR29  0x%x\n", ((int) &fpctx->fr29) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR30  0x%x\n", ((int) &fpctx->fr30) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FR31  0x%x\n", ((int) &fpctx->fr31) - (int) fpctx);
+	fprintf(f,"#define OFFSET_FPSCR 0x%x\n", ((int) &fpctx->fpscr) - (int) fpctx);
+	
 	fclose(f);
 
Index: tools/sparc64/gencontext.c
===================================================================
--- tools/sparc64/gencontext.c	(revision e09d68ab5aa5fe4f5aa0dde9fa751a6fb3d7f2a0)
+++ tools/sparc64/gencontext.c	(revision cd925289a666c0714536473e45783e1a8687a246)
@@ -1,5 +1,6 @@
 #include <stdio.h>
+#include <stdint.h>
 
-typedef long long __u64;
+typedef uint64_t __u64;
 typedef __u64 ipl_t;
 typedef __u64 __address;
@@ -28,23 +29,23 @@
 
 	fprintf(f,"/* struct context */\n");
-	fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
-	fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
-	fprintf(f,"#define OFFSET_I0  0x%x\n",((int)&pctx->i0) - (int )pctx);
-	fprintf(f,"#define OFFSET_I1  0x%x\n",((int)&pctx->i1) - (int )pctx);
-	fprintf(f,"#define OFFSET_I2  0x%x\n",((int)&pctx->i2) - (int )pctx);
-	fprintf(f,"#define OFFSET_I3  0x%x\n",((int)&pctx->i3) - (int )pctx);
-	fprintf(f,"#define OFFSET_I4  0x%x\n",((int)&pctx->i4) - (int )pctx);
-	fprintf(f,"#define OFFSET_I5  0x%x\n",((int)&pctx->i5) - (int )pctx);
-	fprintf(f,"#define OFFSET_FP  0x%x\n",((int)&pctx->fp) - (int )pctx);
-	fprintf(f,"#define OFFSET_I7  0x%x\n",((int)&pctx->i7) - (int )pctx);
-	fprintf(f,"#define OFFSET_L0  0x%x\n",((int)&pctx->l0) - (int )pctx);
-	fprintf(f,"#define OFFSET_L1  0x%x\n",((int)&pctx->l1) - (int )pctx);
-	fprintf(f,"#define OFFSET_L2  0x%x\n",((int)&pctx->l2) - (int )pctx);
-	fprintf(f,"#define OFFSET_L3  0x%x\n",((int)&pctx->l3) - (int )pctx);
-	fprintf(f,"#define OFFSET_L4  0x%x\n",((int)&pctx->l4) - (int )pctx);
-	fprintf(f,"#define OFFSET_L5  0x%x\n",((int)&pctx->l5) - (int )pctx);
-	fprintf(f,"#define OFFSET_L6  0x%x\n",((int)&pctx->l6) - (int )pctx);
-	fprintf(f,"#define OFFSET_L7  0x%x\n",((int)&pctx->l7) - (int )pctx);
-	fprintf(f,"#define OFFSET_CLEANWIN  0x%x\n",((int)&pctx->cleanwin) - (int )pctx);
+	fprintf(f,"#define OFFSET_SP       0x%x\n", ((int) &pctx->sp) - (int) pctx);
+	fprintf(f,"#define OFFSET_PC       0x%x\n", ((int) &pctx->pc) - (int) pctx);
+	fprintf(f,"#define OFFSET_I0       0x%x\n", ((int) &pctx->i0) - (int) pctx);
+	fprintf(f,"#define OFFSET_I1       0x%x\n", ((int) &pctx->i1) - (int) pctx);
+	fprintf(f,"#define OFFSET_I2       0x%x\n", ((int) &pctx->i2) - (int) pctx);
+	fprintf(f,"#define OFFSET_I3       0x%x\n", ((int) &pctx->i3) - (int) pctx);
+	fprintf(f,"#define OFFSET_I4       0x%x\n", ((int) &pctx->i4) - (int) pctx);
+	fprintf(f,"#define OFFSET_I5       0x%x\n", ((int) &pctx->i5) - (int) pctx);
+	fprintf(f,"#define OFFSET_FP       0x%x\n", ((int) &pctx->fp) - (int) pctx);
+	fprintf(f,"#define OFFSET_I7       0x%x\n", ((int) &pctx->i7) - (int) pctx);
+	fprintf(f,"#define OFFSET_L0       0x%x\n", ((int) &pctx->l0) - (int) pctx);
+	fprintf(f,"#define OFFSET_L1       0x%x\n", ((int) &pctx->l1) - (int) pctx);
+	fprintf(f,"#define OFFSET_L2       0x%x\n", ((int) &pctx->l2) - (int) pctx);
+	fprintf(f,"#define OFFSET_L3       0x%x\n", ((int) &pctx->l3) - (int) pctx);
+	fprintf(f,"#define OFFSET_L4       0x%x\n", ((int) &pctx->l4) - (int) pctx);
+	fprintf(f,"#define OFFSET_L5       0x%x\n", ((int) &pctx->l5) - (int) pctx);
+	fprintf(f,"#define OFFSET_L6       0x%x\n", ((int) &pctx->l6) - (int) pctx);
+	fprintf(f,"#define OFFSET_L7       0x%x\n", ((int) &pctx->l7) - (int) pctx);
+	fprintf(f,"#define OFFSET_CLEANWIN 0x%x\n", ((int) &pctx->cleanwin) - (int) pctx);
 
 	fclose(f);
