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

📄 int.s

📁 著名的嵌入式操作系统Nucleus的源代码
💻 S
📖 第 1 页 / 共 3 页
字号:
;/*************************************************************************/
;/*                                                                       */
;/*            Copyright (c) 2000 - 2004 Watertek, Inc.                   */
;/*                                                                       */
;/* PROPRIETARY RIGHTS of Watertek are involved in the subject matter of  */
;/* this material.  All manufacturing, reproduction, use, and sales       */
;/* rights pertaining to this subject matter are governed by the license  */
;/* agreement.  The recipient of this software implicitly accepts the     */
;/* terms of the license.                                                 */
;/*                                                                       */
;/*************************************************************************/
;
;/*************************************************************************/
;/*                                                                       */
;/* FILE NAME                                            VERSION          */
;/*                                                                       */
;/*      int.s                                          EP7212 1.0        */
;/*                                                                       */
;/* COMPONENT                                                             */
;/*                                                                       */
;/*      IN - Initialization                                              */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This file contains the target processor dependent initialization */
;/*      routines and data.                                               */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*      Gai, Feng, Watertek, Inc.                                        */
;/*                                                                       */
;/* DATA STRUCTURES                                                       */
;/*                                                                       */
;/*      INT_Vectors                         Interrupt vector table       */
;/*                                                                       */
;/* FUNCTIONS                                                             */
;/*                                                                       */
;/*      INT_Initialize                      Target initialization        */
;/*      INT_Vectors_Loaded                  Returns a NU_TRUE if all the */
;/*                                            default vectors are loaded */
;/*      INT_Setup_Vector                    Sets up an actual vector     */
;/*                                                                       */
;/* DEPENDENCIES                                                          */
;/*                                                                       */
;/*      nucleus.h                           System constants             */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-09-12      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;#define         NU_SOURCE_FILE
;
;#include        "nucleus.h"                 /* System constants          */
;
;
; EP7212 internal registers definition
;
INTMOD		EQU		0x3ff4000	;Interrupt Mode Register
INTPND		EQU		0x3ff4004	;Interrupt Pending Register
INTMSK		EQU		0x3ff4008	;Interrupt Mask Register
INTPRI0		EQU		0x3ff400c	;Interrupt Priority Register 0
INTPRI1		EQU		0x3ff4010	;Interrupt Priority Register 1
INTPRI2		EQU		0x3ff4014	;Interrupt Priority Register 2
INTPRI3		EQU		0x3ff4018	;Interrupt Priority Register 3
INTPRI4		EQU		0x3ff401c	;Interrupt Priority Register 4
INTPRI5		EQU		0x3ff4020	;Interrupt Priority Register 5
INTOFF		EQU		0x3ff4024	;Interrupt Offset Register
INTOFFI		EQU		0x3ff4030	;Interrupt offset register of IRQ
TMOD		EQU		0x3ff6000	;Timer Mode Register
TDATA1		EQU		0x3ff6008	;Timer 1 data register
TICKSYM		EQU		0x2c
                               
                               


SYSTICK		EQU		0x7a11f		;timer 1 Interval




INTSR1		EQU		0x80000240
INTMR1		EQU		0x80000280
INTMR2		EQU		0x80001280
INTMR3		EQU		0x80002280
SYSCON1		EQU		0x80000100
TC1DATA		EQU		0x80000300
TC1EOI		EQU		0x800006c0
TICK_MASK	EQU		0x100

;
;/* Define constants used in low-level initialization.  */
;
LOCKOUT			EQU	&C0				; Interrupt lockout value
LOCK_MSK		EQU     &C0				; Interrupt lockout mask value
MODE_MASK		EQU     &1F				; Processor Mode Mask
SUP_MODE		EQU     &13				; Supervisor Mode (SVC)

IRQ_MODE		EQU     &12				; Interrupt Mode (IRQ)
FIQ_MODE		EQU     &11				; Fast Interrupt Mode (FIQ)
I_BIT			EQU	0x80				; Interrupt bit of CPSR and SPSR
F_BIT			EQU     0x40				; Interrupt bit of CPSR and SPSR

