kern

diff src/timer.c @ 34:17433fcaa563

forgot to include timer.h in timer.c
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 09 Jun 2011 02:45:49 +0300
parents 373a9f50b4e6
children 06172322fb76
line diff
     1.1 --- a/src/timer.c	Wed Jun 08 03:02:42 2011 +0300
     1.2 +++ b/src/timer.c	Thu Jun 09 02:45:49 2011 +0300
     1.3 @@ -1,6 +1,7 @@
     1.4  #include <stdio.h>
     1.5  #include "intr.h"
     1.6  #include "asmops.h"
     1.7 +#include "timer.h"
     1.8  #include "config.h"
     1.9  
    1.10  /* frequency of the oscillator driving the 8254 timer */
    1.11 @@ -39,24 +40,22 @@
    1.12  
    1.13  static void intr_handler();
    1.14  
    1.15 -static unsigned long nticks;
    1.16 -
    1.17  
    1.18  void init_timer(void)
    1.19  {
    1.20 -	/* calculate the reset count: round(osc / freq) */
    1.21 -	int reset_count = DIV_ROUND(OSC_FREQ_HZ, TICK_FREQ_HZ);
    1.22 +	/* calculate the reload count: round(osc / freq) */
    1.23 +	int reload_count = DIV_ROUND(OSC_FREQ_HZ, TICK_FREQ_HZ);
    1.24  
    1.25  	/* set the mode to square wave for channel 0, both low
    1.26 -	 * and high reset count bytes will follow...
    1.27 +	 * and high reload count bytes will follow...
    1.28  	 */
    1.29  	outb(CMD_CHAN0 | CMD_ACCESS_BOTH | CMD_OP_SQWAVE, PORT_CMD);
    1.30  
    1.31 -	/* write the low and high bytes of the reset count to the
    1.32 +	/* write the low and high bytes of the reload count to the
    1.33  	 * port for channel 0
    1.34  	 */
    1.35 -	outb(reset_count & 0xff, PORT_DATA0);
    1.36 -	outb((reset_count >> 8) & 0xff, PORT_DATA0);
    1.37 +	outb(reload_count & 0xff, PORT_DATA0);
    1.38 +	outb((reload_count >> 8) & 0xff, PORT_DATA0);
    1.39  
    1.40  	nticks = 0;
    1.41