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

📄 int_rom.s

📁 nucleus在S3C2410下的移植全套源代码
💻 S
字号:
;/*************************************************************************/
;/*                                                                       */
;/*               Copyright Mentor Graphics Corporation 2002              */
;/*                         All Rights Reserved.                          */
;/*                                                                       */
;/* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS  */
;/* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS   */
;/* SUBJECT TO LICENSE TERMS.                                             */
;/*                                                                       */
;/*************************************************************************/
;
;/*************************************************************************/
;/*                                                                       */
;/* FILE NAME                                    VERSION                  */
;/*                                                                       */
;/*      int_rom.s                       Nucleus PLUS\ARM PID\ADS 1.13.24 */
;/*                                                                       */
;/* COMPONENT                                                             */
;/*                                                                       */
;/*      IN - Initialization                                              */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This file contains the target processor dependent initialization */
;/*      routines and data for running from FLASH.                        */
;/*                                                                       */
;/*                                                                       */
;/* FUNCTIONS                                                             */
;/*                                                                       */
;/*      INT_Reset                           Target initialization for    */
;/*                                          reset exception              */
;/*                                                                       */
;/* DEPENDENCIES                                                          */
;/*                                                                       */
;/*      int_defs.s                          Initialization constants     */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*     D. Driscoll      10 May 2001      Verified and released           */
;/*                                          version 1.13.21              */
;/*     C. Sheppard      10-15-2001       Released version 1.13.22        */
;/*     J. Pregeant      04-17-2002       Released version 1.13.23        */
;/*     Jack Pregeant     08-16-2002      Released version 1.13.24        */
;/*************************************************************************/
;/* NOTE: Define "NU_INT_ROM_SUPPORT" to run out of Flash.
;       To do this use the -pd option on the assembler line:
;       -pd "NU_INT_ROM_SUPPORT SETL {TRUE}"    */

;/*--------------------------------------------------------------*/
      IF (:LNOT:  :DEF: NU_INT_ROM_SUPPORT)
    GBLL   NU_INT_ROM_SUPPORT ;声明一个逻辑变量,并且初始化为false
NU_INT_ROM_SUPPORT  SETL  {TRUE};给这个逻辑变量赋值
    ENDIF
;/*----------------------------------------------------------------*/



    IF (:DEF: NU_INT_ROM_SUPPORT)

    IF NU_INT_ROM_SUPPORT

;/*************************************************************************/
;/*   INCLUDE FILE                                                        */
;/*************************************************************************/
;/* Define constants used in low-level initialization.  */
    INCLUDE int_defs.s

;/*************************************************************************/
;/*   EXTERNAL VARIABLE/FUNCTION DECLARATIONS                             */
;/*************************************************************************/
    IMPORT  INT_Undef_Inst
    IMPORT  INT_Software
    IMPORT  INT_Prefetch_Abort
    IMPORT  INT_Data_Abort
    IMPORT  INT_Reserved
    IMPORT  INT_IRQ
    IMPORT  INT_FIQ

;/*************************************************************************/
;/*   INTERRUPT TABLES                                                    */
;/*************************************************************************/
    AREA    INT_Init, CODE, READONLY  ;声明一个INT_Init的只读代码区
    ENTRY  ;程序的入口

;/*  This is a label used with the ARM linker -first command to place the code
;    starting at this label first in the image to be flashed */

    EXPORT  INT_ROM_ENTRY
INT_ROM_ENTRY

    b       INT_Reset

    LDR         pc,Undef_Inst_Addr              ; Undefined Instruction
    LDR         pc,Software_Addr                ; Software Generated
    LDR         pc,Abort_Prefetch_Addr          ; Abort Prefetch
    LDR         pc,Abort_Data_Addr              ; Abort Data
    LDR         pc,Reserved_Addr                ; Reserved
    LDR         pc,IRQ_Addr                     ; Standard External Interrupt
    LDR         pc,FIQ_Addr                     ; Fast External Interrupt

Initialize_Addr         DCD     INT_Initialize
Undef_Inst_Addr         DCD     INT_Undef_Inst
Software_Addr           DCD     INT_Software
Abort_Prefetch_Addr     DCD     INT_Prefetch_Abort
Abort_Data_Addr         DCD     INT_Data_Abort
Reserved_Addr           DCD     INT_Reserved
IRQ_Addr                DCD     INT_IRQ
FIQ_Addr                DCD     INT_FIQ

;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Reset                                                        */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*     This function performs the necessary hardware specific            */
;/*     intialization to run from flash on the ARM 6/7 PID board          */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      Nothing. This function is the ENTRY point for Nucleus PLUS       */
;/*      when running from FLASH.                                         */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      INT_Initialize                                                   */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*      D. Driscoll     9 May 2001            Created initial version    */
;/*************************************************************************/
    EXPORT INT_Reset
INT_Reset
    MRS     a1,CPSR                     ; 将状态寄存器CPSR中的内容保存到通用寄存器a1中
    BIC     a1,a1,#MODE_MASK            ; M[4:0]=0b00000不在任何工作模式
    ORR     a1,a1,#SUP_MODE             ; M[4:0]=0b10011 supervisor mode
    ORR     a1,a1,#LOCKOUT              ; I=1,F=1.屏蔽IRQ和FIQ
                                        
    MSR     CPSR_cxsf,a1                ; 将通用寄存器a1中的内容保存到状态寄存器CPSR中

    MOV     a1, #ICBASE                 ; ICBASE=01e00000 Get interrupt controller base address
    MVN     a2, #0                      ; Get clear value (a2=0xFFFFFFFF - clear all interrupts)
    STR     a2, [a1, #IRQ_CLEAR_OFFSET] ; 将a2中的数据写到(a1+IRQ_CLEAR_OFFSET)Clear all IRQ interrupts
    STR     a2, [a1, #FIQ_CLEAR_OFFSET] ; 将a2中的数据写到(a1+FIQ_CLEAR_OFFSET)Clear all FIQ interrupts


    ; Branch to INT_Intialize and start intializing Nucleus RTOS
    IMPORT INT_Initialize
    B INT_Initialize  ;进入板级初始化


    ENDIF ;/* NU_INT_ROM_SUPPORT */

    ENDIF ;/* (:DEF: NU_INT_ROM_SUPPORT) */

    END







⌨️ 快捷键说明

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