/*
    TMScheduler.h, Copyright  (c) by Christian Conrad & George,
    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/TMScheduler.h,v $
 	Author(s):             Christian Conrad & George Fankhauser
 	Affiliation:           ETH Zuerich, TIK
 	Version:               $Revision: 3035 $
 	Creation Date:         
 	Last Date of Change:   $Date: 2007-05-30 19:20:44 +0200 (Mit, 30 Mai 2007) $      by: $Author: sryffel $
	
*/

#ifndef __TMSCHEDULER_H
#define __TMSCHEDULER_H

#include "tm-include.h"

/*
 * Scheduler interface functions (used by the thread manager)
 */
void schedulerInit(Thread* threadPtr);
void schedulerInsert( Thread* threadPtr, ThreadPriority priority);
void schedulerRemove( Thread* threadPtr);

Error schedulerSetReady( Thread* threadPtr);
Error schedulerSetBlocked( Thread* threadPtr);
Error schedulerChangePriority( Thread* threadPtr, ThreadPriority new_priority);
Thread* schedulerRunning(void);
void schedule(void);

/* Clock interrupt handler and idle thread main function */
void tmClockHandler(void);
void tmIdleMain(void);

/* LR 000703 */
/* Informational output about a single and all threads */
int threadDisplay(Thread *thread);
int parseThreadsList(void);

#endif
