| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: acpi_cpu_pstate.c,v 1.1 2010/08/08 16:58:42 jruoho Exp $ */ | | 1 | /* $NetBSD: acpi_cpu_pstate.c,v 1.2 2010/08/08 17:05:50 jruoho Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> | | 4 | * Copyright (c) 2010 Jukka Ruohonen <jruohonen@iki.fi> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * | | 10 | * |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -17,27 +17,27 @@ | | | @@ -17,27 +17,27 @@ |
17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | | 17 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND |
18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | | 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | | 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | | 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE |
21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | | 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | | 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | | 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | | 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY |
26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
27 | * SUCH DAMAGE. | | 27 | * SUCH DAMAGE. |
28 | */ | | 28 | */ |
29 | #include <sys/cdefs.h> | | 29 | #include <sys/cdefs.h> |
30 | __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.1 2010/08/08 16:58:42 jruoho Exp $"); | | 30 | __KERNEL_RCSID(0, "$NetBSD: acpi_cpu_pstate.c,v 1.2 2010/08/08 17:05:50 jruoho Exp $"); |
31 | | | 31 | |
32 | #include <sys/param.h> | | 32 | #include <sys/param.h> |
33 | #include <sys/kmem.h> | | 33 | #include <sys/kmem.h> |
34 | #include <sys/once.h> | | 34 | #include <sys/once.h> |
35 | | | 35 | |
36 | #include <dev/acpi/acpireg.h> | | 36 | #include <dev/acpi/acpireg.h> |
37 | #include <dev/acpi/acpivar.h> | | 37 | #include <dev/acpi/acpivar.h> |
38 | #include <dev/acpi/acpi_cpu.h> | | 38 | #include <dev/acpi/acpi_cpu.h> |
39 | | | 39 | |
40 | #define _COMPONENT ACPI_BUS_COMPONENT | | 40 | #define _COMPONENT ACPI_BUS_COMPONENT |
41 | ACPI_MODULE_NAME ("acpi_cpu_pstate") | | 41 | ACPI_MODULE_NAME ("acpi_cpu_pstate") |
42 | | | 42 | |
43 | static void acpicpu_pstate_attach_print(struct acpicpu_softc *); | | 43 | static void acpicpu_pstate_attach_print(struct acpicpu_softc *); |
| @@ -45,32 +45,26 @@ static ACPI_STATUS acpicpu_pstate_pss(s | | | @@ -45,32 +45,26 @@ static ACPI_STATUS acpicpu_pstate_pss(s |
45 | static ACPI_STATUS acpicpu_pstate_pss_add(struct acpicpu_pstate *, | | 45 | static ACPI_STATUS acpicpu_pstate_pss_add(struct acpicpu_pstate *, |
46 | ACPI_OBJECT *); | | 46 | ACPI_OBJECT *); |
47 | static ACPI_STATUS acpicpu_pstate_pct(struct acpicpu_softc *); | | 47 | static ACPI_STATUS acpicpu_pstate_pct(struct acpicpu_softc *); |
48 | static int acpicpu_pstate_max(struct acpicpu_softc *); | | 48 | static int acpicpu_pstate_max(struct acpicpu_softc *); |
49 | static void acpicpu_pstate_change(struct acpicpu_softc *); | | 49 | static void acpicpu_pstate_change(struct acpicpu_softc *); |
50 | static void acpicpu_pstate_bios(void); | | 50 | static void acpicpu_pstate_bios(void); |
51 | | | 51 | |
52 | void | | 52 | void |
53 | acpicpu_pstate_attach(device_t self) | | 53 | acpicpu_pstate_attach(device_t self) |
54 | { | | 54 | { |
55 | struct acpicpu_softc *sc = device_private(self); | | 55 | struct acpicpu_softc *sc = device_private(self); |
56 | ACPI_STATUS rv; | | 56 | ACPI_STATUS rv; |
57 | | | 57 | |
58 | /* | | | |
59 | * XXX: Only Intel is currently supported. | | | |
60 | */ | | | |
61 | if (sc->sc_cap == 0) | | | |
62 | return; | | | |
63 | | | | |
64 | rv = acpicpu_pstate_pss(sc); | | 58 | rv = acpicpu_pstate_pss(sc); |
65 | | | 59 | |
66 | if (ACPI_FAILURE(rv)) | | 60 | if (ACPI_FAILURE(rv)) |
67 | return; | | 61 | return; |
68 | | | 62 | |
69 | rv = acpicpu_pstate_pct(sc); | | 63 | rv = acpicpu_pstate_pct(sc); |
70 | | | 64 | |
71 | if (ACPI_FAILURE(rv)) | | 65 | if (ACPI_FAILURE(rv)) |
72 | return; | | 66 | return; |
73 | | | 67 | |
74 | rv = acpicpu_pstate_max(sc); | | 68 | rv = acpicpu_pstate_max(sc); |
75 | | | 69 | |
76 | if (rv == 0) | | 70 | if (rv == 0) |