Deleted Added
full compact
acpi_timer.c (81096) acpi_timer.c (81172)
1/*-
2 * Copyright (c) 2000, 2001 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2000, 2001 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/acpica/acpi_timer.c 81096 2001-08-03 09:52:53Z msmith $
27 * $FreeBSD: head/sys/dev/acpica/acpi_timer.c 81172 2001-08-05 23:20:32Z msmith $
28 */
29#include "opt_acpi.h"
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/kernel.h>
33#include <sys/sysctl.h>
34#include <sys/timetc.h>
35

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

312/*
313 * Look at PCI devices going past; if we detect one we know contains
314 * a functional ACPI timer device, enable the faster timecounter read
315 * routine.
316 */
317static int
318acpi_timer_pci_probe(device_t dev)
319{
28 */
29#include "opt_acpi.h"
30#include <sys/param.h>
31#include <sys/bus.h>
32#include <sys/kernel.h>
33#include <sys/sysctl.h>
34#include <sys/timetc.h>
35

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

312/*
313 * Look at PCI devices going past; if we detect one we know contains
314 * a functional ACPI timer device, enable the faster timecounter read
315 * routine.
316 */
317static int
318acpi_timer_pci_probe(device_t dev)
319{
320 if ((pci_get_vendor(dev) == 0x8086) &&
321 (pci_get_device(dev) == 0x7113) &&
322 (pci_get_revid(dev) >= 0x03)) {
320 int vendor, device, revid;
321
322 vendor = pci_get_vendor(dev);
323 device = pci_get_device(dev);
324 revid = pci_get_revid(dev);
325
326 if (((vendor == 0x8086) && (device == 0x7113) && (revid >= 0x03)) || /* PIIX4M */
327 ((vendor == 0x8086) && (device == 0x719b)) || /* i440MX */
328 0) {
329
323 acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount;
330 acpi_timer_timecounter.tc_get_timecount = acpi_timer_get_timecount;
324 acpi_timer_timecounter.tc_name = "ACPI-PIIX4M";
331 acpi_timer_timecounter.tc_name = "ACPI-fast";
325 if (bootverbose)
332 if (bootverbose)
326 device_printf(acpi_timer_dev, "PIIX4M or later detected, enabling ACPI timer optimisation\n");
333 device_printf(acpi_timer_dev, "functional ACPI timer detected, enabling fast timecount interface\n");
327 }
328
329 return(ENXIO); /* we never match anything */
330}
334 }
335
336 return(ENXIO); /* we never match anything */
337}