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

📄 cld.s

📁 NecluesRTX RTOS的源码
💻 S
📖 第 1 页 / 共 2 页
字号:
;/************************************************************************/
;/*                                                                      */
;/*           Copyright 1990-1992 by Accelerated Technology              */
;/*                                                                      */
;/*  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 buyer or recipient of this  */
;/*  package, implicitly accepts the terms of the license.               */
;/*                                                                      */
;/************************************************************************/
;      
;/************************************************************************/
;/*                                                                      */
;/*  FILE DESCRIPTION                                                    */
;/*                                                                      */
;/*  This file contains routines that provide target system dependent    */
;/*  timer interrupt support.                                            */
;/*                                                                      */
;/*  ROUTINES                                                            */
;/*                                                                      */
;/*      CLD_Read_Timer                      Read the timer              */
;/*      CLD_Load_Timer                      Load the timer              */
;/*      CLD_Load_Clock                      Load the system clock       */
;/*      CLD_Read_Clock                      Read the system clock       */
;/*      CLD_Start_System_Timer              Start the system timer      */
;/*      CLD_Stop_System_Timer               Stop the system timer       */
;/*      CLD_Timer_Interrupt                 Timer Interrupt handler     */
;/*                                                                      */
;/*  NOTES                                                               */
;/*                                                                      */
;/*      None                                                            */
;/*                                                                      */
;/************************************************************************/
;
;/* Define processor - CPU32 */
;Introl compiler         OPT     cpu_cpu32

;/* Define necessary include files.  */
;
;#include            "nu_defs.h"             /* General constants        */
;#include            "cl_defs.h"             /* Data structure defns     */
;#include            "cl_extr.h"             /* Clock routine defns      */
;#include            "sk_extr.h"             /* Scheduler routine defns  */
;
;
;/* Define global data and global data references.  */
;
;/* The unsigned "CLD_Timer" is the timer load value which when
;   decremented to 0 causes a timer request to be processed.  */
;   
;unsigned int CLD_Timer;
        SECTION .bss
        export CLD_Timer
CLD_Timer      
        DS.L    1
;
;
;/* The unsigned "CLD_System_Clock" is a clock incremented by the
;   low level routines.  */
;   
;unsigned int   CLD_System_Clock;
        export CLD_System_Clock
CLD_System_Clock       
        DS.L    1
;
;
;/* The pointer to the timer suspension list is provided in order to 
;   determine if something is waiting on a timer.  */
;
;extern struct CL_TIMER_REQUEST_STRUCT *CLP_Active_List_Ptr;
;
        import   CLP_Active_List_Ptr
;
;
;/* The system timer uses several flags that are separate from the task
;   timers for speed purposes.  */
;
;unsigned int  CLD_System_Timer;
        export CLD_System_Timer
CLD_System_Timer       
        DS.L    1
;unsigned int  CLD_Sys_Timer_Active;
        export CLD_Sys_Timer_Active
CLD_Sys_Timer_Active   
        DS.L    1
;
;
;/* Define the timer expiration routines.  */
;extern void  CLP_Timer_Expiration();
;extern void  SKP_Time_Slice();
        import    CLP_Timer_Expiration
        import    SKP_Time_Slice
