📄 int.s
字号:
;/*************************************************************************/
;/* */
;/* 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
;
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 */
;/* */
;/* INT_Initialize */
;/* */
;/* DESCRIPTION */
;/* */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -