Subject: Re: NetBSD/hpcarm snap code
To: Richard Earnshaw <>
From: Chris G. Demetriou <>
List: tech-kern
Date: 02/16/2001 14:33:34
Richard Earnshaw <> writes:
> > There are plenty of optimizations to this, certainly...
> Sure, the trick is to allow optimizaitons when a kernel is only compiled 
> for one CPU type.

Actually, if you're completely insane, you can do something more
tricky even than that, e.g.:

* provide generic stubs, e.g. for cache routines, that initially
indirect through fn ptrs.  Provide plenty of extra padding space at
the end.

* when you know which ones you really need, copy the actual code to
implement the right routines for that CPU into the location of the
generic routines.

Makes debugging those rtns a bit harder.  On some systems (e.g. ones
where jump thru ptr is more expensive, or where you need extra insns
to jump thru ptr as compared to jump to fixed address) that can win a

Depending on the nature of the routine, i imagine that some could
definitely be called often enough for that to make a little bit of a
diff.  8-)