]> xenbits.xensource.com Git - seabios.git/commitdiff
Rename check_timer() function (and similar) to irqtimer_check().
authorKevin O'Connor <kevin@koconnor.net>
Sat, 20 Jul 2013 22:07:50 +0000 (18:07 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 21 Jul 2013 18:09:29 +0000 (14:09 -0400)
Rename functions to be more consistent and so they are not confused
with the normal timer functions.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/boot.c
src/serial.c
src/timer.c
src/util.c
src/util.h

index 2fce315c9838eed9161ad18ece9e86522bd5d4fe..d421a65f48b18a420fbbc4e21fa95331473adca9 100644 (file)
@@ -635,9 +635,9 @@ boot_fail(void)
         printf("No bootable device.  Retrying in %d seconds.\n"
                , BootRetryTime/1000);
     // Wait for 'BootRetryTime' milliseconds and then reboot.
-    u32 end = calc_future_timer(BootRetryTime);
+    u32 end = irqtimer_calc(BootRetryTime);
     for (;;) {
-        if (BootRetryTime != (u32)-1 && check_timer(end))
+        if (BootRetryTime != (u32)-1 && irqtimer_check(end))
             break;
         yield_toirq();
     }
index 153f82a62b53290f253e93af0d0c83b9306329a3..b4a0a5332c9cf415a80834fb16f59b9a45562f5c 100644 (file)
@@ -91,7 +91,7 @@ handle_1401(struct bregs *regs)
     u16 addr = getComAddr(regs);
     if (!addr)
         return;
-    u32 end = calc_future_timer_ticks(GET_BDA(com_timeout[regs->dx]));
+    u32 end = irqtimer_calc_ticks(GET_BDA(com_timeout[regs->dx]));
     for (;;) {
         u8 lsr = inb(addr+SEROFF_LSR);
         if ((lsr & 0x60) == 0x60) {
@@ -101,7 +101,7 @@ handle_1401(struct bregs *regs)
             regs->ah = lsr;
             break;
         }
-        if (check_timer(end)) {
+        if (irqtimer_check(end)) {
             // Timed out - can't write data.
             regs->ah = lsr | 0x80;
             break;
@@ -118,7 +118,7 @@ handle_1402(struct bregs *regs)
     u16 addr = getComAddr(regs);
     if (!addr)
         return;
-    u32 end = calc_future_timer_ticks(GET_BDA(com_timeout[regs->dx]));
+    u32 end = irqtimer_calc_ticks(GET_BDA(com_timeout[regs->dx]));
     for (;;) {
         u8 lsr = inb(addr+SEROFF_LSR);
         if (lsr & 0x01) {
@@ -127,7 +127,7 @@ handle_1402(struct bregs *regs)
             regs->ah = lsr;
             break;
         }
-        if (check_timer(end)) {
+        if (irqtimer_check(end)) {
             // Timed out - can't read data.
             regs->ah = lsr | 0x80;
             break;
@@ -234,7 +234,7 @@ handle_1700(struct bregs *regs)
     if (!addr)
         return;
 
-    u32 end = calc_future_timer_ticks(GET_BDA(lpt_timeout[regs->dx]));
+    u32 end = irqtimer_calc_ticks(GET_BDA(lpt_timeout[regs->dx]));
 
     outb(regs->al, addr);
     u8 val8 = inb(addr+2);
@@ -249,7 +249,7 @@ handle_1700(struct bregs *regs)
             regs->ah = v ^ 0x48;
             break;
         }
-        if (check_timer(end)) {
+        if (irqtimer_check(end)) {
             // Timeout
             regs->ah = (v ^ 0x48) | 0x01;
             break;
index 9c3c0a937adb78217268b518f2c56564f512cab3..4dc851cbc7553cb0599aa6f66547b49335d5fcc6 100644 (file)
@@ -224,23 +224,23 @@ ticks_from_ms(u32 ms)
 // Calculate the timer value at 'count' number of full timer ticks in
 // the future.
 u32
-calc_future_timer_ticks(u32 count)
+irqtimer_calc_ticks(u32 count)
 {
     return (GET_BDA(timer_counter) + count + 1) % TICKS_PER_DAY;
 }
 
 // Return the timer value that is 'msecs' time in the future.
 u32
-calc_future_timer(u32 msecs)
+irqtimer_calc(u32 msecs)
 {
     if (!msecs)
         return GET_BDA(timer_counter);
-    return calc_future_timer_ticks(ticks_from_ms(msecs));
+    return irqtimer_calc_ticks(ticks_from_ms(msecs));
 }
 
 // Check if the given timer value has passed.
 int
-check_timer(u32 end)
+irqtimer_check(u32 end)
 {
     return (((GET_BDA(timer_counter) + TICKS_PER_DAY - end) % TICKS_PER_DAY)
             < (TICKS_PER_DAY/2));
index ccf84b0075c76e9d0a3b011642e5267ae80f9467..ffabd1ca8510dcd958e7a96939e0184ebc124ad9 100644 (file)
@@ -281,11 +281,11 @@ get_raw_keystroke(void)
 int
 get_keystroke(int msec)
 {
-    u32 end = calc_future_timer(msec);
+    u32 end = irqtimer_calc(msec);
     for (;;) {
         if (check_for_keystroke())
             return get_raw_keystroke();
-        if (check_timer(end))
+        if (irqtimer_check(end))
             return -1;
         yield_toirq();
     }
index bc2fd0065e282294a7b602f41c35f694562904e4..10c2364cb1afd1412d63072327584282c1b06893 100644 (file)
@@ -295,9 +295,9 @@ void usleep(u32 count);
 void msleep(u32 count);
 u32 calc_future_tsc(u32 msecs);
 u32 calc_future_tsc_usec(u32 usecs);
-u32 calc_future_timer_ticks(u32 count);
-u32 calc_future_timer(u32 msecs);
-int check_timer(u32 end);
+u32 irqtimer_calc_ticks(u32 count);
+u32 irqtimer_calc(u32 msecs);
+int irqtimer_check(u32 end);
 
 // apm.c
 void apm_shutdown(void);