This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
Re: LPC2XXX interrupt_acknowledge
On Mon, May 08, 2006 at 02:06:57PM +0300, Sergei Gavrikov wrote:
> Andrew,
>
> Thank you for this commit. I have an eCos newbie question.
>
> I have looked var_misc.c sources for other ARM platforms. Most of them
> usually has call hal_plf_hardware_init() after the hal_if_init() call in
> the hal_hardware_init() epilogue. So, the platform layer has point for an
> additional hardware initializing in C. Sorry, but LPC2XXX variant init
> (in the lpc2xxx_misc.c) have no such a call. Therefore, we have one
> point for the early hardware initializing in the hal_platform_setup.h
> for the evolution boards (in assembler only). There is no other point
> for the hardware initializing in the lpc2xxx platforms.
I had a similar problem with the AT91 varient HAL. What i did there was add:
#ifdef HAL_PLF_HARDWARE_INIT
// Perform any platform specific initializations
HAL_PLF_HARDWARE_INIT();
#endif
into hal_hardware_init().
The platform hal then has something like:
//----------------------------------------------------------------------
// The platform needs this initialization during the
// hal_hardware_init() function in the varient HAL.
#ifndef __ASSEMBLER__
extern void hal_plf_hardware_init(void);
#define HAL_PLF_HARDWARE_INIT() \
hal_plf_hardware_init()
#endif
in plf_io.h and the necassary code in the _misc.c file.
Doing it like this with a #define means you do not have to edit all
the platform HALs adding an empty function. You just have the function
when you need it.
Andrew