/[qemu]/qemu/monitor.c
ViewVC logotype

Diff of /qemu/monitor.c

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

revision 1.32 by bellard, Thu Feb 10 21:57:46 2005 UTC revision 1.33 by bellard, Sat Jun 4 20:15:57 2005 UTC
# Line 562  static void do_print(int count, int form Line 562  static void do_print(int count, int form
562      term_printf("\n");      term_printf("\n");
563  }  }
564    
565    static void do_sum(uint32_t start, uint32_t size)
566    {
567        uint32_t addr;
568        uint8_t buf[1];
569        uint16_t sum;
570    
571        sum = 0;
572        for(addr = start; addr < (start + size); addr++) {
573            cpu_physical_memory_rw(addr, buf, 1, 0);
574            /* BSD sum algorithm ('sum' Unix command) */
575            sum = (sum >> 1) | (sum << 15);
576            sum += buf[0];
577        }
578        term_printf("%05d\n", sum);
579    }
580    
581  typedef struct {  typedef struct {
582      int keycode;      int keycode;
583      const char *name;      const char *name;
# Line 906  static term_cmd_t term_cmds[] = { Line 922  static term_cmd_t term_cmds[] = {
922        "keys", "send keys to the VM (e.g. 'sendkey ctrl-alt-f1')" },        "keys", "send keys to the VM (e.g. 'sendkey ctrl-alt-f1')" },
923      { "system_reset", "", do_system_reset,      { "system_reset", "", do_system_reset,
924        "", "reset the system" },        "", "reset the system" },
925        { "sum", "ii", do_sum,
926          "addr size", "compute the checksum of a memory region" },
927      { NULL, NULL, },      { NULL, NULL, },
928  };  };
929    

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26