📄 tct.s
字号:
Execute_HISR
DCD TCD_Execute_HISR
;
Execute_Task
DCD TCD_Execute_Task
;
Time_Slice
DCD TMD_Time_Slice
;
Slice_State
DCD TMD_Time_Slice_State
;
System_Stack
DCD TCD_System_Stack
;
Int_Count
DCD TCD_Interrupt_Count
;
HISR_Tails
DCD TCD_Active_HISR_Tails
;
HISR_Heads
DCD TCD_Active_HISR_Heads
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TCT_Control_Interrupts */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables and disables interrupts as specified by */
;/* the caller. Interrupts disabled by this call are left disabled */
;/* until the another call is made to enable them. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* new_level New interrupt enable level */
;/* */
;/* OUTPUTS */
;/* */
;/* old_level Previous interrupt enable */
;/* level */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* C. Meredith 03-01-1994 Lockout interrupts while setting */
;/* up the new level, resutling in */
;/* version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* M. Trippi 02-03-1997 Masked the return value to only */
;/* return the interrupt bits. */
;/* (SPR0252) */
;/* */
;/*************************************************************************/
;INT TCT_Control_Interrupts (INT new_level)
;{
EXPORT TCT_Control_Interrupts
TCT_Control_Interrupts
;
;INT old_level; /* Old interrupt level */
;
; /* lock out all interrupts before any checking or changing */
;
; /* Obtain the current interrupt lockout posture. */
; old_level = TCD_Interrupt_Level;
;
; /* Setup new interrupt lockout posture. */
; TCD_Interrupt_Level = new_level;
;
; /* renable interrupts for the specified lockout */
;
; /* Return old interrupt lockout level. */
; return(old_level);
;
MRS a3,CPSR ; Pickup current CPSR
ORR a3,a3,#LOCKOUT ; Build lockout CPSR
MSR CPSR_cxsf,a3 ; Lockout interrupts temporarily
LDR a2,[pc, #Int_Level-.-8] ; Pickup interrupt level
LDR a4,[a2, #0] ; Pickup current interrupt lockout
BIC a3,a3,#LOCK_MSK ; Clear lockout mask
ORR a3,a3,a1 ; Build new CPSR with appropriate
; interrupts locked out
STR a1,[a2,#0] ; Save current lockout
MSR CPSR_cxsf,a3 ; Setup new CPSR lockout bits
AND a1,a4,#LOCK_MSK ; Return previous lockout (SPR0252)
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; Return to caller
]
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TCT_Local_Control_Interrupts */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function enables and disables interrupts as specified by */
;/* the caller. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* new_level New interrupt enable level */
;/* */
;/* OUTPUTS */
;/* */
;/* old_level Previous interrupt enable */
;/* level */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* C. Meredith 03-01-1994 Created initial version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* M. Trippi 02-03-1997 Masked the return value to only */
;/* return the interrupt bits. */
;/* (SPR0252) */
;/* */
;/*************************************************************************/
;INT TCT_Local_Control_Interrupts (INT new_level)
;{
EXPORT TCT_Local_Control_Interrupts
TCT_Local_Control_Interrupts
;
;INT old_level; /* Old interrupt level */
;
; /* read in the old level */
; old_level = current interrupt level of processor;
;
MRS a3,CPSR ; Pickup current CPSR
MOV a4,a3 ; save the old level
;
; /* clear out the old level and set the new level */
; current interrupt level of processor &= ~LOCKOUT;
; current interrupt level of processor |= new_level;
;
BIC a3,a3,#LOCK_MSK ; Clear all current interrupts
ORR a3,a3,a1 ; Build new CPSR with new
; interrupt level
MSR CPSR_cxsf,a3 ; Setup new CPSR interrupt bits
;
; /* Return old interrupt lockout level. */
; return(old_level);
;
AND a1,a4,#LOCK_MSK ; Return previous lockout (SPR0252)
[ THUMB
BX lr ; Return to caller
|
MOV pc,lr ; Return to caller
]
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TCT_Restore_Interrupts */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function restores interrupts to that specified in the global*/
;/* TCD_Interrupt_Level variable. */
;/* */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None. */
;/* */
;/* OUTPUTS */
;/* */
;/* None. */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* C. Meredith 03-01-1994 Created initial version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* */
;/*************************************************************************/
;VOID TCT_Restore_Interrupts (VOID)
;{
EXPORT TCT_Restore_Interrupts
TCT_Restore_Interrupts
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -