summaryrefslogtreecommitdiff
path: root/sys/src/9/port/fault.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2020-05-10 16:54:42 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2020-05-10 16:54:42 +0200
commitdbfec06bf1f8de922ca3af09d14675ef44ada5d2 (patch)
tree157e0375612556991e488cdc6cef84e202dc50ea /sys/src/9/port/fault.c
parent0099db7b5b87adb72f1dfa69f893c41ab1c26d6e (diff)
kernel: fix checkpages() and segflush() on SG_PHYSICAL type segments
do not touch s->map on SG_PHYSICAL type segments as they do not have a pte map (s->mapsize == 0 && s->map == nil). also remove the SG_PHYSICAL switch in freepte(), this is never reached.
Diffstat (limited to 'sys/src/9/port/fault.c')
-rw-r--r--sys/src/9/port/fault.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/sys/src/9/port/fault.c b/sys/src/9/port/fault.c
index 4b6e12f67..9e499b722 100644
--- a/sys/src/9/port/fault.c
+++ b/sys/src/9/port/fault.c
@@ -438,14 +438,16 @@ checkpages(void)
if((s = *sp) == nil)
continue;
qlock(s);
- for(addr=s->base; addr<s->top; addr+=BY2PG){
- off = addr - s->base;
- if((p = s->map[off/PTEMAPMEM]) == nil)
- continue;
- pg = p->pages[(off&(PTEMAPMEM-1))/BY2PG];
- if(pagedout(pg))
- continue;
- checkmmu(addr, pg->pa);
+ if(s->mapsize > 0){
+ for(addr=s->base; addr<s->top; addr+=BY2PG){
+ off = addr - s->base;
+ if((p = s->map[off/PTEMAPMEM]) == nil)
+ continue;
+ pg = p->pages[(off&(PTEMAPMEM-1))/BY2PG];
+ if(pagedout(pg))
+ continue;
+ checkmmu(addr, pg->pa);
+ }
}
qunlock(s);
}