//**************************************************************************** /* F i l e D a t a /* /* Module : BasicSW /* C.I. No. : /* $Revision: 1.11 $ /* $Date: 2005/03/10 11:34:20 $ /* Belonging to : /* : /* $RCSfile: OS_rtems_p.c,v $ /* Program Type : /* Sub-modules : /* /**************************************************************************** /* S W D e v e l o p m e n t E n v i r o n m e n t /* /* Host system : /* SW Compiler : /* $Author: faber $ /* : /**************************************************************************** /* U p d a t i n g /* /* $Log: OS_rtems_p.c,v $ /* Revision 1.11 2005/03/10 11:34:20 faber /* tmacros include excluded /* /* Revision 1.10 2005/02/24 16:44:59 sebastiani /* uncomment log info loading /* /* Revision 1.9 2005/02/21 08:58:28 sebastiani /* all log comments completed /* /* Revision 1.8 2004/11/10 16:59:58 sebastiani /* - GS_COMPILE directive introduced and be undef by default /* - automatic flush mechanism by run manager mailbox timeout /* /* Revision 1.7 2004/09/17 15:01:00 faber /* LU_INFN_LOG flags fixing /* /* Revision 1.6 2004/08/26 16:53:56 sebastiani /* fix some bug /* /* Revision 1.5 2004/05/12 08:10:11 faber /* *** empty log message *** /* /* Revision 1.4 2004/03/09 09:39:27 faber /* LU_TRACE system introduced /* /* Revision 1.3 2003/11/20 10:24:46 faber /* - interrupt_is_in_progress check inside the OS_Obtain /* - CM_RETURN_CODE type starting from RTEMS_STATUS_CODES_LAST, in order to have a unique error space coding /* /* Revision 1.2 2003/10/21 16:09:12 alfarano /* LU_LOG_INFN replacement for all remaining original log functions /* /* Revision 1.1.1.1 2003/08/04 09:40:21 sebastiani /* Imported sources laben rel. 19.06.2003 integrated with pam2 /* /* Revision 1.4 2003/08/01 09:46:36 sebastiani /* *** empty log message *** /* /* Revision 1.3 2003/07/25 10:30:17 sebastiani /* bug fix semaphore creation and mailbox creation /* /* Revision 1.2 2003/07/03 12:39:29 sebastiani /* *** empty log message *** /* /* Revision 1.1.1.1 2003/05/27 08:13:24 wizard /* Import of the Official Laben CD Release Software as the pamela-EM_delivery_20030521_1454.tar.bz2 /* /* Revision 1.5 2002/11/14 09:45:56 zulia /* removed unsed status variable /* /* Revision 1.4 2002/05/09 08:16:34 zulia /* * acceptance release /* /* /*****************************************************************************/ /*============================= Include File ================================*/ //#include #include #include #include #include #define __FILEID__ _OS_rtems_p__c #include #include #include LU_DECL_MASK(); #ifdef TEST_I #include #endif #include /*****************************************************************************/ /*==================== RTEMS configuration variables ========================*/ /*****************************************************************************/ /* @Variable: Task_id */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS tasks identification. */ /* @@ */ /*****************************************************************************/ static rtems_id Task_id [MAX_TASK]; /*****************************************************************************/ /* @Variable: Task_name */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS tasks name. */ /* @@ */ /*****************************************************************************/ static rtems_name Task_name [MAX_TASK]; /*****************************************************************************/ /* @Variable: Msg_id */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS mailboxes identification. */ /* @@ */ /*****************************************************************************/ static rtems_id Msg_id [MAX_MBOX]; /*****************************************************************************/ /* @Variable: Msg_name */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS mailboxes name. */ /* @@ */ /*****************************************************************************/ static rtems_name Msg_name [MAX_MBOX]; /*****************************************************************************/ /* @Variable: Sem_id */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS semaphores identification. */ /* @@ */ /*****************************************************************************/ static rtems_id Sem_id [MAX_RES]; /*****************************************************************************/ /* @Variable: Sem_name */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS semaphores name. */ /* @@ */ /*****************************************************************************/ static rtems_name Sem_name [MAX_RES]; /*****************************************************************************/ /* @Variable: Part_id */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS patitios identification. */ /* @@ */ /*****************************************************************************/ static rtems_id Part_id [MAX_PART]; /*****************************************************************************/ /* @Variable: Part_name */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS patitios name. */ /* @@ */ /*****************************************************************************/ static rtems_name Part_name [MAX_PART]; /*****************************************************************************/ /* @Variable: Tim_id */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS timers identification. */ /* @@ */ /*****************************************************************************/ static rtems_id Tim_id [MAX_TIM]; /*****************************************************************************/ /* @Variable: Tim_name */ /* @Purpose : */ /* Array of retems_id */ /* RTEMS timers name. */ /* @@ */ /*****************************************************************************/ static rtems_name Tim_name [MAX_TIM]; /*****************************************************************************/ /* @Variable: MA_Partition */ /* @Purpose : */ /* Array of rtems_unsigned32 */ /* MCMD area patition. */ /* @@ */ /*****************************************************************************/ static rtems_unsigned32 MA_Partition [TOTAL_MCMD_PART]; /* for debugging : */ #ifdef DEBUG #define OS_MAX_PARTITIONS_STORE 1024 static BYTE *max_partitions_store [OS_MAX_PARTITIONS_STORE]; #endif /*****************************************************************************/ /*============ R T E M S P R O V I D E D I N T E R F A C E =============*/ /*****************************************************************************/ /* @Function: OS_piInitOS */ /* @Purpose : */ /* Initialization of the Operating System global resources. */ /* All Task, mailboxes, semaphores, partitons, timers are created and */ /* allocated. RTEMS directives are called for resources creation. */ /* */ /* @@ */ /* @Parameter Name @Mode @Description */ /* IN */ /* status_code OUT Return code */ /* @@ */ /*****************************************************************************/ status_code OS_piInitOS(void) { rtems_status_code status; rtems_time_of_day time; rtems_unsigned32 tmpPart; unsigned long statusRc; unsigned int i; unsigned char c; status =SUCCESSFUL; statusRc =SUCCESSFUL; /*===========================================================================*/ /*==== TASKS CREATION ========================*/ for (i=1,c='A'; i