]> git.proxmox.com Git - mirror_qemu.git/blob - memory.h
memory: move ioeventfd ops to MemoryListener
[mirror_qemu.git] / memory.h
1 /*
2 * Physical memory management API
3 *
4 * Copyright 2011 Red Hat, Inc. and/or its affiliates
5 *
6 * Authors:
7 * Avi Kivity <avi@redhat.com>
8 *
9 * This work is licensed under the terms of the GNU GPL, version 2. See
10 * the COPYING file in the top-level directory.
11 *
12 */
13
14 #ifndef MEMORY_H
15 #define MEMORY_H
16
17 #ifndef CONFIG_USER_ONLY
18
19 #include <stdint.h>
20 #include <stdbool.h>
21 #include "qemu-common.h"
22 #include "cpu-common.h"
23 #include "targphys.h"
24 #include "qemu-queue.h"
25 #include "iorange.h"
26 #include "ioport.h"
27 #include "int128.h"
28
29 typedef struct MemoryRegionOps MemoryRegionOps;
30 typedef struct MemoryRegion MemoryRegion;
31 typedef struct MemoryRegionPortio MemoryRegionPortio;
32 typedef struct MemoryRegionMmio MemoryRegionMmio;
33
34 /* Must match *_DIRTY_FLAGS in cpu-all.h. To be replaced with dynamic
35 * registration.
36 */
37 #define DIRTY_MEMORY_VGA 0
38 #define DIRTY_MEMORY_CODE 1
39 #define DIRTY_MEMORY_MIGRATION 3
40
41 struct MemoryRegionMmio {
42 CPUReadMemoryFunc *read[3];
43 CPUWriteMemoryFunc *write[3];
44 };
45
46 /*
47 * Memory region callbacks
48 */
49 struct MemoryRegionOps {
50 /* Read from the memory region. @addr is relative to @mr; @size is
51 * in bytes. */
52 uint64_t (*read)(void *opaque,
53 target_phys_addr_t addr,
54 unsigned size);
55 /* Write to the memory region. @addr is relative to @mr; @size is
56 * in bytes. */
57 void (*write)(void *opaque,
58 target_phys_addr_t addr,
59 uint64_t data,
60 unsigned size);
61
62 enum device_endian endianness;
63 /* Guest-visible constraints: */
64 struct {
65 /* If nonzero, specify bounds on access sizes beyond which a machine
66 * check is thrown.
67 */
68 unsigned min_access_size;
69 unsigned max_access_size;
70 /* If true, unaligned accesses are supported. Otherwise unaligned
71 * accesses throw machine checks.
72 */
73 bool unaligned;
74 /*
75 * If present, and returns #false, the transaction is not accepted
76 * by the device (and results in machine dependent behaviour such
77 * as a machine check exception).
78 */
79 bool (*accepts)(void *opaque, target_phys_addr_t addr,
80 unsigned size, bool is_write);
81 } valid;
82 /* Internal implementation constraints: */
83 struct {
84 /* If nonzero, specifies the minimum size implemented. Smaller sizes
85 * will be rounded upwards and a partial result will be returned.
86 */
87 unsigned min_access_size;
88 /* If nonzero, specifies the maximum size implemented. Larger sizes
89 * will be done as a series of accesses with smaller sizes.
90 */
91 unsigned max_access_size;
92 /* If true, unaligned accesses are supported. Otherwise all accesses
93 * are converted to (possibly multiple) naturally aligned accesses.
94 */
95 bool unaligned;
96 } impl;
97
98 /* If .read and .write are not present, old_portio may be used for
99 * backwards compatibility with old portio registration
100 */
101 const MemoryRegionPortio *old_portio;
102 /* If .read and .write are not present, old_mmio may be used for
103 * backwards compatibility with old mmio registration
104 */
105 const MemoryRegionMmio old_mmio;
106 };
107
108 typedef struct CoalescedMemoryRange CoalescedMemoryRange;
109 typedef struct MemoryRegionIoeventfd MemoryRegionIoeventfd;
110
111 struct MemoryRegion {
112 /* All fields are private - violators will be prosecuted */
113 const MemoryRegionOps *ops;
114 void *opaque;
115 MemoryRegion *parent;
116 Int128 size;
117 target_phys_addr_t addr;
118 void (*destructor)(MemoryRegion *mr);
119 ram_addr_t ram_addr;
120 IORange iorange;
121 bool subpage;
122 bool terminates;
123 bool readable;
124 bool ram;
125 bool readonly; /* For RAM regions */
126 bool enabled;
127 bool rom_device;
128 bool warning_printed; /* For reservations */
129 MemoryRegion *alias;
130 target_phys_addr_t alias_offset;
131 unsigned priority;
132 bool may_overlap;
133 QTAILQ_HEAD(subregions, MemoryRegion) subregions;
134 QTAILQ_ENTRY(MemoryRegion) subregions_link;
135 QTAILQ_HEAD(coalesced_ranges, CoalescedMemoryRange) coalesced;
136 const char *name;
137 uint8_t dirty_log_mask;
138 unsigned ioeventfd_nb;
139 MemoryRegionIoeventfd *ioeventfds;
140 };
141
142 struct MemoryRegionPortio {
143 uint32_t offset;
144 uint32_t len;
145 unsigned size;
146 IOPortReadFunc *read;
147 IOPortWriteFunc *write;
148 };
149
150 #define PORTIO_END_OF_LIST() { }
151
152 typedef struct MemoryRegionSection MemoryRegionSection;
153
154 /**
155 * MemoryRegionSection: describes a fragment of a #MemoryRegion
156 *
157 * @mr: the region, or %NULL if empty
158 * @address_space: the address space the region is mapped in
159 * @offset_within_region: the beginning of the section, relative to @mr's start
160 * @size: the size of the section; will not exceed @mr's boundaries
161 * @offset_within_address_space: the address of the first byte of the section
162 * relative to the region's address space
163 */
164 struct MemoryRegionSection {
165 MemoryRegion *mr;
166 MemoryRegion *address_space;
167 target_phys_addr_t offset_within_region;
168 uint64_t size;
169 target_phys_addr_t offset_within_address_space;
170 };
171
172 typedef struct MemoryListener MemoryListener;
173
174 /**
175 * MemoryListener: callbacks structure for updates to the physical memory map
176 *
177 * Allows a component to adjust to changes in the guest-visible memory map.
178 * Use with memory_listener_register() and memory_listener_unregister().
179 */
180 struct MemoryListener {
181 void (*region_add)(MemoryListener *listener, MemoryRegionSection *section);
182 void (*region_del)(MemoryListener *listener, MemoryRegionSection *section);
183 void (*log_start)(MemoryListener *listener, MemoryRegionSection *section);
184 void (*log_stop)(MemoryListener *listener, MemoryRegionSection *section);
185 void (*log_sync)(MemoryListener *listener, MemoryRegionSection *section);
186 void (*log_global_start)(MemoryListener *listener);
187 void (*log_global_stop)(MemoryListener *listener);
188 void (*eventfd_add)(MemoryListener *listener, MemoryRegionSection *section,
189 bool match_data, uint64_t data, int fd);
190 void (*eventfd_del)(MemoryListener *listener, MemoryRegionSection *section,
191 bool match_data, uint64_t data, int fd);
192 /* Lower = earlier (during add), later (during del) */
193 unsigned priority;
194 QTAILQ_ENTRY(MemoryListener) link;
195 };
196
197 /**
198 * memory_region_init: Initialize a memory region
199 *
200 * The region typically acts as a container for other memory regions. Use
201 * memory_region_add_subregion() to add subregions.
202 *
203 * @mr: the #MemoryRegion to be initialized
204 * @name: used for debugging; not visible to the user or ABI
205 * @size: size of the region; any subregions beyond this size will be clipped
206 */
207 void memory_region_init(MemoryRegion *mr,
208 const char *name,
209 uint64_t size);
210 /**
211 * memory_region_init_io: Initialize an I/O memory region.
212 *
213 * Accesses into the region will cause the callbacks in @ops to be called.
214 * if @size is nonzero, subregions will be clipped to @size.
215 *
216 * @mr: the #MemoryRegion to be initialized.
217 * @ops: a structure containing read and write callbacks to be used when
218 * I/O is performed on the region.
219 * @opaque: passed to to the read and write callbacks of the @ops structure.
220 * @name: used for debugging; not visible to the user or ABI
221 * @size: size of the region.
222 */
223 void memory_region_init_io(MemoryRegion *mr,
224 const MemoryRegionOps *ops,
225 void *opaque,
226 const char *name,
227 uint64_t size);
228
229 /**
230 * memory_region_init_ram: Initialize RAM memory region. Accesses into the
231 * region will modify memory directly.
232 *
233 * @mr: the #MemoryRegion to be initialized.
234 * @name: the name of the region.
235 * @size: size of the region.
236 */
237 void memory_region_init_ram(MemoryRegion *mr,
238 const char *name,
239 uint64_t size);
240
241 /**
242 * memory_region_init_ram: Initialize RAM memory region from a user-provided.
243 * pointer. Accesses into the region will modify
244 * memory directly.
245 *
246 * @mr: the #MemoryRegion to be initialized.
247 * @name: the name of the region.
248 * @size: size of the region.
249 * @ptr: memory to be mapped; must contain at least @size bytes.
250 */
251 void memory_region_init_ram_ptr(MemoryRegion *mr,
252 const char *name,
253 uint64_t size,
254 void *ptr);
255
256 /**
257 * memory_region_init_alias: Initialize a memory region that aliases all or a
258 * part of another memory region.
259 *
260 * @mr: the #MemoryRegion to be initialized.
261 * @name: used for debugging; not visible to the user or ABI
262 * @orig: the region to be referenced; @mr will be equivalent to
263 * @orig between @offset and @offset + @size - 1.
264 * @offset: start of the section in @orig to be referenced.
265 * @size: size of the region.
266 */
267 void memory_region_init_alias(MemoryRegion *mr,
268 const char *name,
269 MemoryRegion *orig,
270 target_phys_addr_t offset,
271 uint64_t size);
272
273 /**
274 * memory_region_init_rom_device: Initialize a ROM memory region. Writes are
275 * handled via callbacks.
276 *
277 * @mr: the #MemoryRegion to be initialized.
278 * @ops: callbacks for write access handling.
279 * @name: the name of the region.
280 * @size: size of the region.
281 */
282 void memory_region_init_rom_device(MemoryRegion *mr,
283 const MemoryRegionOps *ops,
284 void *opaque,
285 const char *name,
286 uint64_t size);
287
288 /**
289 * memory_region_init_reservation: Initialize a memory region that reserves
290 * I/O space.
291 *
292 * A reservation region primariy serves debugging purposes. It claims I/O
293 * space that is not supposed to be handled by QEMU itself. Any access via
294 * the memory API will cause an abort().
295 *
296 * @mr: the #MemoryRegion to be initialized
297 * @name: used for debugging; not visible to the user or ABI
298 * @size: size of the region.
299 */
300 void memory_region_init_reservation(MemoryRegion *mr,
301 const char *name,
302 uint64_t size);
303 /**
304 * memory_region_destroy: Destroy a memory region and reclaim all resources.
305 *
306 * @mr: the region to be destroyed. May not currently be a subregion
307 * (see memory_region_add_subregion()) or referenced in an alias
308 * (see memory_region_init_alias()).
309 */
310 void memory_region_destroy(MemoryRegion *mr);
311
312 /**
313 * memory_region_size: get a memory region's size.
314 *
315 * @mr: the memory region being queried.
316 */
317 uint64_t memory_region_size(MemoryRegion *mr);
318
319 /**
320 * memory_region_is_ram: check whether a memory region is random access
321 *
322 * Returns %true is a memory region is random access.
323 *
324 * @mr: the memory region being queried
325 */
326 bool memory_region_is_ram(MemoryRegion *mr);
327
328 /**
329 * memory_region_name: get a memory region's name
330 *
331 * Returns the string that was used to initialize the memory region.
332 *
333 * @mr: the memory region being queried
334 */
335 const char *memory_region_name(MemoryRegion *mr);
336
337 /**
338 * memory_region_is_logging: return whether a memory region is logging writes
339 *
340 * Returns %true if the memory region is logging writes
341 *
342 * @mr: the memory region being queried
343 */
344 bool memory_region_is_logging(MemoryRegion *mr);
345
346 /**
347 * memory_region_is_rom: check whether a memory region is ROM
348 *
349 * Returns %true is a memory region is read-only memory.
350 *
351 * @mr: the memory region being queried
352 */
353 bool memory_region_is_rom(MemoryRegion *mr);
354
355 /**
356 * memory_region_get_ram_ptr: Get a pointer into a RAM memory region.
357 *
358 * Returns a host pointer to a RAM memory region (created with
359 * memory_region_init_ram() or memory_region_init_ram_ptr()). Use with
360 * care.
361 *
362 * @mr: the memory region being queried.
363 */
364 void *memory_region_get_ram_ptr(MemoryRegion *mr);
365
366 /**
367 * memory_region_set_log: Turn dirty logging on or off for a region.
368 *
369 * Turns dirty logging on or off for a specified client (display, migration).
370 * Only meaningful for RAM regions.
371 *
372 * @mr: the memory region being updated.
373 * @log: whether dirty logging is to be enabled or disabled.
374 * @client: the user of the logging information; %DIRTY_MEMORY_MIGRATION or
375 * %DIRTY_MEMORY_VGA.
376 */
377 void memory_region_set_log(MemoryRegion *mr, bool log, unsigned client);
378
379 /**
380 * memory_region_get_dirty: Check whether a range of bytes is dirty
381 * for a specified client.
382 *
383 * Checks whether a range of bytes has been written to since the last
384 * call to memory_region_reset_dirty() with the same @client. Dirty logging
385 * must be enabled.
386 *
387 * @mr: the memory region being queried.
388 * @addr: the address (relative to the start of the region) being queried.
389 * @size: the size of the range being queried.
390 * @client: the user of the logging information; %DIRTY_MEMORY_MIGRATION or
391 * %DIRTY_MEMORY_VGA.
392 */
393 bool memory_region_get_dirty(MemoryRegion *mr, target_phys_addr_t addr,
394 target_phys_addr_t size, unsigned client);
395
396 /**
397 * memory_region_set_dirty: Mark a range of bytes as dirty in a memory region.
398 *
399 * Marks a range of bytes as dirty, after it has been dirtied outside
400 * guest code.
401 *
402 * @mr: the memory region being dirtied.
403 * @addr: the address (relative to the start of the region) being dirtied.
404 * @size: size of the range being dirtied.
405 */
406 void memory_region_set_dirty(MemoryRegion *mr, target_phys_addr_t addr,
407 target_phys_addr_t size);
408
409 /**
410 * memory_region_sync_dirty_bitmap: Synchronize a region's dirty bitmap with
411 * any external TLBs (e.g. kvm)
412 *
413 * Flushes dirty information from accelerators such as kvm and vhost-net
414 * and makes it available to users of the memory API.
415 *
416 * @mr: the region being flushed.
417 */
418 void memory_region_sync_dirty_bitmap(MemoryRegion *mr);
419
420 /**
421 * memory_region_reset_dirty: Mark a range of pages as clean, for a specified
422 * client.
423 *
424 * Marks a range of pages as no longer dirty.
425 *
426 * @mr: the region being updated.
427 * @addr: the start of the subrange being cleaned.
428 * @size: the size of the subrange being cleaned.
429 * @client: the user of the logging information; %DIRTY_MEMORY_MIGRATION or
430 * %DIRTY_MEMORY_VGA.
431 */
432 void memory_region_reset_dirty(MemoryRegion *mr, target_phys_addr_t addr,
433 target_phys_addr_t size, unsigned client);
434
435 /**
436 * memory_region_set_readonly: Turn a memory region read-only (or read-write)
437 *
438 * Allows a memory region to be marked as read-only (turning it into a ROM).
439 * only useful on RAM regions.
440 *
441 * @mr: the region being updated.
442 * @readonly: whether rhe region is to be ROM or RAM.
443 */
444 void memory_region_set_readonly(MemoryRegion *mr, bool readonly);
445
446 /**
447 * memory_region_rom_device_set_readable: enable/disable ROM readability
448 *
449 * Allows a ROM device (initialized with memory_region_init_rom_device() to
450 * to be marked as readable (default) or not readable. When it is readable,
451 * the device is mapped to guest memory. When not readable, reads are
452 * forwarded to the #MemoryRegion.read function.
453 *
454 * @mr: the memory region to be updated
455 * @readable: whether reads are satisified directly (%true) or via callbacks
456 * (%false)
457 */
458 void memory_region_rom_device_set_readable(MemoryRegion *mr, bool readable);
459
460 /**
461 * memory_region_set_coalescing: Enable memory coalescing for the region.
462 *
463 * Enabled writes to a region to be queued for later processing. MMIO ->write
464 * callbacks may be delayed until a non-coalesced MMIO is issued.
465 * Only useful for IO regions. Roughly similar to write-combining hardware.
466 *
467 * @mr: the memory region to be write coalesced
468 */
469 void memory_region_set_coalescing(MemoryRegion *mr);
470
471 /**
472 * memory_region_add_coalescing: Enable memory coalescing for a sub-range of
473 * a region.
474 *
475 * Like memory_region_set_coalescing(), but works on a sub-range of a region.
476 * Multiple calls can be issued coalesced disjoint ranges.
477 *
478 * @mr: the memory region to be updated.
479 * @offset: the start of the range within the region to be coalesced.
480 * @size: the size of the subrange to be coalesced.
481 */
482 void memory_region_add_coalescing(MemoryRegion *mr,
483 target_phys_addr_t offset,
484 uint64_t size);
485
486 /**
487 * memory_region_clear_coalescing: Disable MMIO coalescing for the region.
488 *
489 * Disables any coalescing caused by memory_region_set_coalescing() or
490 * memory_region_add_coalescing(). Roughly equivalent to uncacheble memory
491 * hardware.
492 *
493 * @mr: the memory region to be updated.
494 */
495 void memory_region_clear_coalescing(MemoryRegion *mr);
496
497 /**
498 * memory_region_add_eventfd: Request an eventfd to be triggered when a word
499 * is written to a location.
500 *
501 * Marks a word in an IO region (initialized with memory_region_init_io())
502 * as a trigger for an eventfd event. The I/O callback will not be called.
503 * The caller must be prepared to handle failure (that is, take the required
504 * action if the callback _is_ called).
505 *
506 * @mr: the memory region being updated.
507 * @addr: the address within @mr that is to be monitored
508 * @size: the size of the access to trigger the eventfd
509 * @match_data: whether to match against @data, instead of just @addr
510 * @data: the data to match against the guest write
511 * @fd: the eventfd to be triggered when @addr, @size, and @data all match.
512 **/
513 void memory_region_add_eventfd(MemoryRegion *mr,
514 target_phys_addr_t addr,
515 unsigned size,
516 bool match_data,
517 uint64_t data,
518 int fd);
519
520 /**
521 * memory_region_del_eventfd: Cancel an eventfd.
522 *
523 * Cancels an eventfd trigger requested by a previous
524 * memory_region_add_eventfd() call.
525 *
526 * @mr: the memory region being updated.
527 * @addr: the address within @mr that is to be monitored
528 * @size: the size of the access to trigger the eventfd
529 * @match_data: whether to match against @data, instead of just @addr
530 * @data: the data to match against the guest write
531 * @fd: the eventfd to be triggered when @addr, @size, and @data all match.
532 */
533 void memory_region_del_eventfd(MemoryRegion *mr,
534 target_phys_addr_t addr,
535 unsigned size,
536 bool match_data,
537 uint64_t data,
538 int fd);
539 /**
540 * memory_region_add_subregion: Add a subregion to a container.
541 *
542 * Adds a subregion at @offset. The subregion may not overlap with other
543 * subregions (except for those explicitly marked as overlapping). A region
544 * may only be added once as a subregion (unless removed with
545 * memory_region_del_subregion()); use memory_region_init_alias() if you
546 * want a region to be a subregion in multiple locations.
547 *
548 * @mr: the region to contain the new subregion; must be a container
549 * initialized with memory_region_init().
550 * @offset: the offset relative to @mr where @subregion is added.
551 * @subregion: the subregion to be added.
552 */
553 void memory_region_add_subregion(MemoryRegion *mr,
554 target_phys_addr_t offset,
555 MemoryRegion *subregion);
556 /**
557 * memory_region_add_subregion: Add a subregion to a container, with overlap.
558 *
559 * Adds a subregion at @offset. The subregion may overlap with other
560 * subregions. Conflicts are resolved by having a higher @priority hide a
561 * lower @priority. Subregions without priority are taken as @priority 0.
562 * A region may only be added once as a subregion (unless removed with
563 * memory_region_del_subregion()); use memory_region_init_alias() if you
564 * want a region to be a subregion in multiple locations.
565 *
566 * @mr: the region to contain the new subregion; must be a container
567 * initialized with memory_region_init().
568 * @offset: the offset relative to @mr where @subregion is added.
569 * @subregion: the subregion to be added.
570 * @priority: used for resolving overlaps; highest priority wins.
571 */
572 void memory_region_add_subregion_overlap(MemoryRegion *mr,
573 target_phys_addr_t offset,
574 MemoryRegion *subregion,
575 unsigned priority);
576
577 /**
578 * memory_region_get_ram_addr: Get the ram address associated with a memory
579 * region
580 *
581 * DO NOT USE THIS FUNCTION. This is a temporary workaround while the Xen
582 * code is being reworked.
583 */
584 ram_addr_t memory_region_get_ram_addr(MemoryRegion *mr);
585
586 /**
587 * memory_region_del_subregion: Remove a subregion.
588 *
589 * Removes a subregion from its container.
590 *
591 * @mr: the container to be updated.
592 * @subregion: the region being removed; must be a current subregion of @mr.
593 */
594 void memory_region_del_subregion(MemoryRegion *mr,
595 MemoryRegion *subregion);
596
597 /*
598 * memory_region_set_enabled: dynamically enable or disable a region
599 *
600 * Enables or disables a memory region. A disabled memory region
601 * ignores all accesses to itself and its subregions. It does not
602 * obscure sibling subregions with lower priority - it simply behaves as
603 * if it was removed from the hierarchy.
604 *
605 * Regions default to being enabled.
606 *
607 * @mr: the region to be updated
608 * @enabled: whether to enable or disable the region
609 */
610 void memory_region_set_enabled(MemoryRegion *mr, bool enabled);
611
612 /*
613 * memory_region_set_address: dynamically update the address of a region
614 *
615 * Dynamically updates the address of a region, relative to its parent.
616 * May be used on regions are currently part of a memory hierarchy.
617 *
618 * @mr: the region to be updated
619 * @addr: new address, relative to parent region
620 */
621 void memory_region_set_address(MemoryRegion *mr, target_phys_addr_t addr);
622
623 /*
624 * memory_region_set_alias_offset: dynamically update a memory alias's offset
625 *
626 * Dynamically updates the offset into the target region that an alias points
627 * to, as if the fourth argument to memory_region_init_alias() has changed.
628 *
629 * @mr: the #MemoryRegion to be updated; should be an alias.
630 * @offset: the new offset into the target memory region
631 */
632 void memory_region_set_alias_offset(MemoryRegion *mr,
633 target_phys_addr_t offset);
634
635 /**
636 * memory_region_find: locate a MemoryRegion in an address space
637 *
638 * Locates the first #MemoryRegion within an address space given by
639 * @address_space that overlaps the range given by @addr and @size.
640 *
641 * Returns a #MemoryRegionSection that describes a contiguous overlap.
642 * It will have the following characteristics:
643 * .@offset_within_address_space >= @addr
644 * .@offset_within_address_space + .@size <= @addr + @size
645 * .@size = 0 iff no overlap was found
646 * .@mr is non-%NULL iff an overlap was found
647 *
648 * @address_space: a top-level (i.e. parentless) region that contains
649 * the region to be found
650 * @addr: start of the area within @address_space to be searched
651 * @size: size of the area to be searched
652 */
653 MemoryRegionSection memory_region_find(MemoryRegion *address_space,
654 target_phys_addr_t addr, uint64_t size);
655
656
657 /**
658 * memory_global_sync_dirty_bitmap: synchronize the dirty log for all memory
659 *
660 * Synchronizes the dirty page log for an entire address space.
661 * @address_space: a top-level (i.e. parentless) region that contains the
662 * memory being synchronized
663 */
664 void memory_global_sync_dirty_bitmap(MemoryRegion *address_space);
665
666 /**
667 * memory_region_transaction_begin: Start a transaction.
668 *
669 * During a transaction, changes will be accumulated and made visible
670 * only when the transaction ends (is committed).
671 */
672 void memory_region_transaction_begin(void);
673
674 /**
675 * memory_region_transaction_commit: Commit a transaction and make changes
676 * visible to the guest.
677 */
678 void memory_region_transaction_commit(void);
679
680 /**
681 * memory_listener_register: register callbacks to be called when memory
682 * sections are mapped or unmapped into an address
683 * space
684 *
685 * @listener: an object containing the callbacks to be called
686 */
687 void memory_listener_register(MemoryListener *listener);
688
689 /**
690 * memory_listener_unregister: undo the effect of memory_listener_register()
691 *
692 * @listener: an object containing the callbacks to be removed
693 */
694 void memory_listener_unregister(MemoryListener *listener);
695
696 /**
697 * memory_global_dirty_log_start: begin dirty logging for all regions
698 */
699 void memory_global_dirty_log_start(void);
700
701 /**
702 * memory_global_dirty_log_stop: begin dirty logging for all regions
703 */
704 void memory_global_dirty_log_stop(void);
705
706 void mtree_info(fprintf_function mon_printf, void *f);
707
708 #endif
709
710 #endif