📄 uitron.h
字号:
#ifndef CYGONCE_PKGCONF_UITRON_H#define CYGONCE_PKGCONF_UITRON_H//===========================================================================//// pkgconf/uitron.h//// uITRON configuration file////===========================================================================//####COPYRIGHTBEGIN####//// -------------------------------------------// The contents of this file are subject to the Cygnus eCos Public License// Version 1.0 (the "License"); you may not use this file except in// compliance with the License. You may obtain a copy of the License at// http://sourceware.cygnus.com/ecos// // Software distributed under the License is distributed on an "AS IS"// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the// License for the specific language governing rights and limitations under// the License.// // The Original Code is eCos - Embedded Cygnus Operating System, released// September 30, 1998.// // The Initial Developer of the Original Code is Cygnus. Portions created// by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved.// -------------------------------------------////####COPYRIGHTEND####//===========================================================================//#####DESCRIPTIONBEGIN####//// Author(s): hmt// Contributors: hmt// Date: 1998-03-16// Purpose: uITRON configuration file// Description: ////####DESCRIPTIONEND####////===========================================================================// The layout of the uITRON Compatibility layer source code is documented in// .../<REPOSITORY>/compat/uitron/<VERSION>/include/uit_func.h// First get external global configuration in force:#include <pkgconf/kernel.h>// The basic question: is the uITRON package provided at all?#ifdef CYGPKG_UITRON/* --------------------------------------------------------------------- * Define an overall package for the UITRON Compatibility layer. Then * create additional packages for the various different UITRON's currently * available. * * Thought: Can we get a real 'mu' out of this in uITRON throughout? * It's \265 in C strings, in iso_8859_1 * * * {{CFG_DATA cdl_package CYGPKG_UITRON { display "eCos uITRON compatibility layer" type boolean requires CYGPKG_KERNEL description "eCos supports a uITRON Compatibility Layer, providing full Level S (Standard) compliance with Version 3.02 of the uITRON Standard, plus many Level E (Extended) features. uITRON is the premier Japanese embedded RTOS standard." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */// ------------------------------------------------------------------------// Conformance check// ------------------------------------------------------------------------/* {{CFG_DATA cdl_option CYGIMP_UITRON_STRICT_CONFORMANCE { display "Check strict uITRON standards conformance" parent CYGPKG_UITRON type radio description "Require the rest of the system configuration to match the needs of strict uITRON standards conformance. This option can only be set if the rest of the system is configured correctly for uITRON semantics, for example there must be a realtime clock, a suitable scheduler, and no timeslicing. Of course a system without this selected can be completely conformant; this is here to help you check." doc ref/ecos-ref/micro-itron-api.html requires CYGVAR_KERNEL_COUNTERS_CLOCK requires CYGSEM_KERNEL_SCHED_MLQUEUE requires !CYGSEM_KERNEL_SCHED_TIMESLICE requires CYGFUN_KERNEL_THREADS_TIMER } cdl_option CYGIMP_UITRON_LOOSE_CONFORMANCE { display "System configuration overrides uITRON" parent CYGPKG_UITRON type radio description "Do not require the rest of the system configuration to match the needs of strict uITRON standards conformance. For example a bitmap scheduler, or timeslicing, can be used with the uITRON functions, but such an environment is not strictly conformant with the uITRON specification. Of course a system with this selected can be completely conformant; but it is up to you to configure it correctly." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */#undef CYGIMP_UITRON_STRICT_CONFORMANCE#define CYGIMP_UITRON_LOOSE_CONFORMANCE // ------------------------------------------------------------------------// uITRON FUNCTION CALLS// ------------------------------------------------------------------------// If compiling with a C++ compiler, uITRON functions can be inline:// define this to make it so./* {{CFG_DATA cdl_option CYGIMP_UITRON_INLINE_FUNCS { display "Inline functions" parent CYGPKG_UITRON type boolean description "If compiling your application with a C++ compiler, uITRON functions can be inline: set this to make it so. Inlining functions often increases execution speed, though possibly at the cost of a larger executable, depending on what functions are used. Do NOT set this if compiling your application in plain C." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */#undef CYGIMP_UITRON_INLINE_FUNCS// If not using inline functions, then uITRON functions are out-of-line; by// default they have plain 'C' linkage ie. their names are extern 'C' in// the C++ world and unadorned in the C world. To give them C++ names (NOT// useable by plain 'C' programs), define this:/* {{CFG_DATA cdl_option CYGIMP_UITRON_CPP_OUTLINE_FUNCS { display "C++ function names" parent CYGPKG_UITRON type boolean description "If compiling your application with a C++ compiler, uITRON functions can be given C++ style mangled names: set this to make it so. This option may make debugging your program easier, depending on your development environment. Do NOT set this if compiling your application in plain C." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */#undef CYGIMP_UITRON_CPP_OUTLINE_FUNCS// When an application is fully debugged it might be useful to remove the// code which checks parameters in the uITRON function calls. To use// asserts [CYG_ASSERT()] instead - which are compiled to nothing in// release flavored builds - define this:/* {{CFG_DATA cdl_option CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS { display "Return error codes for bad params" parent CYGPKG_UITRON type boolean description "When an application is fully debugged there is no need to check for bad parameters on every system call, for those parameters which are typically pointers or constants. Removing the checking code saves space and improves performance: set this to make it so. When this option is set, the correctness of parameters is asserted using CYG_ASSERT() which compiles to nothing in a non-debug configuration." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */#define CYGSEM_UITRON_BAD_PARAMS_RETURN_ERRORS// By default both C's NULL and uITRON's NADR are treated as bad addresses;// but some controllers might have memory at address zero, and want to use// it. In that case, prevent NULL being bounced by enabling this:/* {{CFG_DATA cdl_option CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR { display "NULL is a good pointer" parent CYGPKG_UITRON type boolean description "uITRON deliberately defines the constant NADR (-1) for use as an invalid memory address. The value -1 is chosen to allow working in microcontrollers which have real memory at address zero, the traditional 'C' NULL pointer. By default, uITRON functions check for both NULL and NADR as bad addresses: set this option to prevent checking for NULL and allow pointers to address zero to be used." doc ref/ecos-ref/micro-itron-api.html } }}CFG_DATA */#undef CYGSEM_UITRON_PARAMS_NULL_IS_GOOD_PTR// ------------------------------------------------------------------------// uITRON KERNEL OBJECTS// ------------------------------------------------------------------------// First, simple synchronisation objects without complex initialization:// semaphores, message or mail boxes and flags. Declare how many of each// will exist in the system. They will be statically created with default// initialization, ready for use. Their IDs in the uITRON sense are from 1// to the value of the appropriate symbol below:/* {{CFG_DATA cdl_component CYGPKG_UITRON_SEMAS { display "Semaphores" type boolean parent CYGPKG_UITRON description "uITRON Semaphore objects are used with functions named xxx_sem(); they support traditional semaphore semantics." } cdl_option CYGNUM_UITRON_SEMAS { display "Number of semaphores" parent CYGPKG_UITRON_SEMAS type count legal_values 1 to 65535 description "The number of uITRON semaphores present in the system. Valid semaphore object IDs will range from 1 to this value." } cdl_component CYGPKG_UITRON_SEMAS_CREATE_DELETE { display "Support create and delete" parent CYGPKG_UITRON_SEMAS type boolean description "Support semaphore create and delete operations (cre_sem, del_sem). Otherwise all semaphores are created, up to the number specified above." } cdl_option CYGNUM_UITRON_SEMAS_INITIALLY { display "Number of semaphores created initially" parent CYGPKG_UITRON_SEMAS_CREATE_DELETE type count legal_values 0 to 65535 description "The number of uITRON semaphores initially created. This number should not be more than the number of semaphores in the system, though setting it to a large value to mean 'all' is acceptable. Initially, only semaphores numbered 1 to this number exist; higher numbered ones must be created before use. It is only useful to initialize semaphores up to this number; higher numbered ones must be created in order to use them, and so they will be re-initialized." } cdl_component CYGPKG_UITRON_SEMAS_ARE_INITIALIZED { display "Initialize semaphore counts" parent CYGPKG_UITRON_SEMAS type boolean description "Initialize semaphores to specific count values. Otherwise semaphores are initialized with the count set to zero." } cdl_option CYGDAT_UITRON_SEMA_INITIALIZERS { display "Static initializers" parent CYGPKG_UITRON_SEMAS_ARE_INITIALIZED type multiline description "A list of initializers separated by commas, one per line. An initializer is 'CYG_UIT_SEMA(INITIAL-COUNT)' or 'CYG_UIT_SEMA_NOEXS' for slots above the number initially to be created, when create and delete operations are supported. Note: this option is invoked in the context of a C++ array initializer, between curly brackets. Ensure that the number of initializers here exactly matches the total number of semaphores specified." } }}CFG_DATA */// Counting Semaphores: xxx_sem() ops in uITRON.#define CYGPKG_UITRON_SEMAS#define CYGNUM_UITRON_SEMAS 3#undef CYGPKG_UITRON_SEMAS_ARE_INITIALIZED// Optionally initialize in terms of CYG_UIT_SEMA( initial_count ):#ifdef CYGPKG_UITRON_SEMAS#ifdef CYGPKG_UITRON_SEMAS_ARE_INITIALIZED#if 0 < CYGNUM_UITRON_SEMAS#define CYGDAT_UITRON_SEMA_INITIALIZERS \ CYG_UIT_SEMA( 0 ), \ CYG_UIT_SEMA( 0 ), \ CYG_UIT_SEMA( 0 )#endif#endif // CYGPKG_UITRON_SEMAS_ARE_INITIALIZED#define CYGPKG_UITRON_SEMAS_CREATE_DELETE#ifdef CYGPKG_UITRON_SEMAS_CREATE_DELETE#define CYGNUM_UITRON_SEMAS_INITIALLY 3#endif // CYGPKG_UITRON_SEMAS_CREATE_DELETE#endif // CYGPKG_UITRON_SEMAS/* {{CFG_DATA cdl_component CYGPKG_UITRON_MBOXES { display "Mailboxes" type boolean parent CYGPKG_UITRON description "uITRON Mailbox objects are used with functions named xxx_msg() and xxx_mbx(); they support passing addresses (of 'messages') between tasks in a safe manner." } cdl_option CYGNUM_UITRON_MBOXES { display "Number of mailboxes" parent CYGPKG_UITRON_MBOXES type count legal_values 1 to 65535 description "The number of uITRON mailboxes present in the system. Valid mailbox object IDs will range from 1 to this value." } cdl_component CYGPKG_UITRON_MBOXES_CREATE_DELETE { display "Support create and delete" parent CYGPKG_UITRON_MBOXES type boolean description "Support mailbox create and delete operations (cre_mbx, del_mbx). Otherwise all mailboxes are created, up to the number specified above." } cdl_option CYGNUM_UITRON_MBOXES_INITIALLY { display "Number of mailboxes created initially" parent CYGPKG_UITRON_MBOXES_CREATE_DELETE type count legal_values 0 to 65535 description "The number of uITRON mailboxes initially created. This number should not be more than the number of mailboxes in the system, though setting it to a large value to mean 'all' is acceptable. Initially, only mailboxes numbered 1 to this number exist; higher numbered ones must be created before use." } }}CFG_DATA */// Message Boxes: xxx_msg() ops in uITRON.#define CYGPKG_UITRON_MBOXES#define CYGNUM_UITRON_MBOXES 4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -