Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMSIS-compatible ARM Cortex-M ports #1

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions Ports/ARM-Cortex-M/ARMv6-M/ARM/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -183,8 +190,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */


/*
Expand Down
10 changes: 8 additions & 2 deletions Ports/ARM-Cortex-M/ARMv6-M/ARM/os_cpu_a.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
; Modified from the original to interoperate with CMIS as follows:
; - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
;
; Quantum Leaps, LLC. www.state-machine.com
; 2020-06-01
;********************************************************************************************************

;********************************************************************************************************
;
Expand Down Expand Up @@ -45,7 +51,7 @@
EXPORT OS_CPU_SR_Restore
EXPORT OSCtxSw
EXPORT OSIntCtxSw
EXPORT OS_CPU_PendSVHandler
EXPORT PendSV_Handler ; QL was: OS_CPU_PendSVHandler


;********************************************************************************************************
Expand Down Expand Up @@ -220,7 +226,7 @@ OSIntCtxSw
; therefore safe to assume that context being switched out was using the process stack (PSP).
;********************************************************************************************************

OS_CPU_PendSVHandler
PendSV_Handler ; QL was: OS_CPU_PendSVHandler
CPSID I ; Prevent interruption during context switch
MRS R0, PSP ; PSP is process stack pointer

Expand Down
11 changes: 9 additions & 2 deletions Ports/ARM-Cortex-M/ARMv6-M/GNU/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -183,8 +190,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */


/*
Expand Down
12 changes: 9 additions & 3 deletions Ports/ARM-Cortex-M/ARMv6-M/GNU/os_cpu_a.s
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
@ Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
@
@********************************************************************************************************
@ Modified from the original to interoperate with CMIS as follows:
@ - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
@
@ Quantum Leaps, LLC. www.state-machine.com
@ 2020-06-01
@********************************************************************************************************

@********************************************************************************************************
@
Expand Down Expand Up @@ -45,7 +51,7 @@
.global OS_CPU_SR_Restore
.global OSCtxSw
.global OSIntCtxSw
.global OS_CPU_PendSVHandler
.global PendSV_Handler @ QL was: OS_CPU_PendSVHandler


@********************************************************************************************************
Expand Down Expand Up @@ -226,13 +232,13 @@ OSIntCtxSw:
@********************************************************************************************************

.thumb_func
OS_CPU_PendSVHandler:
PendSV_Handler: @ QL was: OS_CPU_PendSVHandler
CPSID I @ Prevent interruption during context switch
MRS R0, PSP @ PSP is process stack pointer

CMP R0, #0
BEQ OS_CPU_PendSVHandler_nosave @ equivalent code to CBZ from M3 arch to M0 arch
@ Except that it does not change the condition code flags
@ Except that it does not change the condition code flags

SUBS R0, R0, #0x24 @ Adjust SP to make space for Low, High & LR registers
LDR R1, =OSTCBCur @ OSTCBCur->OSTCBStkPtr = SP;
Expand Down
11 changes: 9 additions & 2 deletions Ports/ARM-Cortex-M/ARMv6-M/IAR/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -183,8 +190,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */


/*
Expand Down
10 changes: 8 additions & 2 deletions Ports/ARM-Cortex-M/ARMv6-M/IAR/os_cpu_a.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
; Modified from the original to interoperate with CMIS as follows:
; - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
;
; Quantum Leaps, LLC. www.state-machine.com
; 2020-06-01
;********************************************************************************************************

;********************************************************************************************************
;
Expand Down Expand Up @@ -45,7 +51,7 @@
PUBLIC OS_CPU_SR_Restore
PUBLIC OSCtxSw
PUBLIC OSIntCtxSw
PUBLIC OS_CPU_PendSVHandler
PUBLIC PendSV_Handler ; QL was: OS_CPU_PendSVHandler


;********************************************************************************************************
Expand Down Expand Up @@ -219,7 +225,7 @@ OSIntCtxSw
; therefore safe to assume that context being switched out was using the process stack (PSP).
;********************************************************************************************************

OS_CPU_PendSVHandler
PendSV_Handler ; QL was: OS_CPU_PendSVHandler
CPSID I ; Prevent interruption during context switch
MRS R0, PSP ; PSP is process stack pointer

Expand Down
8 changes: 7 additions & 1 deletion Ports/ARM-Cortex-M/ARMv6-M/os_cpu_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -465,7 +471,7 @@ void OSTimeTickHook (void)
*********************************************************************************************************
*/

void OS_CPU_SysTickHandler (void)
void SysTick_Handler (void) /* QL was: void OS_CPU_SysTickHandler (void) */
{
#if OS_CRITICAL_METHOD == 3u /* Allocate storage for CPU status register */
OS_CPU_SR cpu_sr;
Expand Down
11 changes: 9 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/ARM/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -208,8 +215,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */

#if (OS_CPU_ARM_FP_EN > 0u)
void OS_CPU_FP_Reg_Push (OS_STK *stkPtr);
Expand Down
10 changes: 8 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/ARM/os_cpu_a.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
; Modified from the original to interoperate with CMIS as follows:
; - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
;
; Quantum Leaps, LLC. www.state-machine.com
; 2020-06-01
;********************************************************************************************************

;********************************************************************************************************
;
Expand Down Expand Up @@ -49,7 +55,7 @@
EXPORT OS_CPU_SR_Restore
EXPORT OSCtxSw
EXPORT OSIntCtxSw
EXPORT OS_CPU_PendSVHandler
EXPORT PendSV_Handler ; QL was: OS_CPU_PendSVHandler

IF {FPU} != "SoftVFP"
EXPORT OS_CPU_FP_Reg_Push
Expand Down Expand Up @@ -326,7 +332,7 @@ OSIntCtxSw
; CPSIE i
;********************************************************************************************************

OS_CPU_PendSVHandler
PendSV_Handler ; QL was: OS_CPU_PendSVHandler
CPSID I ; Cortex-M7 errata notice. See Note #5
MOV32 R2, OS_KA_BASEPRI_Boundary ; Set BASEPRI priority level required for exception preemption
LDR R1, [R2]
Expand Down
11 changes: 9 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/CCS/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/

/*
Expand Down Expand Up @@ -208,8 +215,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */

#if (OS_CPU_ARM_FP_EN > 0u)
void OS_CPU_FP_Reg_Push (OS_STK *stkPtr);
Expand Down
10 changes: 8 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/CCS/os_cpu_a.asm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
; Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
;
;********************************************************************************************************
; Modified from the original to interoperate with CMIS as follows:
; - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
;
; Quantum Leaps, LLC. www.state-machine.com
; 2020-06-01
;********************************************************************************************************

;********************************************************************************************************
;
Expand Down Expand Up @@ -59,7 +65,7 @@ OS_KA_BASEPRI_BoundaryAddr: .word OS_KA_BASEPRI_Boundary
.global OS_CPU_SR_Restore
.global OSCtxSw
.global OSIntCtxSw
.global OS_CPU_PendSVHandler
.global PendSV_Handler ; QL was: OS_CPU_PendSVHandler

.if __TI_VFP_SUPPORT__
.global OS_CPU_FP_Reg_Push
Expand Down Expand Up @@ -347,7 +353,7 @@ OSIntCtxSw:
;********************************************************************************************************

.asmfunc
OS_CPU_PendSVHandler:
PendSV_Handler: ; QL was: OS_CPU_PendSVHandler
CPSID I ; Cortex-M7 errata notice. See Note #5
LDR R2, OS_KA_BASEPRI_BoundaryAddr ; Set BASEPRI priority level required for exception preemption
LDR R1, [R2]
Expand Down
12 changes: 10 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/GNU/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/


/*
*********************************************************************************************************
*
Expand Down Expand Up @@ -208,8 +216,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */

#if (OS_CPU_ARM_FP_EN > 0u)
void OS_CPU_FP_Reg_Push (OS_STK *stkPtr);
Expand Down
10 changes: 8 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/GNU/os_cpu_a.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
@ Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
@
@********************************************************************************************************
@ Modified from the original to interoperate with CMIS as follows:
@ - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
@
@ Quantum Leaps, LLC. www.state-machine.com
@ 2020-06-01
@********************************************************************************************************

@********************************************************************************************************
@
Expand Down Expand Up @@ -49,7 +55,7 @@
.global OS_CPU_SR_Restore
.global OSCtxSw
.global OSIntCtxSw
.global OS_CPU_PendSVHandler
.global PendSV_Handler @ QL was: OS_CPU_PendSVHandler

#if (defined(__VFP_FP__) && !defined(__SOFTFP__))
.global OS_CPU_FP_Reg_Push
Expand Down Expand Up @@ -339,7 +345,7 @@ OSIntCtxSw:
@********************************************************************************************************

.thumb_func
OS_CPU_PendSVHandler:
PendSV_Handler: @ QL was: OS_CPU_PendSVHandler
CPSID I @ Cortex-M7 errata notice. See Note #5
MOVW R2, #:lower16:OS_KA_BASEPRI_Boundary @ Set BASEPRI priority level required for exception preemption
MOVT R2, #:upper16:OS_KA_BASEPRI_Boundary
Expand Down
12 changes: 10 additions & 2 deletions Ports/ARM-Cortex-M/ARMv7-M/IAR/os_cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,16 @@
* Version 2.0 available at www.apache.org/licenses/LICENSE-2.0.
*
*********************************************************************************************************
*
* Modified from the original to interoperate with CMIS as follows:
* - renamed OS_CPU_PendSVHandler to CMSIS-compatible name PendSV_Handler
* - renamed OS_CPU_SysTickHandler to CMSIS-compatible name SysTick_Handler
*
* Quantum Leaps, LLC. www.state-machine.com
* 2020-06-01
*/


/*
*********************************************************************************************************
*
Expand Down Expand Up @@ -208,8 +216,8 @@ void OSStartHighRdy (void);
void OS_CPU_SysTickInit (INT32U cnts);
void OS_CPU_SysTickInitFreq (INT32U cpu_freq);

void OS_CPU_SysTickHandler (void);
void OS_CPU_PendSVHandler (void);
void SysTick_Handler (void); /* QL was: OS_CPU_SysTickHandler (void); */
void PendSV_Handler (void); /* QL was: OS_CPU_PendSVHandler (void); */

#if (OS_CPU_ARM_FP_EN > 0u)
void OS_CPU_FP_Reg_Push (OS_STK *stkPtr);
Expand Down
Loading