/* ******************* ******************************* C HEADER FILE ******************************* ** ******************* ** ** ** ** project : The C Kernel ** ** filename : CKBIND.H ** ** version : 2 ** ** last revised : October 29, 2004 ** ** ** ***************************************************************************** ** ** ** Copyright (c) 2003-2004, P.K. van der Vlugt ** ** All rights reserved. ** ** ** ***************************************************************************** DESCRIPTION: ------------ This is the C Kernel Binding to PC/MSDOS and the good 'old' Borland TurboC compiler V2.01: * The definitions in the definition section have to be setup for each binding environment. * The function prototypes should be implemented in the ckbind.c file. VERSION HISTORY: ---------------- Version : 1 Date : June 01, 2003 Revised by : P.K. van der Vlugt Description : Original version. First version of port to PC/MSDOS and TC 2.01. Version : 2 Date : October 29, 2004 Revised by : P.K. van der Vlugt Description : * Changed module name to comply to new kernel module naming convention. */ #ifndef _CKBIND_INCLUDED #define _CKBIND_INCLUDED /****************************************************************************/ /** **/ /** MODULES USED **/ /** **/ /****************************************************************************/ #include /**** C Kernel configuration ****/ #include "ckconfig.h" /****************************************************************************/ /** **/ /** DEFINITIONS AND MACROS **/ /** **/ /****************************************************************************/ /**** Definitions for protection of critical regions inside CK_ calls ****/ #define START_CRITICAL disable() #define END_CRITICAL enable() #define _disable() disable() #define _enable() enable() /**** Definitions for the inside C Kernel types ****/ #define ck_int8u int8u #define ck_int16u int16u #define ck_bool bool #define ck_int32u int32u /****************************************************************************/ /** **/ /** TYPEDEFS AND STRUCTURES **/ /** **/ /****************************************************************************/ /****************************************************************************/ /** **/ /** EXPORTED VARIABLES **/ /** **/ /****************************************************************************/ #ifndef _CKBIND_C_SRC #endif /****************************************************************************/ /** **/ /** EXPORTED FUNCTIONS **/ /** **/ /****************************************************************************/ /****************************************************************************/ void KernelTickInit (void); /****************************************************************************/ /* * Initializes the necessary tick hardware for the kernel and starts the * tick hardware timer used. This function is called from CK_Init. */ /****************************************************************************/ void KernelTickSetHandler (handlerptr tickHandlerPtr); /****************************************************************************/ /* * Sets the tick handler for the C Kernel. This function is called from * CK_Init. */ /****************************************************************************/ void SetupStack (int8u tid, handlerptr taskFunction, stacktype *stackBasePtr, int16u stacksize); /****************************************************************************/ /* * Initializes the stack for a task. The function is pushed as the return * address, after that all initial values for the registers are pushed in * order to get the correct register values when the task is started. */ /****************************************************************************/ void ContextSwitch (void); /****************************************************************************/ /* * Performs a normal context switch for a task. The context of a task is saved * just as if an interrupt has occured. */ /****************************************************************************/ void ISRcontextSwitch (void); /****************************************************************************/ /* * Performs an interrupt context switch for a task. The context of a task * is already saved by the interrupt so the normal saving of a context * can be skipped. */ #endif /****************************************************************************/ /** **/ /** EOF **/ /** **/ /****************************************************************************/