/[dynamips]/upstream/dynamips-0.2.6-RC2/asmdefs.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /upstream/dynamips-0.2.6-RC2/asmdefs.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (hide annotations)
Sat Oct 6 16:01:44 2007 UTC (16 years, 5 months ago) by dpavlin
Original Path: upstream/dynamips-0.2.5/asmdefs.c
File MIME type: text/plain
File size: 1330 byte(s)
import 0.2.5 from upstream

1 dpavlin 1 /*
2     * Cisco 7200 (Predator) simulation platform.
3     * Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr)
4     *
5     * Produces assembly definitions.
6     */
7    
8     #include <stdio.h>
9     #include <stdlib.h>
10     #include <unistd.h>
11     #include <string.h>
12     #include <sys/types.h>
13     #include <sys/stat.h>
14     #include <sys/mman.h>
15     #include <signal.h>
16     #include <fcntl.h>
17     #include <assert.h>
18    
19     #include "rbtree.h"
20     #include "mips64.h"
21     #include "cp0.h"
22     #include "memory.h"
23     #include "cpu.h"
24     #include "device.h"
25    
26     #define OUTPUT "asmdefs.h"
27    
28     int main(int argc,char *argv[])
29     {
30     FILE *fd;
31    
32     if (!(fd = fopen(OUTPUT,"w"))) {
33     fprintf(stderr,"%s: unable to create output file.\n",argv[0]);
34     exit(EXIT_FAILURE);
35     }
36    
37     fprintf(fd,"#define CP0_VCNT_OFS %lu\n",
38     OFFSET(cpu_mips_t,cp0_virt_cnt_reg));
39    
40     fprintf(fd,"#define CP0_VCMP_OFS %lu\n",
41     OFFSET(cpu_mips_t,cp0_virt_cmp_reg));
42    
43     fprintf(fd,"#define MTS_L1_OFS %lu\n",
44     OFFSET(cpu_mips_t,mts_l1_ptr));
45    
46     fprintf(fd,"#define CPU_GPR_OFS %lu\n",
47     OFFSET(cpu_mips_t,gpr));
48    
49     fprintf(fd,"#define CPU_MTS64_CACHE_OFS %lu\n",
50     OFFSET(cpu_mips_t,mts64_cache));
51    
52     fprintf(fd,"#define MTS64_ENTRY_START_OFS %lu\n",
53     OFFSET(mts64_entry_t,start));
54    
55     fprintf(fd,"#define MIPS_MEMOP_LW %d\n",MIPS_MEMOP_LW);
56    
57     fclose(fd);
58     return(0);
59     }

  ViewVC Help
Powered by ViewVC 1.1.26