/* --- SCHED.H
   ---
   --- Include file for scheduler.
   ---
   --- Copyright 1996 Trident Robotics and Research, Inc.
   ---
   --- 01/20/96 RMV	Initial coding
   ---
   --- */

#define		SBS_ON		100
#define		SBS_OFF		101
#define		SBS_KILL	102

typedef void /* interrupt */(*hndlr_ptr)(void);
typedef void (*voidfnc_ptr)(void);
typedef int (*intfnc_ptr)(void);
typedef void *pointer;

typedef struct{ intfnc_ptr	func_ptr;
		unsigned long	pid;
		short		status;
		short		criticality;
		unsigned long	nPeriod;
		unsigned long	nextReady;
		float		freq;
		short		missed;
		} processT;

typedef struct{ processT	*process;
		pointer		nextProc;
		} procListT;

#ifndef SCHED_SRC
#define SCHED_SRC

extern float	clockFreqG;
extern float	clockPeriodG;
extern long	clockTicksG;

extern processT *sbsSpawn(intfnc_ptr f_ptr, float freq, short crit);

extern int sbsControl(processT *p_ptr, short cmd);

extern void sched();

extern float sched_init(float freq);

/* --- This function re-installs the original timer interrupt handler. */
extern void shutdown();

#endif