summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2002-07-30 04:19:07 +0000
committerjake <jake@FreeBSD.org>2002-07-30 04:19:07 +0000
commitd8a2beb66033fa69770659675131ff9afc977780 (patch)
tree06cb50b698d9a36b50b9aa7839c0352a296dd6ee
parent6d477ea5859cb94e8e1579728112ed797dd61ff8 (diff)
downloadFreeBSD-src-d8a2beb66033fa69770659675131ff9afc977780.zip
FreeBSD-src-d8a2beb66033fa69770659675131ff9afc977780.tar.gz
Panic if the data cache has too many virtual colors (more than 2).
-rw-r--r--sys/sparc64/sparc64/cache.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/sparc64/sparc64/cache.c b/sys/sparc64/sparc64/cache.c
index 912662e..821b599 100644
--- a/sys/sparc64/sparc64/cache.c
+++ b/sys/sparc64/sparc64/cache.c
@@ -207,6 +207,8 @@ cache_init(phandle_t node)
cache.dc_l2size = ffs(cache.dc_size) - 1;
if ((cache.dc_size & ~(1UL << cache.dc_l2size)) != 0)
panic("cache_init: D$ size not a power of 2");
+ if (((cache.dc_size / cache.dc_assoc) / PAGE_SIZE) != DCACHE_COLORS)
+ panic("cache_init: too many D$ colors");
if (cache.dc_assoc != 1)
panic("cache_init: D$ is not directly mapped!");
set = cache.ec_size / cache.ec_assoc;
OpenPOWER on IntegriCloud