/[dynamips]/upstream/dynamips-0.2.7-RC1/dev_vtty.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-RC1/dev_vtty.c

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

upstream/dynamips-0.2.5/dev_vtty.c revision 1 by dpavlin, Sat Oct 6 16:01:44 2007 UTC upstream/dynamips-0.2.6-RC3/dev_vtty.c revision 4 by dpavlin, Sat Oct 6 16:06:49 2007 UTC
# Line 236  int vtty_parse_serial_option(vtty_serial Line 236  int vtty_parse_serial_option(vtty_serial
236     return(0);     return(0);
237  }  }
238    
239  #if defined(__CYGWIN__)  #if defined(__CYGWIN__) || defined(SUNOS)
240  void cfmakeraw(struct termios *termios_p) {  void cfmakeraw(struct termios *termios_p) {
241      termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|      termios_p->c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|
242                              INLCR|IGNCR|ICRNL|IXON);                              INLCR|IGNCR|ICRNL|IXON);
# Line 496  static int vtty_store(vtty_t *vtty,u_cha Line 496  static int vtty_store(vtty_t *vtty,u_cha
496     return(0);     return(0);
497  }  }
498    
499    /* Store a string in the FIFO buffer */
500    int vtty_store_str(vtty_t *vtty,char *str)
501    {
502       if (!vtty)
503          return(0);
504    
505       while(*str != 0) {
506          if (vtty_store(vtty,*str) == -1)
507             return(-1);
508          
509          str++;
510       }
511    
512       vtty->input_pending = TRUE;
513       return(0);
514    }
515    
516  /* Store CTRL+C in buffer */  /* Store CTRL+C in buffer */
517  int vtty_store_ctrlc(vtty_t *vtty)  int vtty_store_ctrlc(vtty_t *vtty)
518  {  {
# Line 591  static void remote_control(vtty_t *vtty, Line 608  static void remote_control(vtty_t *vtty,
608        
609        /* Reboot the C7200 */        /* Reboot the C7200 */
610        case 'k':        case 'k':
611           c7200_boot_ios(VM_C7200(vm));           if (vm->type == VM_TYPE_C7200)
612                c7200_boot_ios(VM_C7200(vm));
613           break;           break;
614        
615        /* Show the device list */        /* Show the device list */
# Line 600  static void remote_control(vtty_t *vtty, Line 618  static void remote_control(vtty_t *vtty,
618           pci_dev_show_list(vm->pci_bus[0]);           pci_dev_show_list(vm->pci_bus[0]);
619           pci_dev_show_list(vm->pci_bus[1]);           pci_dev_show_list(vm->pci_bus[1]);
620           break;           break;
621    
622          /* Show info about Port Adapters or Network Modules */
623          case 'p':
624             switch(vm->type) {
625                case VM_TYPE_C3600:
626                   c3600_nm_show_all_info(VM_C3600(vm));
627                   break;
628                case VM_TYPE_C7200:
629                   c7200_pa_show_all_info(VM_C7200(vm));
630                   break;
631             }
632             break;
633        
634        /* Dump the MIPS registers */        /* Dump the MIPS registers */
635        case 'r':        case 'r':
# Line 626  static void remote_control(vtty_t *vtty, Line 656  static void remote_control(vtty_t *vtty,
656           if (cpu0) tlb_dump(cpu0);           if (cpu0) tlb_dump(cpu0);
657           break;           break;
658        
659          /* Dump the MIPS TLB (raw mode) */
660          case 'z':
661             if (cpu0) tlb_raw_dump(cpu0);
662             break;
663      
664        /* Show information about JIT compiled pages */        /* Show information about JIT compiled pages */
665        case 'b':        case 'b':
666           if (cpu0) {           if (cpu0) {
# Line 640  static void remote_control(vtty_t *vtty, Line 675  static void remote_control(vtty_t *vtty,
675        /* MTS64 cache statistics */        /* MTS64 cache statistics */
676        case 'l':        case 'l':
677           if (cpu0) {           if (cpu0) {
678              mts64_show_stats(cpu0);              cpu0->mts_show_stats(cpu0);
679           }           }
680           break;           break;
681        
# Line 666  static void remote_control(vtty_t *vtty, Line 701  static void remote_control(vtty_t *vtty,
701           if (cpu0) {           if (cpu0) {
702              /* IRQ triggering */              /* IRQ triggering */
703              mips64_set_irq(cpu0,2/*C7200_PA_MGMT_IRQ*/);              mips64_set_irq(cpu0,2/*C7200_PA_MGMT_IRQ*/);
704                //mips64_set_irq(cpu0,3/*C7200_PA_MGMT_IRQ*/);
705                //mips64_set_irq(cpu0,C7200_PA_MGMT_IRQ);
706           }           }
707           break;           break;
708      
709        /* Twice Ctrl + ']' (0x1d, 29), or Alt-Gr + '*' (0xb3, 179) */        /* Twice Ctrl + ']' (0x1d, 29), or Alt-Gr + '*' (0xb3, 179) */
710        case 0x1d:        case 0x1d:
711        case 0xb3:        case 0xb3:
# Line 682  static void remote_control(vtty_t *vtty, Line 719  static void remote_control(vtty_t *vtty,
719                  "d     - Show the device list\n"                  "d     - Show the device list\n"
720                  "r     - Dump MIPS CPU registers\n"                  "r     - Dump MIPS CPU registers\n"
721                  "t     - Dump MIPS TLB entries\n"                  "t     - Dump MIPS TLB entries\n"
722                    "z     - Dump MIPS TLB entries (raw mode)\n"
723                  "m     - Dump the latest memory accesses\n"                  "m     - Dump the latest memory accesses\n"
724                  "s     - Suspend CPU emulation\n"                  "s     - Suspend CPU emulation\n"
725                  "u     - Resume CPU emulation\n"                  "u     - Resume CPU emulation\n"
# Line 984  static void *vtty_thread_main(void *arg) Line 1022  static void *vtty_thread_main(void *arg)
1022                    
1023           if (FD_ISSET(fd,&rfds)) {           if (FD_ISSET(fd,&rfds)) {
1024              vtty_read_and_store(vtty);              vtty_read_and_store(vtty);
1025                vtty->input_pending = TRUE;
1026             }
1027    
1028             if (vtty->input_pending) {
1029              if (vtty->read_notifier != NULL)              if (vtty->read_notifier != NULL)
1030                 vtty->read_notifier(vtty);                             vtty->read_notifier(vtty);
1031    
1032                vtty->input_pending = FALSE;
1033           }           }
1034    
1035           /* Flush any pending output */           /* Flush any pending output */

Legend:
Removed from v.1  
changed lines
  Added in v.4

  ViewVC Help
Powered by ViewVC 1.1.26