Skip to content

Commit

Permalink
5.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantum Leaps committed Oct 10, 2015
1 parent b962026 commit b49c739
Show file tree
Hide file tree
Showing 132 changed files with 11,940 additions and 6,470 deletions.
20 changes: 9 additions & 11 deletions 3rd_party/CMSIS-RTX/INC/RTX_CM_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*----------------------------------------------------------------------------
* Name: RTX_CM_LIB.H
* Purpose: RTX Kernel System Configuration
* Rev.: V4.77
* Rev.: V4.79
*----------------------------------------------------------------------------
*
* Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
Expand Down Expand Up @@ -62,7 +62,7 @@ typedef uint32_t OS_RESULT;

#define runtask_id() rt_tsk_self()
#define mutex_init(m) rt_mut_init(m)
#define mutex_wait(m) os_mut_wait(m,0xFFFF)
#define mutex_wait(m) os_mut_wait(m,0xFFFFU)
#define mutex_rel(m) os_mut_release(m)

extern uint8_t os_running;
Expand Down Expand Up @@ -119,7 +119,7 @@ uint8_t const os_flags = OS_RUNPRIV;
__USED uint32_t const CMSIS_RTOS_API_Version = osCMSIS;
__USED uint32_t const CMSIS_RTOS_RTX_Version = osCMSIS_RTX;
__USED uint32_t const os_clockrate = OS_TICK;
__USED uint32_t const os_timernum = 0;
__USED uint32_t const os_timernum = 0U;

/* Memory pool for TCB allocation */
_declare_box (mp_tcb, OS_TCB_SIZE, OS_TASK_CNT);
Expand Down Expand Up @@ -154,14 +154,14 @@ osMessageQId osMessageQId_osTimerMessageQ;
#else
osThreadDef_t os_thread_def_osTimerThread = { NULL };
osThreadId osThreadId_osTimerThread;
osMessageQDef(osTimerMessageQ, 0, void *);
osMessageQDef(osTimerMessageQ, 0U, void *);
osMessageQId osMessageQId_osTimerMessageQ;
#endif

/* Legacy RTX User Timers not used */
uint32_t os_tmr = 0;
uint32_t os_tmr = 0U;
uint32_t const *m_tmr = NULL;
uint16_t const mp_tmr_size = 0;
uint16_t const mp_tmr_size = 0U;

#if defined (__CC_ARM) && !defined (__MICROLIB)
/* A memory space for arm standard library. */
Expand Down Expand Up @@ -198,8 +198,8 @@ void *__user_perthread_libspace (void) {
/* Provide a separate libspace for each task. */
uint32_t idx;

idx = os_running ? runtask_id () : 0;
if (idx == 0) {
idx = (os_running != 0U) ? runtask_id () : 0U;
if (idx == 0U) {
/* RTX not running yet. */
return (&__libspace_start);
}
Expand Down Expand Up @@ -251,7 +251,7 @@ __attribute__((used)) void _mutex_release (OS_ID *mutex) {

/* Main Thread definition */
extern int main (void);
osThreadDef_t os_thread_def_main = {(os_pthread)main, osPriorityNormal, 1, 4*OS_MAINSTKSIZE };
osThreadDef_t os_thread_def_main = {(os_pthread)main, osPriorityNormal, 1U, 4*OS_MAINSTKSIZE };


#if defined (__CC_ARM)
Expand Down Expand Up @@ -384,8 +384,6 @@ __noreturn __stackless void __cmain(void) {

#endif


/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

6 changes: 3 additions & 3 deletions 3rd_party/CMSIS-RTX/INC/cmsis_os.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@
#ifndef _CMSIS_OS_H
#define _CMSIS_OS_H

#define osCMSIS 0x10002 ///< CMSIS-RTOS API version (main [31:16] .sub [15:0])
#define osCMSIS 0x10002U ///< CMSIS-RTOS API version (main [31:16] .sub [15:0])

#define osCMSIS_RTX ((4<<16)|78) ///< RTOS identification and version (main [31:16] .sub [15:0])

#define osKernelSystemId "RTX V4.78" ///< RTOS identification string
#define osKernelSystemId "RTX V4.79" ///< RTOS identification string


#define osFeature_MainThread 1 ///< main can be thread
Expand Down Expand Up @@ -100,7 +100,7 @@ typedef enum {
} osPriority;

/// Timeout value.
#define osWaitForever 0xFFFFFFFF ///< wait forever timeout value
#define osWaitForever 0xFFFFFFFFU ///< wait forever timeout value

/// Status code values returned by CMSIS-RTOS functions.
typedef enum {
Expand Down
3 changes: 1 addition & 2 deletions 3rd_party/CMSIS-RTX/SRC/ARM/HAL_CM0.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ PrivilegedA

/*--------------------------- _free_box -------------------------------------*/

__asm int _free_box (void *box_mem, void *box) {
__asm U32 _free_box (void *box_mem, void *box) {
/* Function wrapper for Unprivileged/Privileged mode. */
LDR R3,=__cpp(rt_free_box)
MOV R12,R3
Expand Down Expand Up @@ -298,4 +298,3 @@ __asm void OS_Tick_Handler (void) {
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

3 changes: 1 addition & 2 deletions 3rd_party/CMSIS-RTX/SRC/ARM/HAL_CM3.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ __asm void *_alloc_box (void *box_mem) {

/*--------------------------- _free_box -------------------------------------*/

__asm int _free_box (void *box_mem, void *box) {
__asm U32 _free_box (void *box_mem, void *box) {
/* Function wrapper for Unprivileged/Privileged mode. */
LDR R12,=__cpp(rt_free_box)
MRS R3,IPSR
Expand Down Expand Up @@ -271,4 +271,3 @@ __asm void OS_Tick_Handler (void) {
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

29 changes: 19 additions & 10 deletions 3rd_party/CMSIS-RTX/SRC/ARM/HAL_CM4.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
*----------------------------------------------------------------------------
* Name: HAL_CM4.C
* Purpose: Hardware Abstraction Layer for Cortex-M4
* Rev.: V4.70
* Rev.: V4.79
*----------------------------------------------------------------------------
*
* Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH
* Copyright (c) 1999-2009 KEIL, 2009-2015 ARM Germany GmbH
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -99,7 +99,7 @@ __asm void *_alloc_box (void *box_mem) {

/*--------------------------- _free_box -------------------------------------*/

__asm int _free_box (void *box_mem, void *box) {
__asm U32 _free_box (void *box_mem, void *box) {
/* Function wrapper for Unprivileged/Privileged mode. */
LDR R12,=__cpp(rt_free_box)
MRS R3,IPSR
Expand Down Expand Up @@ -152,7 +152,17 @@ SVC_Handler_Veneer
BXEQ LR ; RETI, no task switch
#endif

CBZ R1,SVC_Next ; Runtask deleted?
CBNZ R1,SVC_ContextSave ; Runtask not deleted?

TST LR,#0x10 ; is it extended frame?
BNE SVC_ContextRestore
LDR R1,=0xE000EF34
LDR R0,[R1] ; Load FPCCR
BIC R0,#1 ; Clear LSPACT (Lazy state)
STR R0,[R1] ; Store FPCCR
B SVC_ContextRestore

SVC_ContextSave
TST LR,#0x10 ; is it extended frame?
VSTMDBEQ R12!,{S16-S31} ; yes, stack also VFP hi-regs
MOVEQ R0,#0x01 ; os_tsk->stack_frame val
Expand All @@ -165,16 +175,16 @@ SVC_Handler_Veneer
BL rt_stk_check ; Check for Stack overflow
POP {R2,R3}

SVC_Next
SVC_ContextRestore
STR R2,[R3] ; os_tsk.run = os_tsk.new

LDR R12,[R2,#TCB_TSTACK] ; os_tsk.new->tsk_stack
LDMIA R12!,{R4-R11} ; Restore New Context
LDRB R0,[R2,#TCB_STACKF] ; Stack Frame
CMP R0,#0 ; Basic/Extended Stack Frame
MVNEQ LR,#:NOT:0xFFFFFFFD ; set EXC_RETURN value
MVNNE LR,#:NOT:0xFFFFFFED
VLDMIANE R12!,{S16-S31} ; restore VFP hi-registers
MVNNE LR,#:NOT:0xFFFFFFED ; set EXC_RETURN value
MVNEQ LR,#:NOT:0xFFFFFFFD
MSR PSP,R12 ; Write PSP

SVC_Exit
Expand Down Expand Up @@ -254,9 +264,9 @@ Sys_Switch
LDMIA R12!,{R4-R11} ; Restore New Context
LDRB R0,[R2,#TCB_STACKF] ; Stack Frame
CMP R0,#0 ; Basic/Extended Stack Frame
MVNEQ LR,#:NOT:0xFFFFFFFD ; set EXC_RETURN value
MVNNE LR,#:NOT:0xFFFFFFED
VLDMIANE R12!,{S16-S31} ; restore VFP hi-regs
MVNNE LR,#:NOT:0xFFFFFFED ; set EXC_RETURN value
MVNEQ LR,#:NOT:0xFFFFFFFD
MSR PSP,R12 ; Write PSP

Sys_Exit
Expand Down Expand Up @@ -306,4 +316,3 @@ __asm void OS_Tick_Handler (void) {
/*----------------------------------------------------------------------------
* end of file
*---------------------------------------------------------------------------*/

14 changes: 14 additions & 0 deletions 3rd_party/CMSIS-RTX/SRC/ARM/RTE/RTE_Components.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

/*
* Auto generated Run-Time-Environment Component Configuration File
* *** Do not modify ! ***
*
* Project: 'RTX_Lib_CM'
* Target: 'CM0_LE'
*/

#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H


#endif /* RTE_COMPONENTS_H */
Loading

0 comments on commit b49c739

Please sign in to comment.