;
; /* Constants used in NU+ */
;
IRQ_STACK_SIZE  EQU     512
FIQ_STACK_SIZE  EQU     512
SYSTEM_SIZE     EQU     4096                			; Define the system stack size
TIMER_SIZE      EQU     4096               			; Define timer HISR stack size
TIMER_PRIORITY  EQU     2                   			; Timer HISR priority (0 ~ 2, where 0 is highest)

;/* End of low-level initialization constants.  */

;
; If assembled with TASM the variable {CONFIG} will be set to 16
; If assembled with ARMASM the variable {CONFIG} will be set to 32
; Set the variable THUMB to TRUE or false depending on whether the
; file is being assembled with TASM or ARMASM.
;
        GBLL    THUMB
        GBLL    ARM
    [ {CONFIG} = 16
THUMB   SETL    {TRUE}
ARM     SETL    {FALSE}

; If assembling with TASM go into 32 bit mode as the Armulator will
; start up the program in ARM state.

        CODE32
    |
THUMB   SETL    {FALSE}
ARM     SETL    {TRUE}
    ]

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	AREA |C$$data|,DATA
|x$dataseg|

;/* Define the initialization flag that indicates whether or not all of the
;   default vectors have been loaded during initialization.  */
;
;INT    INT_Loaded_Flag;

	EXPORT  INT_Loaded_Flag
INT_Loaded_Flag
	DCD     &00000001

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

        [ THUMB
	AREA |C$$code|, CODE, READONLY,INTERWORK
|x$codeseg|
        |
	AREA |C$$code|, CODE, READONLY
|x$codeseg|
        ]

;/* Define the global system stack variable.  This is setup by the 
;   initialization routine.  */
;
;extern VOID            *TCD_System_Stack;
;
	IMPORT  TCD_System_Stack
	IMPORT  TCT_System_Limit
;
;
;/* Define the global data structures that need to be initialized by this
;   routine.  These structures are used to define the system timer management
;   HISR.  */
;   
;extern VOID     *TMD_HISR_Stack_Ptr;
;extern UNSIGNED  TMD_HISR_Stack_Size;
;extern INT       TMD_HISR_Priority;
;
	IMPORT  TMD_HISR_Stack_Ptr
	IMPORT  TMD_HISR_Stack_Size
	IMPORT  TMD_HISR_Priority
;
;
;/* Define extern function references.  */
;
;VOID   INC_Initialize(VOID *first_available_memory);
;VOID   TCT_Interrupt_Context_Save(VOID);
;VOID   TCT_Interrupt_Context_Restore(VOID);
;VOID   TCC_Dispatch_LISR(INT vector_number);
;VOID   TMT_Timer_Interrupt(void);
;
	IMPORT  INC_Initialize
	IMPORT  TCT_Interrupt_Context_Save
	IMPORT  TCT_Interrupt_Context_Restore
	IMPORT  TCC_Dispatch_LISR
	IMPORT  TMT_Timer_Interrupt
	IMPORT	irq_entry
	IMPORT  |Image$$ZI$$Limit|

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;INT_Table

;INT_Initialize_Addr		DCD	INT_Initialize
;Undef_Instr_Addr		DCD	INT_UNDEFINE
;SWI_Addr			DCD	INT_SWI_PARSE	
;Prefetch_Abort_Addr		DCD	INT_PREF_ABORT
;Data_Abort_Addr			DCD	INT_DATA_ABORT
;Undefined_Addr			DCD	0	            ; NO LONGER USED
;IRQ_Handler_Addr		DCD	INT_IRQ_PARSE
;FIQ_Handler_Addr		DCD	INT_FIQ_PARSE

;
;/* Define various data structure pointers so their addresses can be obtained 
;   in a PC-relative manner.  */
;
Loaded_Flag_Ptr
	DCD     INT_Loaded_Flag
;
HISR_Stack_Ptr
	DCD     TMD_HISR_Stack_Ptr
;
HISR_Stack_Size
	DCD     TMD_HISR_Stack_Size
;
HISR_Priority
	DCD     TMD_HISR_Priority
;
System_Stack
	DCD     TCD_System_Stack
;
System_Limit
	DCD     TCT_System_Limit

;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */

⌨️ 快捷键说明

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