2 * Declarations for obsolete exec.c functions
4 * Copyright 2011 Red Hat, Inc. and/or its affiliates
7 * Avi Kivity <avi@redhat.com>
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
15 * This header is for use by exec.c and memory.c ONLY. Do not include it.
16 * The functions declared here will be removed soon.
19 #ifndef EXEC_OBSOLETE_H
20 #define EXEC_OBSOLETE_H
22 #ifndef WANT_EXEC_OBSOLETE
23 #error Do not include exec-obsolete.h
26 #ifndef CONFIG_USER_ONLY
28 ram_addr_t
qemu_ram_alloc_from_ptr(ram_addr_t size
, void *host
,
30 ram_addr_t
qemu_ram_alloc(ram_addr_t size
, MemoryRegion
*mr
);
31 void qemu_ram_free(ram_addr_t addr
);
32 void qemu_ram_free_from_ptr(ram_addr_t addr
);
34 int cpu_register_io_memory(CPUReadMemoryFunc
* const *mem_read
,
35 CPUWriteMemoryFunc
* const *mem_write
,
37 void cpu_unregister_io_memory(int table_address
);
39 void cpu_register_physical_memory_log(target_phys_addr_t start_addr
,
41 ram_addr_t phys_offset
,
42 ram_addr_t region_offset
,
45 static inline void cpu_register_physical_memory_offset(target_phys_addr_t start_addr
,
47 ram_addr_t phys_offset
,
48 ram_addr_t region_offset
)
50 cpu_register_physical_memory_log(start_addr
, size
, phys_offset
,
51 region_offset
, false);
54 static inline void cpu_register_physical_memory(target_phys_addr_t start_addr
,
56 ram_addr_t phys_offset
)
58 cpu_register_physical_memory_offset(start_addr
, size
, phys_offset
, 0);
61 void qemu_register_coalesced_mmio(target_phys_addr_t addr
, ram_addr_t size
);
62 void qemu_unregister_coalesced_mmio(target_phys_addr_t addr
, ram_addr_t size
);
64 int cpu_physical_memory_set_dirty_tracking(int enable
);
66 #define VGA_DIRTY_FLAG 0x01
67 #define CODE_DIRTY_FLAG 0x02
68 #define MIGRATION_DIRTY_FLAG 0x08
70 /* read dirty bit (return 0 or 1) */
71 static inline int cpu_physical_memory_is_dirty(ram_addr_t addr
)
73 return ram_list
.phys_dirty
[addr
>> TARGET_PAGE_BITS
] == 0xff;
76 static inline int cpu_physical_memory_get_dirty_flags(ram_addr_t addr
)
78 return ram_list
.phys_dirty
[addr
>> TARGET_PAGE_BITS
];
81 static inline int cpu_physical_memory_get_dirty(ram_addr_t addr
,
84 return ram_list
.phys_dirty
[addr
>> TARGET_PAGE_BITS
] & dirty_flags
;
87 static inline void cpu_physical_memory_set_dirty(ram_addr_t addr
)
89 ram_list
.phys_dirty
[addr
>> TARGET_PAGE_BITS
] = 0xff;
92 static inline int cpu_physical_memory_set_dirty_flags(ram_addr_t addr
,
95 return ram_list
.phys_dirty
[addr
>> TARGET_PAGE_BITS
] |= dirty_flags
;
98 static inline void cpu_physical_memory_mask_dirty_range(ram_addr_t start
,
105 len
= length
>> TARGET_PAGE_BITS
;
107 p
= ram_list
.phys_dirty
+ (start
>> TARGET_PAGE_BITS
);
108 for (i
= 0; i
< len
; i
++) {
113 void cpu_physical_memory_reset_dirty(ram_addr_t start
, ram_addr_t end
,