event.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. enum event_enum { KEYBOARD_INTERRUPT_EVENT, IO_COMPLETION_EVENT, ALARM_EVENT,
  2. OS_SIGNAL_EVENT, ERROR_EVENT, NO_EVENT };
  3. extern bool s48_add_pending_fd(int fd, bool is_input);
  4. extern bool s48_remove_fd(int fd);
  5. extern long s48_schedule_alarm_interrupt(long delta);
  6. extern void s48_start_alarm_interrupts(void);
  7. extern void s48_stop_alarm_interrupts(void);
  8. extern long s48_run_time(long *mseconds);
  9. extern long s48_real_time(long *mseconds);
  10. extern int s48_wait_for_event(long max_wait, bool is_minutes);
  11. extern int s48_get_next_event(long *ready_fd, long *status);
  12. /* these are here only for the CHEAP_TIME() macro */
  13. #define TICKS_PER_SECOND 1000 /* clock resolution */
  14. #define POLLS_PER_SECOND 20 /* how often we poll */
  15. #define TICKS_PER_POLL (TICKS_PER_SECOND / POLLS_PER_SECOND)
  16. extern long s48_current_time;
  17. #define CHEAP_TIME() (s48_current_time * TICKS_PER_POLL)
  18. /*
  19. * Fix (HCC) NOTE_EVENT so that it will act like a single
  20. * statement.
  21. */
  22. #define NOTE_EVENT \
  23. do { \
  24. s48_Spending_eventsPS = 1; \
  25. s48_Sstack_limitS = (((char *) -1)); \
  26. } while (0)