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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [doc/] [html/] [cdl-guide/] [ref.define.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
>define</TITLE
>define</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="default_value"
TITLE="default_value"
HREF="ref.default-value.html"><LINK
HREF="ref.default-value.html"><LINK
REL="NEXT"
REL="NEXT"
TITLE="define_format"
TITLE="define_format"
HREF="ref.define-format.html"></HEAD
HREF="ref.define-format.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.default-value.html"
HREF="ref.default-value.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.define-format.html"
HREF="ref.define-format.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.DEFINE"><SPAN
NAME="REF.DEFINE"><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define</SPAN
>define</SPAN
></H1
></H1
><DIV
><DIV
CLASS="REFNAMEDIV"
CLASS="REFNAMEDIV"
><A
><A
NAME="AEN3980"
NAME="AEN3980"
></A
></A
><H2
><H2
>Name</H2
>Name</H2
>Property <SPAN
>Property <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define</SPAN
>define</SPAN
>&nbsp;--&nbsp;Specify additional <TT
>&nbsp;--&nbsp;Specify additional <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> symbols that
> symbols that
should go into the owning package's configuration header file.</DIV
should go into the owning package's configuration header file.</DIV
><DIV
><DIV
CLASS="REFSYNOPSISDIV"
CLASS="REFSYNOPSISDIV"
><A
><A
NAME="AEN3985"><H2
NAME="AEN3985"><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; {
    define [-file=&lt;filename&gt;] [-format=&lt;format&gt;] &lt;symbol&gt;
    define [-file=&lt;filename&gt;] [-format=&lt;format&gt;] &lt;symbol&gt;
    &#8230;
    &#8230;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN3987"
NAME="AEN3987"
></A
></A
><H2
><H2
>Description</H2
>Description</H2
><P
><P
>Normally the configuration system generates a single
>Normally the configuration system generates a single
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> for each option that is active and enabled,
> for each option that is active and enabled,
with the defined symbol being the name of the option. These
with the defined symbol being the name of the option. These
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define's</TT
>#define's</TT
> go to the package's own configuration
> go to the package's own configuration
header file, for example <TT
header file, for example <TT
CLASS="FILENAME"
CLASS="FILENAME"
>pkgconf/kernel.h</TT
>pkgconf/kernel.h</TT
>
>
for kernel configuration options. For the majority of options this is
for kernel configuration options. For the majority of options this is
sufficient. Sometimes it is useful to have more control over which
sufficient. Sometimes it is useful to have more control over which
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define's</TT
>#define's</TT
> get generated.</P
> get generated.</P
><P
><P
>The <SPAN
>The <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define</SPAN
>define</SPAN
> property can be used to generate an addition
> property can be used to generate an addition
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> if the option is both active and enabled,
> if the option is both active and enabled,
for example:</P
for example:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cdl_option CYGNUM_LIBC_STDIO_FOPEN_MAX {
>cdl_option CYGNUM_LIBC_STDIO_FOPEN_MAX {
    &#8230;
    &#8230;
    define FOPEN_MAX
    define FOPEN_MAX
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>If this option is given the value 40 then the following
>If this option is given the value 40 then the following
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define's</TT
>#define's</TT
> will be generated in the configuration
> will be generated in the configuration
header <TT
header <TT
CLASS="FILENAME"
CLASS="FILENAME"
>pkgconf/libc.h</TT
>pkgconf/libc.h</TT
>:</P
>:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="SCREEN"
CLASS="SCREEN"
>#define CYGNUM_LIBC_STDIO_FOPEN_MAX 40
>#define CYGNUM_LIBC_STDIO_FOPEN_MAX 40
#define FOPEN_MAX 40</PRE
#define FOPEN_MAX 40</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>The default <TT
>The default <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> can be suppressed if desired
> can be suppressed if desired
using the <SPAN
using the <SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>no_define</SPAN
>no_define</SPAN
> property. This is useful if the symbol should
> property. This is useful if the symbol should
only be defined in
only be defined in
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>pkgconf/system.h</TT
>pkgconf/system.h</TT
> and not in
> and not in
the package's own configuration header file. The value that will be
the package's own configuration header file. The value that will be
used for this <TT
used for this <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> is the same as for the
> is the same as for the
default one, and depends on the option's flavor as follows:</P
default one, and depends on the option's flavor as follows:</P
><P
><P
></P
></P
><DIV
><DIV
CLASS="VARIABLELIST"
CLASS="VARIABLELIST"
><DL
><DL
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>flavor none</TT
>flavor none</TT
></DT
></DT
><DD
><DD
><P
><P
>Options with this flavor are always enabled and have no value, so the
>Options with this flavor are always enabled and have no value, so the
constant <TT
constant <TT
CLASS="LITERAL"
CLASS="LITERAL"
>1</TT
>1</TT
> will be used.</P
> will be used.</P
></DD
></DD
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>flavor bool</TT
>flavor bool</TT
></DT
></DT
><DD
><DD
><P
><P
>If the option is disabled then no <TT
>If the option is disabled then no <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> will be
> will be
generated. Otherwise the constant <TT
generated. Otherwise the constant <TT
CLASS="LITERAL"
CLASS="LITERAL"
>1</TT
>1</TT
> will be used.</P
> will be used.</P
></DD
></DD
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>flavor booldata</TT
>flavor booldata</TT
></DT
></DT
><DD
><DD
><P
><P
>If the option is disabled then no <TT
>If the option is disabled then no <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> will be
> will be
generated. Otherwise the option's current value will be used.</P
generated. Otherwise the option's current value will be used.</P
></DD
></DD
><DT
><DT
><TT
><TT
CLASS="LITERAL"
CLASS="LITERAL"
>flavor data</TT
>flavor data</TT
></DT
></DT
><DD
><DD
><P
><P
>The option's current value will be used.</P
>The option's current value will be used.</P
></DD
></DD
></DL
></DL
></DIV
></DIV
><P
><P
>For active options with the <TT
>For active options with the <TT
CLASS="LITERAL"
CLASS="LITERAL"
>data</TT
>data</TT
> flavor, and for
> flavor, and for
active and enabled options with the <TT
active and enabled options with the <TT
CLASS="LITERAL"
CLASS="LITERAL"
>booldata</TT
>booldata</TT
>
>
flavor, either one or two <TT
flavor, either one or two <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define's</TT
>#define's</TT
> will be
> will be
generated. These take the following forms:</P
generated. These take the following forms:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>#define &lt;symbol&gt; &lt;value&gt;
>#define &lt;symbol&gt; &lt;value&gt;
#define &lt;symbol&gt;_&lt;value&gt;</PRE
#define &lt;symbol&gt;_&lt;value&gt;</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>For the first <TT
>For the first <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> it is possible to control the
> it is possible to control the
format used for the value using a
format used for the value using a
<TT
<TT
CLASS="LITERAL"
CLASS="LITERAL"
>-format=&lt;format&gt;</TT
>-format=&lt;format&gt;</TT
> option. For example, the
> option. For example, the
following can be used to output some configuration data as a C string:</P
following can be used to output some configuration data as a C string:</P
><TABLE
><TABLE
BORDER="5"
BORDER="5"
BGCOLOR="#E0E0F0"
BGCOLOR="#E0E0F0"
WIDTH="70%"
WIDTH="70%"
><TR
><TR
><TD
><TD
><PRE
><PRE
CLASS="PROGRAMLISTING"
CLASS="PROGRAMLISTING"
>cdl_option &lt;name&gt; {
>cdl_option &lt;name&gt; {
    &#8230;
    &#8230;
    define -format="\\\"%s\\\"" &lt;symbol&gt;
    define -format="\\\"%s\\\"" &lt;symbol&gt;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
><P
><P
>The implementation of this facility involves concatenating the
>The implementation of this facility involves concatenating the
Tcl command <TT
Tcl command <TT
CLASS="LITERAL"
CLASS="LITERAL"
>format</TT
>format</TT
>, the format string, and the
>, the format string, and the
string representation of the option's value, and evaluating this in a
string representation of the option's value, and evaluating this in a
Tcl interpreter. Therefore the format string will be processed twice
Tcl interpreter. Therefore the format string will be processed twice
by a Tcl parser, and appropriate care has to be taken with quoting.</P
by a Tcl parser, and appropriate care has to be taken with quoting.</P
><P
><P
>The second <TT
>The second <TT
CLASS="LITERAL"
CLASS="LITERAL"
>#define</TT
>#define</TT
> will be generated only if is a
> will be generated only if is a
valid C preprocessor macro symbol. By default the symbols generated by
valid C preprocessor macro symbol. By default the symbols generated by
<SPAN
<SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define</SPAN
>define</SPAN
> properties will end up in the package's own configuration
> properties will end up in the package's own configuration
header file. The <TT
header file. The <TT
CLASS="LITERAL"
CLASS="LITERAL"
>-file</TT
>-file</TT
> option can be used to
> option can be used to
specify an alternative destination. At the time of writing the only
specify an alternative destination. At the time of writing the only
valid alternative definition is <TT
valid alternative definition is <TT
CLASS="LITERAL"
CLASS="LITERAL"
>-file=system.h</TT
>-file=system.h</TT
>,
>,
which will send the output to the global configuration header file
which will send the output to the global configuration header file
<TT
<TT
CLASS="FILENAME"
CLASS="FILENAME"
>pkgconf/system.h</TT
>pkgconf/system.h</TT
>.</P
>.</P
><DIV
><DIV
CLASS="CAUTION"
CLASS="CAUTION"
><P
><P
></P
></P
><TABLE
><TABLE
CLASS="CAUTION"
CLASS="CAUTION"
BORDER="1"
BORDER="1"
WIDTH="100%"
WIDTH="100%"
><TR
><TR
><TD
><TD
ALIGN="CENTER"
ALIGN="CENTER"
><B
><B
>Caution</B
>Caution</B
></TD
></TD
></TR
></TR
><TR
><TR
><TD
><TD
ALIGN="LEFT"
ALIGN="LEFT"
><P
><P
>Care has to be taken with the <TT
>Care has to be taken with the <TT
CLASS="LITERAL"
CLASS="LITERAL"
>-format</TT
>-format</TT
> option.
> option.
Because the Tcl interpreter's <TT
Because the Tcl interpreter's <TT
CLASS="LITERAL"
CLASS="LITERAL"
>format</TT
>format</TT
> command is
> command is
used, this property is subject to any problems with the implementation
used, this property is subject to any problems with the implementation
of this in the Tcl library. Generally there should be no problems with
of this in the Tcl library. Generally there should be no problems with
string data or with integers up to 32 bits, but there may well be
string data or with integers up to 32 bits, but there may well be
problems if 64-bit data is involved. This issue may be addressed in a
problems if 64-bit data is involved. This issue may be addressed in a
future release.</P
future release.</P
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN4053"
NAME="AEN4053"
></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"
>cdl_component CYG_HAL_STARTUP {
>cdl_component CYG_HAL_STARTUP {
    display       "Startup type"
    display       "Startup type"
    flavor        data
    flavor        data
    legal_values  {"RAM" "ROM" }
    legal_values  {"RAM" "ROM" }
    default_value {"RAM"}
    default_value {"RAM"}
    no_define
    no_define
    define -file=system.h CYG_HAL_STARTUP
    define -file=system.h CYG_HAL_STARTUP
    &#8230;
    &#8230;
}</PRE
}</PRE
></TD
></TD
></TR
></TR
></TABLE
></TABLE
></DIV
></DIV
><DIV
><DIV
CLASS="REFSECT1"
CLASS="REFSECT1"
><A
><A
NAME="AEN4056"
NAME="AEN4056"
></A
></A
><H2
><H2
>See Also</H2
>See Also</H2
><P
><P
>Properties <A
>Properties <A
HREF="ref.define-format.html"
HREF="ref.define-format.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define_format</SPAN
>define_format</SPAN
></A
></A
>,
>,
<A
<A
HREF="ref.define-header.html"
HREF="ref.define-header.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define_header</SPAN
>define_header</SPAN
></A
></A
>,
>,
<A
<A
HREF="ref.define-proc.html"
HREF="ref.define-proc.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>define_proc</SPAN
>define_proc</SPAN
></A
></A
>,
>,
<A
<A
HREF="ref.if-define.html"
HREF="ref.if-define.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>if_define</SPAN
>if_define</SPAN
></A
></A
> and
> and
<A
<A
HREF="ref.no-define.html"
HREF="ref.no-define.html"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>no_define</SPAN
>no_define</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.default-value.html"
HREF="ref.default-value.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.define-format.html"
HREF="ref.define-format.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"
><SPAN
><SPAN
CLASS="PROPERTY"
CLASS="PROPERTY"
>default_value</SPAN
>default_value</SPAN
></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"
>define_format</SPAN
>define_format</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.