Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/arch/powerpc/string Make this work in kernel space ...



details:   https://anonhg.NetBSD.org/src/rev/c5c8f1cc2faf
branches:  trunk
changeset: 518362:c5c8f1cc2faf
user:      mjl <mjl%NetBSD.org@localhost>
date:      Thu Nov 29 00:20:37 2001 +0000

description:
Make this work in kernel space too.

diffstat:

 lib/libc/arch/powerpc/string/bzero.S |  16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diffs (44 lines):

diff -r c540f37a602a -r c5c8f1cc2faf lib/libc/arch/powerpc/string/bzero.S
--- a/lib/libc/arch/powerpc/string/bzero.S      Thu Nov 29 00:16:35 2001 +0000
+++ b/lib/libc/arch/powerpc/string/bzero.S      Thu Nov 29 00:20:37 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bzero.S,v 1.1 2001/11/25 01:09:59 mjl Exp $ */
+/*     $NetBSD: bzero.S,v 1.2 2001/11/29 00:20:37 mjl Exp $ */
 
 /*-
  * Copyright (C) 2001  Martin J. Laubach <mjl%netbsd.org@localhost>
@@ -29,6 +29,9 @@
 /*----------------------------------------------------------------------*/
 
 #include <machine/asm.h>
+#ifdef _KERNEL
+#include <assym.h>
+#endif
 
 #define USE_STSWX 0    /* don't. slower than trivial copy loop */
 
@@ -62,6 +65,7 @@
 cb_memset:
 
 /*----------------------------------------------------------------------*/
+#ifndef _KERNEL
                /* First find out cache line size */
 #ifdef PIC
                mflr    r9
@@ -157,6 +161,16 @@
                lis     r10, cache_sh@ha
                lwz     r10, cache_sh@l(r10)
 #endif
+
+#else /* _KERNEL */
+               li      r9, CACHELINESIZE
+#if CACHELINESIZE == 32
+#define CACHELINESHIFT 5
+#else
+#error Define CACHELINESHIFT for your CACHELINESIZE
+#endif
+               li      r10, CACHELINESHIFT
+#endif /* _KERNEL */
                /* Back in memory filling business */
                
                cmplwi  cr1, r_len, 0           /* Nothing to do? */



Home | Main Index | Thread Index | Old Index