


ARM Macro Assembler    Page 1 


    1 00000000         ;/******************************************************
                       ****************/
    2 00000000         ;/*                                                     
                                      */
    3 00000000         ;/* File name: uip_kernel_isr_cm.s                      
                                      */
    4 00000000         ;/*                                                     
                                      */
    5 00000000         ;/* Since:     2013-08-27                               
                                      */
    6 00000000         ;/*                                                     
                                      */
    7 00000000         ;/* Version:   uip Kernel v1.09                         
                                      */
    8 00000000         ;/*            Copyright (C) 2006..2018 Wang Baojin.    
                                      */
    9 00000000         ;/*                                                     
                                      */
   10 00000000         ;/* Author:    Designed by Wang Baojin(王保进)          
                                      */
   11 00000000         ;/*                                                     
                                      */
   12 00000000         ;/*                                                     
                                      */
   13 00000000         ;/* Purpose:   Definition of interrupt handler architect
                       ure functions. */
   14 00000000         ;/*            中断处理服务框架的汇编语言部分           
                                      */
   15 00000000         ;/*                                                     
                                      */
   16 00000000         ;/* Distribution: This file is part of uip Kernel.      
                                      */
   17 00000000         ;/*            uip Kernel is free software, you can redi
                       stribute it    */
   18 00000000         ;/*            and/or modify it under the terms of the G
                       NU General     */
   19 00000000         ;/*            Public License as published by the Free S
                       oftware        */
   20 00000000         ;/*            Foundation either version 2, or (at your 
                       option)        */
   21 00000000         ;/*            any later version.                       
                                      */
   22 00000000         ;/*                                                     
                                      */
   23 00000000         ;/*            uip Kernel is distributed in the hope tha
                       t it will be   */
   24 00000000         ;/*            useful, but WITHOUT ANY WARRANTY without 
                       even the       */
   25 00000000         ;/*            implied warranty of MERCHANTABILITY or FI
                       TNESS FOR A    */
   26 00000000         ;/*            PuipICULAR PURPOSE.  See the GNU General 
                       Public         */
   27 00000000         ;/*            License for more details.                
                                      */
   28 00000000         ;/*                                                     
                                      */
   29 00000000         ;/*            You should have received a copy of the GN
                       U General      */
   30 00000000         ;/*            Public License along with gpsim see the f



ARM Macro Assembler    Page 2 


                       ile            */
   31 00000000         ;/*            COPYING.txt. If not, write to the Free So
                       ftware         */
   32 00000000         ;/*            Foundation, 59 Temple Place - Suite 330, 
                                      */
   33 00000000         ;/*            Boston, MA 02111-1307, USA.              
                                      */
   34 00000000         ;/*                                                     
                                      */
   35 00000000         ;/*          > A special exception to the GPL can be app
                       lied should    */
   36 00000000         ;/*            you wish to distribute a combined work th
                       at includes    */
   37 00000000         ;/*            uip Kernel, without being obliged to prov
                       ide the        */
   38 00000000         ;/*            source code for any proprietary component
                       s.             */
   39 00000000         ;/*                                                     
                                      */
   40 00000000         ;/* History:                                            
                                      */
   41 00000000         ;/*   2013/08/27  [WBJ] Create this file.               
                                      */
   42 00000000         ;/*                                                     
                                      */
   43 00000000         ;/******************************************************
                       ****************/
   44 00000000         
   45 00000000 E000ED04 
                       UIP_CORTEX_M_NVIC_INT_CTRL_REG
                               EQU              0xE000ED04
   46 00000000 10000000 
                       UIP_CORTEX_M_NVIC_PENDSVSET_VAL
                               EQU              0x10000000
   47 00000000         
   48 00000000                 IMPORT           uipCurrentTaskTCBPtr
   49 00000000                 IMPORT           uipPreContexSwitch
   50 00000000         
   51 00000000                 EXPORT           uipDisableAllInterrupts
   52 00000000                 EXPORT           uipIntMaskStateRestore
   53 00000000         
   54 00000000         ;EXPORT  uipGeneralCounterISR
   55 00000000         
   56 00000000                 EXPORT           uipPendSVHandler
   57 00000000         ;EXPORT  uipContextSwitch     
   58 00000000         
   59 00000000                 PRESERVE8
   60 00000000                 THUMB
   61 00000000         
   62 00000000                 AREA             CODE, CODE, READONLY
   63 00000000         
   64 00000000         ;/******************************************************
                       ****************/ 
   65 00000000         ;/*                                                     
                                      */ 
   66 00000000         ;/*  Function name                                      
                        Version       */ 
   67 00000000         ;/*                                                     
                                      */ 



