You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

timer.c 658B

123456789101112131415161718192021222324252627282930
  1. /* A couple of routines to implement a low-overhead timer for drivers */
  2. /*
  3. * This program is free software; you can redistribute it and/or
  4. * modify it under the terms of the GNU General Public License as
  5. * published by the Free Software Foundation; either version 2, or (at
  6. * your option) any later version.
  7. */
  8. #include "etherboot.h"
  9. #include "timer.h"
  10. /* Machine Independant timer helper functions */
  11. void mdelay(unsigned int msecs)
  12. {
  13. unsigned int i;
  14. for(i = 0; i < msecs; i++) {
  15. udelay(1000);
  16. poll_interruptions();
  17. }
  18. }
  19. void waiton_timer2(unsigned int ticks)
  20. {
  21. load_timer2(ticks);
  22. while(timer2_running()) {
  23. poll_interruptions();
  24. }
  25. }