[ECOS] dynamic HAL_PLATFORM_* values

Nick Garnett nickg@ecoscentric.com
Tue Apr 27 16:10:00 GMT 2004


"Andy Dyer" <adyer@righthandtech.com> writes:

> > -----Original Message-----
> > From: Andrew Lunn [mailto:andrew@lunn.ch]
> > Sent: Monday, April 12, 2004 6:20 AM
> > To: Andy Dyer
> > Cc: ecos-discuss@ecos.sourceware.org
> > Subject: Re: [ECOS] dynamic HAL_PLATFORM_* values
> > 
> > 
> > Things like this normally go into plf_io.h. Just add a prototype for
> > something like char *cyg_hal_fgpa_version(void), and edit the
> > define_proc in the hal cdl to something like
> > 
> > puts $::cdl_header "#define HAL_PLATFORM_EXTRA  
> > cyg_hal_fpga_version()"
> > 
> > Im note sure is redboot/src/main.c pulls in plf_io.h. If not you will
> > also need
> > 
> > puts $::cdl_header "#include <cyg/hal/plf_io.h>"
> > 
> 
> I finally got around to messing with this again.  Putting the #include
> of plf_io.h into the platform specific .h file seems to break a bunch
> of things in building on MIPS.

That is not going to work in general. plf_io.h is designed to be
included only from hal_io.h and may depend on things defined there, or
vice versa.

The simplest thing you could do to make this work is something like
this in the define_proc:

puts $::cdl_header "#ifndef __ASSEMBLER__"
puts $::cdl_header "extern void cyg_hal_fpga_version(void);"
puts $::cdl_header "#define HAL_PLATFORM_EXTRA cyg_hal_fpga_version()"
puts $::cdl_header "#endif"

Since this is just for your platform, this would be OK. It would be a
bit yukky if we were to do this in the architecture or variant HALs.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list