diff --git a/kernel/exec.c b/kernel/exec.c index 0e8762f..26fc8ec 100644 --- a/kernel/exec.c +++ b/kernel/exec.c @@ -52,7 +52,7 @@ exec(char *path, char **argv) if((sz1 = uvmalloc(pagetable, sz, ph.vaddr + ph.memsz)) == 0) goto bad; sz = sz1; - if(ph.vaddr % PGSIZE != 0) + if((ph.vaddr % PGSIZE) != 0) goto bad; if(loadseg(pagetable, ph.vaddr, ip, ph.off, ph.filesz) < 0) goto bad; @@ -138,9 +138,6 @@ loadseg(pagetable_t pagetable, uint64 va, struct inode *ip, uint offset, uint sz uint i, n; uint64 pa; - if((va % PGSIZE) != 0) - panic("loadseg: va must be page aligned"); - for(i = 0; i < sz; i += PGSIZE){ pa = walkaddr(pagetable, va + i); if(pa == 0)