Fork of official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.

Dependents:   Final_Coffee_Roaster

Fork of mbed-rtos by mbed official

Committer:
emilmont
Date:
Fri Nov 23 09:57:31 2012 +0000
Revision:
6:350b53afb889
Child:
31:015df9e602b6
Merge RTOS C++ API and RTX under the same library; Update RTX to version 4.60; Add proper Thread destructor;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
emilmont 6:350b53afb889 1 /*----------------------------------------------------------------------------
emilmont 6:350b53afb889 2 * RL-ARM - RTX
emilmont 6:350b53afb889 3 *----------------------------------------------------------------------------
emilmont 6:350b53afb889 4 * Name: RT_TASK.H
emilmont 6:350b53afb889 5 * Purpose: Task functions and system start up.
emilmont 6:350b53afb889 6 * Rev.: V4.60
emilmont 6:350b53afb889 7 *----------------------------------------------------------------------------
emilmont 6:350b53afb889 8 *
emilmont 6:350b53afb889 9 * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH
emilmont 6:350b53afb889 10 * All rights reserved.
emilmont 6:350b53afb889 11 * Redistribution and use in source and binary forms, with or without
emilmont 6:350b53afb889 12 * modification, are permitted provided that the following conditions are met:
emilmont 6:350b53afb889 13 * - Redistributions of source code must retain the above copyright
emilmont 6:350b53afb889 14 * notice, this list of conditions and the following disclaimer.
emilmont 6:350b53afb889 15 * - Redistributions in binary form must reproduce the above copyright
emilmont 6:350b53afb889 16 * notice, this list of conditions and the following disclaimer in the
emilmont 6:350b53afb889 17 * documentation and/or other materials provided with the distribution.
emilmont 6:350b53afb889 18 * - Neither the name of ARM nor the names of its contributors may be used
emilmont 6:350b53afb889 19 * to endorse or promote products derived from this software without
emilmont 6:350b53afb889 20 * specific prior written permission.
emilmont 6:350b53afb889 21 *
emilmont 6:350b53afb889 22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
emilmont 6:350b53afb889 23 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
emilmont 6:350b53afb889 24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
emilmont 6:350b53afb889 25 * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
emilmont 6:350b53afb889 26 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
emilmont 6:350b53afb889 27 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
emilmont 6:350b53afb889 28 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
emilmont 6:350b53afb889 29 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
emilmont 6:350b53afb889 30 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
emilmont 6:350b53afb889 31 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
emilmont 6:350b53afb889 32 * POSSIBILITY OF SUCH DAMAGE.
emilmont 6:350b53afb889 33 *---------------------------------------------------------------------------*/
emilmont 6:350b53afb889 34
emilmont 6:350b53afb889 35 /* Definitions */
emilmont 6:350b53afb889 36 #define __CMSIS_RTOS 1
emilmont 6:350b53afb889 37
emilmont 6:350b53afb889 38 /* Values for 'state' */
emilmont 6:350b53afb889 39 #define INACTIVE 0
emilmont 6:350b53afb889 40 #define READY 1
emilmont 6:350b53afb889 41 #define RUNNING 2
emilmont 6:350b53afb889 42 #define WAIT_DLY 3
emilmont 6:350b53afb889 43 #define WAIT_ITV 4
emilmont 6:350b53afb889 44 #define WAIT_OR 5
emilmont 6:350b53afb889 45 #define WAIT_AND 6
emilmont 6:350b53afb889 46 #define WAIT_SEM 7
emilmont 6:350b53afb889 47 #define WAIT_MBX 8
emilmont 6:350b53afb889 48 #define WAIT_MUT 9
emilmont 6:350b53afb889 49
emilmont 6:350b53afb889 50 /* Return codes */
emilmont 6:350b53afb889 51 #define OS_R_TMO 0x01
emilmont 6:350b53afb889 52 #define OS_R_EVT 0x02
emilmont 6:350b53afb889 53 #define OS_R_SEM 0x03
emilmont 6:350b53afb889 54 #define OS_R_MBX 0x04
emilmont 6:350b53afb889 55 #define OS_R_MUT 0x05
emilmont 6:350b53afb889 56
emilmont 6:350b53afb889 57 #define OS_R_OK 0x00
emilmont 6:350b53afb889 58 #define OS_R_NOK 0xff
emilmont 6:350b53afb889 59
emilmont 6:350b53afb889 60 /* Variables */
emilmont 6:350b53afb889 61 extern struct OS_TSK os_tsk;
emilmont 6:350b53afb889 62 extern struct OS_TCB os_idle_TCB;
emilmont 6:350b53afb889 63
emilmont 6:350b53afb889 64 /* Functions */
emilmont 6:350b53afb889 65 extern void rt_switch_req (P_TCB p_new);
emilmont 6:350b53afb889 66 extern void rt_dispatch (P_TCB next_TCB);
emilmont 6:350b53afb889 67 extern void rt_block (U16 timeout, U8 block_state);
emilmont 6:350b53afb889 68 extern void rt_tsk_pass (void);
emilmont 6:350b53afb889 69 extern OS_TID rt_tsk_self (void);
emilmont 6:350b53afb889 70 extern OS_RESULT rt_tsk_prio (OS_TID task_id, U8 new_prio);
emilmont 6:350b53afb889 71 extern OS_RESULT rt_tsk_delete (OS_TID task_id);
emilmont 6:350b53afb889 72 extern void rt_sys_init (void);
emilmont 6:350b53afb889 73 extern void rt_sys_start (void);