ref: b3df8945bd2512349ae7662843d5bdcf15b3804d
parent: 9c99675c1c02320c7ad74ae525e2449254a0dc8c
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Feb 7 20:01:26 EST 2014
reuse mtrr slots with default memory type
--- a/sys/src/9/pc/mtrr.c
+++ b/sys/src/9/pc/mtrr.c
@@ -295,7 +295,9 @@
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;
}