timer.c revision 1
1N/A/* A couple of routines to implement a low-overhead timer for drivers */
1N/A
1N/A /*
1N/A * This program is free software; you can redistribute it and/or
1N/A * modify it under the terms of the GNU General Public License as
1N/A * published by the Free Software Foundation; either version 2, or (at
1N/A * your option) any later version.
1N/A */
1N/A#include "grub.h"
1N/A#include "timer.h"
1N/A
1N/A/* Machine Independant timer helper functions */
1N/A
1N/Avoid mdelay(unsigned int msecs)
1N/A{
1N/A unsigned int i;
1N/A for(i = 0; i < msecs; i++) {
1N/A udelay(1000);
1N/A poll_interruptions();
1N/A }
1N/A}
1N/A
1N/Avoid waiton_timer2(unsigned int ticks)
1N/A{
1N/A load_timer2(ticks);
1N/A while(timer2_running()) {
1N/A poll_interruptions();
1N/A }
1N/A}