LDLIBS += $(LDLIBS_libxentoollog)
LDLIBS += $(LDLIBS_libxencall)
-SRCS-y += core.c
+SRCS-y += core.c core_unstable.c
SRCS-y += emuirq.c emuirq_unstable.c
SRCS-y += ioreqserv_unstable.c
endif
# XXX These use unstable hypervisor interfaces
+core_unstable.o core_unstable.opic: CFLAGS += -D__XEN_TOOLS__
emuirq_unstable.o emuirq_unstable.opic: CFLAGS += -D__XEN_TOOLS__
ioreqserv_unstable.o ioreqserv_unstable.opic: CFLAGS += -D__XEN_TOOLS__
--- /dev/null
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <stdlib.h>
+#include <assert.h>
+#include <errno.h>
+
+#include "private.h"
+
+int xendevicemodel_mark_memory_region_dirty(xendevicemodel_handle *dm,
+ xen_pfn_t start, xen_pfn_t nr)
+{
+ xen_hvm_modified_memory_t *arg;
+ int ret = -1;
+
+ arg = xencall_alloc_buffer(dm->call, sizeof(*arg));
+ if ( arg == NULL )
+ {
+ LOGE(ERROR, "unable to allocate memory for modified memory hypercall");
+ goto err;
+ }
+
+ arg->domid = dm->domid;
+ arg->first_pfn = start;
+ arg->nr = nr;
+
+ ret = xencall2(dm->call, __HYPERVISOR_hvm_op,
+ HVMOP_modified_memory,
+ (uintptr_t)arg);
+
+ if ( ret )
+ LOGE(ERROR, "modified memory hypercall failed");
+
+ xencall_free_buffer(dm->call, arg);
+
+ err:
+ return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
int xendevicemodel_inject_msi(xendevicemodel_handle *dm,
uint64_t addr, uint32_t data);
+/*
+ * Memory handling
+ * ===============
+ */
+
+/*
+ * Indicates to the hypervisor that emulation has resulting in the
+ * specified region of RAM has being modified.
+ */
+int xendevicemodel_mark_memory_region_dirty(xendevicemodel_handle *dm,
+ xen_pfn_t start, xen_pfn_t nr);
+
/*
* IOREQ Servers
* =============