17c478bd9Sstevel@tonic-gate /* A couple of routines to implement a low-overhead timer for drivers */ 27c478bd9Sstevel@tonic-gate 37c478bd9Sstevel@tonic-gate /* 47c478bd9Sstevel@tonic-gate * This program is free software; you can redistribute it and/or 57c478bd9Sstevel@tonic-gate * modify it under the terms of the GNU General Public License as 67c478bd9Sstevel@tonic-gate * published by the Free Software Foundation; either version 2, or (at 77c478bd9Sstevel@tonic-gate * your option) any later version. 87c478bd9Sstevel@tonic-gate */ 97c478bd9Sstevel@tonic-gate #include "grub.h" 107c478bd9Sstevel@tonic-gate #include "timer.h" 117c478bd9Sstevel@tonic-gate 127c478bd9Sstevel@tonic-gate /* Machine Independant timer helper functions */ 137c478bd9Sstevel@tonic-gate mdelay(unsigned int msecs)147c478bd9Sstevel@tonic-gatevoid mdelay(unsigned int msecs) 157c478bd9Sstevel@tonic-gate { 167c478bd9Sstevel@tonic-gate unsigned int i; 177c478bd9Sstevel@tonic-gate for(i = 0; i < msecs; i++) { 187c478bd9Sstevel@tonic-gate udelay(1000); 197c478bd9Sstevel@tonic-gate poll_interruptions(); 207c478bd9Sstevel@tonic-gate } 217c478bd9Sstevel@tonic-gate } 227c478bd9Sstevel@tonic-gate waiton_timer2(unsigned int ticks)237c478bd9Sstevel@tonic-gatevoid waiton_timer2(unsigned int ticks) 247c478bd9Sstevel@tonic-gate { 257c478bd9Sstevel@tonic-gate load_timer2(ticks); 267c478bd9Sstevel@tonic-gate while(timer2_running()) { 277c478bd9Sstevel@tonic-gate poll_interruptions(); 287c478bd9Sstevel@tonic-gate } 297c478bd9Sstevel@tonic-gate } 30