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

📄 bsp.s

📁 基于nucleus操作系统的GPRS无线数据传输终端全套源文件。包括支持ARM7的BSP,操作系统
💻 S
📖 第 1 页 / 共 3 页
字号:
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-04-03      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;INT    INT_Vectors_Loaded(void)
;{
	EXPORT  INT_Vectors_Loaded
INT_Vectors_Loaded
;
;    /* Just return the loaded vectors flag.  */
;    return(INT_Loaded_Flag);
;
     ;LDR    a1,[pc, #Loaded_Flag-.-8]       ; Get the address
     LDR	a1,=Loaded_Flag
     LDR	a1,[a1,#0]
     LDR    a1,[a1,#0]                      ; Load current value
     MOV    pc,lr                           ; Return to caller
;}
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Setup_Vector                                                 */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function sets up the specified vector with the new vector   */
;/*      value.  The previous vector value is returned to the caller.     */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      Gai, Feng, Watertek, Inc.                                        */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      Application                                                      */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*      new                                 Pointer to new assembly      */
;/*                                            language ISR               */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      old vector contents                                              */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-04-03      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;VOID  *INT_Setup_Vector(INT vector, VOID *new)
;{
	EXPORT  INT_Setup_Vector
INT_Setup_Vector
;
;VOID    *old_vector;                        /* Old interrupt vector      */
;VOID   **vector_table;                      /* Pointer to vector table   */
;
;    /* Calculate the starting address of the actual vector table.  */
;    vector_table =  (VOID **) 0;
;
;    /* Pickup the old interrupt vector.  */
;    old_vector =  vector_table[vector];
;    
;    /* Setup the new interrupt vector.  */
;    vector_table[vector] =  new;
;    
;    /* Return the old interrupt vector.  */
;    return(old_vector);
;

     LDR    a3,=EXPHDL_TBLBASE              ; Get the address of our table
     LDR    a4,[a3,a1,LSL #2]               ; Make sure we are pointing to
                                            ; the right vector
     STR    a2,[a3,a1,LSL #2]               ; Store the new isr 
     MOV    a1,a4                           ; Setup return parameter
     MOV    pc,lr                           ; Return to caller
;}
;
;
;
;/*************************************************************************/
;/*                                                                       */
;/* FUNCTION                                                              */
;/*                                                                       */
;/*      INT_Retrieve_Shell                                               */
;/*                                                                       */
;/* DESCRIPTION                                                           */
;/*                                                                       */
;/*      This function retrieves the pointer to the shell interrupt       */
;/*      service routine.  The shell interrupt service routine calls      */
;/*      the LISR dispatch routine.                                       */
;/*                                                                       */
;/* AUTHOR                                                                */
;/*                                                                       */
;/*      Gai, Feng, Watertek, Inc.                                        */
;/*                                                                       */
;/* CALLED BY                                                             */
;/*                                                                       */
;/*      TCC_Register_LISR                   Register LISR for vector     */
;/*                                                                       */
;/* CALLS                                                                 */
;/*                                                                       */
;/*      None                                                             */
;/*                                                                       */
;/* INPUTS                                                                */
;/*                                                                       */
;/*      vector                              Vector number to setup       */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      shell pointer                                                    */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*        F. Gai         2000-04-03      Created initial version 1.0     */
;/*                                                                       */
;/*************************************************************************/
;VOID  *INT_Retrieve_Shell(INT vector)
;{
	EXPORT  INT_Retrieve_Shell
INT_Retrieve_Shell
;
;    /* Return the LISR Shell interrupt routine.  */
;    return(INT_Vectors[vector]);
;

    LDR    a2,=EXPHDL_TBLBASE               ; Get address of our table
    LDR    a1,[a2,a1,LSL #2]                ; Make sure we have correct isr
    
    MOV    pc,lr                            ; Return to caller
;}



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

INT_IRQ_Parse
;
;    /* Call Prepare for IRQ interrupt processing by calling
;       TCT_Interrupt_Context_Save.  */
;
	STMDB	sp!,{a1-a4}					; Save a1-a4 on temporary IRQ stack
	SUB		a4,lr,#4					; Save IRQ's lr (return address)
	BL		TCT_Interrupt_Context_Save	; Call context save routine

	LDR		a2, =I_ISPR
	LDR		a3,[a2,#0]					; Get current IRQ No.
    
	TST		a3,#TIMER0_MASK_BIT			; Check for timer interrupt.
	BEQ		NOT_TIMER_INTR
;
; /* Timer Interrupt */
;
	LDR		a1,=I_ISPC
	MOV		a2,#TIMER0_MASK_BIT			; clear pending bit
	STR		a2,[a1,#0]
	BL		TMT_Timer_Interrupt			; Call the timer interrupt processing.
	B		IRQ_PARSE_END

NOT_TIMER_INTR

	MOV		a1,#0						; LISR 0
TEST_NEXT_LISR
	MOV		a3, a3, LSR #1				; next irq bit
	CMP		a3,#0
	ADDNE	a1,a1,#1
	BNE		TEST_NEXT_LISR
	;LDR		a3, =I_ISPC
	;MOV		a2, #1
	;MOV		a2, a2, LSL a1
	;STR		a2, [a3,#0]					; clear pending bit
	LDR		a3,=INT_Pending_Bit
	MOV		a2,#1
	MOV		a2,a2,LSL a1
	STR		a2,[a3,#0]
	BL		TCC_Dispatch_LISR
	
	LDR		a3,=INT_Pending_Bit
	LDR		a3,[a3,#0]
	LDR		a2,=I_ISPC
	STR		a3,[a2,#0]
	
IRQ_PARSE_END
	B		TCT_Interrupt_Context_Restore

; end of IRQ_PARSE Routine

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

INT_FIQ_Parse

; /* Check for a previously enabled interrupt */ 

Default_ISR
	SUBS	pc,lr,#4
;
;/* The following section contains the remaining interrupt handlers.
;	Place you Interrupt Service routine at the appropriate label.
;	For IRQ, you can use Nucleus PLUS call to NU_Register_LISR
;	setup up an interrupt service routine.  */
;
;

Undef_Instr_ISR

	B	    Undef_Instr_ISR
;
SWI_ISR


	B	    SWI_ISR
;
Prefetch_Abort_ISR
	B	    Prefetch_Abort_ISR
;
Data_Abort_ISR
	B	    Data_Abort_ISR
;
	

_ISR_STARTADDRESS  	EQU   0xc7fff00 ;GCS6:8M DRAM
	
	AREA RamData, DATA, READWRITE
			^	_ISR_STARTADDRESS
			
HandleReset		#	4
HandleUndef		#	4
HandleSWI		#	4
HandlePabort	#	4
HandleDabort	#	4
HandleReserved	#	4
HandleIRQ		#	4
HandleFIQ		#	4
	
	END

⌨️ 快捷键说明

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