📄 tmt.s
字号:
mfspr r0,LR
stw r0,12(r1)
#
# /* Return the current value of the count-down timer. */
# return(TMD_Timer);
#
addis r3,0,TMD_Timer@ha
lwz r3,TMD_Timer@l(r3)
#
# /* restore the SP and LR for return */
#
lwz r0,12(r1)
mtspr LR,r0
addi r1,r1,8
blr
#
#}
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TMT_Enable_Timer */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function enables the count-down timer with the specified */
#/* value. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
#/* */
#/* CALLED BY */
#/* */
#/* TMC_Start_Timer Start timer function */
#/* TMC_Timer_Task Timer expiration task */
#/* */
#/* CALLS */
#/* */
#/* None */
#/* */
#/* INPUTS */
#/* */
#/* time (argument r3) New count-down time */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID TMT_Enable_Timer(UNSIGNED time)
#{
.text
.align 2
.globl TMT_Enable_Timer
TMT_Enable_Timer:
#
# /* Save the SP and LR for the return */
#
stwu r1,-16(r1)
mfspr r0,LR
stw r0,20(r1)
#
# /* Place the new time value into the count-down timer. */
# TMD_Timer = time;
#
addis r12,0,TMD_Timer@ha
stw r3,TMD_Timer@l(r12)
#
# /* Indicate that the timer is active. */
# TMD_Timer_State = TM_ACTIVE;
#
addis r11,0,TMD_Timer_State@ha
li r10,0
stw r10,TMD_Timer_State@l(r11)
#
# /* Restore the SP and LR for return */
#
lwz r0,20(r1)
mtspr LR,r0
addi r1,r1,16
blr
#
#}
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TMT_Adjust_Timer */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function adjusts the count-down timer with the specified */
#/* value- if the new value is less than the current. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
#/* */
#/* CALLED BY */
#/* */
#/* TMC_Start_Timer Start timer function */
#/* */
#/* CALLS */
#/* */
#/* None */
#/* */
#/* INPUTS */
#/* */
#/* time (argument r3) New count-down time */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID TMT_Adjust_Timer(UNSIGNED time)
#{
.text
.align 2
.globl TMT_Adjust_Timer
TMT_Adjust_Timer:
#
# /* Save the SP and LR for return */
#
stwu r1,-16(r1)
mfspr r0,LR
stw r0,20(r1)
#
# /* lockout interrupts */
#
mfmsr r11 # get current MSR value
rlwinm r11,r11,0,17,15 # mask off MSR[EE] bit
mtmsr r11 # write current interrupt status
#
# /* See if new time value is less than current time value. */
# if (time < TMD_Timer)
#
addis r12,0,TMD_Timer@ha
lwz r12,TMD_Timer@l(r12)
cmpl 0,r12,r3
ble Time_Ok
#
# /* Adjust timer. */
# TMD_Timer = time;
#
addis r12,0,TMD_Timer@ha
stw r3,TMD_Timer@l(r12)
#
# /* restore the interrupt level */
#
addis r12,0,TCD_Interrupt_Level@ha
lwz r12,TCD_Interrupt_Level@l(r12)
mfmsr r11 # get current MSR value
rlwinm r11,r11,0,17,15 # mask off MSR[EE] bit
or r11,r11,r12 # or in the interrupt bits
mtmsr r11 # write current interrupt status
Time_Ok:
#
# /* restore the SP and LR for return */
#
lwz r0,20(r1)
mtspr LR,r0
addi r1,r1,16
blr
#
#}
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TMT_Disable_Timer */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function disables the count-down timer. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
#/* */
#/* CALLED BY */
#/* */
#/* TMC_Start_Timer Start timer function */
#/* TMC_Timer_Task Timer expiration task */
#/* */
#/* CALLS */
#/* */
#/* None */
#/* */
#/* INPUTS */
#/* */
#/* None */
#/* */
#/* OUTPUTS */
#/* */
#/* None */
#/* */
#/* HISTORY */
#/* */
#/* NAME DATE REMARKS */
#/* */
#/* Barry Sellew 06-24-1996 Created initial version 1.0 */
#/* */
#/*************************************************************************/
#VOID TMT_Disable_Timer(VOID)
#{
.text
.align 2
.globl TMT_Disable_Timer
TMT_Disable_Timer:
#
# /* Save the SP and LR for return */
#
stwu r1,-8(r1)
mfspr r0,LR
stw r0,12(r1)
#
# /* Disable the count-down timer. */
# TMD_Timer_State = TM_NOT_ACTIVE;
#
addis r12,0,TMD_Timer_State@ha
li r11,1 # load the TM_NOT_ACTIVE value
stw r11,TMD_Timer_State@l(r12)
#
# /* restore the SP and LR for return */
#
lwz r0,12(r1)
mtspr LR,r0
addi r1,r1,8
blr
#
# /* debugger information */
#
#/*************************************************************************/
#/* */
#/* FUNCTION */
#/* */
#/* TMT_Retrieve_TS_Task */
#/* */
#/* DESCRIPTION */
#/* */
#/* This function returns the time-sliced task pointer. */
#/* */
#/* AUTHOR */
#/* */
#/* Barry Sellew, Accelerated Technology, Inc. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -