[linux-sh:03196] Re: [linuxsh-dev] cache info
Daniel Jacobowitz <[email protected]> Tue, 23 Mar 2004 09:54:13 -0500
| Newsgroups | gmane.linux.ports.sh.general,gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <[email protected]> |
On Sat, Mar 20, 2004 at 12:54:00PM +0900, Kaz Kojima wrote: > Hi, > > There is a request for a function replying to the queries about > cache specifications like cache sizes, ways and line sizes, from > the latest glibc. > Unfortunately, /proc can't be used because it might be required at > very early stage of the userland. Some other archs read CPU id > register and other cache-related registers which are readable in > user mode. > For SH, such registers are readable only in kernel mode and anyway > kernel has to give such informations to the userland. It seems > saveral ways to implement such function: > > (1) SH specific system call to get the cache info, > (2) interface (including system call) to read hurmless CPU > registers, > (3) special device, > (4) ... > > Perhaps (1) is cleaner as an interface than another methods though > I'm a bit concerned with SH specific system call number. We have > "holes" in system call numbers but there might be no guarantee > that they won't be used for another purpose. > > Thoughts? Implementations will be more welcome :-) PowerPC does this using ELF auxilliary data. Would that do? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer