Clone of mbed rtos 2 for easy accessibility.
Fork of mbed-rtos by
rtx/TARGET_CORTEX_M/rt_OsEventObserver.h@118:6635230e06ba, 2016-07-25 (annotated)
- Committer:
- Kojto
- Date:
- Mon Jul 25 14:12:24 2016 +0100
- Revision:
- 118:6635230e06ba
- Child:
- 123:58563e6cba1e
RTOS rev118
Compatible with the mbed library v122
Changes:
- warnings about duplicated CM symbols fix
- init sequence update - allows init array to be run prior kernel start
- RTOS with OS_TIMERS=0 fix for thread id
- Thread ctor is deprecated, use start() method
- main stack fix for IAR (set via linker script)
- add TCB context pointer
- provide thread safety for toolchains (std lib locks)
- add MBED_RTOS_SINGLE_THREAD macro (sets TSKCNT to 1 and TIMERS to 0)
- nrf51, nucleo l423kc, nucleo f767zi, nucleo f446ze, efm32 support addition
- add OSObserver function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Kojto | 118:6635230e06ba | 1 | /*---------------------------------------------------------------------------- |
Kojto | 118:6635230e06ba | 2 | * CMSIS-RTOS - RTX |
Kojto | 118:6635230e06ba | 3 | *---------------------------------------------------------------------------- |
Kojto | 118:6635230e06ba | 4 | * Name: os_events.h |
Kojto | 118:6635230e06ba | 5 | * Purpose: OS Event Callbacks for CMSIS RTOS |
Kojto | 118:6635230e06ba | 6 | * Rev.: VX.XX |
Kojto | 118:6635230e06ba | 7 | *---------------------------------------------------------------------------- |
Kojto | 118:6635230e06ba | 8 | * |
Kojto | 118:6635230e06ba | 9 | * Copyright (c) 1999-2009 KEIL, 2009-2016 ARM Germany GmbH |
Kojto | 118:6635230e06ba | 10 | * All rights reserved. |
Kojto | 118:6635230e06ba | 11 | * Redistribution and use in source and binary forms, with or without |
Kojto | 118:6635230e06ba | 12 | * modification, are permitted provided that the following conditions are met: |
Kojto | 118:6635230e06ba | 13 | * - Redistributions of source code must retain the above copyright |
Kojto | 118:6635230e06ba | 14 | * notice, this list of conditions and the following disclaimer. |
Kojto | 118:6635230e06ba | 15 | * - Redistributions in binary form must reproduce the above copyright |
Kojto | 118:6635230e06ba | 16 | * notice, this list of conditions and the following disclaimer in the |
Kojto | 118:6635230e06ba | 17 | * documentation and/or other materials provided with the distribution. |
Kojto | 118:6635230e06ba | 18 | * - Neither the name of ARM nor the names of its contributors may be used |
Kojto | 118:6635230e06ba | 19 | * to endorse or promote products derived from this software without |
Kojto | 118:6635230e06ba | 20 | * specific prior written permission. |
Kojto | 118:6635230e06ba | 21 | * |
Kojto | 118:6635230e06ba | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Kojto | 118:6635230e06ba | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Kojto | 118:6635230e06ba | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
Kojto | 118:6635230e06ba | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
Kojto | 118:6635230e06ba | 26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
Kojto | 118:6635230e06ba | 27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
Kojto | 118:6635230e06ba | 28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
Kojto | 118:6635230e06ba | 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
Kojto | 118:6635230e06ba | 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
Kojto | 118:6635230e06ba | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
Kojto | 118:6635230e06ba | 32 | * POSSIBILITY OF SUCH DAMAGE. |
Kojto | 118:6635230e06ba | 33 | *---------------------------------------------------------------------------*/ |
Kojto | 118:6635230e06ba | 34 | #ifndef _RT_OS_EVENT_OBSERVER_H |
Kojto | 118:6635230e06ba | 35 | #define _RT_OS_EVENT_OBSERVER_H |
Kojto | 118:6635230e06ba | 36 | |
Kojto | 118:6635230e06ba | 37 | #include <stdint.h> |
Kojto | 118:6635230e06ba | 38 | |
Kojto | 118:6635230e06ba | 39 | #ifdef __cplusplus |
Kojto | 118:6635230e06ba | 40 | extern "C" { |
Kojto | 118:6635230e06ba | 41 | #endif |
Kojto | 118:6635230e06ba | 42 | |
Kojto | 118:6635230e06ba | 43 | typedef struct { |
Kojto | 118:6635230e06ba | 44 | uint32_t version; |
Kojto | 118:6635230e06ba | 45 | void (*pre_start)(void); |
Kojto | 118:6635230e06ba | 46 | void *(*thread_create)(int thread_id, void *context); |
Kojto | 118:6635230e06ba | 47 | void (*thread_destroy)(void *context); |
Kojto | 118:6635230e06ba | 48 | void (*thread_switch)(void *context); |
Kojto | 118:6635230e06ba | 49 | } OsEventObserver; |
Kojto | 118:6635230e06ba | 50 | extern const OsEventObserver *osEventObs; |
Kojto | 118:6635230e06ba | 51 | |
Kojto | 118:6635230e06ba | 52 | void osRegisterForOsEvents(const OsEventObserver *observer); |
Kojto | 118:6635230e06ba | 53 | |
Kojto | 118:6635230e06ba | 54 | #ifdef __cplusplus |
Kojto | 118:6635230e06ba | 55 | }; |
Kojto | 118:6635230e06ba | 56 | #endif |
Kojto | 118:6635230e06ba | 57 | |
Kojto | 118:6635230e06ba | 58 | #endif |