/[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-RC1/dynamips.c revision 7 by dpavlin, Sat Oct 6 16:23:47 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 "ppc32_vmtest.h"
36  #include "dev_vtty.h"  #include "dev_vtty.h"
37  #include "ptask.h"  #include "ptask.h"
38  #include "timer.h"  #include "timer.h"
# Line 171  static void show_usage(int argc,char *ar Line 177  static void show_usage(int argc,char *ar
177           def_disk1_size = C3600_DEFAULT_DISK1_SIZE;           def_disk1_size = C3600_DEFAULT_DISK1_SIZE;
178           def_nm_iomem_size = C3600_DEFAULT_IOMEM_SIZE;           def_nm_iomem_size = C3600_DEFAULT_IOMEM_SIZE;
179           break;           break;
180          case VM_TYPE_C2691:
181             def_ram_size   = C2691_DEFAULT_RAM_SIZE;
182             def_rom_size   = C2691_DEFAULT_ROM_SIZE;
183             def_nvram_size = C2691_DEFAULT_NVRAM_SIZE;
184             def_conf_reg   = C2691_DEFAULT_CONF_REG;
185             def_clock_div  = C2691_DEFAULT_CLOCK_DIV;
186             def_disk0_size = C2691_DEFAULT_DISK0_SIZE;
187             def_disk1_size = C2691_DEFAULT_DISK1_SIZE;
188             def_nm_iomem_size = C2691_DEFAULT_IOMEM_SIZE;
189             break;
190          case VM_TYPE_C3725:
191             def_ram_size   = C3725_DEFAULT_RAM_SIZE;
192             def_rom_size   = C3725_DEFAULT_ROM_SIZE;
193             def_nvram_size = C3725_DEFAULT_NVRAM_SIZE;
194             def_conf_reg   = C3725_DEFAULT_CONF_REG;
195             def_clock_div  = C3725_DEFAULT_CLOCK_DIV;
196             def_disk0_size = C3725_DEFAULT_DISK0_SIZE;
197             def_disk1_size = C3725_DEFAULT_DISK1_SIZE;
198             def_nm_iomem_size = C3725_DEFAULT_IOMEM_SIZE;
199             break;
200          case VM_TYPE_C3745:
201             def_ram_size   = C3745_DEFAULT_RAM_SIZE;
202             def_rom_size   = C3745_DEFAULT_ROM_SIZE;
203             def_nvram_size = C3745_DEFAULT_NVRAM_SIZE;
204             def_conf_reg   = C3745_DEFAULT_CONF_REG;
205             def_clock_div  = C3745_DEFAULT_CLOCK_DIV;
206             def_disk0_size = C3745_DEFAULT_DISK0_SIZE;
207             def_disk1_size = C3745_DEFAULT_DISK1_SIZE;
208             def_nm_iomem_size = C3745_DEFAULT_IOMEM_SIZE;
209             break;
210          case VM_TYPE_C2600:
211             def_ram_size   = C2600_DEFAULT_RAM_SIZE;
212             def_rom_size   = C2600_DEFAULT_ROM_SIZE;
213             def_nvram_size = C2600_DEFAULT_NVRAM_SIZE;
214             def_conf_reg   = C2600_DEFAULT_CONF_REG;
215             def_clock_div  = C2600_DEFAULT_CLOCK_DIV;
216             def_disk0_size = C2600_DEFAULT_DISK0_SIZE;
217             def_disk1_size = C2600_DEFAULT_DISK1_SIZE;
218             def_nm_iomem_size = C3745_DEFAULT_IOMEM_SIZE;
219             break;
220          case VM_TYPE_PPC32_TEST:
221             def_ram_size   = PPC32_VMTEST_DEFAULT_RAM_SIZE;
222        default:        default:
223           fprintf(stderr,"show_usage: invalid platform.\n");           fprintf(stderr,"show_usage: invalid platform.\n");
224           return;           return;
# Line 180  static void show_usage(int argc,char *ar Line 228  static void show_usage(int argc,char *ar
228        
229     printf("Available options:\n"     printf("Available options:\n"
230            "  -H <tcp_port>      : Run in hypervisor mode\n\n"            "  -H <tcp_port>      : Run in hypervisor mode\n\n"
231            "  -P <platform>      : Platform to emulate (7200 or 3600) "            "  -P <platform>      : Platform to emulate (7200, 3600, "
232              "2691, 3725 or 3745) "
233            "(default: 7200)\n\n"            "(default: 7200)\n\n"
234            "  -l <log_file>      : Set logging file (default is %s)\n"            "  -l <log_file>      : Set logging file (default is %s)\n"
235            "  -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 248  static void show_usage(int argc,char *ar
248            "  -C <cfg_file>      : Import an IOS configuration file "            "  -C <cfg_file>      : Import an IOS configuration file "
249            "into NVRAM\n"            "into NVRAM\n"
250            "  -X                 : Do not use a file to simulate RAM (faster)\n"            "  -X                 : Do not use a file to simulate RAM (faster)\n"
251              "  -G <ghost_file>    : Use a ghost file to simulate RAM\n"
252              "  -g <ghost_file>    : Generate a ghost RAM file\n"
253              "  --sparse-mem       : Use sparse memory\n"
254            "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"            "  -R <rom_file>      : Load an alternate ROM (default: embedded)\n"
255            "  -k <clock_div>     : Set the clock divisor (default: %d)\n"            "  -k <clock_div>     : Set the clock divisor (default: %d)\n"
256            "\n"            "\n"
# Line 238  static void show_usage(int argc,char *ar Line 290  static void show_usage(int argc,char *ar
290                  "Network Module\n",                  "Network Module\n",
291                  C3600_DEFAULT_CHASSIS,def_nm_iomem_size);                  C3600_DEFAULT_CHASSIS,def_nm_iomem_size);
292           break;           break;
293    
294          case VM_TYPE_C2691:
295             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
296                    "  -p <nm_desc>       : Define a Network Module\n"
297                    "  -s <nm_nio>        : Bind a Network IO interface to a "
298                    "Network Module\n",
299                    def_nm_iomem_size);
300             break;
301    
302          case VM_TYPE_C3725:
303             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
304                    "  -p <nm_desc>       : Define a Network Module\n"
305                    "  -s <nm_nio>        : Bind a Network IO interface to a "
306                    "Network Module\n",
307                    def_nm_iomem_size);
308             break;
309    
310          case VM_TYPE_C3745:
311             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
312                    "  -p <nm_desc>       : Define a Network Module\n"
313                    "  -s <nm_nio>        : Bind a Network IO interface to a "
314                    "Network Module\n",
315                    def_nm_iomem_size);
316             break;
317    
318          case VM_TYPE_C2600:
319             printf("  --iomem-size <val> : IO memory (in percents, default: %u)\n"
320                    "  -p <nm_desc>       : Define a Network Module\n"
321                    "  -s <nm_nio>        : Bind a Network IO interface to a "
322                    "Network Module\n",
323                    def_nm_iomem_size);
324             break;
325     }     }
326    
327     printf("\n"     printf("\n"
# Line 286  static void show_usage(int argc,char *ar Line 370  static void show_usage(int argc,char *ar
370           /* Show the possible chassis types for C3600 platform */           /* Show the possible chassis types for C3600 platform */
371           c3600_chassis_show_drivers();           c3600_chassis_show_drivers();
372    
373           /* Show the possible PA drivers */           /* Show the possible NM drivers */
374           c3600_nm_show_drivers();           c3600_nm_show_drivers();
375           break;           break;
376    
377          case VM_TYPE_C2691:
378             printf("<nm_desc> format:\n"
379                    "   \"slot:nm_driver\"\n"
380                    "\n");
381    
382             printf("<nm_nio> format:\n"
383                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
384                    "\n");
385    
386             /* Show the possible NM drivers */
387             c2691_nm_show_drivers();
388             break;
389    
390          case VM_TYPE_C3725:
391             printf("<nm_desc> format:\n"
392                    "   \"slot:nm_driver\"\n"
393                    "\n");
394    
395             printf("<nm_nio> format:\n"
396                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
397                    "\n");
398    
399             /* Show the possible NM drivers */
400             c3725_nm_show_drivers();
401             break;
402    
403          case VM_TYPE_C3745:
404             printf("<nm_desc> format:\n"
405                    "   \"slot:nm_driver\"\n"
406                    "\n");
407    
408             printf("<nm_nio> format:\n"
409                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
410                    "\n");
411    
412             /* Show the possible NM drivers */
413             c3745_nm_show_drivers();
414             break;
415    
416          case VM_TYPE_C2600:
417             printf("<nm_desc> format:\n"
418                    "   \"slot:nm_driver\"\n"
419                    "\n");
420    
421             printf("<nm_nio> format:\n"
422                    "   \"slot:port:netio_type{:netio_parameters}\"\n"
423                    "\n");
424    
425             /* Show the possible chassis types for C2600 platform */
426             c2600_mainboard_show_drivers();
427    
428             /* Show the possible NM drivers */
429             c2600_nm_show_drivers();
430             break;
431     }     }
432        
433     /* Show the possible NETIO types */     /* Show the possible NETIO types */
# Line 330  static int cli_get_platform_type(int arg Line 469  static int cli_get_platform_type(int arg
469           vm_type = VM_TYPE_C3600;           vm_type = VM_TYPE_C3600;
470        else if (!strcmp(str,"7200"))        else if (!strcmp(str,"7200"))
471           vm_type = VM_TYPE_C7200;           vm_type = VM_TYPE_C7200;
472          else if (!strcmp(str,"2691"))
473             vm_type = VM_TYPE_C2691;
474          else if (!strcmp(str,"3725"))
475             vm_type = VM_TYPE_C3725;
476          else if (!strcmp(str,"3745"))
477             vm_type = VM_TYPE_C3745;
478          else if (!strcmp(str,"2600"))
479             vm_type = VM_TYPE_C2600;
480          else if (!strcmp(str,"PPC32_TEST"))
481             vm_type = VM_TYPE_PPC32_TEST;
482        else        else
483           fprintf(stderr,"Invalid platform type '%s'\n",str);           fprintf(stderr,"Invalid platform type '%s'\n",str);
484     }     }
# Line 345  static int cli_get_platform_type(int arg Line 494  static int cli_get_platform_type(int arg
494  #define OPT_TIMER_ITV   0x104  #define OPT_TIMER_ITV   0x104
495  #define OPT_VM_DEBUG    0x105  #define OPT_VM_DEBUG    0x105
496  #define OPT_IOMEM_SIZE  0x106  #define OPT_IOMEM_SIZE  0x106
497    #define OPT_SPARSE_MEM  0x107
498    
499  static struct option cmd_line_lopts[] = {  static struct option cmd_line_lopts[] = {
500     { "disk0"      , 1, NULL, OPT_DISK0_SIZE },     { "disk0"      , 1, NULL, OPT_DISK0_SIZE },
# Line 354  static struct option cmd_line_lopts[] = Line 504  static struct option cmd_line_lopts[] =
504     { "timer-itv"  , 1, NULL, OPT_TIMER_ITV },     { "timer-itv"  , 1, NULL, OPT_TIMER_ITV },
505     { "vm-debug"   , 1, NULL, OPT_VM_DEBUG },     { "vm-debug"   , 1, NULL, OPT_VM_DEBUG },
506     { "iomem-size" , 1, NULL, OPT_IOMEM_SIZE },     { "iomem-size" , 1, NULL, OPT_IOMEM_SIZE },
507       { "sparse-mem" , 0, NULL, OPT_SPARSE_MEM },
508     { NULL         , 0, NULL, 0 },     { NULL         , 0, NULL, 0 },
509  };  };
510    
# Line 431  static int cli_parse_c3600_options(vm_in Line 582  static int cli_parse_c3600_options(vm_in
582     return(0);     return(0);
583  }  }
584    
585    /* Parse specific options for the Cisco 2691 platform */
586    static int cli_parse_c2691_options(vm_instance_t *vm,int option)
587    {
588       c2691_t *router;
589    
590       router = VM_C2691(vm);
591    
592       switch(option) {
593          /* IO memory reserved for NMs (in percents!) */
594          case OPT_IOMEM_SIZE:
595             router->nm_iomem_size = 0x8000 | atoi(optarg);
596             break;
597    
598          /* NM settings */
599          case 'p':
600             return(c2691_cmd_nm_create(router,optarg));
601    
602          /* NM NIO settings */
603          case 's':
604             return(c2691_cmd_add_nio(router,optarg));
605    
606          /* Unknown option */
607          default:
608             return(-1);
609       }
610    
611       return(0);
612    }
613    
614    /* Parse specific options for the Cisco 3725 platform */
615    static int cli_parse_c3725_options(vm_instance_t *vm,int option)
616    {
617       c3725_t *router;
618    
619       router = VM_C3725(vm);
620    
621       switch(option) {
622          /* IO memory reserved for NMs (in percents!) */
623          case OPT_IOMEM_SIZE:
624             router->nm_iomem_size = 0x8000 | atoi(optarg);
625             break;
626    
627          /* NM settings */
628          case 'p':
629             return(c3725_cmd_nm_create(router,optarg));
630    
631          /* NM NIO settings */
632          case 's':
633             return(c3725_cmd_add_nio(router,optarg));
634    
635          /* Unknown option */
636          default:
637             return(-1);
638       }
639    
640       return(0);
641    }
642    
643    /* Parse specific options for the Cisco 3745 platform */
644    static int cli_parse_c3745_options(vm_instance_t *vm,int option)
645    {
646       c3745_t *router;
647    
648       router = VM_C3745(vm);
649    
650       switch(option) {
651          /* IO memory reserved for NMs (in percents!) */
652          case OPT_IOMEM_SIZE:
653             router->nm_iomem_size = 0x8000 | atoi(optarg);
654             break;
655    
656          /* NM settings */
657          case 'p':
658             return(c3745_cmd_nm_create(router,optarg));
659    
660          /* NM NIO settings */
661          case 's':
662             return(c3745_cmd_add_nio(router,optarg));
663    
664          /* Unknown option */
665          default:
666             return(-1);
667       }
668    
669       return(0);
670    }
671    
672    /* Parse specific options for the Cisco 2600 platform */
673    static int cli_parse_c2600_options(vm_instance_t *vm,int option)
674    {
675       c2600_t *router;
676    
677       router = VM_C2600(vm);
678    
679       switch(option) {
680          /* IO memory reserved for NMs (in percents!) */
681          case OPT_IOMEM_SIZE:
682             router->nm_iomem_size = 0x8000 | atoi(optarg);
683             break;
684    
685          /* Mainboard type */
686          case 't':
687             c2600_mainboard_set_type(router,optarg);
688             break;
689    
690          /* NM settings */
691          case 'p':
692             return(c2600_cmd_nm_create(router,optarg));
693    
694          /* NM NIO settings */
695          case 's':
696             return(c2600_cmd_add_nio(router,optarg));
697    
698          /* Unknown option */
699          default:
700             return(-1);
701       }
702    
703       return(0);
704    }
705    
706  /* Create a router instance */  /* Create a router instance */
707  static vm_instance_t *cli_create_instance(char *name,int platform_type,  static vm_instance_t *cli_create_instance(char *name,int platform_type,
708                                            int instance_id)                                            int instance_id)
709  {  {
710       vm_instance_t *vm;
711     c7200_t *c7200;     c7200_t *c7200;
712     c3600_t *c3600;     c3600_t *c3600;
713       c2691_t *c2691;
714       c3725_t *c3725;
715       c3745_t *c3745;
716       c2600_t *c2600;
717    
718     switch(platform_type) {     switch(platform_type) {
719        case VM_TYPE_C7200:        case VM_TYPE_C7200:
# Line 453  static vm_instance_t *cli_create_instanc Line 730  static vm_instance_t *cli_create_instanc
730           }           }
731           return(c3600->vm);           return(c3600->vm);
732    
733          case VM_TYPE_C2691:
734             if (!(c2691 = c2691_create_instance(name,instance_id))) {
735                fprintf(stderr,"C2691: unable to create instance!\n");
736                return NULL;
737             }
738             return(c2691->vm);
739    
740          case VM_TYPE_C3725:
741             if (!(c3725 = c3725_create_instance(name,instance_id))) {
742                fprintf(stderr,"C3725: unable to create instance!\n");
743                return NULL;
744             }
745             return(c3725->vm);
746    
747          case VM_TYPE_C3745:
748             if (!(c3745 = c3745_create_instance(name,instance_id))) {
749                fprintf(stderr,"C3745: unable to create instance!\n");
750                return NULL;
751             }
752             return(c3745->vm);
753    
754          case VM_TYPE_C2600:
755             if (!(c2600 = c2600_create_instance(name,instance_id))) {
756                fprintf(stderr,"C2600: unable to create instance!\n");
757                return NULL;
758             }
759             return(c2600->vm);
760    
761          case VM_TYPE_PPC32_TEST:
762             if (!(vm = ppc32_vmtest_create_instance(name,instance_id))) {
763                fprintf(stderr,"PPC32_TEST: unable to create instance!\n");
764                return NULL;
765             }
766             return(vm);
767    
768        default:        default:
769           fprintf(stderr,"Unknown platform type '%d'!\n",platform_type);           fprintf(stderr,"Unknown platform type '%d'!\n",platform_type);
770           return NULL;           return NULL;
# Line 463  static vm_instance_t *cli_create_instanc Line 775  static vm_instance_t *cli_create_instanc
775  static int parse_std_cmd_line(int argc,char *argv[],int *platform)  static int parse_std_cmd_line(int argc,char *argv[],int *platform)
776  {  {
777     char *options_list =     char *options_list =
778        "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:";
779     vm_instance_t *vm;     vm_instance_t *vm;
780     int instance_id;     int instance_id;
781     int res,option;     int res,option;
# Line 558  static int parse_std_cmd_line(int argc,c Line 870  static int parse_std_cmd_line(int argc,c
870              vm->ram_mmap = 0;              vm->ram_mmap = 0;
871              break;              break;
872    
873             /* Use a ghost file to simulate RAM */          
874             case 'G':
875                vm->ghost_ram_filename = strdup(optarg);
876                vm->ghost_status = VM_GHOST_RAM_USE;
877                break;
878    
879             /* Generate a ghost RAM image */
880             case 'g':
881                vm->ghost_ram_filename = strdup(optarg);
882                vm->ghost_status = VM_GHOST_RAM_GENERATE;
883                break;
884    
885             /* Use sparse memory */
886             case OPT_SPARSE_MEM:
887                vm->sparse_mem = TRUE;
888                break;
889    
890           /* Alternate ROM */           /* Alternate ROM */
891           case 'R':           case 'R':
892              vm->rom_filename = optarg;              vm->rom_filename = optarg;
# Line 689  static int parse_std_cmd_line(int argc,c Line 1018  static int parse_std_cmd_line(int argc,c
1018                    break;                    break;
1019                 case VM_TYPE_C3600:                 case VM_TYPE_C3600:
1020                    res = cli_parse_c3600_options(vm,option);                    res = cli_parse_c3600_options(vm,option);
1021                      break;              
1022                   case VM_TYPE_C2691:
1023                      res = cli_parse_c2691_options(vm,option);
1024                      break;
1025                   case VM_TYPE_C3725:
1026                      res = cli_parse_c3725_options(vm,option);
1027                      break;
1028                  case VM_TYPE_C3745:
1029                      res = cli_parse_c3745_options(vm,option);
1030                      break;
1031                  case VM_TYPE_C2600:
1032                      res = cli_parse_c2600_options(vm,option);
1033                    break;                    break;
1034              }              }
1035    
# Line 771  void dynamips_reset(void) Line 1112  void dynamips_reset(void)
1112  {  {
1113     printf("Shutdown in progress...\n");     printf("Shutdown in progress...\n");
1114    
1115     /* Delete all C7200 and C3600 instances */     /* Delete all virtual router instances */
1116     c7200_delete_all_instances();     c7200_delete_all_instances();
1117     c3600_delete_all_instances();     c3600_delete_all_instances();
1118       c2691_delete_all_instances();
1119       c3725_delete_all_instances();
1120       c3745_delete_all_instances();
1121       c2600_delete_all_instances();
1122       ppc32_vmtest_delete_all_instances();
1123    
1124     /* Delete ATM and Frame-Relay switches + bridges */     /* Delete ATM and Frame-Relay switches + bridges */
1125     netio_bridge_delete_all();     netio_bridge_delete_all();
# Line 799  int main(int argc,char *argv[]) Line 1145  int main(int argc,char *argv[])
1145     atexit(profiler_savestat);     atexit(profiler_savestat);
1146  #endif  #endif
1147    
1148     printf("Cisco 7200 Simulation Platform (version %s)\n",sw_version);     printf("Cisco Router Simulation Platform (version %s)\n",sw_version);
1149     printf("Copyright (c) 2005,2006 Christophe Fillot.\n\n");     printf("Copyright (c) 2005-2007 Christophe Fillot.\n");
1150       printf("Build date: %s %s\n\n",__DATE__,__TIME__);
1151    
1152     /* Initialize timers */     /* Initialize timers */
1153     timer_init();     timer_init();
# Line 837  int main(int argc,char *argv[]) Line 1184  int main(int argc,char *argv[])
1184     /* Create instruction lookup tables */     /* Create instruction lookup tables */
1185     mips64_jit_create_ilt();     mips64_jit_create_ilt();
1186     mips64_exec_create_ilt();     mips64_exec_create_ilt();
1187       ppc32_jit_create_ilt();
1188       ppc32_exec_create_ilt();
1189    
1190     setup_signals();     setup_signals();
1191    
# Line 851  int main(int argc,char *argv[]) Line 1200  int main(int argc,char *argv[])
1200              break;              break;
1201           case VM_TYPE_C3600:           case VM_TYPE_C3600:
1202              res = c3600_init_instance(VM_C3600(vm));              res = c3600_init_instance(VM_C3600(vm));
1203                break;      
1204             case VM_TYPE_C2691:
1205                res = c2691_init_instance(VM_C2691(vm));
1206                break;
1207             case VM_TYPE_C3725:
1208                res = c3725_init_instance(VM_C3725(vm));
1209                break;
1210             case VM_TYPE_C3745:
1211                res = c3745_init_instance(VM_C3745(vm));
1212                break;
1213             case VM_TYPE_C2600:
1214                res = c2600_init_instance(VM_C2600(vm));
1215                break;
1216             case VM_TYPE_PPC32_TEST:
1217                res = ppc32_vmtest_init_instance(vm);
1218              break;              break;
1219           default:           default:
1220              res = -1;              res = -1;
# Line 861  int main(int argc,char *argv[]) Line 1225  int main(int argc,char *argv[])
1225           exit(EXIT_FAILURE);           exit(EXIT_FAILURE);
1226        }        }
1227    
1228  #if DEBUG_PERF_COUNTER  #if (DEBUG_INSN_PERF_CNT > 0) || (DEBUG_BLOCK_PERF_CNT > 0)
1229        {        {
1230           m_uint64_t prev = 0,delta;           m_uint64_t counter,prev = 0,delta;
1231           while(vm->status == VM_STATUS_RUNNING) {           while(vm->status == VM_STATUS_RUNNING) {
1232              delta = vm->boot_cpu->perf_counter - prev;              counter = cpu_get_perf_counter(vm->boot_cpu);
1233              prev = vm->boot_cpu->perf_counter;              delta = counter - prev;
1234                prev = counter;
1235              printf("delta = %llu\n",delta);              printf("delta = %llu\n",delta);
1236              sleep(1);              sleep(1);
1237           }           }

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

  ViewVC Help
Powered by ViewVC 1.1.26