;
;
;/************************************************************************/
;/*                                                                      */
;/*  FUNCTION                                "CLD_Read_Timer"            */
;/*                                                                      */
;/*                                                                      */
;/*  DESCRIPTION                                                         */
;/*                                                                      */
;/*      This function is used to read the current value of the timer.   */
;/*                                                                      */
;/*  AUTHOR                                                              */
;/*                                                                      */
;/*      William E. Lamie,  Accelerated Technology                       */
;/*                                                                      */
;/*  CALLED FROM                                                         */
;/*                                                                      */
;/*      CLP_Start_Timer                     Start a timer               */
;/*      CLP_Stop_Timer                      Stop a timer                */
;/*                                                                      */
;/*  ROUTINES CALLED                                                     */
;/*                                                                      */
;/*      None                                                            */
;/*                                                                      */
;/*  INPUTS                                                              */
;/*                                                                      */
;/*      None                                                            */
;/*                                                                      */
;/*  OUTPUTS                                                             */
;/*                                                                      */
;/*      Timer value                                                     */
;/*                                                                      */
;/************************************************************************/
;unsigned int  CLD_Read_Timer()
;{
        SECTION .text
        export CLD_Read_Timer
CLD_Read_Timer
;
;    /* This is target system dependent.  The only requirement of this 
;       routine is to return the current timer value in terms of generic
;       time clicks.  */
;    return(CLD_Timer);
        MOVE.L  CLD_Timer,D0
        RTS
;}                                           /* end of CLD_Read_Timer    */
;
;
;
;/************************************************************************/
;/*                                                                      */
;/*  FUNCTION                                "CLD_Load_Timer"            */
;/*                                                                      */
;/*                                                                      */
;/*  DESCRIPTION                                                         */
;/*                                                                      */
;/*      This function is used to set the current value of the timer.    */
;/*                                                                      */
;/*  AUTHOR                                                              */
;/*                                                                      */
;/*      William E. Lamie,  Accelerated Technology                       */
;/*                                                                      */
;/*  CALLED FROM                                                         */
;/*                                                                      */
;/*      CLP_Start_Timer                     Start a timer               */
;/*      CLP_Stop_Timer                      Stop a timer                */
;/*      CLP_Timer_Expiration                Timer expiration            */
;/*                                                                      */
;/*  ROUTINES CALLED                                                     */
;/*                                                                      */
;/*      None                                                            */
;/*                                                                      */
;/*  INPUTS                                                              */
;/*                                                                      */
;/*      new_timer                           New value for timer         */
;/*                                                                      */
;/*  OUTPUTS                                                             */
;/*                                                                      */
;/*      Timer updated                                                   */
;/*                                                                      */
;/************************************************************************/
;void  CLD_Load_Timer(new_timer)
;
;unsigned int  new_timer;                    /* new timer value          */
        export CLD_Load_Timer
CLD_Load_Timer
;{
;
;    /* This is target system dependent.  The only requirement of this 
;       routine is to set the current timer value in terms of generic
;       time clicks.  */
;    CLD_Timer =  new_timer;
        MOVE.L  4(A7),CLD_Timer
;    /* Fix for version 3.07 and later of the INTROL compiler
;     * Return and pop parameters off stack
;     */
;       RTD #$4
       RTS
;}                                           /* end of CLD_Load_Timer    */
;
;
;
;/************************************************************************/
;/*                                                                      */
;/*  FUNCTION                                "CLD_Load_Clock"            */
;/*                                                                      */
;/*                                                                      */
;/*  DESCRIPTION                                                         */
;/*                                                                      */
;/*      This function is used to set the system time clock.             */
;/*                                                                      */
;/*  AUTHOR                                                              */
;/*                                                                      */
;/*      William E. Lamie,  Accelerated Technology                       */
;/*                                                                      */
;/*  CALLED FROM                                                         */
;/*                                                                      */
;/*      Routines that require time information                          */
;/*                                                                      */
;/*  ROUTINES CALLED                                                     */
;/*                                                                      */
;/*      None                                                            */
;/*                                                                      */
;/*  INPUTS                                                              */
;/*                                                                      */
;/*      new_time                            New system time             */
;/*                                                                      */
;/*  OUTPUTS                                                             */
;/*                                                                      */
;/*      CLD_System_Clock                    System clock                */
;/*                                                                      */
;/************************************************************************/
;void  CLD_Load_Clock(new_time)
;
;unsigned int       new_time;                /* new clock value          */
        export CLD_Load_Clock
CLD_Load_Clock
;{
;
;    /* Set the system time.  */
;    CLD_System_Clock =  new_time;
        MOVE.L  4(A7),CLD_System_Clock
;    /* Fix for version 3.07 and later of the INTROL compiler
;     * Return and pop parameters off stack
;     */

⌨️ 快捷键说明

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