1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >µITRON and eCos</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
23 HREF="compat-uitron-microitron-api.html"><LINK
26 HREF="compat-uitron-microitron-api.html"><LINK
28 TITLE="Task Management Functions"
29 HREF="compat-uitron-task-management-functions.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="compat-uitron-microitron-api.html"
65 >Chapter 32. µITRON API</TD
71 HREF="compat-uitron-task-management-functions.html"
85 NAME="COMPAT-UITRON-OVER-ECOS">µITRON and <SPAN
99 > kernel implements the functionality
100 used by the µITRON compatibility subsystem.
101 The configuration of the kernel influences the behavior of µITRON
104 >In particular, the default configuration has time slicing
105 (also known as round-robin scheduling) switched on; this means that
106 a task can be moved from <TT
113 > state at any time, in
114 order that one of its peers may run. This is not strictly conformant
115 to the µITRON specification, which
116 states that timeslicing may be implemented by periodically issuing
121 within a periodic task or cyclic handler; otherwise it is expected
122 that a task runs until it is pre-empted in consequence of synchronization
123 or communication calls it makes, or the effects of an interrupt
124 or other external event on a higher priority task cause that task
128 >. To disable timeslicing
129 functionality in the kernel and µITRON
130 compatibility environment, please disable the
133 >CYGSEM_KERNEL_SCHED_TIMESLICE</TT
135 configuration option in the kernel package. A description of kernel
137 HREF="kernel-overview.html"
141 >For another example, the semantics of task queueing when waiting
142 on a synchronization object depend solely on the way the underlying
143 kernel is configured. As discussed above, the multi-level queue
144 scheduler is the only one which is µITRON
145 compliant, and it queues waiting tasks in FIFO order. Future releases
146 of that scheduler might be configurable to support priority ordering
147 of task queues. Other schedulers might be different again: for example
148 the bitmap scheduler can be used with the µITRON
149 compatibility layer, even though it only allows one task at each
150 priority and as such is not µITRON
151 compliant, but it supports only priority ordering of task queues.
152 So which queueing scheme is supported is not really a property of
153 the µITRON compatibility layer; it
154 depends on the kernel. </P
156 >In this version of the µITRON
157 compatibility layer, the calls to disable and enable scheduling
173 call underlying kernel functions; in particular, the <TT
177 lock the scheduler entirely, which prevents dispatching of DSRs; functions
178 implemented by DSRs include clock counters and alarm timers. Thus time “stops” while
179 dispatching is disabled with <TT
184 >Like all parts of the <SPAN
191 detailed semantics of the µITRON layer
192 are dependent on its configuration and the configuration of other components
193 that it uses. The µITRON configuration
194 options are all defined in the file <TT
196 >pkgconf/uitron.h</TT
198 and can be set using the configuration tool or editing the
203 file in your build directory by hand. </P
205 >An important configuration option for the µITRON
206 compatibility layer is “Option: Return Error Codes for Bad Params”
210 >CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS</TT
212 ), which allows a lot of the error
213 checking code in the µITRON compatibility layer to
214 be removed. Of course this leaves a program open to undetected errors,
215 so it should only be used once an application is fully debugged and
216 tested. Its benefits include reduced code size and faster execution.
217 However, it affects the API significantly, in that with this option
218 enabled, bad calls do not return errors, but cause an assert
219 failure (if that is itself enabled) or malfunction internally. There
220 is discussion in more detail about this in each section below.</P
222 >We now give a brief description of the µITRON
223 functions which are implemented in this release. Note that all C
224 and C++ source files should have the following <TT
235 CLASS="PROGRAMLISTING"
236 >#include <cyg/compat/uitron/uit_func.h></PRE
246 SUMMARY="Footer navigation table"
257 HREF="compat-uitron-microitron-api.html"
275 HREF="compat-uitron-task-management-functions.html"
285 >µITRON API</TD
291 HREF="compat-uitron-microitron-api.html"
299 >Task Management Functions</TD