⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 irq.lst

📁 NXP LPC2148 GPS Demo for Keil
💻 LST
📖 第 1 页 / 共 2 页
字号:
ARM COMPILER V2.53,  irq                                                                   24/10/06  20:29:56  PAGE 1   


ARM COMPILER V2.53, COMPILATION OF MODULE irq
OBJECT MODULE PLACED IN .\Obj\irq.obj
COMPILER INVOKED BY: d:\Keil\ARM\BIN\CA.exe ..\Common\src\irq.c THUMB INCDIR(..\Common\inc) DEBUG PRINT(.\LST\IRQ.LST) T
                    -ABS(4) OBJECT(.\Obj\irq.obj) 

stmt  level    source

    1          /*****************************************************************************
    2           *   irq.c: Interrupt handler C file for Philips LPC214x Family Microprocessors
    3           *
    4           *   Copyright(C) 2006, Philips Semiconductor
    5           *   All rights reserved.
    6           *
    7           *   History
    8           *   2005.10.01  ver 1.00    Prelimnary version, first Release
    9           *
   10          ******************************************************************************/
   11          #include "LPC214x.h"            /* LPC23XX Peripheral Registers */
   12          #include "type.h"
   13          #include "irq.h"
   14          
   15          /******************************************************************************
   16          ** Function name:       DefaultVICHandler
   17          **
   18          ** Descriptions:        Default VIC interrupt handler.
   19          **              This handler is set to deal with spurious 
   20          **              interrupt.
   21          **              If the IRQ service routine reads the VIC
   22          **              address register, and no IRQ slot responses
   23          **              as described above, this address is returned.
   24          ** parameters:          None
   25          ** Returned value:      None
   26          ** 
   27          ******************************************************************************/
   28          void DefaultVICHandler (void) __irq
   29          {
   30   1          /* if the IRQ is not installed into the VIC, and interrupt occurs, the
   31   1          default interrupt VIC address will be used. This could happen in a race 
   32   1          condition. For debugging, use this endless loop to trace back. */
   33   1          /* For more details, see Philips appnote AN10414 */
   34   1          VICVectAddr = 0;        /* Acknowledge Interrupt */ 
   35   1          while ( 1 );
   36   1      }
   37          
   38          /* Initialize the interrupt controller */
   39          /******************************************************************************
   40          ** Function name:       init_VIC
   41          **
   42          ** Descriptions:        Initialize VIC interrupt controller.
   43          ** parameters:          None
   44          ** Returned value:      None
   45          ** 
   46          ******************************************************************************/
   47          void init_VIC(void) 
   48          {
   49   1          DWORD i = 0;
   50   1          DWORD *vect_addr, *vect_cntl;
   51   1          
   52   1          /* initialize VIC*/
   53   1          VICIntEnClr = 0xffffffff;
   54   1          VICVectAddr = 0;
   55   1          VICIntSelect = 0;
   56   1      
   57   1          /* set all the vector and vector control register to 0 */
   58   1          for ( i = 0; i < VIC_SIZE; i++ )
ARM COMPILER V2.53,  irq                                                                   24/10/06  20:29:56  PAGE 2   

   59   1          {
   60   2          vect_addr = (DWORD *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + i*4);
   61   2          vect_cntl = (DWORD *)(VIC_BASE_ADDR + VECT_CNTL_INDEX + i*4);
   62   2          *vect_addr = 0; 
   63   2          *vect_cntl = 0;
   64   2          }
   65   1      
   66   1          /* Install the default VIC handler here */
   67   1          VICDefVectAddr = (DWORD)DefaultVICHandler;   
   68   1          return;
   69   1      }
   70          
   71          /******************************************************************************
   72          ** Function name:       install_irq
   73          **
   74          ** Descriptions:        Install interrupt handler
   75          **              The max VIC size is 16, but, there are 32 interrupt
   76          **              request inputs. Not all of them can be installed into
   77          **              VIC table at the same time.
   78          **              The order of the interrupt request installation is
   79          **              first come first serve.
   80          ** parameters:          Interrupt number and interrupt handler address
   81          ** Returned value:      true or false, when the table is full, return false
   82          ** 
   83          ******************************************************************************/
   84          DWORD install_irq( DWORD IntNumber, void *HandlerAddr )
   85          {
   86   1          DWORD i;
   87   1          DWORD *vect_addr;
   88   1          DWORD *vect_cntl;
   89   1            
   90   1          VICIntEnClr = 1 << IntNumber;   /* Disable Interrupt */
   91   1          
   92   1          for ( i = 0; i < VIC_SIZE; i++ )
   93   1          {
   94   2          /* find first un-assigned VIC address for the handler */
   95   2      
   96   2          vect_addr = (DWORD *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + i*4);
   97   2          vect_cntl = (DWORD *)(VIC_BASE_ADDR + VECT_CNTL_INDEX + i*4);
   98   2          if ( *vect_addr == (DWORD)NULL )
   99   2          {
  100   3              *vect_addr = (DWORD)HandlerAddr;    /* set interrupt vector */
  101   3              *vect_cntl = (DWORD)(IRQ_SLOT_EN | IntNumber);
  102   3              break;
  103   3          }
  104   2          }
  105   1          if ( i == VIC_SIZE )
  106   1          {
  107   2          return( FALSE );        /* fatal error, can't find empty vector slot */
  108   2          }
  109   1          VICIntEnable = 1 << IntNumber;  /* Enable Interrupt */
  110   1          return( TRUE );
  111   1      }
  112          
  113          /******************************************************************************
  114          ** Function name:       uninstall_irq
  115          **
  116          ** Descriptions:        Uninstall interrupt handler
  117          **              Find the interrupt handler installed in the VIC
  118          **              based on the interrupt number, set the location
  119          **              back to NULL to uninstall it.
  120          ** parameters:          Interrupt number
  121          ** Returned value:      true or false, when the interrupt number is not found, 
  122          **              return false
  123          ** 
  124          ******************************************************************************/
