summaryrefslogtreecommitdiff
path: root/sys/src
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2014-02-08 01:01:26 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2014-02-08 01:01:26 +0100
commitb3df8945bd2512349ae7662843d5bdcf15b3804d (patch)
treec9ae83b7a80250135900ef6cc9789e30e3bf3544 /sys/src
parent9c99675c1c02320c7ad74ae525e2449254a0dc8c (diff)
reuse mtrr slots with default memory type
Diffstat (limited to 'sys/src')
-rw-r--r--sys/src/9/pc/mtrr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/9/pc/mtrr.c b/sys/src/9/pc/mtrr.c
index 77f754cb0..b92835d79 100644
--- a/sys/src/9/pc/mtrr.c
+++ b/sys/src/9/pc/mtrr.c
@@ -295,7 +295,9 @@ mtrr(uvlong base, uvlong size, char *tstr)
for(i = 0; i < vcnt; i++){
mtrrget(&mtrr, i);
mok = mtrrdec(&mtrr, &mp, &msize, &mtype);
- if(!mok || mp == base && msize == size){
+ if(slot == -1 && !mok || mtype == (def & Deftype))
+ slot = i; /* good, but look further for exact match */
+ if(mok && mp == base && msize == size){
slot = i;
break;
}