@@ -37,6 +37,8 @@ The above 3 registers are saved into the stack in combination(xPSR).
3737 . global RMP_Int_Mask
3838 / * Start the first thread * /
3939 . global _RMP_Start
40+ / * Yield to another thread * /
41+ . global _RMP_A6M_Yield
4042 / * The system pending service routine * /
4143 . global PendSV_Handler
4244 / * The systick timer routine * /
@@ -89,14 +91,23 @@ _RMP_Start:
8991 BLX R0 / * Branch to our target * /
9092/ * End Function:_RMP_Start *************************************************** /
9193
94+ / * Function:_RMP_A6M_Yield ****************************************************
95+ Description : Trigger a yield to another thread.
96+ Input : None.
97+ Output : None.
98+ Return : None.
99+ ****************************************************************************** /
100+ .thumb_func
101+ _RMP_A6M_Yield:
102+ LDR R0 , = 0xE000ED04 / * The NVIC_INT_CTRL register * /
103+ LDR R1 , = 0x10000000 / * Trigger the PendSV * /
104+ STR R1 ,[ R0 ]
105+ DSB
106+ BX LR
107+ / * End Function:_RMP_A6M_Yield *********************************************** /
108+
92109/ * Function:PendSV_Handler ****************************************************
93- Description : The PendSV interrupt routine. In fact , it will call a C function
94- directly. The reason why the interrupt routine must be an assembly
95- function is th at the compiler may deal with the stack in a different
96- way when different optimization level is chosen. An assembly function
97- can make way around this problem.
98- However , if your compiler support inline assembly functions , this
99- can also be written in C.
110+ Description : The PendSV interrupt handler.
100111 ARMv6 - M only have STMIA , will have to live with it.
101112Input : None.
102113Output : None.
@@ -136,13 +147,7 @@ PendSV_Handler:
136147/ * End Function:PendSV_Handler *********************************************** /
137148
138149/ * Function:SysTick_Handler ***************************************************
139- Description : The SysTick interrupt routine. In fact , it will call a C function
140- directly. The reason why the interrupt routine must be an assembly
141- function is th at the compiler may deal with the stack in a different
142- way when different optimization level is chosen. An assembly function
143- can make way around this problem.
144- However , if your compiler support inline assembly functions , this
145- can also be written in C.
150+ Description : The SysTick interrupt handler.
146151Input : None.
147152Output : None.
148153Return : None.
0 commit comments