/[dynamips]/upstream/dynamips-0.2.7-RC2/dynamips.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

Diff of /upstream/dynamips-0.2.7-RC2/dynamips.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

upstream/dynamips-0.2.6-RC2/dynamips.c revision 3 by dpavlin, Sat Oct 6 16:05:34 2007 UTC upstream/dynamips-0.2.7-RC2/dynamips.c revision 8 by dpavlin, Sat Oct 6 16:24:54 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   * Cisco 7200 (Predator) simulation platform.   * Cisco router simulation platform.
3   * Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr)   * Copyright (c) 2005,2006 Christophe Fillot (cf@utc.fr)
4   *   *
5   * Many thanks to Nicolas Szalay for his patch   * Many thanks to Nicolas Szalay for his patch
# Line 20  Line 20 
20  #include <assert.h>  #include <assert.h>
21  #include <getopt.h>  #include <getopt.h>
22    
 #include ARCH_INC_FILE  
   
23  #include "dynamips.h"  #include "dynamips.h"
24  #include "mips64.h"  #include "cpu.h"
25  #include "mips64_exec.h"  #include "mips64_exec.h"
26    #include "mips64_jit.h"
27    #include "ppc32_exec.h"
28    #include "ppc32_jit.h"
29  #include "dev_c7200.h"  #include "dev_c7200.h"
30  #include "dev_c3600.h"  #include "dev_c3600.h"
31    #include "dev_c2691.h"
32    #include "dev_c3725.h"
33    #include "dev_c3745.h"
34    #include "dev_c2600.h"
35    #include "dev_msfc1.h"
36    #include "ppc32_vmtest.h"
37  #include "dev_vtty.h"  #include "dev_vtty.h"
38  #include "ptask.h"  #include "ptask.h"
39  #include "timer.h"  #include "timer.h"
# Line 52  Line 59 
59  /* Software version */  /* Software version */
60  const char *sw_version = DYNAMIPS_VERSION"-"JIT_ARCH;  const char *sw_version = DYNAMIPS_VERSION"-"JIT_ARCH;
61    
62    /* Software version tag */
63    const char *sw_version_tag = "2007030219";
64    
65  /* Hypervisor */  /* Hypervisor */
66  int hypervisor_mode = 0;  int hypervisor_mode = 0;
67  int hypervisor_tcp_port = 0;  int hypervisor_tcp_port = 0;
# Line 148  static void show_usage(int argc,char *ar Line 158  static void show_usage(int argc,char *ar
158  {  {
159     u_int def_ram_size,def_rom_size,def_nvram_size;     u_int def_ram_size,def_rom_size,def_nvram_size;
160     u_int def_conf_reg,def_clock_div;     u_int def_conf_reg,def_clock_div;
161     u_int def_disk0_size,def_disk1_size;     u_int def_disk0_size = 0,def_disk1_size = 0;
162     u_int def_nm_iomem_size = 0;     u_int def_nm_iomem_size = 0;
163    
164     switch(platform) {     switch(platform) {
# Line 171  static void show_usage(int argc,char *ar Line 181  static void show_usage(int argc,char *ar
181           def_disk1_size = C3600_DEFAULT_DISK1_SIZE;           def_disk1_size = C3600_DEFAULT_DISK1_SIZE;
182           def_nm_iomem_size = C3600_DEFAULT_IOMEM_SIZE;           def_nm_iomem_size = C3600_DEFAULT_IOMEM_SIZE;
183           break;           break;
184          case VM_TYPE_C2691:
185             def_ram_size   = C2691_DEFAULT_RAM_SIZE;
186             def_rom_size   = C2691_DEFAULT_ROM_SIZE;
187             def_nvram_size = C2691_DEFAULT_NVRAM_SIZE;
188             def_conf_reg   = C2691_DEFAULT_CONF_REG;
189             def_clock_div  = C2691_DEFAULT_CLOCK_DIV;
190             def_disk0_size = C2691_DEFAULT_DISK0_SIZE;
191             def_disk1_size = C2691_DEFAULT_DISK1_SIZE;
192             def_nm_iomem_size = C2691_DEFAULT_IOMEM_SIZE;
193             break;
194          case VM_TYPE_C3725:
195             def_ram_size   = C3725_DEFAULT_RAM_SIZE;
196             def_rom_size   = C3725_DEFAULT_ROM_SIZE;
197             def_nvram_size = C3725_DEFAULT_NVRAM_SIZE;
198             def_conf_reg   = C3725_DEFAULT_CONF_REG;
199             def_clock_div  = C3725_DEFAULT_CLOCK_DIV;
200             def_disk0_size = C3725_DEFAULT_DISK0_SIZE;
201             def_disk1_size = C3725_DEFAULT_DISK1_SIZE;
202             def_nm_iomem_size = C3725_DEFAULT_IOMEM_SIZE;
203             break;
204          case VM_TYPE_C3745:
205             def_ram_size   = C3745_DEFAULT_RAM_SIZE;
206             def_rom_size   = C3745_DEFAULT_ROM_SIZE;
207             def_nvram_size = C3745_DEFAULT_NVRAM_SIZE;
208             def_conf_reg   = C3745_DEFAULT_CONF_REG;
209             def_clock_div  = C3745_DEFAULT_CLOCK_DIV;
210             def_disk0_size = C3745_DEFAULT_DISK0_SIZE;
211             def_disk1_size = C3745_DEFAULT_DISK1_SIZE;
212             def_nm_iomem_size = C3745_DEFAULT_IOMEM_SIZE;
213             break;
214          case VM_TYPE_C2600:
215             def_ram_size   = C2600_DEFAULT_RAM_SIZE;
216             def_rom_size   = C2600_DEFAULT_ROM_SIZE;
217             def_nvram_size = C2600_DEFAULT_NVRAM_SIZE;
218             def_conf_reg   = C2600_DEFAULT_CONF_REG;
219             def_clock_div  = C2600_DEFAULT_CLOCK_DIV;
220             def_disk0_size = C2600_DEFAULT_DISK0_SIZE;
221             def_disk1_size = C2600_DEFAULT_DISK1_SIZE;
222             def_nm_iomem_size = C2600_DEFAULT_IOMEM_SIZE;
223             break;
224          case VM_TYPE_MSFC1:
225             def_ram_size   = MSFC1_DEFAULT_RAM_SIZE;
226             def_rom_size   = MSFC1_DEFAULT_ROM_SIZE;
227             def_nvram_size = MSFC1_DEFAULT_NVRAM_SIZE;
228             def_conf_reg   = MSFC1_DEFAULT_CONF_REG;
229             def_clock_div  = MSFC1_DEFAULT_CLOCK_DIV;
230             break;
231          case VM_TYPE_PPC32_TEST:
232             def_ram_size   = PPC32_VMTEST_DEFAULT_RAM_SIZE;
233        default:        default:
234           fprintf(stderr,"show_usage: invalid platform.\n");           fprintf(stderr,"show_usage: invalid platform.\n");
235           return;           return;
# Line 180  static void show_usage(int argc,char *ar Line 239  static void show_usage(int argc,char *ar
239        
240     printf("Available options:\n"     printf("Available options:\n"
241            "  -H <tcp_port>      : Run in hypervisor mode\n\n"            "  -H <tcp_port>      : Run in hypervisor mode\n\n"
242            "  -P <platform>      : Platform to emulate (7200 or 3600) "            "  -P <platform>      : Platform to emulate (7200, 3600, "
243              "2691, 3725 or 3745) "
244            "(default: 7200)\n\n"            "(default: 7200)\n\n"
245            "  -l <log_file>      : Set logging file (default is %s)\n"            "  -l <log_file>      : Set logging file (default is %s)\n"
246            "  -j                 : Disable the JIT compiler, very slow\n"            "  -j                 : Disable the JIT compiler, very slow\n"
# Line 199  static void show_usage(int argc,char *ar Line 259  static void show_usage(int argc,char *ar
259            "  -C <cfg_file>      : Import an IOS configuration file "            "  -C <cfg_file>      : Import an IOS configuration file "
260            "into NVRAM\n"            "into NVRAM\n"
261            "  -X                 : Do not use a file to simulate RAM (faster)\n"            "  -X                 : Do not use a file to simulate RAM (faster)\n"
262              "  -G <ghost_file>    : Use a ghost file to simulate RAM\n"
263              "  -g <ghost_file>    : Generate a ghost RAM file\n"
264              "  --sparse-mem       : Use sparse memory\n"
265            "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"            "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"
266            "  -k <clock_div>     : Set the clock divisor (default: %d)\n"            "  -k <clock_div>     : Set the clock divisor (default: %d)\n"
267            "\n"            "\n"
# Line 238  static void show_usage(int argc,char *ar Line 301  static void show_usage(int argc,char *ar
301                  "Network Module\n",                  "Network Module\n",
302                  C3600_DEFAULT_CHASSIS,def_nm_iomem_size);                  C3600_DEFAULT_CHASSIS,def_nm_iomem_size);
303           break;           break;
304    
305          case VM_TYPE_C2691:
306             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
307                    "  -p <nm_desc>       : Define a Network Module\n"
308                    "  -s <nm_nio>        : Bind a Network IO interface to a "
309                    "Network Module\n",
310                    def_nm_iomem_size);
311             break;
312    
313          case VM_TYPE_C3725:
314             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
315                    "  -p <nm_desc>       : Define a Network Module\n"
316                    "  -s <nm_nio>        : Bind a Network IO interface to a "
317                    "Network Module\n",
318                    def_nm_iomem_size);
319             break;
320    
321          case VM_TYPE_C3745:
322             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
323                    "  -p <nm_desc>       : Define a Network Module\n"
324                    "  -s <nm_nio>        : Bind a Network IO interface to a "
325                    "Network Module\n",
326                    def_nm_iomem_size);
327             break;
328    
329          case VM_TYPE_C2600:
330             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
331                    "  -p <nm_desc>       : Define a Network Module\n"
332                    "  -s <nm_nio>        : Bind a Network IO interface to a "
333                    "Network Module\n",
334                    def_nm_iomem_size);
335             break;
336    
337          case VM_TYPE_MSFC1:
338             printf("  -s <pa_nio>        : Bind a Network IO interface to a "
339                    "Port Adapter\n");
340             break;
341    
342     }     }
343    
344     printf("\n"     printf("\n"
# Line 286  static void show_usage(int argc,char *ar Line 387  static void show_usage(int argc,char *ar
387           /* Show the possible chassis types for C3600 platform */           /* Show the possible chassis types for C3600 platform */
388           c3600_chassis_show_drivers();           c3600_chassis_show_drivers();
389    
390           /* Show the possible PA drivers */           /* Show the possible NM drivers */
391           c3600_nm_show_drivers();           c3600_nm_show_drivers();
392           break;           break;
393    
394          case VM_TYPE_C2691:
395             printf("<nm_desc> format:\n"
396                    "   \"slot:nm_driver\"\n"
397                    "\n");
398    
399             printf("<nm_nio> format:\n"
400                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
401                    "\n");
402    
403             /* Show the possible NM drivers */
404             c2691_nm_show_drivers();
405             break;
406    
407          case VM_TYPE_C3725:
408             printf("<nm_desc> format:\n"
409                    "   \"slot:nm_driver\"\n"
410                    "\n");
411    
412             printf("<nm_nio> format:\n"
413                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
414                    "\n");
415    
416             /* Show the possible NM drivers */
417             c3725_nm_show_drivers();
418             break;
419    
420          case VM_TYPE_C3745:
421             printf("<nm_desc> format:\n"
422                    "   \"slot:nm_driver\"\n"
423                    "\n");
424    
425             printf("<nm_nio> format:\n"
426                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
427                    "\n");
428    
429             /* Show the possible NM drivers */
430             c3745_nm_show_drivers();
431             break;
432    
433          case VM_TYPE_C2600:
434             printf("<nm_desc> format:\n"
435                    "   \"slot:nm_driver\"\n"
436                    "\n");
437    
438             printf("<nm_nio> format:\n"
439                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
440                    "\n");
441    
442             /* Show the possible chassis types for C2600 platform */
443             c2600_mainboard_show_drivers();
444    
445             /* Show the possible NM drivers */
446             c2600_nm_show_drivers();
447             break;
448     }     }
449        
450     /* Show the possible NETIO types */     /* Show the possible NETIO types */
# Line 330  static int cli_get_platform_type(int arg Line 486  static int cli_get_platform_type(int arg
486           vm_type = VM_TYPE_C3600;           vm_type = VM_TYPE_C3600;
487        else if (!strcmp(str,"7200"))        else if (!strcmp(str,"7200"))
488           vm_type = VM_TYPE_C7200;           vm_type = VM_TYPE_C7200;
489          else if (!strcmp(str,"2691"))
490             vm_type = VM_TYPE_C2691;
491          else if (!strcmp(str,"3725"))
492             vm_type = VM_TYPE_C3725;
493          else if (!strcmp(str,"3745"))
494             vm_type = VM_TYPE_C3745;
495          else if (!strcmp(str,"2600"))
496             vm_type = VM_TYPE_C2600;
497          else if (!strcmp(str,"MSFC1"))
498             vm_type = VM_TYPE_MSFC1;
499          else if (!strcmp(str,"PPC32_TEST"))
500             vm_type = VM_TYPE_PPC32_TEST;
501        else        else
502           fprintf(stderr,"Invalid platform type '%s'\n",str);           fprintf(stderr,"Invalid platform type '%s'\n",str);
503     }     }
# Line 345  static int cli_get_platform_type(int arg Line 513  static int cli_get_platform_type(int arg
513  #define OPT_TIMER_ITV   0x104  #define OPT_TIMER_ITV   0x104
514  #define OPT_VM_DEBUG    0x105  #define OPT_VM_DEBUG    0x105
515  #define OPT_IOMEM_SIZE  0x106  #define OPT_IOMEM_SIZE  0x106
516    #define OPT_SPARSE_MEM  0x107
517    
518  static struct option cmd_line_lopts[] = {  static struct option cmd_line_lopts[] = {
519     { "disk0"      , 1, NULL, OPT_DISK0_SIZE },     { "disk0"      , 1, NULL, OPT_DISK0_SIZE },
# Line 354  static struct option cmd_line_lopts[] = Line 523  static struct option cmd_line_lopts[] =
523     { "timer-itv"  , 1, NULL, OPT_TIMER_ITV },     { "timer-itv"  , 1, NULL, OPT_TIMER_ITV },
524     { "vm-debug"   , 1, NULL, OPT_VM_DEBUG },     { "vm-debug"   , 1, NULL, OPT_VM_DEBUG },
525     { "iomem-size" , 1, NULL, OPT_IOMEM_SIZE },     { "iomem-size" , 1, NULL, OPT_IOMEM_SIZE },
526       { "sparse-mem" , 0, NULL, OPT_SPARSE_MEM },
527     { NULL         , 0, NULL, 0 },     { NULL         , 0, NULL, 0 },
528  };  };
529    
# Line 431  static int cli_parse_c3600_options(vm_in Line 601  static int cli_parse_c3600_options(vm_in
601     return(0);     return(0);
602  }  }
603    
604    /* Parse specific options for the Cisco 2691 platform */
605    static int cli_parse_c2691_options(vm_instance_t *vm,int option)
606    {
607       c2691_t *router;
608    
609       router = VM_C2691(vm);
610    
611       switch(option) {
612          /* IO memory reserved for NMs (in percents!) */
613          case OPT_IOMEM_SIZE:
614             router->nm_iomem_size = 0x8000 | atoi(optarg);
615             break;
616    
617          /* NM settings */
618          case 'p':
619             return(c2691_cmd_nm_create(router,optarg));
620    
621          /* NM NIO settings */
622          case 's':
623             return(c2691_cmd_add_nio(router,optarg));
624    
625          /* Unknown option */
626          default:
627             return(-1);
628       }
629    
630       return(0);
631    }
632    
633    /* Parse specific options for the Cisco 3725 platform */
634    static int cli_parse_c3725_options(vm_instance_t *vm,int option)
635    {
636       c3725_t *router;
637    
638       router = VM_C3725(vm);
639    
640       switch(option) {
641          /* IO memory reserved for NMs (in percents!) */
642          case OPT_IOMEM_SIZE:
643             router->nm_iomem_size = 0x8000 | atoi(optarg);
644             break;
645    
646          /* NM settings */
647          case 'p':
648             return(c3725_cmd_nm_create(router,optarg));
649    
650          /* NM NIO settings */
651          case 's':
652             return(c3725_cmd_add_nio(router,optarg));
653    
654          /* Unknown option */
655          default:
656             return(-1);
657       }
658    
659       return(0);
660    }
661    
662    /* Parse specific options for the Cisco 3745 platform */
663    static int cli_parse_c3745_options(vm_instance_t *vm,int option)
664    {
665       c3745_t *router;
666    
667       router = VM_C3745(vm);
668    
669       switch(option) {
670          /* IO memory reserved for NMs (in percents!) */
671          case OPT_IOMEM_SIZE:
672             router->nm_iomem_size = 0x8000 | atoi(optarg);
673             break;
674    
675          /* NM settings */
676          case 'p':
677             return(c3745_cmd_nm_create(router,optarg));
678    
679          /* NM NIO settings */
680          case 's':
681             return(c3745_cmd_add_nio(router,optarg));
682    
683          /* Unknown option */
684          default:
685             return(-1);
686       }
687    
688       return(0);
689    }
690    
691    /* Parse specific options for the Cisco 2600 platform */
692    static int cli_parse_c2600_options(vm_instance_t *vm,int option)
693    {
694       c2600_t *router;
695    
696       router = VM_C2600(vm);
697    
698       switch(option) {
699          /* IO memory reserved for NMs (in percents!) */
700          case OPT_IOMEM_SIZE:
701             router->nm_iomem_size = 0x8000 | atoi(optarg);
702             break;
703    
704          /* Mainboard type */
705          case 't':
706             c2600_mainboard_set_type(router,optarg);
707             break;
708    
709          /* NM settings */
710          case 'p':
711             return(c2600_cmd_nm_create(router,optarg));
712    
713          /* NM NIO settings */
714          case 's':
715             return(c2600_cmd_add_nio(router,optarg));
716    
717          /* Unknown option */
718          default:
719             return(-1);
720       }
721    
722       return(0);
723    }
724    
725    /* Parse specific options for the MSFC1 platform */
726    static int cli_parse_msfc1_options(vm_instance_t *vm,int option)
727    {
728       msfc1_t *router;
729    
730       router = VM_MSFC1(vm);
731    
732       switch(option) {
733          /* PA NIO settings */
734          case 's':
735             return(msfc1_cmd_add_nio(router,optarg));
736    
737          /* Unknown option */
738          default:
739             return(-1);
740       }
741    
742       return(0);
743    }
744    
745  /* Create a router instance */  /* Create a router instance */
746  static vm_instance_t *cli_create_instance(char *name,int platform_type,  static vm_instance_t *cli_create_instance(char *name,int platform_type,
747                                            int instance_id)                                            int instance_id)
748  {  {
749       vm_instance_t *vm;
750     c7200_t *c7200;     c7200_t *c7200;
751     c3600_t *c3600;     c3600_t *c3600;
752       c2691_t *c2691;
753       c3725_t *c3725;
754       c3745_t *c3745;
755       c2600_t *c2600;
756       msfc1_t *msfc1;
757    
758     switch(platform_type) {     switch(platform_type) {
759        case VM_TYPE_C7200:        case VM_TYPE_C7200:
# Line 453  static vm_instance_t *cli_create_instanc Line 770  static vm_instance_t *cli_create_instanc
770           }           }
771           return(c3600->vm);           return(c3600->vm);
772    
773          case VM_TYPE_C2691:
774             if (!(c2691 = c2691_create_instance(name,instance_id))) {
775                fprintf(stderr,"C2691: unable to create instance!\n");
776                return NULL;
777             }
778             return(c2691->vm);
779    
780          case VM_TYPE_C3725:
781             if (!(c3725 = c3725_create_instance(name,instance_id))) {
782                fprintf(stderr,"C3725: unable to create instance!\n");
783                return NULL;
784             }
785             return(c3725->vm);
786    
787          case VM_TYPE_C3745:
788             if (!(c3745 = c3745_create_instance(name,instance_id))) {
789                fprintf(stderr,"C3745: unable to create instance!\n");
790                return NULL;
791             }
792             return(c3745->vm);
793    
794          case VM_TYPE_C2600:
795             if (!(c2600 = c2600_create_instance(name,instance_id))) {
796                fprintf(stderr,"C2600: unable to create instance!\n");
797                return NULL;
798             }
799             return(c2600->vm);
800    
801          case VM_TYPE_MSFC1:
802             if (!(msfc1 = msfc1_create_instance(name,instance_id))) {
803                fprintf(stderr,"MSFC1: unable to create instance!\n");
804                return NULL;
805             }
806             return(msfc1->vm);
807    
808          case VM_TYPE_PPC32_TEST:
809             if (!(vm = ppc32_vmtest_create_instance(name,instance_id))) {
810                fprintf(stderr,"PPC32_TEST: unable to create instance!\n");
811                return NULL;
812             }
813             return(vm);
814    
815        default:        default:
816           fprintf(stderr,"Unknown platform type '%d'!\n",platform_type);           fprintf(stderr,"Unknown platform type '%d'!\n",platform_type);
817           return NULL;           return NULL;
# Line 463  static vm_instance_t *cli_create_instanc Line 822  static vm_instance_t *cli_create_instanc
822  static int parse_std_cmd_line(int argc,char *argv[],int *platform)  static int parse_std_cmd_line(int argc,char *argv[],int *platform)
823  {  {
824     char *options_list =     char *options_list =
825        "r:o:n:c:m:l:C:i:jt:p:s:k:T:U:A:B:a:f:E:b:S:R:M:eXP:N:";        "r:o:n:c:m:l:C:i:jt:p:s:k:T:U:A:B:a:f:E:b:S:R:M:eXP:N:G:g:";
826     vm_instance_t *vm;     vm_instance_t *vm;
827     int instance_id;     int instance_id;
828     int res,option;     int res,option;
# Line 558  static int parse_std_cmd_line(int argc,c Line 917  static int parse_std_cmd_line(int argc,c
917              vm->ram_mmap = 0;              vm->ram_mmap = 0;
918              break;              break;
919    
920             /* Use a ghost file to simulate RAM */          
921             case 'G':
922                vm->ghost_ram_filename = strdup(optarg);
923                vm->ghost_status = VM_GHOST_RAM_USE;
924                break;
925    
926             /* Generate a ghost RAM image */
927             case 'g':
928                vm->ghost_ram_filename = strdup(optarg);
929                vm->ghost_status = VM_GHOST_RAM_GENERATE;
930                break;
931    
932             /* Use sparse memory */
933             case OPT_SPARSE_MEM:
934                vm->sparse_mem = TRUE;
935                break;
936    
937           /* Alternate ROM */           /* Alternate ROM */
938           case 'R':           case 'R':
939              vm->rom_filename = optarg;              vm->rom_filename = optarg;
# Line 689  static int parse_std_cmd_line(int argc,c Line 1065  static int parse_std_cmd_line(int argc,c
1065                    break;                    break;
1066                 case VM_TYPE_C3600:                 case VM_TYPE_C3600:
1067                    res = cli_parse_c3600_options(vm,option);                    res = cli_parse_c3600_options(vm,option);
1068                      break;              
1069                   case VM_TYPE_C2691:
1070                      res = cli_parse_c2691_options(vm,option);
1071                      break;
1072                   case VM_TYPE_C3725:
1073                      res = cli_parse_c3725_options(vm,option);
1074                      break;
1075                  case VM_TYPE_C3745:
1076                      res = cli_parse_c3745_options(vm,option);
1077                      break;
1078                  case VM_TYPE_C2600:
1079                      res = cli_parse_c2600_options(vm,option);
1080                      break;
1081                  case VM_TYPE_MSFC1:
1082                      res = cli_parse_msfc1_options(vm,option);
1083                    break;                    break;
1084              }              }
1085    
# Line 771  void dynamips_reset(void) Line 1162  void dynamips_reset(void)
1162  {  {
1163     printf("Shutdown in progress...\n");     printf("Shutdown in progress...\n");
1164    
1165     /* Delete all C7200 and C3600 instances */     /* Delete all virtual router instances */
1166     c7200_delete_all_instances();     c7200_delete_all_instances();
1167     c3600_delete_all_instances();     c3600_delete_all_instances();
1168       c2691_delete_all_instances();
1169       c3725_delete_all_instances();
1170       c3745_delete_all_instances();
1171       c2600_delete_all_instances();
1172       msfc1_delete_all_instances();
1173       ppc32_vmtest_delete_all_instances();
1174    
1175     /* Delete ATM and Frame-Relay switches + bridges */     /* Delete ATM and Frame-Relay switches + bridges */
1176     netio_bridge_delete_all();     netio_bridge_delete_all();
# Line 799  int main(int argc,char *argv[]) Line 1196  int main(int argc,char *argv[])
1196     atexit(profiler_savestat);     atexit(profiler_savestat);
1197  #endif  #endif
1198    
1199     printf("Cisco 7200 Simulation Platform (version %s)\n",sw_version);     printf("Cisco Router Simulation Platform (version %s)\n",sw_version);
1200     printf("Copyright (c) 2005,2006 Christophe Fillot.\n\n");     printf("Copyright (c) 2005-2007 Christophe Fillot.\n");
1201       printf("Build date: %s %s\n\n",__DATE__,__TIME__);
1202    
1203     /* Initialize timers */     /* Initialize timers */
1204     timer_init();     timer_init();
# Line 837  int main(int argc,char *argv[]) Line 1235  int main(int argc,char *argv[])
1235     /* Create instruction lookup tables */     /* Create instruction lookup tables */
1236     mips64_jit_create_ilt();     mips64_jit_create_ilt();
1237     mips64_exec_create_ilt();     mips64_exec_create_ilt();
1238       ppc32_jit_create_ilt();
1239       ppc32_exec_create_ilt();
1240    
1241     setup_signals();     setup_signals();
1242    
# Line 851  int main(int argc,char *argv[]) Line 1251  int main(int argc,char *argv[])
1251              break;              break;
1252           case VM_TYPE_C3600:           case VM_TYPE_C3600:
1253              res = c3600_init_instance(VM_C3600(vm));              res = c3600_init_instance(VM_C3600(vm));
1254                break;      
1255             case VM_TYPE_C2691:
1256                res = c2691_init_instance(VM_C2691(vm));
1257                break;
1258             case VM_TYPE_C3725:
1259                res = c3725_init_instance(VM_C3725(vm));
1260                break;
1261             case VM_TYPE_C3745:
1262                res = c3745_init_instance(VM_C3745(vm));
1263                break;
1264             case VM_TYPE_C2600:
1265                res = c2600_init_instance(VM_C2600(vm));
1266                break;
1267             case VM_TYPE_MSFC1:
1268                res = msfc1_init_instance(VM_MSFC1(vm));
1269                break;
1270             case VM_TYPE_PPC32_TEST:
1271                res = ppc32_vmtest_init_instance(vm);
1272              break;              break;
1273           default:           default:
1274              res = -1;              res = -1;
# Line 861  int main(int argc,char *argv[]) Line 1279  int main(int argc,char *argv[])
1279           exit(EXIT_FAILURE);           exit(EXIT_FAILURE);
1280        }        }
1281    
1282  #if DEBUG_PERF_COUNTER  #if (DEBUG_INSN_PERF_CNT > 0) || (DEBUG_BLOCK_PERF_CNT > 0)
1283        {        {
1284           m_uint64_t prev = 0,delta;           m_uint64_t counter,prev = 0,delta;
1285           while(vm->status == VM_STATUS_RUNNING) {           while(vm->status == VM_STATUS_RUNNING) {
1286              delta = vm->boot_cpu->perf_counter - prev;              counter = cpu_get_perf_counter(vm->boot_cpu);
1287              prev = vm->boot_cpu->perf_counter;              delta = counter - prev;
1288                prev = counter;
1289              printf("delta = %llu\n",delta);              printf("delta = %llu\n",delta);
1290              sleep(1);              sleep(1);
1291           }           }

Legend:
Removed from v.3  
changed lines
  Added in v.8

  ViewVC Help
Powered by ViewVC 1.1.26