Rev 799 | Rev 1021 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 799 | Rev 859 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | #include <stdio.h> |
1 | #include <stdio.h> |
- | 2 | #include <stdint.h> |
|
2 | 3 | ||
3 | - | ||
4 | typedef long long __u64; |
4 | typedef uint64_t __u64; |
5 | typedef __u64 ipl_t; |
5 | typedef __u64 ipl_t; |
6 | typedef __u64 __address; |
6 | typedef __u64 __address; |
7 | 7 | ||
8 | #define __amd64_TYPES_H__ |
8 | #define __amd64_TYPES_H__ |
9 | #include "../../arch/amd64/include/context.h" |
9 | #include "../../arch/amd64/include/context.h" |
Line 25... | Line 25... | ||
25 | return 1; |
25 | return 1; |
26 | } |
26 | } |
27 | 27 | ||
28 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
28 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
29 | 29 | ||
30 | fprintf(f,"#define OFFSET_SP 0x%x\n",((int)&pctx->sp) - (int )pctx); |
30 | fprintf(f,"#define OFFSET_SP 0x%x\n", ((int) &pctx->sp) - (int) pctx); |
31 | fprintf(f,"#define OFFSET_PC 0x%x\n",((int)&pctx->pc) - (int )pctx); |
31 | fprintf(f,"#define OFFSET_PC 0x%x\n", ((int) &pctx->pc) - (int) pctx); |
32 | fprintf(f,"#define OFFSET_RBX 0x%x\n",((int)&pctx->rbx) - (int )pctx); |
32 | fprintf(f,"#define OFFSET_RBX 0x%x\n", ((int) &pctx->rbx) - (int) pctx); |
33 | fprintf(f,"#define OFFSET_RBP 0x%x\n",((int)&pctx->rbp) - (int )pctx); |
33 | fprintf(f,"#define OFFSET_RBP 0x%x\n", ((int) &pctx->rbp) - (int) pctx); |
34 | fprintf(f,"#define OFFSET_R12 0x%x\n",((int)&pctx->r12) - (int )pctx); |
34 | fprintf(f,"#define OFFSET_R12 0x%x\n", ((int) &pctx->r12) - (int) pctx); |
35 | 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); |
36 | 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); |
37 | 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); |
38 | fprintf(f,"#define OFFSET_IPL 0x%x\n",((int)&pctx->ipl) - (int )pctx); |
38 | fprintf(f,"#define OFFSET_IPL 0x%x\n", ((int) &pctx->ipl) - (int) pctx); |
39 | 39 | ||
40 | fprintf(f, "\n"); |
40 | fprintf(f, "\n"); |
41 | 41 | ||
42 | #define ifpr(big,nm) fprintf(f, "#define IOFFSET_" #big " 0x%x\n", ((int)&ipctx->nm) - (int) ipctx) |
42 | #define ifpr(big, nm) fprintf(f, "#define IOFFSET_" #big " 0x%x\n", ((int) &ipctx->nm) - (int) ipctx) |
43 | 43 | ||
44 | ifpr(RAX, rax); |
44 | ifpr(RAX, rax); |
45 | ifpr(RBX, rbx); |
45 | ifpr(RBX, rbx); |
46 | ifpr(RCX, rcx); |
46 | ifpr(RCX, rcx); |
47 | ifpr(RDX, rdx); |
47 | ifpr(RDX, rdx); |