diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-06-18 12:16:54 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-06-18 12:16:54 +0200 |
commit | 1bf5b4ad4eb7f9f3b65c147777ab43ac2e62f233 (patch) | |
tree | 42f9da9a44fab376ed557fdce4d3489342588087 /sys/src/9 | |
parent | 0dab8869adf16f425b0cbd13eef1a8df4d2823f0 (diff) |
zynq: use KADDR() for kmap() if we can avoiding the mapping
Diffstat (limited to 'sys/src/9')
-rw-r--r-- | sys/src/9/zynq/mmu.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/9/zynq/mmu.c b/sys/src/9/zynq/mmu.c index 4c561ae70..e3e63bd3d 100644 --- a/sys/src/9/zynq/mmu.c +++ b/sys/src/9/zynq/mmu.c @@ -286,6 +286,8 @@ kmap(Page *page) ulong *e, *v; int i, s; + if(cankaddr(page->pa)) + return (KMap*)KADDR(page->pa); if(up == nil) panic("kmap: up=0 pc=%#.8lux", getcallerpc(&page)); if(up->l1 == nil) @@ -329,6 +331,8 @@ kunmap(KMap *arg) ulong *e; va = (uintptr) arg; + if(va >= KZERO) + return; if(up->l1 == nil || (up->l1->va[L1X(KMAP)] & 3) == 0) panic("kunmap: no kmaps"); if(va < KMAP || va >= KMAP + NKMAP * BY2PG) |