atrtc.c (69521) | atrtc.c (71262) |
---|---|
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 * $FreeBSD: head/sys/isa/atrtc.c 69521 2000-12-02 17:59:41Z markm $ | 37 * $FreeBSD: head/sys/isa/atrtc.c 71262 2001-01-19 14:09:54Z peter $ |
38 */ 39 40/* 41 * Routines to handle clock hardware. 42 */ 43 44/* 45 * inittodr, settodr and support routines written 46 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at> 47 * 48 * reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94 49 */ 50 51#include "opt_clock.h" | 38 */ 39 40/* 41 * Routines to handle clock hardware. 42 */ 43 44/* 45 * inittodr, settodr and support routines written 46 * by Christoph Robitschko <chmr@edvz.tu-graz.ac.at> 47 * 48 * reintroduced and updated by Chris Stenton <chris@gnome.co.uk> 8/10/94 49 */ 50 51#include "opt_clock.h" |
52#include "apm.h" | 52#include "opt_apm.h" |
53 54#include <sys/param.h> 55#include <sys/systm.h> 56#include <sys/bus.h> 57#include <sys/ipl.h> 58#include <sys/mutex.h> 59#include <sys/proc.h> 60#include <sys/time.h> --- 730 unchanged lines hidden (view full) --- 791#if !defined(SMP) 792 /* 793 * We can not use the TSC in SMP mode, until we figure out a 794 * cheap (impossible), reliable and precise (yeah right!) way 795 * to synchronize the TSCs of all the CPUs. 796 * Curse Intel for leaving the counter out of the I/O APIC. 797 */ 798 | 53 54#include <sys/param.h> 55#include <sys/systm.h> 56#include <sys/bus.h> 57#include <sys/ipl.h> 58#include <sys/mutex.h> 59#include <sys/proc.h> 60#include <sys/time.h> --- 730 unchanged lines hidden (view full) --- 791#if !defined(SMP) 792 /* 793 * We can not use the TSC in SMP mode, until we figure out a 794 * cheap (impossible), reliable and precise (yeah right!) way 795 * to synchronize the TSCs of all the CPUs. 796 * Curse Intel for leaving the counter out of the I/O APIC. 797 */ 798 |
799#if NAPM > 0 | 799#ifdef DEV_APM |
800 /* 801 * We can not use the TSC if we support APM. Precise timekeeping 802 * on an APM'ed machine is at best a fools pursuit, since 803 * any and all of the time spent in various SMM code can't 804 * be reliably accounted for. Reading the RTC is your only 805 * source of reliable time info. The i8254 looses too of course 806 * but we need to have some kind of time... 807 * We don't know at this point whether APM is going to be used 808 * or not, nor when it might be activated. Play it safe. 809 */ 810 { 811 int disabled = 0; 812 resource_int_value("apm", 0, "disabled", &disabled); 813 if (disabled == 0) 814 return; 815 } | 800 /* 801 * We can not use the TSC if we support APM. Precise timekeeping 802 * on an APM'ed machine is at best a fools pursuit, since 803 * any and all of the time spent in various SMM code can't 804 * be reliably accounted for. Reading the RTC is your only 805 * source of reliable time info. The i8254 looses too of course 806 * but we need to have some kind of time... 807 * We don't know at this point whether APM is going to be used 808 * or not, nor when it might be activated. Play it safe. 809 */ 810 { 811 int disabled = 0; 812 resource_int_value("apm", 0, "disabled", &disabled); 813 if (disabled == 0) 814 return; 815 } |
816#endif /* NAPM > 0 */ | 816#endif /* DEV_APM */ |
817 818 if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { 819 tsc_timecounter.tc_frequency = tsc_freq; 820 tc_init(&tsc_timecounter); 821 } 822 823#endif /* !defined(SMP) */ 824} --- 451 unchanged lines hidden --- | 817 818 if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { 819 tsc_timecounter.tc_frequency = tsc_freq; 820 tc_init(&tsc_timecounter); 821 } 822 823#endif /* !defined(SMP) */ 824} --- 451 unchanged lines hidden --- |