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: PowerPC vector base location


Patrick Doyle wrote:
> 
> In addition, or instead, why not change the "calculated" property to
> "default"?  That way it could be overridden on a case by case basis.
> 
> Actually, I think that Bob's idea is a fine one, I am more seeking guidance
> from the CDL gurus as to why one would choose "calculated" over "default"
> (or vice versa) for an option such as where to place the interrupt vector
> table.

Maybe it should indeed be. That could also be fine - although if there
really are only two valid values, you could maybe use a "legal_values"
list. Calculated is used when something really shouldn't be overridden.

(Note to Gary: for what I believe Bob is doing, it should be okay - he
already has an assignment).
 
> > > Therefore I think that it makes sense to rewrite the CDL option for the
> > > vector
> > > base as follows.
> > >
> > >     cdl_option CYGHWR_HAL_POWERPC_VECTOR_BASE {
> > >         display       "Exception vectors location"
> > >         description   "
> > >             PowerPC exception vectors can reside either at 0x00000000 or
> > >             0xfff00000. The startup type and platform HAL controls which
> > >             is used."
> > >         flavor        data
> > >         calculated { (! CYGHWR_HAL_POWERPC_FORCE_VECTOR_BASE_LOW &&
> > >                        (CYGHWR_HAL_POWERPC_FORCE_VECTOR_BASE_HIGH ||
> > >                        (CYG_HAL_STARTUP != "RAM" &&
> > >                         ! CYGSEM_HAL_POWERPC_COPY_VECTORS)))
> > >                       ? 0xfff00000 : 0x00000000 }
> > >     }
> > >
> > > If the platform HAL does not define
> > > CYGHWR_HAL_POWERPC_FORCE_VECTOR_BASE_LOW,
> > > nothing changes, so there is no risk of breaking existing code. It
> > > leaves however
> > > the option to force the vector base at zero with copying (for RAM at
> > > 0x0000) or
> > > WITHOUT copying the vectors. (FLASH 0x0000000)

One other way could be just to make the CDL option a "default_value" of the
above, and have the platform HAL have a "requires" statement for the CDL.
But if the powerpc really only allows 0x0 or 0xfff00000, then what about
just eliminating CYGHWR_HAL_POWERPC_FORCE_VECTOR_BASE_HIGH entirely (no
platform in our sources uses it):

flavor data
legal_values 0xfff00000 0x00000000
default_value { (CYG_HAL_STARTUP != "RAM" &&
                        ! CYGSEM_HAL_POWERPC_COPY_VECTORS)
                      ? 0xfff00000 : 0x00000000 }

And then platforms just override it using explicit "requires" statements in
their own CDL. That seems a more natural CDL way to do it.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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