ARM Macro Assembler    Page 3 


   68 00000000         ;/*    uipDisableAllInterrupts                          
                          1.09        */ 
   69 00000000         ;/*                                                     
                                      */ 
   70 00000000         ;/*  Author                                             
                                      */ 
   71 00000000         ;/*                                                     
                                      */ 
   72 00000000         ;/*    Wang Baojin                                      
                                      */ 
   73 00000000         ;/*                                                     
                                      */ 
   74 00000000         ;/*  Description                                        
                                      */ 
   75 00000000         ;/*                                                     
                                      */ 
   76 00000000         ;/*    Disable all interrupts and save current state of 
                       interrupts     */
   77 00000000         ;/*    (in CPSR) to global variable.                    
                                      */ 
   78 00000000         ;/*                                                     
                                      */ 
   79 00000000         ;/*  Parameter(In)                                      
                                      */ 
   80 00000000         ;/*                                                     
                                      */ 
   81 00000000         ;/*    None                                             
                                      */ 
   82 00000000         ;/*                                                     
                                      */ 
   83 00000000         ;/*  Parameter(Out)                                     
                                      */ 
   84 00000000         ;/*                                                     
                                      */ 
   85 00000000         ;/*    None                                             
                                      */ 
   86 00000000         ;/*                                                     
                                      */ 
   87 00000000         ;/*  Return Status                                      
                                      */ 
   88 00000000         ;/*                                                     
                                      */ 
   89 00000000         ;/*    None                                             
                                      */ 
   90 00000000         ;/*                                                     
                                      */ 
   91 00000000         ;/*  Call functions                                     
                                      */ 
   92 00000000         ;/*                                                     
                                      */ 
   93 00000000         ;/*    None                                             
                                      */ 
   94 00000000         ;/*                                                     
                                      */ 
   95 00000000         ;/*  Called by                                          
                                      */ 
   96 00000000         ;/*                                                     
                                      */ 
   97 00000000         ;/*    uip_KERNEL_DISABLE_INTS                          



ARM Macro Assembler    Page 4 


                                      */ 
   98 00000000         ;/*                                                     
                                      */ 
   99 00000000         ;/*  Release                                            
                                      */ 
  100 00000000         ;/*                                                     
                                      */ 
  101 00000000         ;/*  author name         release date              Descr
                       iption         */ 
  102 00000000         ;/*                                                     
                                      */ 
  103 00000000         ;/*  Wang Baojin          2013.08.27            Initial 
                       Version 1.09   */ 
  104 00000000         ;/*                                                     
                                      */ 
  105 00000000         ;/******************************************************
                       ****************/ 
  106 00000000         uipDisableAllInterrupts
  107 00000000 F3EF 8010       MRS              R0, PRIMASK
  108 00000004 B672            CPSID            I
  109 00000006 4770            BX               LR          ; Return to caller
  110 00000008         
  111 00000008         ;/******************************************************
                       ****************/ 
  112 00000008         ;/*                                                     
                                      */ 
  113 00000008         ;/*  Function name                                      
                        Version       */ 
  114 00000008         ;/*                                                     
                                      */ 
  115 00000008         ;/*    uipIntMaskStateRestore                           
                          1.09        */ 
  116 00000008         ;/*                                                     
                                      */ 
  117 00000008         ;/*  Author                                             
                                      */ 
  118 00000008         ;/*                                                     
                                      */ 
  119 00000008         ;/*    Wang Baojin                                      
                                      */ 
  120 00000008         ;/*                                                     
                                      */ 
  121 00000008         ;/*  Description                                        
                                      */ 
  122 00000008         ;/*                                                     
                                      */ 
  123 00000008         ;/*    Restore saved current state of interrupts (in CPS
                       R) from        */
  124 00000008         ;/*    global variable.                                 
                                      */ 
  125 00000008         ;/*                                                     
                                      */ 
  126 00000008         ;/*  Parameter(In)                                      
                                      */ 
  127 00000008         ;/*                                                     
                                      */ 
  128 00000008         ;/*    None                                             
                                      */ 
  129 00000008         ;/*                                                     



ARM Macro Assembler    Page 5 


                                      */ 
  130 00000008         ;/*  Parameter(Out)                                     
                                      */ 
  131 00000008         ;/*                                                     
                                      */ 
  132 00000008         ;/*    None                                             
                                      */ 
  133 00000008         ;/*                                                     
                                      */ 
  134 00000008         ;/*  Return Status                                      
                                      */ 
  135 00000008         ;/*                                                     
                                      */ 
  136 00000008         ;/*    None                                             
                                      */ 
  137 00000008         ;/*                                                     
                                      */ 
  138 00000008         ;/*  Call functions                                     
                                      */ 
  139 00000008         ;/*                                                     
                                      */ 
  140 00000008         ;/*    None                                             
                                      */ 
  141 00000008         ;/*                                                     
                                      */ 
  142 00000008         ;/*  Called by                                          
                                      */ 
  143 00000008         ;/*                                                     
                                      */ 
  144 00000008         ;/*    uip_KERNEL_RESTORE_INTS                          
                                      */ 
  145 00000008         ;/*                                                     
                                      */ 
  146 00000008         ;/*  Release                                            
                                      */ 
  147 00000008         ;/*                                                     
                                      */ 
  148 00000008         ;/*  author name         release date              Descr
                       iption         */ 
  149 00000008         ;/*                                                     
                                      */ 
  150 00000008         ;/*  Wang Baojin          2013.08.27            Initial 
                       Version 1.09   */ 
  151 00000008         ;/*                                                     
                                      */ 
  152 00000008         ;/******************************************************
                       ****************/ 
  153 00000008         uipIntMaskStateRestore
  154 00000008 F380 8810       MSR              PRIMASK, R0
  155 0000000C 4770            BX               LR
  156 0000000E         
  157 0000000E         ;/******************************************************
                       ****************/ 
  158 0000000E         ;/*                                                     
                                      */ 
  159 0000000E         ;/*  Function name                                      
                        Version       */ 
  160 0000000E         ;/*                                                     
                                      */ 



