| 1 | /*- |
| 2 | * Copyright (c) 1990 The Regents of the University of California. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * This code is derived from software contributed to Berkeley by |
| 6 | * William Jolitz. |
| 7 | * |
| 8 | * %sccs.include.386.c% |
| 9 | * |
| 10 | * @(#)clock.c 5.1 (Berkeley) %G% |
| 11 | */ |
| 12 | |
| 13 | /* |
| 14 | * Primitive clock interrupt routines. |
| 15 | */ |
| 16 | #include "param.h" |
| 17 | #include "time.h" |
| 18 | #include "kernel.h" |
| 19 | #include "icu.h" |
| 20 | |
| 21 | startrtclock() { |
| 22 | |
| 23 | /* initialize 8253 clock */ |
| 24 | outb (0x43, 0x36); |
| 25 | outb (0x40, 1193182/60); |
| 26 | outb (0x40, (1193182/60)/256); |
| 27 | } |
| 28 | |
| 29 | clkreld() { |
| 30 | pg("clkreld"); |
| 31 | } |
| 32 | |
| 33 | /* |
| 34 | * Initialze the time of day register, based on the time base which is, e.g. |
| 35 | * from a filesystem. |
| 36 | */ |
| 37 | inittodr(base) |
| 38 | time_t base; |
| 39 | { |
| 40 | |
| 41 | time.tv_sec = base; |
| 42 | } |
| 43 | |
| 44 | /* |
| 45 | * Restart the clock. |
| 46 | */ |
| 47 | resettodr() |
| 48 | { |
| 49 | } |
| 50 | |
| 51 | enablertclock() { |
| 52 | INTREN(IRQ0); |
| 53 | splnone(); |
| 54 | } |