Subject: Re: bzero.S and assym.h (Re: CVS commit: syssrc/sys/lib/libkern/arch/powerpc)
To: None <port-powerpc@netbsd.org>
From: Martin J. Laubach <mjl@emsi.priv.at>
List: port-powerpc
Date: 12/02/2001 11:17:38
  FYI, I have just backed out that change until we resolve the
problem so people's build won't break.

| | > You should not be depending on a statically defined CACHELINESIZE
| | > since that can vary between different CPU models.
| |
| | I think libc version does not depend on static CACHELINESIZE,
| | but for libkern case, could single port have different CPU models
| | that have different cacheline size?
|  
|  Yes.

  The libc version does a sysctl to get the cache line size the
first time the bzero routine is called.

  The libkern variant (really the same routine with some _KERNEL
ifdefs) tries to extract the CACHELINESIZE definition from
powerpc/cpu.h, since the aforementioned sysctl does (in powerpc/
powerpc_machdep.c):

> return sysctl_rdint(oldp, oldlenp, newp, CACHELINESIZE);

  I figured that since the sysctl does nothing else than just
returning that value, it would be OK to use it too. I was not
aware that stuff outside the kernel use libkern too.

  So I am soliciting ideas and/or fixes to the problems mentioned
here:

  - dependency on assym.h
  - use of libkern by non-kernel (but with no working sysctl either,
    eg. bootloader)
  - how to actually and correctly get at the cache line size
    in kernel (do we have to have that dynamic too? if so, I
    fear the infrastructure for that is not in yet place, see 
    the snipped above for the sysctl).


  Thanks for your patience so far :)

	mjl