lfn
serial
ticket/834-toolchain-update
topic/msim-upgrade
topic/simplify-dev-export
Last change
on this file since 7f1c620 was 7f1c620, checked in by Jakub Jermar <jakub@…>, 19 years ago |
Replace old u?? types with respective C99 variants (e.g. uint32_t, int64_t, uintptr_t etc.).
|
-
Property mode
set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[ee7e6ace] | 1 | #include <stdio.h>
|
---|
[cd92528] | 2 | #include <stdint.h>
|
---|
[ee7e6ace] | 3 |
|
---|
[7f1c620] | 4 | typedef uint64_t uint64_t;
|
---|
| 5 | typedef uint64_t ipl_t;
|
---|
| 6 | typedef uint64_t uintptr_t;
|
---|
[ee7e6ace] | 7 |
|
---|
| 8 | #define __amd64_TYPES_H__
|
---|
| 9 | #include "../../arch/amd64/include/context.h"
|
---|
| 10 |
|
---|
[d246e7e] | 11 | #define FILENAME "../../arch/amd64/include/context_offset.h"
|
---|
[ee7e6ace] | 12 |
|
---|
| 13 | int main(void)
|
---|
| 14 | {
|
---|
| 15 | FILE *f;
|
---|
| 16 | struct context ctx;
|
---|
| 17 | struct context *pctx = &ctx;
|
---|
| 18 |
|
---|
[49a39c2] | 19 | struct interrupt_context ictx;
|
---|
| 20 | struct interrupt_context *ipctx = &ictx;
|
---|
| 21 |
|
---|
[ee7e6ace] | 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 |
|
---|
[cd92528] | 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);
|
---|
| 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);
|
---|
| 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);
|
---|
| 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);
|
---|
| 38 | fprintf(f,"#define OFFSET_IPL 0x%x\n", ((int) &pctx->ipl) - (int) pctx);
|
---|
[49a39c2] | 39 |
|
---|
[ee7e6ace] | 40 | fclose(f);
|
---|
| 41 |
|
---|
| 42 | return 0;
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.