Rev 845 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 845 | Rev 859 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include <stdio.h> |
1 | #include <stdio.h> |
- | 2 | #include <stdint.h> |
|
2 | 3 | ||
3 | typedef unsigned int __u32; |
4 | typedef uint32_t __u32; |
- | 5 | typedef uint64_t __u64; |
|
4 | typedef __u32 ipl_t; |
6 | typedef __u32 ipl_t; |
5 | typedef __u32 __address; |
7 | typedef __u32 __address; |
6 | 8 | ||
7 | #define __ppc32_TYPES_H__ |
9 | #define __ppc32_TYPES_H__ |
8 | #include "../../arch/ppc32/include/context.h" |
10 | #include "../../arch/ppc32/include/context.h" |
- | 11 | #include "../../arch/ppc32/include/fpu_context.h" |
|
9 | 12 | ||
10 | #define FILENAME "../../arch/ppc32/include/context_offset.h" |
13 | #define FILENAME "../../arch/ppc32/include/context_offset.h" |
11 | 14 | ||
12 | int main(void) |
15 | int main(void) |
13 | { |
16 | { |
14 | FILE *f; |
17 | FILE *f; |
15 | struct context *pctx = NULL; |
18 | struct context *pctx = NULL; |
- | 19 | struct fpu_context *fpctx = NULL; |
|
16 | 20 | ||
17 | 21 | ||
18 | f = fopen(FILENAME,"w"); |
22 | f = fopen(FILENAME,"w"); |
19 | if (!f) { |
23 | if (!f) { |
20 | perror(FILENAME); |
24 | perror(FILENAME); |
Line 23... | Line 27... | ||
23 | 27 | ||
24 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
28 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
25 | 29 | ||
26 | fprintf(f,"/* struct context */\n"); |
30 | fprintf(f,"/* struct context */\n"); |
27 | 31 | ||
28 | fprintf(f,"#define OFFSET_SP 0x%x\n", ((int) &pctx->sp) - (int) pctx); |
32 | fprintf(f,"#define OFFSET_SP 0x%x\n", ((int) &pctx->sp) - (int) pctx); |
29 | fprintf(f,"#define OFFSET_PC 0x%x\n", ((int) &pctx->pc) - (int) pctx); |
33 | fprintf(f,"#define OFFSET_PC 0x%x\n", ((int) &pctx->pc) - (int) pctx); |
30 | fprintf(f,"#define OFFSET_R2 0x%x\n", ((int) &pctx->r2) - (int) pctx); |
34 | fprintf(f,"#define OFFSET_R2 0x%x\n", ((int) &pctx->r2) - (int) pctx); |
31 | fprintf(f,"#define OFFSET_R13 0x%x\n", ((int) &pctx->r13) - (int) pctx); |
35 | fprintf(f,"#define OFFSET_R13 0x%x\n", ((int) &pctx->r13) - (int) pctx); |
32 | fprintf(f,"#define OFFSET_R14 0x%x\n", ((int) &pctx->r14) - (int) pctx); |
36 | fprintf(f,"#define OFFSET_R14 0x%x\n", ((int) &pctx->r14) - (int) pctx); |
33 | fprintf(f,"#define OFFSET_R15 0x%x\n", ((int) &pctx->r15) - (int) pctx); |
37 | fprintf(f,"#define OFFSET_R15 0x%x\n", ((int) &pctx->r15) - (int) pctx); |
34 | fprintf(f,"#define OFFSET_R16 0x%x\n", ((int) &pctx->r16) - (int) pctx); |
38 | fprintf(f,"#define OFFSET_R16 0x%x\n", ((int) &pctx->r16) - (int) pctx); |
35 | fprintf(f,"#define OFFSET_R17 0x%x\n", ((int) &pctx->r17) - (int) pctx); |
39 | fprintf(f,"#define OFFSET_R17 0x%x\n", ((int) &pctx->r17) - (int) pctx); |
36 | fprintf(f,"#define OFFSET_R18 0x%x\n", ((int) &pctx->r18) - (int) pctx); |
40 | fprintf(f,"#define OFFSET_R18 0x%x\n", ((int) &pctx->r18) - (int) pctx); |
37 | fprintf(f,"#define OFFSET_R19 0x%x\n", ((int) &pctx->r19) - (int) pctx); |
41 | fprintf(f,"#define OFFSET_R19 0x%x\n", ((int) &pctx->r19) - (int) pctx); |
38 | fprintf(f,"#define OFFSET_R20 0x%x\n", ((int) &pctx->r20) - (int) pctx); |
42 | fprintf(f,"#define OFFSET_R20 0x%x\n", ((int) &pctx->r20) - (int) pctx); |
39 | fprintf(f,"#define OFFSET_R21 0x%x\n", ((int) &pctx->r21) - (int) pctx); |
43 | fprintf(f,"#define OFFSET_R21 0x%x\n", ((int) &pctx->r21) - (int) pctx); |
40 | fprintf(f,"#define OFFSET_R22 0x%x\n", ((int) &pctx->r22) - (int) pctx); |
44 | fprintf(f,"#define OFFSET_R22 0x%x\n", ((int) &pctx->r22) - (int) pctx); |
41 | fprintf(f,"#define OFFSET_R23 0x%x\n", ((int) &pctx->r23) - (int) pctx); |
45 | fprintf(f,"#define OFFSET_R23 0x%x\n", ((int) &pctx->r23) - (int) pctx); |
42 | fprintf(f,"#define OFFSET_R24 0x%x\n", ((int) &pctx->r24) - (int) pctx); |
46 | fprintf(f,"#define OFFSET_R24 0x%x\n", ((int) &pctx->r24) - (int) pctx); |
43 | fprintf(f,"#define OFFSET_R25 0x%x\n", ((int) &pctx->r25) - (int) pctx); |
47 | fprintf(f,"#define OFFSET_R25 0x%x\n", ((int) &pctx->r25) - (int) pctx); |
44 | fprintf(f,"#define OFFSET_R26 0x%x\n", ((int) &pctx->r26) - (int) pctx); |
48 | fprintf(f,"#define OFFSET_R26 0x%x\n", ((int) &pctx->r26) - (int) pctx); |
45 | fprintf(f,"#define OFFSET_R27 0x%x\n", ((int) &pctx->r27) - (int) pctx); |
49 | fprintf(f,"#define OFFSET_R27 0x%x\n", ((int) &pctx->r27) - (int) pctx); |
46 | fprintf(f,"#define OFFSET_R28 0x%x\n", ((int) &pctx->r28) - (int) pctx); |
50 | fprintf(f,"#define OFFSET_R28 0x%x\n", ((int) &pctx->r28) - (int) pctx); |
47 | fprintf(f,"#define OFFSET_R29 0x%x\n", ((int) &pctx->r29) - (int) pctx); |
51 | fprintf(f,"#define OFFSET_R29 0x%x\n", ((int) &pctx->r29) - (int) pctx); |
48 | fprintf(f,"#define OFFSET_R30 0x%x\n", ((int) &pctx->r30) - (int) pctx); |
52 | fprintf(f,"#define OFFSET_R30 0x%x\n", ((int) &pctx->r30) - (int) pctx); |
49 | fprintf(f,"#define OFFSET_R31 0x%x\n", ((int) &pctx->r31) - (int) pctx); |
53 | fprintf(f,"#define OFFSET_R31 0x%x\n", ((int) &pctx->r31) - (int) pctx); |
50 | fprintf(f,"#define OFFSET_CR 0x%x\n", ((int) &pctx->cr) - (int) pctx); |
54 | fprintf(f,"#define OFFSET_CR 0x%x\n", ((int) &pctx->cr) - (int) pctx); |
- | 55 | ||
- | 56 | fprintf(f,"\n"); |
|
51 | 57 | ||
- | 58 | fprintf(f,"#define OFFSET_FR14 0x%x\n", ((int) &fpctx->fr14) - (int) fpctx); |
|
- | 59 | fprintf(f,"#define OFFSET_FR15 0x%x\n", ((int) &fpctx->fr15) - (int) fpctx); |
|
- | 60 | fprintf(f,"#define OFFSET_FR16 0x%x\n", ((int) &fpctx->fr16) - (int) fpctx); |
|
- | 61 | fprintf(f,"#define OFFSET_FR17 0x%x\n", ((int) &fpctx->fr17) - (int) fpctx); |
|
- | 62 | fprintf(f,"#define OFFSET_FR18 0x%x\n", ((int) &fpctx->fr18) - (int) fpctx); |
|
- | 63 | fprintf(f,"#define OFFSET_FR19 0x%x\n", ((int) &fpctx->fr19) - (int) fpctx); |
|
- | 64 | fprintf(f,"#define OFFSET_FR20 0x%x\n", ((int) &fpctx->fr20) - (int) fpctx); |
|
- | 65 | fprintf(f,"#define OFFSET_FR21 0x%x\n", ((int) &fpctx->fr21) - (int) fpctx); |
|
- | 66 | fprintf(f,"#define OFFSET_FR22 0x%x\n", ((int) &fpctx->fr22) - (int) fpctx); |
|
- | 67 | fprintf(f,"#define OFFSET_FR23 0x%x\n", ((int) &fpctx->fr23) - (int) fpctx); |
|
- | 68 | fprintf(f,"#define OFFSET_FR24 0x%x\n", ((int) &fpctx->fr24) - (int) fpctx); |
|
- | 69 | fprintf(f,"#define OFFSET_FR25 0x%x\n", ((int) &fpctx->fr25) - (int) fpctx); |
|
- | 70 | fprintf(f,"#define OFFSET_FR26 0x%x\n", ((int) &fpctx->fr26) - (int) fpctx); |
|
- | 71 | fprintf(f,"#define OFFSET_FR27 0x%x\n", ((int) &fpctx->fr27) - (int) fpctx); |
|
- | 72 | fprintf(f,"#define OFFSET_FR28 0x%x\n", ((int) &fpctx->fr28) - (int) fpctx); |
|
- | 73 | fprintf(f,"#define OFFSET_FR29 0x%x\n", ((int) &fpctx->fr29) - (int) fpctx); |
|
- | 74 | fprintf(f,"#define OFFSET_FR30 0x%x\n", ((int) &fpctx->fr30) - (int) fpctx); |
|
- | 75 | fprintf(f,"#define OFFSET_FR31 0x%x\n", ((int) &fpctx->fr31) - (int) fpctx); |
|
- | 76 | fprintf(f,"#define OFFSET_FPSCR 0x%x\n", ((int) &fpctx->fpscr) - (int) fpctx); |
|
- | 77 | ||
52 | fclose(f); |
78 | fclose(f); |
53 | 79 | ||
54 | return 0; |
80 | return 0; |
55 | } |
81 | } |