Diff for /src/sys/dev/sound/isa/i386/spkr/Attic/spkr.c between versions 1.8 and 1.9

version 1.8, 2003/08/27 06:48:15 version 1.9, 2004/01/30 05:42:16
Line 15 Line 15
 #include <sys/uio.h>  #include <sys/uio.h>
 #include <sys/conf.h>  #include <sys/conf.h>
 #include <sys/ctype.h>  #include <sys/ctype.h>
   #include <sys/systimer.h>
 #include <bus/isa/i386/isa.h>  #include <bus/isa/i386/isa.h>
 #include <i386/isa/timerreg.h>  #include <i386/isa/timerreg.h>
 #include <machine/clock.h>  #include <machine/clock.h>
Line 79  tone(thz, ticks) Line 80  tone(thz, ticks)
         unsigned int thz, ticks;          unsigned int thz, ticks;
 {  {
     unsigned int divisor;      unsigned int divisor;
     int sps;  
   
     if (thz <= 0)      if (thz <= 0)
         return;          return;
   
    divisor = timer_freq / thz;    divisor = cputimer_freq / thz;
   
 #ifdef DEBUG  #ifdef DEBUG
     (void) printf("tone: thz=%d ticks=%d\n", thz, ticks);      (void) printf("tone: thz=%d ticks=%d\n", thz, ticks);
 #endif /* DEBUG */  #endif /* DEBUG */
   
     /* set timer to generate clicks at given frequency in Hertz */      /* set timer to generate clicks at given frequency in Hertz */
     sps = splclock();  
   
     if (acquire_timer2(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT)) {      if (acquire_timer2(TIMER_SEL2 | TIMER_SQWAVE | TIMER_16BIT)) {
         /* enter list of waiting procs ??? */          /* enter list of waiting procs ??? */
         splx(sps);  
         return;          return;
     }      }
     splx(sps);  
     clock_lock();      clock_lock();
     outb(TIMER_CNTR2, (divisor & 0xff));        /* send lo byte */      outb(TIMER_CNTR2, (divisor & 0xff));        /* send lo byte */
     outb(TIMER_CNTR2, (divisor >> 8));  /* send hi byte */      outb(TIMER_CNTR2, (divisor >> 8));  /* send hi byte */
Line 115  tone(thz, ticks) Line 112  tone(thz, ticks)
     if (ticks > 0)      if (ticks > 0)
         tsleep((caddr_t)&endtone, PCATCH, "spkrtn", ticks);          tsleep((caddr_t)&endtone, PCATCH, "spkrtn", ticks);
     outb(IO_PPI, inb(IO_PPI) & ~PPI_SPKR);      outb(IO_PPI, inb(IO_PPI) & ~PPI_SPKR);
     sps = splclock();  
     release_timer2();      release_timer2();
     splx(sps);  
 }  }
   
 /* rest for given number of ticks */  /* rest for given number of ticks */

Removed from v.1.8  
changed lines
  Added in v.1.9