Deleted Added
full compact
acpi_timer.c (69744) acpi_timer.c (71872)
1/*-
2 * Copyright (c) 2000 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 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 69744 2000-12-08 09:16:20Z msmith $
27 * $FreeBSD: head/sys/dev/acpica/acpi_timer.c 71872 2001-01-31 09:30:57Z msmith $
28 */
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/bus.h>
34
35#include "acpi.h"

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

68};
69
70devclass_t acpi_timer_devclass;
71DRIVER_MODULE(acpi_timer, acpi, acpi_timer_driver, acpi_timer_devclass, 0, 0);
72
73static void
74acpi_timer_identify(driver_t *driver, device_t parent)
75{
28 */
29
30#include "opt_acpi.h"
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/bus.h>
34
35#include "acpi.h"

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

68};
69
70devclass_t acpi_timer_devclass;
71DRIVER_MODULE(acpi_timer, acpi, acpi_timer_driver, acpi_timer_devclass, 0, 0);
72
73static void
74acpi_timer_identify(driver_t *driver, device_t parent)
75{
76 static FADT_DESCRIPTOR_REV1 fadt;
77 ACPI_BUFFER buf;
78 ACPI_STATUS status;
79 device_t dev;
80 char desc[40];
81
82 FUNCTION_TRACE(__FUNCTION__);
83
84 if (acpi_disabled("timer"))
85 return_VOID;
86
76 device_t dev;
77 char desc[40];
78
79 FUNCTION_TRACE(__FUNCTION__);
80
81 if (acpi_disabled("timer"))
82 return_VOID;
83
87 buf.Pointer = &fadt;
88 buf.Length = sizeof(fadt);
89 if ((status = AcpiGetTable(ACPI_TABLE_FADT, 1, &buf)) != AE_OK) {
90 device_printf(parent, "can't locate FADT - %s\n", acpi_strerror(status));
84 if (AcpiGbl_FADT == NULL)
91 return_VOID;
85 return_VOID;
92 }
93 if (buf.Length != sizeof(fadt)) {
94 device_printf(parent, "invalid FADT\n");
95 return_VOID;
96 }
97
86
98 if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) {
99 device_printf(parent, "could not add acpi_timer0\n");
100 return_VOID;
101 }
102 if (acpi_set_magic(dev, ACPITIMER_MAGIC)) {
103 device_printf(dev, "could not set magic\n");
104 return_VOID;
105 }
106
87 if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) {
88 device_printf(parent, "could not add acpi_timer0\n");
89 return_VOID;
90 }
91 if (acpi_set_magic(dev, ACPITIMER_MAGIC)) {
92 device_printf(dev, "could not set magic\n");
93 return_VOID;
94 }
95
107 sprintf(desc, "%d-bit timer at 3.579545MHz", fadt.TmrValExt ? 32 : 24);
96 sprintf(desc, "%d-bit timer at 3.579545MHz", AcpiGbl_FADT->TmrValExt ? 32 : 24);
108 device_set_desc_copy(dev, desc);
109
110 return_VOID;
111}
112
113static int
114acpi_timer_probe(device_t dev)
115{

--- 17 unchanged lines hidden ---
97 device_set_desc_copy(dev, desc);
98
99 return_VOID;
100}
101
102static int
103acpi_timer_probe(device_t dev)
104{

--- 17 unchanged lines hidden ---