Revision 56c4bfb3 memory_mapping.c
b/memory_mapping.c | ||
---|---|---|
279 | 279 |
return NULL; |
280 | 280 |
} |
281 | 281 |
|
282 |
void qemu_get_guest_memory_mapping(MemoryMappingList *list, Error **errp) |
|
282 |
void qemu_get_guest_memory_mapping(MemoryMappingList *list, |
|
283 |
const GuestPhysBlockList *guest_phys_blocks, |
|
284 |
Error **errp) |
|
283 | 285 |
{ |
284 | 286 |
CPUState *cpu, *first_paging_enabled_cpu; |
285 |
RAMBlock *block;
|
|
287 |
GuestPhysBlock *block;
|
|
286 | 288 |
ram_addr_t offset, length; |
287 | 289 |
|
288 | 290 |
first_paging_enabled_cpu = find_paging_enabled_cpu(first_cpu); |
... | ... | |
302 | 304 |
* If the guest doesn't use paging, the virtual address is equal to physical |
303 | 305 |
* address. |
304 | 306 |
*/ |
305 |
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
|
|
306 |
offset = block->offset;
|
|
307 |
length = block->length;
|
|
307 |
QTAILQ_FOREACH(block, &guest_phys_blocks->head, next) {
|
|
308 |
offset = block->target_start;
|
|
309 |
length = block->target_end - block->target_start;
|
|
308 | 310 |
create_new_memory_mapping(list, offset, offset, length); |
309 | 311 |
} |
310 | 312 |
} |
311 | 313 |
|
312 |
void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list) |
|
314 |
void qemu_get_guest_simple_memory_mapping(MemoryMappingList *list, |
|
315 |
const GuestPhysBlockList *guest_phys_blocks) |
|
313 | 316 |
{ |
314 |
RAMBlock *block;
|
|
317 |
GuestPhysBlock *block;
|
|
315 | 318 |
|
316 |
QTAILQ_FOREACH(block, &ram_list.blocks, next) { |
|
317 |
create_new_memory_mapping(list, block->offset, 0, block->length); |
|
319 |
QTAILQ_FOREACH(block, &guest_phys_blocks->head, next) { |
|
320 |
create_new_memory_mapping(list, block->target_start, 0, |
|
321 |
block->target_end - block->target_start); |
|
318 | 322 |
} |
319 | 323 |
} |
320 | 324 |
|
Also available in: Unified diff