Subversion Repositories HelenOS-historic

Rev

Rev 527 | Rev 532 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 527 Rev 528
1
#include <stdio.h>
1
#include <stdio.h>
2
 
2
 
3
typedef long long __u64;
3
typedef long long __u64;
4
typedef __u64 ipl_t;
4
typedef __u64 ipl_t;
5
typedef __u64 __address;
5
typedef __u64 __address;
6
 
6
 
7
#define __sparc64_TYPES_H__
7
#define __sparc64_TYPES_H__
8
#define __ALIGN_H__
8
#define __ALIGN_H__
9
 
9
 
10
#include "../../arch/sparc64/include/stack.h"
10
#include "../../arch/sparc64/include/stack.h"
11
#include "../../arch/sparc64/include/context.h"
11
#include "../../arch/sparc64/include/context.h"
12
 
12
 
13
#define FILENAME "../../arch/sparc64/include/context_offset.h"
13
#define FILENAME "../../arch/sparc64/include/context_offset.h"
14
 
14
 
15
int main(void)
15
int main(void)
16
{
16
{
17
    FILE *f;
17
    FILE *f;
18
    struct context *pctx = NULL;
18
    struct context *pctx = NULL;
19
   
19
   
20
 
20
 
21
    f = fopen(FILENAME,"w");
21
    f = fopen(FILENAME,"w");
22
    if (!f) {
22
    if (!f) {
23
        perror(FILENAME);
23
        perror(FILENAME);
24
        return 1;
24
        return 1;
25
    }
25
    }
26
 
26
 
27
    fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__);   
27
    fprintf(f, "/* This file is automatically generated by %s. */\n", __FILE__);   
28
 
28
 
29
    fprintf(f,"/* struct context */\n");
29
    fprintf(f,"/* struct context */\n");
30
    fprintf(f,"#define OFFSET_O1  0x%x\n",((int)&pctx->o1) - (int )pctx);
30
    fprintf(f,"#define OFFSET_O1  0x%x\n",((int)&pctx->o1) - (int )pctx);
31
    fprintf(f,"#define OFFSET_O2  0x%x\n",((int)&pctx->o2) - (int )pctx);
31
    fprintf(f,"#define OFFSET_O2  0x%x\n",((int)&pctx->o2) - (int )pctx);
32
    fprintf(f,"#define OFFSET_O3  0x%x\n",((int)&pctx->o3) - (int )pctx);
32
    fprintf(f,"#define OFFSET_O3  0x%x\n",((int)&pctx->o3) - (int )pctx);
33
    fprintf(f,"#define OFFSET_O4  0x%x\n",((int)&pctx->o4) - (int )pctx);
33
    fprintf(f,"#define OFFSET_O4  0x%x\n",((int)&pctx->o4) - (int )pctx);
34
    fprintf(f,"#define OFFSET_O5  0x%x\n",((int)&pctx->o5) - (int )pctx);
34
    fprintf(f,"#define OFFSET_O5  0x%x\n",((int)&pctx->o5) - (int )pctx);
35
    fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
35
    fprintf(f,"#define OFFSET_SP  0x%x\n",((int)&pctx->sp) - (int )pctx);
36
    fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
36
    fprintf(f,"#define OFFSET_PC  0x%x\n",((int)&pctx->pc) - (int )pctx);
-
 
37
    fprintf(f,"#define OFFSET_FP  0x%x\n",((int)&pctx->fp) - (int )pctx);
37
 
38
 
38
    fclose(f);
39
    fclose(f);
39
 
40
 
40
    return 0;
41
    return 0;
41
}
42
}
42
 
43