This is the mail archive of the ecos-discuss@sourceware.cygnus.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]

Re: CDL question


>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:

    Grant> In the cdl file for my platform HAL package, I'd like to
    Grant> change the default value of CYGHWR_HAL_ARM_BIGENDIAN to 1.
    Grant> In the Component Writer's Guide it explains how to define
    Grant> new options in a cdl file, but what I'm trying to do is set
    Grant> the value for an existing option.

    Grant> Is this possible?

You cannot change the default value of some option in another package
(for the time being anyway), manipulating package configury like that
breaks encapsulation.

Instead your HAL package should use an appropriate requires property,
i.e.:

cdl_package XXXPKG_HAL_ARM_WHATEVER {
    ...
    requires CYGHWR_HAL_ARM_BIGENDIAN
}

The libcdl inference engine should sort this out pretty much
automatically, with no user intervention. If some user still wants to
use little-endian mode on that platform (assuming the platform HAL
code allows it), you will end up with a configuration containing
conflicts. This should not prevent a user from building the
configuration, but there will be some warnings.

If you want to be less draconian, you can add a line to the ecos.db
file:

target whatever {
    ...
    enable { CYGHWR_HAL_ARM_BIGENDIAN }
}

This would give BIGENDIAN a user value of enabled when the target is
selected, and the user could then switch back to little-endian without
raising any conflicts. 

Generally the requires property would be preferred, the ecos.db
mechanism is basically a backdoor mechanism that helps us to cope with
the vast diversity of hardware.

You could also add an endianness configuration option to the platform
HAL with an appropriate requires property for the architectural HAL,
but that starts getting messy.

Bart

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