From 50c1e1491e1981ecba14a477897681d8d0602500 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Wed, 8 Feb 2012 21:36:02 +0200 Subject: memory: support stateless memory listeners Current memory listeners are incremental; that is, they are expected to maintain their own state, and receive callbacks for changes to that state. This patch adds support for stateless listeners; these work by receiving a ->begin() callback (which tells them that new state is coming), a sequence of ->region_add() and ->region_nop() callbacks, and then a ->commit() callback which signifies the end of the new state. They should ignore ->region_del() callbacks. Signed-off-by: Avi Kivity --- memory.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'memory.h') diff --git a/memory.h b/memory.h index bc9600b4..b7bccd1 100644 --- a/memory.h +++ b/memory.h @@ -180,8 +180,11 @@ typedef struct MemoryListener MemoryListener; * Use with memory_listener_register() and memory_listener_unregister(). */ struct MemoryListener { + void (*begin)(MemoryListener *listener); + void (*commit)(MemoryListener *listener); void (*region_add)(MemoryListener *listener, MemoryRegionSection *section); void (*region_del)(MemoryListener *listener, MemoryRegionSection *section); + void (*region_nop)(MemoryListener *listener, MemoryRegionSection *section); void (*log_start)(MemoryListener *listener, MemoryRegionSection *section); void (*log_stop)(MemoryListener *listener, MemoryRegionSection *section); void (*log_sync)(MemoryListener *listener, MemoryRegionSection *section); -- cgit v1.1