00001 /* 00002 * Copyright (c) 2004-2006, Dennis Kuschel. 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * 1. Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * 2. Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * 3. The name of the author may not be used to endorse or promote 00015 * products derived from this software without specific prior written 00016 * permission. 00017 * 00018 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 00019 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 00020 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00021 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 00022 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00023 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00024 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00025 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 00026 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00027 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 00028 * OF THE POSSIBILITY OF SUCH DAMAGE. 00029 * 00030 */ 00031 00032 00045 #ifndef _PORT_H 00046 #define _PORT_H 00047 00048 00049 /*--------------------------------------------------------------------------- 00050 * ARCHITECTURE / CPU SPECIFIC SETTINGS 00051 *-------------------------------------------------------------------------*/ 00052 00073 #define MVAR_t char 00074 00082 #define MVAR_BITS 8 /* = (sizeof(MVAR_t) * 8) */ 00083 00091 #define MPTR_t long 00092 00101 #define POSCFG_ALIGNMENT 2 00102 00111 #define POSCFG_ISR_INTERRUPTABLE 0 00112 00137 #define POSCFG_TASKSTACKTYPE 0 00138 00144 #define POSCFG_CALLINITARCH 1 00145 00152 #define POSCFG_DYNAMIC_MEMORY 0 00153 00165 #define POSCFG_DYNAMIC_REFILL 0 00166 00174 #define POS_MEM_ALLOC(bytes) nosMemAlloc(bytes) 00175 00180 /*--------------------------------------------------------------------------- 00181 * LOCKING (DISABLE INTERRUPTS IN CRITICAL SECTIONS) 00182 *-------------------------------------------------------------------------*/ 00183 00231 #define POSCFG_LOCK_USEFLAGS 0 00232 00241 #define POSCFG_LOCK_FLAGSTYPE register VAR_t 00242 00250 #ifdef GCC 00251 #define POS_SCHED_LOCK asm volatile("pushf\n" "cli\n"::) 00252 #else 00253 #define POS_SCHED_LOCK asm { PUSHF; CLI } 00254 #endif 00255 00260 #ifdef GCC 00261 #define POS_SCHED_UNLOCK asm volatile("popf\n"::) 00262 #else 00263 #define POS_SCHED_UNLOCK asm POPF 00264 #endif 00265 00280 #define POS_IRQ_DISABLE_ALL POS_SCHED_LOCK 00281 00286 #define POS_IRQ_ENABLE_ALL POS_SCHED_UNLOCK 00287 00292 /*--------------------------------------------------------------------------- 00293 * FINDBIT - DEFINITIONS FOR GENERIC FILE fbit_gen.c 00294 *-------------------------------------------------------------------------*/ 00295 00328 #define POSCFG_FBIT_USE_LUTABLE 0 00329 00335 #define POSCFG_FBIT_BITSHIFT 1 00336 00341 /*--------------------------------------------------------------------------- 00342 * PORT DEPENDENT NANO LAYER CONFIGURATION 00343 *-------------------------------------------------------------------------*/ 00344 00357 #define NOSCFG_STACK_GROWS_UP 0 00358 00363 #define NOSCFG_DEFAULT_STACKSIZE 2048 00364 00368 #define NOSCFG_CONOUT_HANDSHAKE 0 00369 00377 #define NOSCFG_CONOUT_FIFOSIZE 256 00378 00383 /*--------------------------------------------------------------------------- 00384 * USER DEFINED CONTENT OF TASK ENVIRONMENT 00385 *-------------------------------------------------------------------------*/ 00386 00387 #if DOX!=0 00388 00393 #define POS_USERTASKDATA void *stackptr; 00394 #else 00395 00396 /* Here is an example for different memory handling types: 00397 */ 00398 00399 #if POSCFG_TASKSTACKTYPE == 0 00400 00401 #define POS_USERTASKDATA \ 00402 void *stackptr; 00403 00404 #elif POSCFG_TASKSTACKTYPE == 1 00405 00406 #define POS_USERTASKDATA \ 00407 void *stackptr; \ 00408 void *stackroot; 00409 00410 #elif POSCFG_TASKSTACKTYPE == 2 00411 00412 #define FIXED_STACK_SIZE 0x0600 00413 #define POS_USERTASKDATA \ 00414 void *stackptr; \ 00415 unsigned short stack[FIXED_STACK_SIZE]; 00416 00417 #endif 00418 00419 #endif /* DOX */ 00420 00421 #endif /* _PORT_H */
1.4.6-NO