⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ref.flavor.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>flavor</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="The eCos Component Writer's Guide"HREF="cdl-guide.html"><LINKREL="UP"TITLE="CDL Language Specification"HREF="reference.html"><LINKREL="PREVIOUS"TITLE="doc"HREF="ref.doc.html"><LINKREL="NEXT"TITLE="hardware"HREF="ref.hardware.html"></HEAD><BODYCLASS="REFENTRY"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">The <SPANCLASS="APPLICATION">eCos</SPAN> Component Writer's Guide</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="ref.doc.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom"></TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="ref.hardware.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><H1><ANAME="REF.FLAVOR"><SPANCLASS="PROPERTY">flavor</SPAN></H1><DIVCLASS="REFNAMEDIV"><ANAME="AEN4315"></A><H2>Name</H2>Property <SPANCLASS="PROPERTY">flavor</SPAN>&nbsp;--&nbsp;Specify the nature of a configuration option.</DIV><DIVCLASS="REFSYNOPSISDIV"><ANAME="AEN4319"><H2>Synopsis</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SYNOPSIS">cdl_option &lt;name&gt; {    flavor &lt;flavor&gt;    &#8230;}</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4321"></A><H2>Description</H2><P>The state of a <SPANCLASS="APPLICATION">CDL</SPAN> configuration option is a somewhat complicatedconcept. This state determines what happens when a build tree isgenerated: it controls what files get built and what<TTCLASS="LITERAL">#define's</TT> end up in configuration header files. Thestate also controls the values used during expression evaluation. Thekey concepts are:</P><P></P><OLTYPE="1"><LI><P>An option may or may not be loaded into the current configuration.However it is still possible for packages to reference options whichare not loaded in a <SPANCLASS="PROPERTY">requires</SPAN> constraint or other expression. If anoption is not loaded then it will have no direct effect on the buildprocess, and <TTCLASS="LITERAL">0</TT> will be used for expressionevaluation. </P></LI><LI><P>Even if an option is loaded it may still be inactive. Usually this iscontrolled by the option's location in the configuration hierarchy. Ifan option's parent is active and enabled then the option will normallybe active. If the parent is either inactive or disabled then theoption will be inactive. For example, if kernel timeslicing is diabledthen the option <TTCLASS="LITERAL">CYGNUM_KERNEL_SCHED_TIMESLICE_TICKS</TT>is irrelevant and must have no effect. The <SPANCLASS="PROPERTY">active_if</SPAN> property can beused to specify additional constraints. If an option is inactive thenit will have no direct effect on the build process, in other words itwill not cause any files to get built or <TTCLASS="LITERAL">#define's</TT>to be generated. For the purposes of expression evaluation an inactiveoption has a value of <TTCLASS="LITERAL">0</TT>.</P></LI><LI><P>An option may be enabled or disabled. Most options are boolean innature, for example a particular function may get inlined or it mayinvolve a full procedure call. If an option is disabled then it has nodirect effect on the build process, and for the purposes of expressionevaluation it has a value of 0.</P></LI><LI><P>An option may also have additional data associated with it, forexample a numerical value used to control the size of an array.</P></LI></OL><P>Most options are boolean in nature and do not have any additionalassociated data. For some options only the data part makes sense andusers should be unable to manipulate the enabled/disabled part of thestate. For a comparatively small number of options it makes sense tohave the ability to disable that option or to enable it and associatedata as well. Finally, when constructing an option hierarchy it isoccasionally useful to have entities which serve only as placeholders.The <SPANCLASS="PROPERTY">flavor</SPAN> property can be used to control all this. There are fourpossible values. It should be noted that the active or inactive stateof an option takes priority over the flavor: if an option is inactivethen no <TTCLASS="LITERAL">#define's</TT> will be generated and anybuild-related properties such as <SPANCLASS="PROPERTY">compile</SPAN> will be ignored.</P><P></P><DIVCLASS="VARIABLELIST"><DL><DT>flavor&nbsp;<TTCLASS="LITERAL">none</TT></DT><DD><P>The <TTCLASS="LITERAL">none</TT> is intended primarily for placeholdercomponents in the hierarchy, although it can be used for otherpurposes. Options with this flavor are always enabled and do not haveany additional data associated with them, so there is no way for usersto modify the option. For the purposes of expression evaluation anoption with flavor <TTCLASS="LITERAL">none</TT> always has the value<TTCLASS="LITERAL">1</TT>. Normal <TTCLASS="LITERAL">#define</TT> processingwill take place, so typically a single <TTCLASS="LITERAL">#define</TT> willbe generated using the option name and a value of<TTCLASS="LITERAL">1</TT>. Similarly build-related properties such as<SPANCLASS="PROPERTY">compile</SPAN> will take effect.</P></DD><DT>flavor&nbsp;<TTCLASS="LITERAL">bool</TT></DT><DD><P>Boolean options can be either enabled or disabled, and there is noadditional data associated with them. If a boolean option is disabledthen no <TTCLASS="LITERAL">#define</TT> will be generated and anybuild-related properties such as <SPANCLASS="PROPERTY">compile</SPAN> will be ignored. For thepurposes of expression evaluation a disabled option has the value<TTCLASS="LITERAL">0</TT>. If a boolean option is enabled then normal<TTCLASS="LITERAL">#define</TT> processing will take place, allbuild-related properties take effect, and the option's value will be<TTCLASS="LITERAL">1</TT>.</P></DD><DT>flavor&nbsp;<TTCLASS="LITERAL">data</TT></DT><DD><P>Options with this flavor are always enabled, and have some additionaldata associated with them which can be edited by the user. This datacan be any sequence of characters, although in practice the<SPANCLASS="PROPERTY">legal_values</SPAN> property will often be used to impose constraints. Inappropriate contexts such as expressions the configuration tools willattempt to interpret the data as integer or floating point numbers.Since an option with the <TTCLASS="LITERAL">data</TT> flavor cannot bedisabled, normal <TTCLASS="LITERAL">#define</TT> processing takes place andthe data will be used for the value. Similarly all build-relatedproperties take effect, and the option's value for the purposes ofexpression evaluation is the data.</P></DD><DT>flavor&nbsp;<TTCLASS="LITERAL">booldata</TT></DT><DD><P>This combines the <TTCLASS="LITERAL">bool</TT> and <TTCLASS="LITERAL">data</TT>flavors. The option may be enabled or disabled, and in addition theoption has some associated data. If the option is disabled then no<TTCLASS="LITERAL">#define</TT> will be generated, the build-relatedproperties have no effect, and for the purposes of expressionevaluation the option's value is <TTCLASS="LITERAL">0</TT>. If the optionis enabled then a <TTCLASS="LITERAL">#define</TT> will be generated usingthe data as the value, all build-related properties take effect, andthe option's value for the purposes of expression evaluation is thedata. If <TTCLASS="LITERAL">0</TT> is legal data then it is not possible todistinguish this case from the option being disabled or inactive.</P></DD></DL></DIV><P>Options and components have the <TTCLASS="LITERAL">bool</TT> flavor bydefault, but this can be changed as desired. Packages always have the<TTCLASS="LITERAL">booldata</TT> flavor, and this cannot be changed.Interfaces have the <TTCLASS="LITERAL">data</TT> flavor by default, sincethe value of an interface is a count of the number of active andenabled interfaces, but they can be given the <TTCLASS="LITERAL">bool</TT>or <TTCLASS="LITERAL">booldata</TT> flavors.</P><DIVCLASS="NOTE"><BLOCKQUOTECLASS="NOTE"><P><B>Note: </B>The expression syntax needs to be extended to allow the loaded,active, enabled and data aspects of an option's state to be examinedindividually. This would allow component writers to distinguishbetween a disabled <TTCLASS="LITERAL">booldata</TT> option and an enabledone which has a value of <TTCLASS="LITERAL">0</TT>. Such an enhancement tothe expression syntax may also prove useful in other circumstances.</P></BLOCKQUOTE></DIV></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4397"></A><H2>Example</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="PROGRAMLISTING">&#13;cdl_component CYGPKG_LIBM_COMPATIBILITY {    cdl_component CYGNUM_LIBM_COMPATIBILITY {        flavor booldata        &#8230;        cdl_option CYGNUM_LIBM_COMPAT_DEFAULT {            flavor data            &#8230;        }    }    &#8230;}cdl_component CYGPKG_LIBM_TRACE {    flavor        bool    &#8230;}</PRE></TD></TR></TABLE></DIV><DIVCLASS="REFSECT1"><ANAME="AEN4400"></A><H2>See Also</H2><P>Properties <AHREF="ref.calculated.html"><SPANCLASS="PROPERTY">calculated</SPAN></A>,<AHREF="ref.default-value.html"><SPANCLASS="PROPERTY">default_value</SPAN></A> and<AHREF="ref.legal-values.html"><SPANCLASS="PROPERTY">legal_values</SPAN></A>,</P></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="ref.doc.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="cdl-guide.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="ref.hardware.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><SPANCLASS="PROPERTY">doc</SPAN></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="reference.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><SPANCLASS="PROPERTY">hardware</SPAN></TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -