diff options
| author | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-08 01:01:26 +0100 |
|---|---|---|
| committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2014-02-08 01:01:26 +0100 |
| commit | b3df8945bd2512349ae7662843d5bdcf15b3804d (patch) | |
| tree | c9ae83b7a80250135900ef6cc9789e30e3bf3544 | |
| parent | 9c99675c1c02320c7ad74ae525e2449254a0dc8c (diff) | |
| download | plan9front-b3df8945bd2512349ae7662843d5bdcf15b3804d.tar.xz | |
reuse mtrr slots with default memory type
| -rw-r--r-- | sys/src/9/pc/mtrr.c | 4 |
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; } |
