acpi_cpu: make it work with newer acpi
authorAlexander Polakov <polachok@gmail.com>
Wed, 14 Oct 2009 18:20:53 +0000 (22:20 +0400)
committerAlexander Polakov <polachok@gmail.com>
Wed, 14 Oct 2009 18:20:53 +0000 (22:20 +0400)
sys/dev/acpica5/acpi_cpu_cstate.c
sys/dev/acpica5/acpi_cpu_pstate.c

index 69773b6..9f62c1d 100644 (file)
@@ -47,7 +47,6 @@
 #include <sys/rman.h>
 
 #include "acpi.h"
-#include "accommon.h"
 #include "acpivar.h"
 #include "acpi_cpu.h"
 
@@ -517,7 +516,7 @@ acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc)
        gas.Address = sc->cpu_p_blk + 4;
 
        cx_ptr->rid = sc->cpu_parent->cpux_next_rid;
-       cx_ptr->p_lvlx = acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->rid, &gas,
+       acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->type, &cx_ptr->rid, &gas, &cx_ptr->p_lvlx,
                                            RF_SHAREABLE);
        if (cx_ptr->p_lvlx != NULL) {
            sc->cpu_parent->cpux_next_rid++;
@@ -535,8 +534,8 @@ acpi_cpu_generic_cx_probe(struct acpi_cpu_softc *sc)
        gas.Address = sc->cpu_p_blk + 5;
 
        cx_ptr->rid = sc->cpu_parent->cpux_next_rid;
-       cx_ptr->p_lvlx = acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->rid, &gas,
-                                           RF_SHAREABLE);
+       acpi_bus_alloc_gas(sc->cpu_dev, &cx_ptr->type, &cx_ptr->rid, &gas,
+                                           &cx_ptr->p_lvlx, RF_SHAREABLE);
        if (cx_ptr->p_lvlx != NULL) {
            sc->cpu_parent->cpux_next_rid++;
            cx_ptr->type = ACPI_STATE_C3;
@@ -641,7 +640,7 @@ acpi_cpu_cx_cst(struct acpi_cpu_softc *sc)
 
        /* Allocate the control register for C2 or C3. */
        cx_ptr->rid = sc->cpu_parent->cpux_next_rid;
-       acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->rid, &cx_ptr->p_lvlx,
+       acpi_PkgGas(sc->cpu_dev, pkg, 0, &cx_ptr->type, &cx_ptr->rid, &cx_ptr->p_lvlx,
                    RF_SHAREABLE);
        if (cx_ptr->p_lvlx) {
            sc->cpu_parent->cpux_next_rid++;
@@ -1016,7 +1015,7 @@ acpi_cpu_quirks(void)
            if (val) {
                ACPI_DEBUG_PRINT((ACPI_DB_INFO,
                    "acpi_cpu: PIIX4: reset BRLD_EN_BM\n"));
-               AcpiWriteBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0);
+               AcpiReadBitRegister(ACPI_BITREG_BUS_MASTER_RLD, 0);
            }
            break;
        default:
index d1252f4..5e436c8 100644 (file)
@@ -351,9 +351,9 @@ acpi_pst_attach(device_t dev)
                return error;
        }
        if (bootverbose) {
-               device_printf(dev, "control reg %jd %jx\n",
-                             (intmax_t)sc->pst_creg.pr_gas.SpaceId,
-                             (intmax_t)sc->pst_creg.pr_gas.Address);
+               device_printf(dev, "control reg %d %llx\n",
+                             sc->pst_creg.pr_gas.SpaceId,
+                             sc->pst_creg.pr_gas.Address);
        }
 
        /* Save and try allocating status register */
@@ -1065,7 +1065,7 @@ acpi_pst_alloc_resource(device_t dev, ACPI_OBJECT *obj, int idx,
                        struct acpi_pst_res *res)
 {
        struct acpi_pst_softc *sc = device_get_softc(dev);
-       int error;
+       int error, type;
 
        /* Save GAS */
        error = acpi_PkgRawGas(obj, idx, &res->pr_gas);
@@ -1074,7 +1074,7 @@ acpi_pst_alloc_resource(device_t dev, ACPI_OBJECT *obj, int idx,
 
        /* Allocate resource, if possible */
        res->pr_rid = sc->pst_parent->cpux_next_rid;
-       res->pr_res = acpi_bus_alloc_gas(dev, &res->pr_rid, &res->pr_gas, 0);
+       acpi_bus_alloc_gas(dev, &type, &res->pr_rid, &res->pr_gas, &res->pr_res, 0);
        if (res->pr_res != NULL) {
                sc->pst_parent->cpux_next_rid++;
                res->pr_bt = rman_get_bustag(res->pr_res);