📄 tmt.s
字号:
;/*************************************************************************/
;/* */
;/* Copyright Mentor Graphics Corporation 2002 */
;/* All Rights Reserved. */
;/* */
;/* THIS WORK CONTAINS TRADE SECRET AND PROPRIETARY INFORMATION WHICH IS */
;/* THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS */
;/* SUBJECT TO LICENSE TERMS. */
;/* */
;/*************************************************************************/
;
;/*************************************************************************/
;/* */
;/* FILE NAME VERSION */
;/* */
;/* tmt.s Nucleus PLUS\ARM PID\ADS 1.13.24 */
;/* */
;/* COMPONENT */
;/* */
;/* TM - Timer Management */
;/* */
;/* DESCRIPTION */
;/* */
;/* This file contains the target dependent routines of the timer */
;/* management component. */
;/* */
;/* 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 */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* C. Meredith 03-01-1994 Added two new functions, */
;/* resulting in version 1.1 */
;/* D. Lamie 03-18-1994 Verified version 1.1 */
;/* C. Meredith 08-27-1994 Corrected bug in new timer */
;/* adjust routine, resulting in */
;/* version 1.1a */
;/* W. Lamie 08-27-1994 Verified version 1.1a */
;/* U. Pollock 03-29-1996 Modified TMT_Adjust_Timer */
;/* resulting in ver 1.1a+1(spr79) */
;/* M. Trippi 07-11-1996 Released version 1.2 */
;/* M. Trippi 02-18-1997 Released version 1.3 */
;/* M. Manning 03-04-1997 Released version 1.4 */
;/* J. Bolton 08-26-1997 Released version 1.5 */
;/* J. Bolton 10-08-1997 Released version 1.6 */
;/* M. Kyle Craig 02-05-1999 Revised version 1.17 */
;/* George Clark 02-05-1999 Released version 1.11.17 */
;/* B. Whatley 08-12-1999 Released version 1.11.18 */
;/* D. Phillips 01-18-2000 Updated port to new structuring */
;/* scheme */
;/* B. Whatley 01-25-2001 Verified and Released 1.13.20 */
;/* Added int_defs.s file */
;/* D. Driscoll 05-22-2001 Updated to 1.13.21, fixed spr 808*/
;/* C. Sheppard 10-15-2001 Released version 1.13.22 */
;/* Fixed spr 843 */
;/* J. Pregeant 04-17-2002 Released version 1.13.23 */
;/* J. Pregeant 08-16-2002 Released version 1.13.24 */
;/*************************************************************************/
;#define NU_SOURCE_FILE
;
;
;#include "tc_extr.h" /* Thread control functions */
;#include "tm_extr.h" /* Timer functions */
;
;
;/* Define constants used in low-level initialization. */
; INCLUDE .\Hardware\int_defs.s
GET int_defs.s
;/* End of low-level initialization constants. */
; If assembled with TASM the variable {CONFIG} will be set to 16
; II 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$$code|, CODE, READONLY
|x$codeseg|
;
;/* Define external inner-component global data references. */
;
;extern VOID *TCD_Current_Thread;
;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;
;
IMPORT TCD_Current_Thread
IMPORT TMD_System_Clock
IMPORT TMD_Timer
IMPORT TMD_Timer_State
IMPORT TMD_Time_Slice
IMPORT TMD_Time_Slice_Task
IMPORT TMD_Time_Slice_State
IMPORT TMD_HISR
IMPORT TCD_Interrupt_Level
;
;
;/* Define activate HISR function. */
;STATUS TCT_Activate_HISR(TC_HCB *hisr);
;
IMPORT TCT_Activate_HISR
;
;
;/* Define various data structure pointers so their addresses can be obtained
; in a PC-relative manner. */
;
System_Clock
DCD TMD_System_Clock
;
Timer
DCD TMD_Timer
;
Timer_State
DCD TMD_Timer_State
;
Slice_State
DCD TMD_Time_Slice_State
;
Time_Slice
DCD TMD_Time_Slice
;
Current_Thread
DCD TCD_Current_Thread
;
Slice_Task
DCD TMD_Time_Slice_Task
;
HISR
DCD TMD_HISR
;
Int_Level
DCD TCD_Interrupt_Level
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Set_Clock */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function sets the system clock to the specified value. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* new_value New value for the clock */
;/* */
;/* OUTPUTS */
;/* */
;/* None */
;/* */
;/* HISTORY */
;/* */
;/* NAME DATE REMARKS */
;/* */
;/* W. Lamie 02-15-1994 Created initial version 1.0 */
;/* D. Lamie 02-15-1994 Verified version 1.0 */
;/* */
;/*************************************************************************/
;VOID TMT_Set_Clock(UNSIGNED new_value)
;{
EXPORT TMT_Set_Clock
TMT_Set_Clock
;
; /* Set the system clock to the specified value. */
; TMD_System_Clock = new_value;
;
LDR r1,System_Clock ; Build address of system clock
STR r0,[r1,#0] ; Store new system clock value
BX lr ; Return to caller
;}
;
;
;
;/*************************************************************************/
;/* */
;/* FUNCTION */
;/* */
;/* TMT_Retrieve_Clock */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function returns the current value of the system clock. */
;/* */
;/* CALLED BY */
;/* */
;/* Application */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* INPUTS */
;/* */
;/* None */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -