xref: /titanic_41/usr/src/grub/grub-0.97/netboot/timer.c (revision 1b8adde7ba7d5e04395c141c5400dc2cffd7d809)
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 
mdelay(unsigned int msecs)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 
waiton_timer2(unsigned int ticks)23 void waiton_timer2(unsigned int ticks)
24 {
25 	load_timer2(ticks);
26 	while(timer2_running()) {
27 		poll_interruptions();
28 	}
29 }
30