Deleted Added
full compact
clock.c (1390) clock.c (1407)
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 and Don Ahn.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
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 and Don Ahn.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 20 unchanged lines hidden (view full) ---

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)clock.c 7.2 (Berkeley) 5/12/91
37 * $Id: clock.c,v 1.6 1994/02/06 22:48:13 davidg Exp $
37 * $Id: clock.c,v 1.7 1994/04/21 14:19:16 sos Exp $
38 */
39
40/*
41 * Primitive clock interrupt routines.
42 */
43#include "param.h"
44#include "systm.h"
45#include "time.h"

--- 34 unchanged lines hidden (view full) ---

80 prescale = 0;
81 }
82}
83
84
85int
86acquire_timer0(int rate, void (*function)() )
87{
38 */
39
40/*
41 * Primitive clock interrupt routines.
42 */
43#include "param.h"
44#include "systm.h"
45#include "time.h"

--- 34 unchanged lines hidden (view full) ---

80 prescale = 0;
81 }
82}
83
84
85int
86acquire_timer0(int rate, void (*function)() )
87{
88#ifndef INACCURATE_MICROTIME_IS_OK
89 return -1;
90#else
88 if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
89 return -1;
90 timer0_in_use = 1;
91 timer0_rate = rate;
92 prescale = 0;
93 hardclock_prescale = rate/hz;
94 outb(TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT);
95 outb(TIMER_CNTR0, TIMER_DIV(rate)%256);
96 outb(TIMER_CNTR0, TIMER_DIV(rate)/256);
97 if (function)
98 timer_func = function;
99 return 0;
91 if (timer0_in_use) /* XXX || (rate < 20000 && rate % hz)) */
92 return -1;
93 timer0_in_use = 1;
94 timer0_rate = rate;
95 prescale = 0;
96 hardclock_prescale = rate/hz;
97 outb(TIMER_MODE, TIMER_SEL0|TIMER_RATEGEN|TIMER_16BIT);
98 outb(TIMER_CNTR0, TIMER_DIV(rate)%256);
99 outb(TIMER_CNTR0, TIMER_DIV(rate)/256);
100 if (function)
101 timer_func = function;
102 return 0;
103#endif
100}
101
102
103int
104acquire_timer2(int mode)
105{
106 if (timer2_in_use)
107 return -1;

--- 329 unchanged lines hidden ---
104}
105
106
107int
108acquire_timer2(int mode)
109{
110 if (timer2_in_use)
111 return -1;

--- 329 unchanged lines hidden ---