#ifndef __CLOCK_H_ #define __CLOCK_H_ /* clock.h If you wish to incorporate preemption into your project, you will need the following routines. Tian Lim 1/26/96 last modified 4/7/96 8/8/96 (sungeun) 10/13/97 (Neal Cardwell) */ #include #include /* ClockHandler is a ptr to a function such as "void clkhndlr(void)". */ typedef void (*ClockHandler) (); /* PERIOD is the clock period in microseconds. It is the interval at which clock ticks will be sent */ #define PERIOD 500 /* Are interrupts enabled? */ typedef int boolean_t; extern boolean_t interrupts; /* this is defined in clock.c */ #define ENABLED 1 #define DISABLED 0 /* routines to set the interrupts flag */ extern void enable_interrupts(); extern void disable_interrupts(); /* minithread_clock_init * installs your clock interrupt service routine h. * h will be called every PERIOD microseconds (defined above). * interrupts are disabled by default. After you enable interrupts * then your handler will be called automatically on every clock tick. */ extern void minithread_clock_init(ClockHandler h); #endif __CLOCK_H_