diff options
author | Frans Kaashoek <[email protected]> | 2017-08-09 07:43:06 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2017-08-09 07:44:51 -0400 |
commit | 4f14d8d1e594bdf45e36a035f6c3fd4ca959711e (patch) | |
tree | bef4071d263d8dc36f4a01e9342b0a697dc1dc7b /timer.c | |
parent | 70705966adb7a055582f76f2ecdb5ce9cd3c8a85 (diff) | |
download | xv6-labs-4f14d8d1e594bdf45e36a035f6c3fd4ca959711e.tar.gz xv6-labs-4f14d8d1e594bdf45e36a035f6c3fd4ca959711e.tar.bz2 xv6-labs-4f14d8d1e594bdf45e36a035f6c3fd4ca959711e.zip |
Commit to running on an SMP (perhaps with only 1 core). Remove most code
from picirq.c and remove timer.c completely. Update runoff.list.
Diffstat (limited to 'timer.c')
-rw-r--r-- | timer.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/timer.c b/timer.c deleted file mode 100644 index 8df75a9..0000000 --- a/timer.c +++ /dev/null @@ -1,32 +0,0 @@ -// Intel 8253/8254/82C54 Programmable Interval Timer (PIT). -// Only used on uniprocessors; -// SMP machines use the local APIC timer. - -#include "types.h" -#include "defs.h" -#include "traps.h" -#include "x86.h" - -#define IO_TIMER1 0x040 // 8253 Timer #1 - -// Frequency of all three count-down timers; -// (TIMER_FREQ/freq) is the appropriate count -// to generate a frequency of freq Hz. - -#define TIMER_FREQ 1193182 -#define TIMER_DIV(x) ((TIMER_FREQ+(x)/2)/(x)) - -#define TIMER_MODE (IO_TIMER1 + 3) // timer mode port -#define TIMER_SEL0 0x00 // select counter 0 -#define TIMER_RATEGEN 0x04 // mode 2, rate generator -#define TIMER_16BIT 0x30 // r/w counter 16 bits, LSB first - -void -timerinit(void) -{ - // Interrupt 100 times/sec. - outb(TIMER_MODE, TIMER_SEL0 | TIMER_RATEGEN | TIMER_16BIT); - outb(IO_TIMER1, TIMER_DIV(100) % 256); - outb(IO_TIMER1, TIMER_DIV(100) / 256); - picenable(IRQ_TIMER); -} |