This is the mail archive of the
ecos-devel@sources.redhat.com
mailing list for the eCos project.
Re: Dynamic SMP
Jiri Gaisler <jiri@gaisler.com> writes:
> We are in the processes of adding SMP support to the sparc port.
> We have a running system, but I still have a few questions:
>
> 1. Is it really necessary to build the kernel for the exact
> number cpu's? We would like to build the kernel for a
> maximum number, e.g. 4, but run it on systems with 1 - 4
> cpu's without re-compiling.
You can build the kernel for a maximum number of CPUs and discover at
runtime how many exist. HAL_SMP_CPU_MAX defines the maximum for which
the system is compiled and HAL_SMP_CPU_COUNT() returns the actual
number available at runtime. The code is fairly careful to use the
appropriate macro.
The system should also be able to handle a sparse population of
CPUs. For example if you have CPUs 0 and 2 of four. In that case
HAL_SMP_CPU_COUNT() should return 3 and HAL_SMP_CPU_START() on CPU 1
needs to detect that it is absent and do nothing. The same goes for
HAL_SMP_CPU_RESCHEDULE_INTERRUPT() and
HAL_SMP_CPU_TIMESLICE_INTERRUPT().
However, if you can arrange for the CPUs to appear to be numbered
consecutively, then it will be a lot simpler. Some simple translation
arrays in the HAL would do this with minimal effort and expense.
>
> 2. If we would do the modifications to run a dynamic number
> of cpu's, would it be accepted into the eCos distribution?
> Or is it likely that we will break to many things which will
> require all other SMP ports to be modified and re-validated?
>
No need, its already there!
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
Besuchen Sie uns vom 22.-24.02.05 auf der Embedded World 2005, Stand 11-124
Visit us at Embedded World 2005, NÃrnberg, Germany, 22-24 Feb, Stand 11-124