ARM Macro Assembler    Page 6 


  161 0000000E         ;/*    uipPendSVHandler                                 
                         1.09         */ 
  162 0000000E         ;/*                                                     
                                      */ 
  163 0000000E         ;/*  Author                                             
                                      */ 
  164 0000000E         ;/*                                                     
                                      */ 
  165 0000000E         ;/*    Wang Baojin                                      
                                      */ 
  166 0000000E         ;/*                                                     
                                      */ 
  167 0000000E         ;/*  Description                                        
                                      */ 
  168 0000000E         ;/*                                                     
                                      */ 
  169 0000000E         ;/*    ISR for context switch in Cortex-M               
                                      */ 
  170 0000000E         ;/*    实现任务现场切换的中断处理程序                   
                                      */ 
  171 0000000E         ;/*    能判断是否不需要保存被换出任务的现场，           
                                      */
  172 0000000E         ;/*    用于 TerminateTask与 ChainTask 的执行逻辑中      
                                      */ 
  173 0000000E         ;/*                                                     
                                      */ 
  174 0000000E         ;/*  Parameter(In)                                      
                                      */ 
  175 0000000E         ;/*                                                     
                                      */ 
  176 0000000E         ;/*    None                                             
                                      */ 
  177 0000000E         ;/*                                                     
                                      */ 
  178 0000000E         ;/*  Parameter(Out)                                     
                                      */ 
  179 0000000E         ;/*                                                     
                                      */ 
  180 0000000E         ;/*    None                                             
                                      */ 
  181 0000000E         ;/*                                                     
                                      */ 
  182 0000000E         ;/*  Return Status                                      
                                      */ 
  183 0000000E         ;/*                                                     
                                      */ 
  184 0000000E         ;/*    None                                             
                                      */ 
  185 0000000E         ;/*                                                     
                                      */ 
  186 0000000E         ;/*  Call functions                                     
                                      */ 
  187 0000000E         ;/*                                                     
                                      */ 
  188 0000000E         ;/*    None                                             
                                      */ 
  189 0000000E         ;/*                                                     
                                      */ 
  190 0000000E         ;/*  Called by                                          



ARM Macro Assembler    Page 7 


                                      */ 
  191 0000000E         ;/*                                                     
                                      */ 
  192 0000000E         ;/*    None                                             
                                      */ 
  193 0000000E         ;/*                                                     
                                      */ 
  194 0000000E         ;/*  Release                                            
                                      */ 
  195 0000000E         ;/*                                                     
                                      */ 
  196 0000000E         ;/*  author name         release date              Descr
                       iption         */ 
  197 0000000E         ;/*                                                     
                                      */ 
  198 0000000E         ;/*  Wang Baojin          2013.08.27           Initial V
                       ersion 1.09    */ 
  199 0000000E         ;/*                                                     
                                      */ 
  200 0000000E         ;/******************************************************
                       ****************/ 
  201 0000000E         uipPendSVHandler
  202 0000000E B672            CPSID            I
  203 00000010 4B0C            LDR              R3, =uipCurrentTaskTCBPtr ; Pic
                                                            kup address of curr
                                                            ent task's TCB poin
                                                            ter
  204 00000012 681A            LDR              R2, [R3]
  205 00000014         ;判断是否当前任务控制块的指针值为0；若是，则不保存被换出
                       任务的现场
  206 00000014 2A00            CMP              R2, #0
  207 00000016 D004            BEQ              uipKernelOnlySwitchNextTaskCont
