/*
   Copyright 2001 (c) by Lukas Ruf,
   Swiss Federal Institute of Technology,
   Computer Engineering and Networks Laboratory.
  
   TOPSY -- A Teachable Operating System.  Implementation of a tiny and
   simple micro kernel for teaching purposes.
  
   For further information, please visit http://www.tik.ee.ethz.ch/~topsy
  
   This software is provided under the terms of the GNU General Public 
   Licence. A full copy of the GNU GPL is provided in the file COPYING 
   found in the development root of Topsy.
 */
/*
   File:                 $Source: /home/ruf/cvs_Topsy/cvs/Topsy/Threads/TMTimerNG.h,v $
   Author(s):            Lukas Ruf
   Affiliation:          ETH Zuerich, TIK
   Version:              $Revision: 2922 $
   Creation Date:        2001/01/29
   Last Date of Change:  $Date: 2007-03-19 17:48:52 +0100 (Mon, 19 Mär 2007) $      by: $Author: baderma $
 */

#ifndef _TM_TIMER_
#define _TM_TIMER_

#include "Topsy.h"
#include "Threads.h"
#include "Messages.h"

#define TIMER_LISTEMPTY      1  /* non-critical > 0 */
#define TIMER_OK             0  /* OK */
#define TIMER_INSERTFAILED  -1  /* critical < 0 */
#define TIMER_CLEARFAILED   -2
#define TIMER_EXPIREFAILED  -3

void  tmTimerInit();
Error tmTimerFire();
Error tmTimerInsert(unsigned long deltaTime, ThreadId id,
                    unsigned long *timerId);
Error tmTimerRemove(ThreadId id, unsigned timerId);

#endif
