0.7.2-alt1
[qemu] / kqemu / kqemu.h
index f92933b..2355e7a 100644 (file)
@@ -1,7 +1,30 @@
+/*
+ * KQEMU header
+ * 
+ * Copyright (c) 2004-2005 Fabrice Bellard
+ * 
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
 #ifndef KQEMU_H
 #define KQEMU_H
 
-#define KQEMU_VERSION 0x010100
+#define KQEMU_VERSION 0x010200
 
 struct kqemu_segment_cache {
     uint32_t selector;
@@ -43,7 +66,8 @@ struct kqemu_cpu_state {
     unsigned long dr6;
     unsigned long dr7;
 
-    int cpl; /* currently only 3 */
+    uint8_t cpl;
+    uint8_t user_only;
 
     uint32_t error_code; /* error_code when exiting with an exception */
     unsigned long next_eip; /* next eip value when exiting with an interrupt */
@@ -53,6 +77,11 @@ struct kqemu_cpu_state {
 #define KQEMU_FLUSH_ALL (KQEMU_MAX_PAGES_TO_FLUSH + 1)
 
     long retval;
+
+    /* number of ram_dirty entries to update */
+    unsigned int nb_ram_pages_to_update; 
+#define KQEMU_MAX_RAM_PAGES_TO_UPDATE 512
+#define KQEMU_RAM_PAGES_UPDATE_ALL (KQEMU_MAX_RAM_PAGES_TO_UPDATE + 1)
 };
 
 struct kqemu_init {
@@ -61,6 +90,7 @@ struct kqemu_init {
     uint8_t *ram_dirty; /* must be page aligned */
     uint32_t **phys_to_ram_map; /* must be page aligned */
     unsigned long *pages_to_flush; /* must be page aligned */
+    unsigned long *ram_pages_to_update; /* must be page aligned */
 };
 
 #define KQEMU_RET_ABORT    (-1)
@@ -81,39 +111,4 @@ struct kqemu_init {
 #define KQEMU_GET_VERSION    _IOR('q', 3, int)
 #endif
 
-#ifdef __KERNEL__
-struct kqemu_state;
-
-#define CDECL __attribute__((regparm(0)))
-
-struct kqemu_state * CDECL kqemu_init(struct kqemu_init *d, int max_locked_pages);
-struct kqemu_cpu_state * CDECL kqemu_get_cpu_state(struct kqemu_state *s);
-long CDECL kqemu_exec(struct kqemu_state *s);
-void CDECL kqemu_delete(struct kqemu_state *s);
-
-/* callbacks */
-struct kqemu_page; /* opaque data for host page */
-struct kqemu_user_page; /* opaque data for host user page */
-
-struct kqemu_user_page *CDECL kqemu_lock_user_page(unsigned long *ppage_index,
-                                                   unsigned long user_addr);
-void CDECL kqemu_unlock_user_page(struct kqemu_user_page *page);
-
-struct kqemu_page *CDECL kqemu_alloc_zeroed_page(unsigned long *ppage_index);
-void CDECL kqemu_free_page(struct kqemu_page *page);
-void * CDECL kqemu_page_kaddr(struct kqemu_page *page);
-
-void * CDECL kqemu_vmalloc(unsigned int size);
-void CDECL kqemu_vfree(void *ptr);
-unsigned long CDECL kqemu_vmalloc_to_phys(const void *vaddr);
-
-void * CDECL kqemu_io_map(unsigned long page_index, unsigned int size);
-void CDECL kqemu_io_unmap(void *ptr, unsigned int size);
-
-int CDECL kqemu_schedule(void);
-
-void CDECL kqemu_log(const char *fmt, ...);
-
-#endif
-
 #endif /* KQEMU_H */