On 03/16/2010 12:53 PM, Yoshiaki Tamura wrote:
Introduces cpu_physical_memory_get_dirty_range().
It checks the first row and puts dirty addr in the array.
If the first row is empty, it skips to the first non-dirty row
or the end addr, and put the length in the first entry of the array.



+/* It checks the first row and puts dirty addrs in the array.
+   If the first row is empty, it skips to the first non-dirty row
+   or the end addr, and put the length in the first entry of the array. */
+int cpu_physical_memory_get_dirty_range(ram_addr_t start, ram_addr_t end,
+                                        ram_addr_t *dirty_rams, int length,
+                                        int dirty_flag)
+{
+    unsigned long phys_ram_dirty, page_number, *p;
+    ram_addr_t addr;
+    int s_idx = (start>>  TARGET_PAGE_BITS) / HOST_LONG_BITS;
+    int e_idx = (end>>  TARGET_PAGE_BITS) / HOST_LONG_BITS;
+    int i, j, offset;
+
+    switch (dirty_flag) {
+    case VGA_DIRTY_FLAG:
+        p = phys_ram_vga_dirty;
+        break;
+    case CODE_DIRTY_FLAG:
+        p = phys_ram_code_dirty;
+        break;
+    case MIGRATION_DIRTY_FLAG:
+        p = phys_ram_migration_dirty;
+        break;
+    default:
+        abort();
+    }

This bit would be improved by switching to an array of bitmaps.


--
error compiling committee.c: too many arguments to function



Reply via email to