Rev 859 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
426 | jermar | 1 | #include <stdio.h> |
859 | decky | 2 | #include <stdint.h> |
426 | jermar | 3 | |
1780 | jermar | 4 | typedef uint64_t uint64_t; |
5 | typedef uint64_t ipl_t; |
||
6 | typedef uint64_t uintptr_t; |
||
426 | jermar | 7 | |
8 | #define __sparc64_TYPES_H__ |
||
9 | #define __ALIGN_H__ |
||
10 | |||
526 | jermar | 11 | #include "../../arch/sparc64/include/stack.h" |
426 | jermar | 12 | #include "../../arch/sparc64/include/context.h" |
13 | |||
14 | #define FILENAME "../../arch/sparc64/include/context_offset.h" |
||
15 | |||
16 | int main(void) |
||
17 | { |
||
18 | FILE *f; |
||
19 | struct context *pctx = NULL; |
||
20 | |||
21 | |||
22 | f = fopen(FILENAME,"w"); |
||
23 | if (!f) { |
||
24 | perror(FILENAME); |
||
25 | return 1; |
||
26 | } |
||
27 | |||
28 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
||
29 | |||
30 | fprintf(f,"/* struct context */\n"); |
||
859 | decky | 31 | fprintf(f,"#define OFFSET_SP 0x%x\n", ((int) &pctx->sp) - (int) pctx); |
32 | fprintf(f,"#define OFFSET_PC 0x%x\n", ((int) &pctx->pc) - (int) pctx); |
||
33 | fprintf(f,"#define OFFSET_I0 0x%x\n", ((int) &pctx->i0) - (int) pctx); |
||
34 | fprintf(f,"#define OFFSET_I1 0x%x\n", ((int) &pctx->i1) - (int) pctx); |
||
35 | fprintf(f,"#define OFFSET_I2 0x%x\n", ((int) &pctx->i2) - (int) pctx); |
||
36 | fprintf(f,"#define OFFSET_I3 0x%x\n", ((int) &pctx->i3) - (int) pctx); |
||
37 | fprintf(f,"#define OFFSET_I4 0x%x\n", ((int) &pctx->i4) - (int) pctx); |
||
38 | fprintf(f,"#define OFFSET_I5 0x%x\n", ((int) &pctx->i5) - (int) pctx); |
||
39 | fprintf(f,"#define OFFSET_FP 0x%x\n", ((int) &pctx->fp) - (int) pctx); |
||
40 | fprintf(f,"#define OFFSET_I7 0x%x\n", ((int) &pctx->i7) - (int) pctx); |
||
41 | fprintf(f,"#define OFFSET_L0 0x%x\n", ((int) &pctx->l0) - (int) pctx); |
||
42 | fprintf(f,"#define OFFSET_L1 0x%x\n", ((int) &pctx->l1) - (int) pctx); |
||
43 | fprintf(f,"#define OFFSET_L2 0x%x\n", ((int) &pctx->l2) - (int) pctx); |
||
44 | fprintf(f,"#define OFFSET_L3 0x%x\n", ((int) &pctx->l3) - (int) pctx); |
||
45 | fprintf(f,"#define OFFSET_L4 0x%x\n", ((int) &pctx->l4) - (int) pctx); |
||
46 | fprintf(f,"#define OFFSET_L5 0x%x\n", ((int) &pctx->l5) - (int) pctx); |
||
47 | fprintf(f,"#define OFFSET_L6 0x%x\n", ((int) &pctx->l6) - (int) pctx); |
||
48 | fprintf(f,"#define OFFSET_L7 0x%x\n", ((int) &pctx->l7) - (int) pctx); |
||
49 | fprintf(f,"#define OFFSET_CLEANWIN 0x%x\n", ((int) &pctx->cleanwin) - (int) pctx); |
||
426 | jermar | 50 | |
51 | fclose(f); |
||
52 | |||
53 | return 0; |
||
54 | } |