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

📄 tmt.s

📁 nuclues 内核源代码已经在arm7-9 上作了移植
💻 S
📖 第 1 页 / 共 3 页
字号:
;/*************************************************************************/
;/*                                                                       */
;/*            Copyright (c) 1994 - 2002 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                         Nucleus PLUS\Integrator\ADS 1.13.4 */
;/*                                                                       */
;/* 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               */
;/*                                                                       */
;/*   D. Driscoll          07-02-2001       Released version 1.13.2       */
;/*                                         Fixed SPR 843                 */
;/*   D. Driscoll          01-04-2002       Released version 1.13.3       */
;/*   J. Pregeant          03-27-2002       Released version 1.13.4       */
;/*************************************************************************/
;#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 int_defs.s
;/* End of low-level initialization constants.  */

;/* Build as an ARM module */
    CODE32

;
        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
        IMPORT  TCD_Interrupt_Count
;

;
;/* 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

;Int_Count
;        DCD     TCD_Interrupt_Count
;
;
;/*************************************************************************/
;/*                                                                       */
;/* 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     a2,System_Clock             ; Build address of system clock
        STR     a1,[a2,#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                                                             */
;/*                                                                       */
;/* OUTPUTS                                                               */
;/*                                                                       */
;/*      TMD_System_Clock                    Value of system clock        */
;/*                                                                       */
;/* HISTORY                                                               */
;/*                                                                       */
;/*         NAME            DATE                    REMARKS               */
;/*                                                                       */
;/*      W. Lamie        02-15-1994      Created initial version 1.0      */
;/*      D. Lamie        02-15-1994      Verified version 1.0             */
;/*                                                                       */
;/*************************************************************************/
;UNSIGNED  TMT_Retrieve_Clock(void)
;{
        EXPORT  TMT_Retrieve_Clock
TMT_Retrieve_Clock
;
;    /* Return the current value of the system clock.  */
;    return(TMD_System_Clock);
;
        LDR     a1,System_Clock             ; Build address to system clock
        LDR     a1,[a1,#0]                  ; Pickup system clock contents

⌨️ 快捷键说明

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