This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: dynamic HAL_PLATFORM_* values


> 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"
> 

As a refresher I was trying to define a function to return a string
with some version information from the fpga on our board to be
printed at boot time by redboot.  I was trying to figure out the right
way to get a prototype for this included when compiling redboot's main.c

Nick suggested the above solution, but it doesn't work as the function
prototype ends up being included in the target.ld linker file via an
include of <cyg/infra/cyg_type.inc>.  I tried using an #ifdef  
__LANGUAGE_C instead of the #ifndef __ASSEMBLER__, but that didn't work
either.

For now, I'll live with the compilation warning :-)

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]