From c2fa6c1890a9e61a64bfd2c85620e86f96beb129 Mon Sep 17 00:00:00 2001 From: Marius Strobl Date: Tue, 1 May 2007 16:19:28 +0000 Subject: [PATCH] Use the VIS-based Spitfire version of the page copying and zeroing functions with CPUs they apply to only, otherwise default to the plain C functions. This is modeled in a way so that f.e. a Cheetah version of these functions can be inserted easily. --- sys/sparc64/sparc64/machdep.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 443969648c03..6a589b49ec05 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -356,13 +356,20 @@ sparc64_init(caddr_t mdp, u_long o1, u_long o2, u_long o3, ofw_vec_t *vec) cache_init(child); uma_set_align(cache.dc_linesize - 1); + cpu_block_copy = bcopy; + cpu_block_zero = bzero; getenv_int("machdep.use_vis", &cpu_use_vis); if (cpu_use_vis) { - cpu_block_copy = spitfire_block_copy; - cpu_block_zero = spitfire_block_zero; - } else { - cpu_block_copy = bcopy; - cpu_block_zero = bzero; + switch (cpu_impl) { + case CPU_IMPL_SPARC64: + case CPU_IMPL_ULTRASPARCI: + case CPU_IMPL_ULTRASPARCII: + case CPU_IMPL_ULTRASPARCIIi: + case CPU_IMPL_ULTRASPARCIIe: + cpu_block_copy = spitfire_block_copy; + cpu_block_zero = spitfire_block_zero; + break; + } } #ifdef SMP