ARM COMPILER V2.53,  irq                                                                   24/10/06  20:29:56  PAGE 3   

  125          DWORD uninstall_irq( DWORD IntNumber )
  126          {
  127   1          DWORD i;
  128   1          DWORD *vect_addr;
  129   1          DWORD *vect_cntl;
  130   1            
  131   1          VICIntEnClr = 1 << IntNumber;   /* Disable Interrupt */
  132   1          
  133   1          for ( i = 0; i < VIC_SIZE; i++ )
  134   1          {
  135   2          /* find first un-assigned VIC address for the handler */
  136   2          vect_addr = (DWORD *)(VIC_BASE_ADDR + VECT_ADDR_INDEX + i*4);
  137   2          vect_cntl = (DWORD *)(VIC_BASE_ADDR + VECT_CNTL_INDEX + i*4);
  138   2          if ( (*vect_cntl & ~IRQ_SLOT_EN ) == IntNumber )
  139   2          {
  140   3              *vect_addr = (DWORD)NULL;   /* clear the VIC entry in the VIC table */
  141   3              *vect_cntl &= ~IRQ_SLOT_EN; /* disable SLOT_EN bit */   
  142   3              break;
  143   3          }
  144   2          }
  145   1          if ( i == VIC_SIZE )
  146   1          {
  147   2          return( FALSE );        /* fatal error, can't find interrupt number 
  148   2                          in vector slot */
  149   2          }
  150   1          VICIntEnable = 1 << IntNumber;  /* Enable Interrupt */
  151   1          return( TRUE );
  152   1      }
  153          
  154          /******************************************************************************
  155          **                            End Of File
  156          ******************************************************************************/
ARM COMPILER V2.53,  irq                                                                   24/10/06  20:29:56  PAGE 4   

ASSEMBLY LISTING OF GENERATED OBJECT CODE



*** PUBLICS:
 PUBLIC         init_VIC?T
 PUBLIC         install_irq?T
 PUBLIC         uninstall_irq?T
 PUBLIC         DefaultVICHandler?A



*** CODE SEGMENT '?PR?DefaultVICHandler?A?irq':
   28: void DefaultVICHandler (void) __irq
 00000000  E92D0003  STMDB       R13!,{R0-R1}
   34:     VICVectAddr = 0;        /* Acknowledge Interrupt */ 
 00000004  E3A01000  MOV         R1,#0x0
 00000008  E5100000  LDR         R0,=0xFFFFF030
 0000000C  E5801000  STR         R1,[R0,#0x0]
   35:     while ( 1 );
 00000010          L_1:
 00000010  EAFFFFFE  B           L_1  ; Targ=0x10
   36: }
 00000014  E8BD0003  LDMIA       R13!,{R0-R1}
 00000018  E25EF004  SUBS        R15,R14,#0x0004
 0000001C          ENDP ; 'DefaultVICHandler?A'


*** CODE SEGMENT '?PR?init_VIC?T?irq':
   47: void init_VIC(void) 
 00000000  B410      PUSH        {R4}
   48: {
 00000002            ; SCOPE-START
   49:     DWORD i = 0;
 00000002  2100      MOV         R1,#0x0
 00000004  1C08      MOV         R0,R1 ; i
 00000006  ---- Variable 'i' assigned to Register 'R0' ----
   53:     VICIntEnClr = 0xffffffff;
 00000006  4800      LDR         R2,=0xFFFFFFFF
 00000008  4800      LDR         R0,=0xFFFFF014
 0000000A  6002      STR         R2,[R0,#0x0]
   54:     VICVectAddr = 0;
 0000000C  4800      LDR         R0,=0xFFFFF030
 0000000E  6001      STR         R1,[R0,#0x0]

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -