Added demand paging support
[akaros.git] / kern / arch / i686 / env.c
index 33f8d1f..4a858a2 100644 (file)
@@ -74,7 +74,6 @@ void env_pop_tf(trapframe_t *tf)
                              "addl $0x10,%%esp;        "
                              "popfl;                   "
                              "movl %%ebp,%%ecx;        "
-                             "movl %%esi,%%edx;        "
                              "popl %%esp;              "
                              "sti;                     "
                              "sysexit                  "
@@ -93,7 +92,7 @@ int env_user_mem_walk(env_t* e, void* start, size_t len,
        uint32_t pdeno, pteno;
        physaddr_t pa;
 
-       assert((intptr_t)start % PGSIZE == 0 && len % PGSIZE == 0);
+       assert((uintptr_t)start % PGSIZE == 0 && len % PGSIZE == 0);
        void* end = (char*)start+len;
        uint32_t pdeno_start = PDX(start);
        uint32_t pdeno_end = PDX(ROUNDUP(end,PTSIZE));
@@ -113,7 +112,7 @@ int env_user_mem_walk(env_t* e, void* start, size_t len,
                                      PTX(end) : NPTENTRIES );
                int ret;
                for (pteno = pteno_start; pteno < pteno_end; pteno++) {
-                       if (pt[pteno] & PTE_P)
+                       if (!PAGE_UNMAPPED(pt[pteno]))
                                if((ret = callback(e, &pt[pteno], PGADDR(pdeno, pteno, 0), arg)))
                                        return ret;
                }