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