Re: low_delay_interrupts?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 24, 2004 at 08:31:17AM -0800, prasanna wakhare wrote:
> Hi all,
>  timer generates interruptes at HZ value  we set this 
> value in  timer0 .
> this calculates to 1ms at which jiffies are incerment
> in interrupt handler routine for timer interrupt!
> if one have to generate same periodic interrupts at
> extremly small delays like say 20 micro second ?
> is there any way to do it in timer0 interrupt only we
> can adjust the counter to generate at say 20 micro
> second!or like that?
> what are the ways to do have extremly low delay
> interrupts!
> thanks !

You can directly modify PIT controller on I/O port 0x40-0x43.

0x43 is the Mode Control Register, you must program it to accept binary-form-value 
and then insert new one:

from: i8259.c
	outb_p(0x34,0x43);              /* binary, mode 2, LSB/MSB, ch 0 */
	outb_p(LATCH & 0xff , 0x40);    /* LSB */
	outb(LATCH >> 8 , 0x40);        /* MSB */

you must modify LATCH value as you wish:

#define LATCH ((CLOCK_TICK_RATE + HZ/2) / HZ)  

/* CLOCK_TICK_RATE is internal freq, HZ is 100 on linux, 
   you must modify it, for example set LATCH to:
   
   #define LATCH ((CLOCK_TICK_RATE + 1000/2) / 1000)  
   
   if you want 1000hz freq(one tick every ms).
		

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux