This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: hal_idle_thread_action on ARM
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: daniel dot neri at sigicom dot se (Daniel Néri)
- Cc: ecos-patches at sources dot redhat dot com
- Date: 16 May 2003 18:29:45 +0100
- Subject: Re: hal_idle_thread_action on ARM
- References: <87r89nxbho.fsf@fnord.local.sigicom.com><3E655589.1070401@eCosCentric.com><87fznehjqo.fsf@fnord.local.sigicom.com>
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