hal_idle_thread_action on ARM
Nick Garnett
nickg@ecoscentric.com
Fri May 16 17:29:00 GMT 2003
daniel.neri@sigicom.se (Daniel Néri) writes:
> Jonathan Larmour <jifl@eCosCentric.com> wrote:
>
> > Daniel Nri wrote:
> >> Greetings,
> >> The ARM architecture HAL defines a dummy hal_idle_thread_action.
> >> Which is the best way to override this in a variant or platform HAL?
> >
> > Since it's empty, but included all the time from the arch/hal_misc.c,
> > it's probably better just to remove it from hal_arch.h and hal/misc.c.
> >
> > For overriding it, I'd probably recommend adding:
> >
> > #ifdef CYGINT_HAL_ARM_PLF_ARCH_H
> > # include <cyg/hal/plf_arch.h>
> > #endif
> >
> > and then adding CDL in the arch HAL to add a cdl_interface
> > CYGINT_HAL_ARM_PLF_ARCH_H which platform CDL that supplies that header
> > could then implement.
> >
> > Just my opinion though.
>
> As I didn't quite share Jonathan's opinion, I finally came up with my
> own solution (attached below). I'll make a separate post with a
> HAL_IDLE_THREAD_ACTION implementation for the new AT91 variant HAL.
>
This patch seem over-complicated for what it does. And defining
hal_arm_var_idle_thread_action() in hal_arch.h is not right.
The way we have done this kind of thing in the past, with interrupt
controller macros, cache macros etc. is to do something like this:
in hal_arch.h:
#ifndef HAL_IDLE_THREAD_ACTION
#define HAL_IDLE_THREAD_ACTION(__count) CYG_EMPTY_STATEMENT
#endif
in some variants' var_arch.h:
#ifndef HAL_IDLE_THREAD_ACTION
externC void hal_arm_var_idle_thread_action(cyg_uint32);
#define HAL_IDLE_THREAD_ACTION(__count) hal_arm_var_idle_thread_action(__count);
#endif
Then the platform can just define HAL_IDLE_THREAD_ACTION() if it
wants it. Simple, clean, minimal changes.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
More information about the Ecos-patches
mailing list