📄 tct.s
字号:
;/*************************************************************************/;/* */;/* Copyright (c) 1993-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 */;/* */;/* tct.s Nucleus PLUS\Integrator\ADS 1.13.4 */;/* */;/* COMPONENT */;/* */;/* TC - Thread Control */;/* */;/* DESCRIPTION */;/* */;/* This file contains the target processor dependent routines for */;/* performing target-dependent scheduling functions. */;/* */;/* DATA STRUCTURES */;/* */;/* None */;/* */;/* FUNCTIONS */;/* */;/* TCT_Control_Interrupts Enable / disable interrupts */;/* by changing */;/* TCD_Interrupt_Level */;/* TCT_Local_Control_Interrupts Enable/disable interrupts */;/* by not changing */;/* TCD_Interrupt_Level */;/* TCT_Restore_Interrupts Restores interrupts to the */;/* level in TCD_Interrupt_Level */;/* TCT_Build_Task_Stack Build initial task stack */;/* TCT_Build_HISR_Stack Build initial HISR stack */;/* TCT_Build_Signal_Frame Build signal handler frame */;/* TCT_Check_Stack Check current stack */;/* TCT_Schedule Schedule the next thread */;/* TCT_Control_To_Thread Transfer control to a thread */;/* TCT_Control_To_System Transfer control from thread */;/* TCT_Signal_Exit Exit from signal handler */;/* TCT_Current_Thread Returns a pointer to current */;/* thread */;/* TCT_Set_Execute_Task Sets TCD_Execute_Task under */;/* protection from interrupts */;/* TCT_Protect Protect critical section */;/* TCT_Unprotect Unprotect critical section */;/* TCT_Unprotect_Specific Release specific protection */;/* TCT_Set_Current_Protect Set the thread's current */;/* protection field */;/* TCT_Protect_Switch Switch to protected thread */;/* TCT_Schedule_Protected Schedule the protected thread*/;/* TCT_Interrupt_Context_Save Save interrupted context */;/* TCT_Interrupt_Context_Restore Restore interrupted context */;/* TCT_Activate_HISR Activate a HISR */;/* TCT_HISR_Shell HISR execution shell */;/* */;/* DEPENDENCIES */;/* */;/* cs_extr.h Common Service functions */;/* tc_extr.h Thread Control functions */;/* */;/* HISTORY */;/* */;/* NAME DATE REMARKS */;/* */;/* D. Driscoll 07-02-2001 Released version 1.13.2 */;/* D. Driscoll 01-04-2002 Released version 1.13.3. */;/* Updated context save/restore */;/* routines to handle nested / */;/* prioritized IRQs. */;/* J. Pregeant 03-27-2002 Released version 1.13.4 */;/*************************************************************************/;#define NU_SOURCE_FILE;#include "cs_extr.h" /* Common service functions */;#include "tc_extr.h" /* Thread control functions */;/* Define constants used in low-level initialization. */ INCLUDE int_defs.s;/* End of low-level initialization constants. */ IF (:DEF: SYSTEM_PROFILING_A) INCLUDE sysprofile.inc ENDIF;/* NOTE: Define "INCLUDE_PROVIEW" to include hooks for Nucleus ProView; support. To do this use the -pd option on the assembler line:; -pd "INCLUDE_PROVIEW SETL {TRUE}";*/ IF (:LNOT: :DEF: INCLUDE_PROVIEW) GBLL INCLUDE_PROVIEWINCLUDE_PROVIEW SETL {FALSE} ENDIF AREA |C$$data|,DATA|x$dataseg|;/* Define a variable for saving the system stack limit in. This value is; intialized in INT_DEFS.S and is in effect whenever the system stack is in ; use. */;VOID *TCT_System_Limit;/* Define internal variables so the C compiler can provide meaningful ; code with offsets into data structures. Typically, this section is; removed after this file is compiled down to assembly language. */; ;BYTE_PTR REG_Stack_Base;BYTE_PTR REG_Stack_End;BYTE_PTR REG_Stack_Ptr;UNSIGNED REG_Stack_Size;TC_TCB *REG_Thread_Ptr;TC_HCB *REG_HISR_Ptr;TC_PROTECT *REG_Protect_Ptr;VOID *REG_Function_Ptr EXPORT TCT_System_LimitTCT_System_Limit DCD &00000000; 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} = 16THUMB 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 TC_TCB *TCD_Execute_Task;extern TC_HCB *TCD_Execute_HISR;extern VOID *TCD_Current_Thread;extern VOID *TCD_System_Stack;extern INT TCD_Interrupt_Count;extern TC_HCB *TCD_Active_HISR_Heads[TC_HISR_PRIORITIES];extern TC_HCB *TCD_Active_HISR_Tails[TC_HISR_PRIORITIES];extern INT TCD_Interrupt_Level;extern UNSIGNED TMD_Time_Slice;extern INT TMD_Time_Slice_State IMPORT TCD_Execute_Task IMPORT TCD_Execute_HISR IMPORT TCD_Current_Thread IMPORT TCD_System_Stack IMPORT TCD_Interrupt_Count IMPORT TCD_Active_HISR_Heads IMPORT TCD_Active_HISR_Tails IMPORT TCD_Interrupt_Level IMPORT TMD_Time_Slice IMPORT TMD_Time_Slice_State;/* Define external function references. */;VOID TCC_Task_Shell(VOID);VOID TCC_Signal_Shell(VOID);VOID TCT_HISR_Shell(VOID);VOID ERC_System_Error(INT error) IMPORT TCC_Task_Shell IMPORT TCC_Signal_Shell IMPORT ERC_System_Error IF INCLUDE_PROVIEW IMPORT _NU_Idle_Hook IMPORT _NU_Schedule_Task_Hook ENDIF IMPORT l1c_pwr_sleep_mode_handler IMPORT l1d_reg_perf_idle_start IMPORT l1d_reg_perf_idle_end IMPORT l1d_reg_perf_suspend;/* Define internal function references. */;VOID TCT_Schedule_Protected(VOID *thread) EXPORT TCT_Schedule_Protected;/* Define pointers to system variables so their addresses may be obtained in a; pc-relative manner. */System_Limit DCD TCT_System_LimitInt_Level DCD TCD_Interrupt_LevelTask_Shell DCD TCC_Task_ShellHISR_Shell DCD TCT_HISR_ShellSignal_Shell DCD TCC_Signal_ShellCurrent_Thread DCD TCD_Current_ThreadExecute_HISR DCD TCD_Execute_HISRExecute_Task DCD TCD_Execute_TaskTime_Slice DCD TMD_Time_SliceSlice_State DCD TMD_Time_Slice_StateSystem_Stack DCD TCD_System_StackInt_Count DCD TCD_Interrupt_CountHISR_Tails DCD TCD_Active_HISR_TailsHISR_Heads DCD TCD_Active_HISR_Heads
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -