genassym.c
1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (C) 1998 by the Board of Trustees
* of Leland Stanford Junior University.
* Copyright (C) 1998 Digital Equipment Corporation
*
* This file is part of the SimOS distribution.
* See LICENSE file for terms of the license.
*
*/
/*
* this file compiled as part of the build.
*/
#include <stdio.h>
#include <stddef.h>
#include "simtypes.h"
#include "alpha.h"
#define O(__STR, __STRUC, __FIELD) \
printf("#define\t%s\t%ld\n", __STR, offsetof(__STRUC, __FIELD))
int main(int argc, char **argv)
{
printf("#ifndef DELTA_ASSYM_H\n");
printf("#define DELTA_ASSYM_H\n");
O("PC_OFF",AlphaState,PC);
O("REG_OFF",AlphaState,reg[0]);
O("FPREG_OFF",AlphaState,fp[0]);
O("FPCR_OFF",AlphaState,fpcr);
O("NEXTCPU_OFF", AlphaState, nextCPU);
O("COUNTDOWN_OFF",AlphaState,cycleCountDown);
O("LLADDR_OFF",AlphaState,llAddr);
O("LLVALUE_OFF",AlphaState,llValue);
O("CURIQC_OFF",AlphaState,curIQC);
O("CURDQC_OFF",AlphaState,curDQC);
O("CONSTANTS_OFF",AlphaState,constantsPtr);
O("IPR_OFF",AlphaState,ipr);
printf("#endif\n");
return 0;
}