source: mainline/tools/mips/gencontext.c@ b49f4ae

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since b49f4ae was e84439a, checked in by Ondrej Palkovsky <ondrap@…>, 20 years ago

Fixed mips boot process.
On interrupt saving registers, save $lo, $hi.
Add interrupt naming to asm files (mips).
Save only necessary registers on context switch (see mips ABI).
Fixed copyright info.

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#include <stdio.h>
2
3
4typedef unsigned int __u32;
5typedef __u32 pri_t;
6
7#define __mips_TYPES_H_
8#include "../../arch/mips/include/context.h"
9
10#define FILENAME "../../arch/mips/src/context_offset.h"
11
12int 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_S0 0x%x\n",((int)&pctx->s0) - (int )pctx);
29 fprintf(f,"#define OFFSET_S1 0x%x\n",((int)&pctx->s1) - (int )pctx);
30 fprintf(f,"#define OFFSET_S2 0x%x\n",((int)&pctx->s2) - (int )pctx);
31 fprintf(f,"#define OFFSET_S3 0x%x\n",((int)&pctx->s3) - (int )pctx);
32 fprintf(f,"#define OFFSET_S4 0x%x\n",((int)&pctx->s4) - (int )pctx);
33 fprintf(f,"#define OFFSET_S5 0x%x\n",((int)&pctx->s5) - (int )pctx);
34 fprintf(f,"#define OFFSET_S6 0x%x\n",((int)&pctx->s6) - (int )pctx);
35 fprintf(f,"#define OFFSET_S7 0x%x\n",((int)&pctx->s7) - (int )pctx);
36 fprintf(f,"#define OFFSET_S8 0x%x\n",((int)&pctx->s8) - (int )pctx);
37 fprintf(f,"#define OFFSET_GP 0x%x\n",((int)&pctx->gp) - (int )pctx);
38
39
40 fclose(f);
41
42 return 0;
43}
Note: See TracBrowser for help on using the repository browser.