📄 tmt.s
字号:
;/*************************************************************************/
;/* */
;/* Copyright (c) 1993-1998 Accelerated Technology, Inc. */
;/* */
;/* PROPRIETARY RIGHTS of Accelerated Technology 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 */
;/* */
;/* tmt.s PLUS/MCF5204_06/D 1.3 */
;/* */
;/* COMPONENT */
;/* */
;/* TM - Timer Management */
;/* */
;/* DESCRIPTION */
;/* */
;/* This file contains the target dependent routines of the timer */
;/* management component. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* DATA STRUCTURES */
;/* */
;/* None */
;/* */
;/* FUNCTIONS */
;/* */
;/* TMT_Set_Clock Set system clock */
;/* TMT_Retrieve_Clock Retrieve system clock */
;/* TMT_Read_Timer Read count-down timer */
;/* TMT_Enable_Timer Enable count-down timer */
;/* TMT_Adjust_Timer Adjust count-down timer */
;/* TMT_Disable_Timer Disable count-down timer */
;/* TMT_Retrieve_TS_Task Retrieve time-sliced task ptr*/
;/* TMT_Timer_Interrupt Process timer interrupt */
;/* */
;/* DEPENDENCIES */
;/* */
;/* tc_extr.h Thread Control functions */
;/* tm_extr.h Timer functions */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* B. Sellew 07-30-1997 Created and verified version 1.1 */
;/* B. Sellew 11-06-1997 Created and verified version 1.2 */
;/* B. Sellew 05-12-1998 Created and verified version 1.3 */
;/* */
;/*************************************************************************/
;#define NU_SOURCE_FILE
;
;
;#include "tc_extr.h" /* Thread control functions */
;#include "tm_extr.h" /* Timer functions */
;
;
;/* Define external inner-component global data references. */
;
;extern VOID *TCD_Current_Thread;
;extern INT TCD_Interrupt_Level;
;extern UNSIGNED TMD_System_Clock;
;extern UNSIGNED TMD_Timer;
;extern INT TMD_Timer_State;
;extern UNSIGNED TMD_Time_Slice;
;extern TC_TCB *TMD_Time_Slice_Task;
;extern INT TMD_Time_Slice_State;
;extern TC_HCB TMD_HISR;
;extern TC_TCB TMD_Task;
;
XREF _TMD_System_Clock
XREF _TMD_Timer
XREF _TMD_Timer_State
XREF _TMD_Time_Slice_State
XREF _TMD_Time_Slice
XREF _TMD_Time_Slice_Task
XREF _TCD_Current_Thread
XREF _TCD_Interrupt_Level
XREF _TMD_HISR
;
;
;/* Define external function references. */
;
;VOID TCT_Interrupt_Context_Save(INT vector);
;STATUS TCT_Activate_HISR(TC_HCB *hisr);
;VOID TCT_Interrupt_Context_Restore(VOID);
;VOID TCT_Check_For_Preemption(VOID);
;
XREF _TCT_Interrupt_Context_Save
XREF _TCT_Activate_HISR
XREF _TCT_Interrupt_Context_Restore
XREF _TCT_Check_For_Preemption
;
;
;
;/* Define internal interrupt lockout constant. This value must lockout
; the Nucleus PLUS timer interrupt. */
;
LOCKOUT EQU $00000700
;
;
SECTION .text
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Set_Clock */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function sets the system clock to the specified value. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* new_value New value for the clock */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Set_Clock
_TMT_Set_Clock:
;VOID TMT_Set_Clock(UNSIGNED new_value)
;{
;
; /* Set the system clock to the specified value. */
; TMD_System_Clock = new_value;
;
MOVE.L D1,-(A7) ; Set the system clock
MOVE.L 8(A7),D1
MOVE.L D1,_TMD_System_Clock
MOVE.L (A7)+,D1
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Retrieve_Clock */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the system clock. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
;/* */
;/* OUTPUTS */
;/* */
;/* TMD_System_Clock Value of system clock */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* B. Sellew 02-21-1997 Created and verified version 1.0 */
;/* */
;/*************************************************************************/
XDEF _TMT_Retrieve_Clock
_TMT_Retrieve_Clock:
;UNSIGNED TMT_Retrieve_Clock(void)
;{
;
; /* Return the current value of the system clock. */
; return(TMD_System_Clock);
;
MOVE.L _TMD_System_Clock,D0 ; Pickup the system clock
RTS ; Return to caller
;}
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Read_Timer */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the count-down timer. */
;/* */
;/* AUTHOR */
;/* */
;/* Barry Sellew, Accelerated Technology, Inc. */
;/* */
;/* CALLED BY */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -