Subject: Re: NetBSD/hpcarm snap code
To: Richard Earnshaw <firstname.lastname@example.org>
From: Chris G. Demetriou <email@example.com>
Date: 02/16/2001 14:21:11
firstname.lastname@example.org (Richard Earnshaw) writes:
> arch/arm/arm2 <- contains e.g. the ARM2 pmap module
> arch/arm/arm6 <- contains e.g. the ARM6 pmap module,
> cache routines, TLB routines, etc.
> arch/arm/arm7 <- contains all the ARM7-specific goo.
> arch/arm/arm8 <- contains all the ARM8-specific goo.
> arch/arm/sa110 <- contains e.g. the SA110 cache routines,
> TLB routines, etc.
> Seems basically sound, except...
> A RiscPC can be fitted with any of arm6,7/SA110 (or even a few had arm8)
> How would one build a kernel that could select at boot time the
> appropriate CPU?
in general, the right thing to do is, if you can support multiple CPU
types, use a set of structures containing pointers to functions, and
select the right one at boot time.
There are plenty of optimizations to this, certainly...