summaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-06-24 13:28:12 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2003-06-24 13:28:12 +0000
commit66e85a21c7f65540ac1976ed29ed9973089fe1f1 (patch)
treedaa3c3c45afd97c50bc28af28dbe43f868311e85 /exec.c
parent90a9fdae1f1acc791abc2c20731eddf01ba73ae6 (diff)
downloadqemu-66e85a21c7f65540ac1976ed29ed9973089fe1f1.tar.gz
MMU support
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@262 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/exec.c b/exec.c
index 79c2bd0b6a..f7fdc03592 100644
--- a/exec.c
+++ b/exec.c
@@ -30,7 +30,7 @@
#include "exec.h"
//#define DEBUG_TB_INVALIDATE
-#define DEBUG_FLUSH
+//#define DEBUG_FLUSH
/* make various TB consistency checks */
//#define DEBUG_TB_CHECK
@@ -579,3 +579,33 @@ void cpu_abort(CPUState *env, const char *fmt, ...)
abort();
}
+#ifdef TARGET_I386
+/* unmap all maped pages and flush all associated code */
+void page_unmap(void)
+{
+ PageDesc *p, *pmap;
+ unsigned long addr;
+ int i, j, ret;
+
+ for(i = 0; i < L1_SIZE; i++) {
+ pmap = l1_map[i];
+ if (pmap) {
+ p = pmap;
+ for(j = 0;j < L2_SIZE; j++) {
+ if (p->flags & PAGE_VALID) {
+ addr = (i << (32 - L1_BITS)) | (j << TARGET_PAGE_BITS);
+ ret = munmap((void *)addr, TARGET_PAGE_SIZE);
+ if (ret != 0) {
+ fprintf(stderr, "Could not unmap page 0x%08lx\n", addr);
+ exit(1);
+ }
+ }
+ p++;
+ }
+ free(pmap);
+ l1_map[i] = NULL;
+ }
+ }
+ tb_flush();
+}
+#endif