lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since ee7e6ace was ee7e6ace, checked in by Jakub Jermar <jakub@…>, 20 years ago |
Create tools/ directory.
Move helper scripts and tools out of src/ and arch/.
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | #include <stdio.h>
|
---|
2 |
|
---|
3 |
|
---|
4 | typedef long long __u64;
|
---|
5 | typedef __u64 pri_t;
|
---|
6 |
|
---|
7 | #define __amd64_TYPES_H__
|
---|
8 | #include "../../arch/amd64/include/context.h"
|
---|
9 |
|
---|
10 | #define FILENAME "../../arch/amd64/src/context_offset.h"
|
---|
11 |
|
---|
12 | int main(void)
|
---|
13 | {
|
---|
14 | FILE *f;
|
---|
15 | struct context ctx;
|
---|
16 | struct context *pctx = &ctx;
|
---|
17 |
|
---|
18 | f = fopen(FILENAME,"w");
|
---|
19 | if (!f) {
|
---|
20 | perror(FILENAME);
|
---|
21 | return 1;
|
---|
22 | }
|
---|
23 |
|
---|
24 | fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__);
|
---|
25 |
|
---|
26 | fprintf(f,"#define OFFSET_SP 0x%x\n",((int)&pctx->sp) - (int )pctx);
|
---|
27 | fprintf(f,"#define OFFSET_PC 0x%x\n",((int)&pctx->pc) - (int )pctx);
|
---|
28 | fprintf(f,"#define OFFSET_RBX 0x%x\n",((int)&pctx->rbx) - (int )pctx);
|
---|
29 | fprintf(f,"#define OFFSET_RBP 0x%x\n",((int)&pctx->rbp) - (int )pctx);
|
---|
30 | fprintf(f,"#define OFFSET_R12 0x%x\n",((int)&pctx->r12) - (int )pctx);
|
---|
31 | 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);
|
---|
33 | fprintf(f,"#define OFFSET_R15 0x%x\n",((int)&pctx->r15) - (int )pctx);
|
---|
34 | fprintf(f,"#define OFFSET_PRI 0x%x\n",((int)&pctx->pri) - (int )pctx);
|
---|
35 | fclose(f);
|
---|
36 |
|
---|
37 | return 0;
|
---|
38 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.