ext
  208 00000018         
  209 00000018 F3EF 8009       MRS              R0, PSP
  210 0000001C E920 0FF0       STMDB            R0!, {R4-R11}
  211 00000020 60D0            STR              R0, [R2, #0x0C]
  212 00000022         
  213 00000022         uipKernelOnlySwitchNextTaskContext
  214 00000022 B508            STMDB            SP!, {R3, LR}
  215 00000024 F3BF 8F4F       DSB
  216 00000028 F7FF FFFE       BL               uipPreContexSwitch
  217 0000002C E8BD 4008       LDMIA            SP!, {R3, LR}
  218 00000030         
  219 00000030 F04E 0E04       ORR              LR, LR, #0x04
  220 00000034 6819            LDR              R1, [R3]
  221 00000036 68C8            LDR              R0, [R1, #0x0C]
  222 00000038 E8B0 0FF0       LDMIA            R0!, {R4-R11}
  223 0000003C F380 8809       MSR              PSP, R0
  224 00000040 B662            CPSIE            I
  225 00000042 4770            BX               LR
  226 00000044         
  227 00000044                 END
              00000000 
Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw
ork --depend=.\objects\uip_kernel_isr_cm.d -o.\objects\uip_kernel_isr_cm.o -IC:
\Keil_v5\ARM\RV31\INC -IC:\Keil_v5\ARM\CMSIS\Include -IC:\Keil_v5\ARM\INC\ST\ST
M32F10x --predefine="__UVISION_VERSION SETA 527" --list=.\listings\uip_kernel_i
sr_cm.lst uipkernel\uip_kernel_isr_cm.s



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Relocatable symbols

CODE 00000000

Symbol: CODE
   Definitions
      At line 62 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      None
Comment: CODE unused
uipDisableAllInterrupts 00000000

Symbol: uipDisableAllInterrupts
   Definitions
      At line 106 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 51 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipDisableAllInterrupts used once
uipIntMaskStateRestore 00000008

Symbol: uipIntMaskStateRestore
   Definitions
      At line 153 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 52 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipIntMaskStateRestore used once
uipKernelOnlySwitchNextTaskContext 00000022

Symbol: uipKernelOnlySwitchNextTaskContext
   Definitions
      At line 213 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 207 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipKernelOnlySwitchNextTaskContext used once
uipPendSVHandler 0000000E

Symbol: uipPendSVHandler
   Definitions
      At line 201 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 56 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipPendSVHandler used once
5 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
Absolute symbols

UIP_CORTEX_M_NVIC_INT_CTRL_REG E000ED04

Symbol: UIP_CORTEX_M_NVIC_INT_CTRL_REG
   Definitions
      At line 45 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      None
Comment: UIP_CORTEX_M_NVIC_INT_CTRL_REG unused
UIP_CORTEX_M_NVIC_PENDSVSET_VAL 10000000

Symbol: UIP_CORTEX_M_NVIC_PENDSVSET_VAL
   Definitions
      At line 46 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      None
Comment: UIP_CORTEX_M_NVIC_PENDSVSET_VAL unused
2 symbols



ARM Macro Assembler    Page 1 Alphabetic symbol ordering
External symbols

uipCurrentTaskTCBPtr 00000000

Symbol: uipCurrentTaskTCBPtr
   Definitions
      At line 48 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 203 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipCurrentTaskTCBPtr used once
uipPreContexSwitch 00000000

Symbol: uipPreContexSwitch
   Definitions
      At line 49 in file uipkernel\uip_kernel_isr_cm.s
   Uses
      At line 216 in file uipkernel\uip_kernel_isr_cm.s
Comment: uipPreContexSwitch used once
2 symbols
342 symbols in table
