Rev 200 | Rev 318 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 200 | Rev 288 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | 3 | ||
4 | typedef long long __u64; |
4 | typedef long long __u64; |
5 | typedef __u64 pri_t; |
5 | typedef __u64 pri_t; |
6 | 6 | ||
7 | #define __amd64_TYPES_H__ |
7 | #define __amd64_TYPES_H__ |
8 | #include "../include/context.h" |
8 | #include "../../arch/amd64/include/context.h" |
9 | 9 | ||
10 | #define FILENAME "context_offset.h" |
10 | #define FILENAME "../../arch/amd64/src/context_offset.h" |
11 | 11 | ||
12 | int main(void) |
12 | int main(void) |
13 | { |
13 | { |
14 | FILE *f; |
14 | FILE *f; |
15 | struct context ctx; |
15 | struct context ctx; |
Line 19... | Line 19... | ||
19 | if (!f) { |
19 | if (!f) { |
20 | perror(FILENAME); |
20 | perror(FILENAME); |
21 | return 1; |
21 | return 1; |
22 | } |
22 | } |
23 | 23 | ||
- | 24 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__); |
|
- | 25 | ||
24 | fprintf(f,"#define OFFSET_SP 0x%x\n",((int)&pctx->sp) - (int )pctx); |
26 | fprintf(f,"#define OFFSET_SP 0x%x\n",((int)&pctx->sp) - (int )pctx); |
25 | fprintf(f,"#define OFFSET_PC 0x%x\n",((int)&pctx->pc) - (int )pctx); |
27 | fprintf(f,"#define OFFSET_PC 0x%x\n",((int)&pctx->pc) - (int )pctx); |
26 | fprintf(f,"#define OFFSET_RBX 0x%x\n",((int)&pctx->rbx) - (int )pctx); |
28 | fprintf(f,"#define OFFSET_RBX 0x%x\n",((int)&pctx->rbx) - (int )pctx); |
27 | fprintf(f,"#define OFFSET_RBP 0x%x\n",((int)&pctx->rbp) - (int )pctx); |
29 | fprintf(f,"#define OFFSET_RBP 0x%x\n",((int)&pctx->rbp) - (int )pctx); |
28 | fprintf(f,"#define OFFSET_R12 0x%x\n",((int)&pctx->r12) - (int )pctx); |
30 | fprintf(f,"#define OFFSET_R12 0x%x\n",((int)&pctx->r12) - (int )pctx); |