* how is the asm-generic to be used?
@ 2002-12-05 9:34 george anzinger
2002-12-05 17:02 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: george anzinger @ 2002-12-05 9:34 UTC (permalink / raw)
To: linux-kernel@vger.kernel.org, Andrew Morton
Lets say there is a bit of code in the kernel ( i.e.
.../kernel/ ) that needs a function that is in an
asm-gneric/*.h file. Now someone comes along and does an
asm-x386/*.h with the same functionality but much faster asm
functions. How should the using code be set up to get the
faster asm version if it exists and the generic version if
it does not?
--
George Anzinger george@mvista.com
High-res-timers:
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how is the asm-generic to be used?
2002-12-05 9:34 how is the asm-generic to be used? george anzinger
@ 2002-12-05 17:02 ` Jeff Garzik
2002-12-05 19:19 ` george anzinger
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2002-12-05 17:02 UTC (permalink / raw)
To: george anzinger; +Cc: linux-kernel@vger.kernel.org, Andrew Morton
george anzinger wrote:
> Lets say there is a bit of code in the kernel ( i.e.
> .../kernel/ ) that needs a function that is in an
> asm-gneric/*.h file. Now someone comes along and does an
> asm-x386/*.h with the same functionality but much faster asm
> functions. How should the using code be set up to get the
> faster asm version if it exists and the generic version if
> it does not?
Can you be more specific? :)
asm-generic is for things that belong in include/asm-$ARCH but are also
shared across multiple architectures.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: how is the asm-generic to be used?
2002-12-05 17:02 ` Jeff Garzik
@ 2002-12-05 19:19 ` george anzinger
0 siblings, 0 replies; 3+ messages in thread
From: george anzinger @ 2002-12-05 19:19 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-kernel@vger.kernel.org, Andrew Morton
Jeff Garzik wrote:
>
> george anzinger wrote:
> > Lets say there is a bit of code in the kernel ( i.e.
> > .../kernel/ ) that needs a function that is in an
> > asm-gneric/*.h file. Now someone comes along and does an
> > asm-x386/*.h with the same functionality but much faster asm
> > functions. How should the using code be set up to get the
> > faster asm version if it exists and the generic version if
> > it does not?
>
> Can you be more specific? :)
>
> asm-generic is for things that belong in include/asm-$ARCH but are also
> shared across multiple architectures.
>
What I have is a generic version of sc_math.h, a set of
inlines and defines that make it easy to access the mpy and
div instructions with 64-bit/32-bit arguments (for example
mpy takes 2 32-bit arguments and produces a 64-bit result).
Individual archs would do these things with an sc_math.h
that uses asm (which I also have for the i386 arch). So the
question is how things are set up so that the arch version
is used if available and the generic if not.
I think the answer (one of those, "it came to me in the
shower answers") is that it is handled by the make file
setting up the include file search paths so that first
asm-<arch> is search and then asm-generic.
--
George Anzinger george@mvista.com
High-res-timers:
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-12-05 19:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-05 9:34 how is the asm-generic to be used? george anzinger
2002-12-05 17:02 ` Jeff Garzik
2002-12-05 19:19 ` george anzinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox