OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [cdl-guide/] [ref.active-if.html] - Diff between revs 28 and 174

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 28 Rev 174
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- Copyright (C) 2003 Red Hat, Inc.                                -->
<!-- This material may be distributed only subject to the terms      -->
<!-- This material may be distributed only subject to the terms      -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- and conditions set forth in the Open Publication License, v1.0  -->
<!-- or later (the latest version is presently available at          -->
<!-- or later (the latest version is presently available at          -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- http://www.opencontent.org/openpub/).                           -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- Distribution of the work or derivative of the work in any       -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- standard (paper) book form is prohibited unless prior           -->
<!-- permission is obtained from the copyright holder.               -->
<!-- permission is obtained from the copyright holder.               -->
<HTML
<HTML
><HEAD
><HEAD
><TITLE
><TITLE
>active_if</TITLE
>active_if</TITLE
><meta name="MSSmartTagsPreventParsing" content="TRUE">
><meta name="MSSmartTagsPreventParsing" content="TRUE">
<META
<META
NAME="GENERATOR"
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
"><LINK
"><LINK
REL="HOME"
REL="HOME"
TITLE="The eCos Component Writer's Guide"
TITLE="The eCos Component Writer's Guide"
HREF="cdl-guide.html"><LINK
HREF="cdl-guide.html"><LINK
REL="UP"
REL="UP"
TITLE="CDL Language Specification"
TITLE="CDL Language Specification"
HREF="reference.html"><LINK
HREF="reference.html"><LINK
REL="PREVIOUS"
REL="PREVIOUS"
TITLE="cdl_interface"
TITLE="cdl_interface"
HREF="ref.cdl-interface.html"><LINK
HREF="ref.cdl-interface.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="calculated"
TITLE="calculated"
HREF="ref.calculated.html"></HEAD
HREF="ref.calculated.html"></HEAD
><BODY
><BODY
CLASS="REFENTRY"
CLASS="REFENTRY"
BGCOLOR="#FFFFFF"
BGCOLOR="#FFFFFF"
TEXT="#000000"
TEXT="#000000"
LINK="#0000FF"
LINK="#0000FF"
VLINK="#840084"
VLINK="#840084"
ALINK="#0000FF"
ALINK="#0000FF"
><DIV
><DIV
CLASS="NAVHEADER"
CLASS="NAVHEADER"
><TABLE
><TABLE
SUMMARY="Header navigation table"
SUMMARY="Header navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TH
><TH
COLSPAN="3"
COLSPAN="3"
ALIGN="center"
ALIGN="center"
>The <SPAN
>The <SPAN
CLASS="APPLICATION"
CLASS="APPLICATION"
>eCos</SPAN
>eCos</SPAN
> Component Writer's Guide</TH
> Component Writer's Guide</TH
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="left"
ALIGN="left"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="ref.cdl-interface.html"
HREF="ref.cdl-interface.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="80%"
WIDTH="80%"
ALIGN="center"
ALIGN="center"
VALIGN="bottom"
VALIGN="bottom"
></TD
></TD
><TD
><TD
WIDTH="10%"
WIDTH="10%"
ALIGN="right"
ALIGN="right"
VALIGN="bottom"
VALIGN="bottom"
><A
><A
HREF="ref.calculated.html"
HREF="ref.calculated.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"></DIV
WIDTH="100%"></DIV
><H1
><H1
><A
><A
NAME="REF.ACTIVE-IF"><SPAN
NAME="REF.ACTIVE-IF"><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
></H1
></H1
><DIV
><DIV
CLASS="REFNAMEDIV"
CLASS="REFNAMEDIV"
><A
><A
NAME="AEN3662"
NAME="AEN3662"
></A
></A
><H2
><H2
>Name</H2
>Name</H2
>Property <SPAN
>Property <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
>&nbsp;--&nbsp;Allow additional control over the active state of an
>&nbsp;--&nbsp;Allow additional control over the active state of an
option or other CDL entity.</DIV
option or other CDL entity.</DIV
><DIV
><DIV
CLASS="REFSYNOPSISDIV"
CLASS="REFSYNOPSISDIV"
><A
><A
NAME="AEN3666"><H2
NAME="AEN3666"><H2
>Synopsis</H2
>Synopsis</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="SYNOPSIS"
CLASS="SYNOPSIS"
>cdl_option &lt;name&gt; {
>cdl_option &lt;name&gt; {
    active_if &lt;condition&gt;
    active_if &lt;condition&gt;
    &#8230;
    &#8230;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3668"
NAME="AEN3668"
></A
></A
><H2
><H2
>Description</H2
>Description</H2
><P
><P
>Configuration options or other entities may be either active or
>Configuration options or other entities may be either active or
inactive. Typically this is controlled by the option's location in the
inactive. Typically this is controlled by the option's location in the
overall hierarchy. Consider the option
overall hierarchy. Consider the option
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYGDBG_INFRA_DEBUG_PRECONDITIONS</TT
>CYGDBG_INFRA_DEBUG_PRECONDITIONS</TT
>, which exists
>, which exists
below the component <TT
below the component <TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYGDBG_USE_ASSERT</TT
>CYGDBG_USE_ASSERT</TT
>. If the whole
>. If the whole
component is disabled then the options it contains are inactive: there
component is disabled then the options it contains are inactive: there
is no point in enabling preconditions unless there is generic
is no point in enabling preconditions unless there is generic
assertion support; any <SPAN
assertion support; any <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>requires</SPAN
>requires</SPAN
> constraints associated with
> constraints associated with
preconditions are irrelevant; any <SPAN
preconditions are irrelevant; any <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>compile</SPAN
>compile</SPAN
> property or other
> property or other
build-related property is ignored.</P
build-related property is ignored.</P
><P
><P
>In some cases the hierarchy does not provide sufficient control over
>In some cases the hierarchy does not provide sufficient control over
whether or not a particular option should be active. For example, the
whether or not a particular option should be active. For example, the
math library could have support for floating point exceptions which
math library could have support for floating point exceptions which
is only worthwhile if the hardware implements appropriate
is only worthwhile if the hardware implements appropriate
functionality, as specified by the architectural HAL. The relevant
functionality, as specified by the architectural HAL. The relevant
math library configuration options should remain below the
math library configuration options should remain below the
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>CYGPKG_LIBM</TT
>CYGPKG_LIBM</TT
> package in the overall hierarchy, but
> package in the overall hierarchy, but
should be inactive unless there is appropriate hardware support. In
should be inactive unless there is appropriate hardware support. In
cases like this an <SPAN
cases like this an <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> property is appropriate.</P
> property is appropriate.</P
><P
><P
>Another common use of <SPAN
>Another common use of <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> properties is to avoid excessive
> properties is to avoid excessive
nesting in the configuration hierarchy. If some option B is only
nesting in the configuration hierarchy. If some option B is only
relevant if option A is enabled, it is possible to turn A into a
relevant if option A is enabled, it is possible to turn A into a
component that contains B. However adding another level to the
component that contains B. However adding another level to the
hierarchy for a component which will contain just one entry may be
hierarchy for a component which will contain just one entry may be
considered excessive. In such cases it is possible for B to have an
considered excessive. In such cases it is possible for B to have an
<SPAN
<SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> dependency on A.</P
> dependency on A.</P
><P
><P
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> takes a goal expression as argument. For details of goal
> takes a goal expression as argument. For details of goal
expression syntax see <A
expression syntax see <A
HREF="language.values.html#LANGUAGE.GOAL-EXPRESSION"
HREF="language.values.html#LANGUAGE.GOAL-EXPRESSION"
>the Section called <I
>the Section called <I
>Goal Expressions</I
>Goal Expressions</I
> in Chapter 3</A
> in Chapter 3</A
>. In
>. In
most cases the goal expression will be very simple, often involving
most cases the goal expression will be very simple, often involving
just one other option, but more complicated expressions can be used
just one other option, but more complicated expressions can be used
when appropriate. It is also possible to have multiple <SPAN
when appropriate. It is also possible to have multiple <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
>
>
conditions in a single option, in which case all of the conditions
conditions in a single option, in which case all of the conditions
have to be satisfied if the option is to be active.</P
have to be satisfied if the option is to be active.</P
><P
><P
>The <SPAN
>The <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> and <SPAN
> and <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>requires</SPAN
>requires</SPAN
> properties have certain similarities,
> properties have certain similarities,
but they serve a different purpose. Suppose there are two options A
but they serve a different purpose. Suppose there are two options A
and B, and option B relies on functionality provided by A. This could
and B, and option B relies on functionality provided by A. This could
be expressed as either <TT
be expressed as either <TT
CLASS="LITERAL"
CLASS="LITERAL"
>active_if&nbsp;A</TT
>active_if&nbsp;A</TT
> or as
> or as
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>requires&nbsp;A</TT
>requires&nbsp;A</TT
>. The points to note are:</P
>. The points to note are:</P
><P
><P
></P
></P
><UL
><UL
><LI
><LI
><P
><P
>If <TT
>If <TT
CLASS="LITERAL"
CLASS="LITERAL"
>active_if&nbsp;A</TT
>active_if&nbsp;A</TT
> is used and A is disabled or
> is used and A is disabled or
inactive, then graphical tools will generally prevent any attempt at
inactive, then graphical tools will generally prevent any attempt at
modifying B. For example the text for B could be grayed out, and the
modifying B. For example the text for B could be grayed out, and the
associated checkbutton (if B is a boolean option) would be disabled.
associated checkbutton (if B is a boolean option) would be disabled.
If the user needs the functionality provided by option B then it is
If the user needs the functionality provided by option B then it is
necessary to go to option A first and manipulate it appropriately.</P
necessary to go to option A first and manipulate it appropriately.</P
></LI
></LI
><LI
><LI
><P
><P
>If <TT
>If <TT
CLASS="LITERAL"
CLASS="LITERAL"
>requires&nbsp;A</TT
>requires&nbsp;A</TT
> is used and A is disabled or
> is used and A is disabled or
inactive, graphical tools will still allow B to be manipulated and
inactive, graphical tools will still allow B to be manipulated and
enabled. This would result in a new conflict which may get resolved
enabled. This would result in a new conflict which may get resolved
automatically or which may need user intervention.</P
automatically or which may need user intervention.</P
></LI
></LI
><LI
><LI
><P
><P
>If there are hardware dependencies then an <SPAN
>If there are hardware dependencies then an <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> condition is
> condition is
usually the preferred approach. There is no point in allowing the user
usually the preferred approach. There is no point in allowing the user
to manipulate a configuration option if the corresponding
to manipulate a configuration option if the corresponding
functionality cannot possibly work on the currently-selected hardware.
functionality cannot possibly work on the currently-selected hardware.
Much the same argument applies to coarse-grained dependencies, for
Much the same argument applies to coarse-grained dependencies, for
example if an option depends on the presence of a TCP/IP stack then an
example if an option depends on the presence of a TCP/IP stack then an
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>active_if&nbsp;CYGPKG_NET</TT
>active_if&nbsp;CYGPKG_NET</TT
> condition is appropriate:
> condition is appropriate:
it may be possible to satisfy the condition, but it requires the
it may be possible to satisfy the condition, but it requires the
fairly drastic step of loading another package; further more, if the
fairly drastic step of loading another package; further more, if the
user wanted a TCP/IP stack in the configuration then it would probably
user wanted a TCP/IP stack in the configuration then it would probably
have been loaded already. </P
have been loaded already. </P
></LI
></LI
><LI
><LI
><P
><P
>If option B exists to provide additional debugging information about
>If option B exists to provide additional debugging information about
the functionality provided by A then again an <SPAN
the functionality provided by A then again an <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> constraint
> constraint
is appropriate. There is no point in letting users enable extra
is appropriate. There is no point in letting users enable extra
debugging facilities for a feature that is not actually present.</P
debugging facilities for a feature that is not actually present.</P
></LI
></LI
><LI
><LI
><P
><P
>The configuration system's inference engine will cope equally well
>The configuration system's inference engine will cope equally well
with <SPAN
with <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>active_if</SPAN
>active_if</SPAN
> and <SPAN
> and <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>requires</SPAN
>requires</SPAN
> properties. Suppose there is a
> properties. Suppose there is a
conflict because some third option depends on B. If B is
conflict because some third option depends on B. If B is
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>active_if&nbsp;A</TT
>active_if&nbsp;A</TT
> then the inference engine will
> then the inference engine will
attempt to make A active and enabled, and then to enable B if
attempt to make A active and enabled, and then to enable B if
necessary. If B <TT
necessary. If B <TT
CLASS="LITERAL"
CLASS="LITERAL"
>requires&nbsp;A</TT
>requires&nbsp;A</TT
> then the inference
> then the inference
engine will attempt to enable B and resolve the resulting conflict by
engine will attempt to enable B and resolve the resulting conflict by
causing A to be both active and enabled. Although the inference occurs
causing A to be both active and enabled. Although the inference occurs
in a different order, in most cases the effect will be the same.</P
in a different order, in most cases the effect will be the same.</P
></LI
></LI
></UL
></UL
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3710"
NAME="AEN3710"
></A
></A
><H2
><H2
>Example</H2
>Example</H2
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
># Do not provide extra semaphore debugging if there are no semaphores
># Do not provide extra semaphore debugging if there are no semaphores
cdl_option CYGDBG_KERNEL_INSTRUMENT_BINSEM {
cdl_option CYGDBG_KERNEL_INSTRUMENT_BINSEM {
    active_if CYGPKG_KERNEL_SYNCH
    active_if CYGPKG_KERNEL_SYNCH
    &#8230;
    &#8230;
}
}
 
 
# Avoid another level in the configuration hierarchy
# Avoid another level in the configuration hierarchy
cdl_option CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE_RELAY {
cdl_option CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE_RELAY {
    active_if CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE
    active_if CYGSEM_KERNEL_SYNCH_MUTEX_PRIORITY_INHERITANCE_SIMPLE
    &#8230;
    &#8230;
}
}
 
 
# Functionality that is only relevant if another package is loaded
# Functionality that is only relevant if another package is loaded
cdl_option CYGSEM_START_UITRON_COMPATIBILITY {
cdl_option CYGSEM_START_UITRON_COMPATIBILITY {
    active_if CYGPKG_UITRON
    active_if CYGPKG_UITRON
    &#8230;
    &#8230;
}
}
 
 
# Check that the hardware or HAL provide the appropriate functionality
# Check that the hardware or HAL provide the appropriate functionality
cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
cdl_option CYGDBG_HAL_DEBUG_GDB_BREAK_SUPPORT {
    active_if CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
    active_if CYGINT_HAL_DEBUG_GDB_STUBS_BREAK
    &#8230;
    &#8230;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3713"
NAME="AEN3713"
></A
></A
><H2
><H2
>See Also</H2
>See Also</H2
><P
><P
>Property <A
>Property <A
HREF="ref.requires.html"
HREF="ref.requires.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>requires</SPAN
>requires</SPAN
></A
></A
>.</P
>.</P
></DIV
></DIV
><DIV
><DIV
CLASS="NAVFOOTER"
CLASS="NAVFOOTER"
><HR
><HR
ALIGN="LEFT"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
SUMMARY="Footer navigation table"
WIDTH="100%"
WIDTH="100%"
BORDER="0"
BORDER="0"
CELLPADDING="0"
CELLPADDING="0"
CELLSPACING="0"
CELLSPACING="0"
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ref.cdl-interface.html"
HREF="ref.cdl-interface.html"
ACCESSKEY="P"
ACCESSKEY="P"
>Prev</A
>Prev</A
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="cdl-guide.html"
HREF="cdl-guide.html"
ACCESSKEY="H"
ACCESSKEY="H"
>Home</A
>Home</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="ref.calculated.html"
HREF="ref.calculated.html"
ACCESSKEY="N"
ACCESSKEY="N"
>Next</A
>Next</A
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="left"
ALIGN="left"
VALIGN="top"
VALIGN="top"
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>cdl_interface</TT
>cdl_interface</TT
></TD
></TD
><TD
><TD
WIDTH="34%"
WIDTH="34%"
ALIGN="center"
ALIGN="center"
VALIGN="top"
VALIGN="top"
><A
><A
HREF="reference.html"
HREF="reference.html"
ACCESSKEY="U"
ACCESSKEY="U"
>Up</A
>Up</A
></TD
></TD
><TD
><TD
WIDTH="33%"
WIDTH="33%"
ALIGN="right"
ALIGN="right"
VALIGN="top"
VALIGN="top"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>calculated</SPAN
>calculated</SPAN
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></BODY
></BODY
></HTML
></HTML
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.