diff options
-rw-r--r-- | sys/dev/acpi/acpi.c | 4 | ||||
-rw-r--r-- | sys/dev/acpi/acpiac.c | 4 | ||||
-rw-r--r-- | sys/dev/acpi/acpidev.h | 5 | ||||
-rw-r--r-- | sys/dev/acpi/dsdt.c | 25 |
4 files changed, 15 insertions, 23 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 1a0e224525d..7ec2aca0558 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.28 2006/02/16 22:42:11 jordan Exp $ */ +/* $OpenBSD: acpi.c,v 1.29 2006/02/17 00:46:54 jordan Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -715,7 +715,7 @@ acpi_attach(struct device *parent, struct device *self, void *aux) acpi_softc = sc; -#if 0 +#if 1 /* attach devices found in dsdt */ aml_find_node(aml_root.child, "_INI", acpi_inidev, sc); #endif diff --git a/sys/dev/acpi/acpiac.c b/sys/dev/acpi/acpiac.c index 7afdb0bd1e4..95877874bef 100644 --- a/sys/dev/acpi/acpiac.c +++ b/sys/dev/acpi/acpiac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpiac.c,v 1.3 2006/02/16 22:14:32 marco Exp $ */ +/* $OpenBSD: acpiac.c,v 1.4 2006/02/17 00:46:54 jordan Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * @@ -107,8 +107,6 @@ acpiac_getsta(struct acpiac_softc *sc) return (1); } - dnprintf(40, "_STA value: %x\n", res.v_integer); - if (aml_eval_name(sc->sc_acpi, sc->sc_devnode, "_PSR", &res, &env)) { dnprintf(10, "%s: no _PSR\n", DEVNAME(sc)); diff --git a/sys/dev/acpi/acpidev.h b/sys/dev/acpi/acpidev.h index d823bcb64b8..8db54c162dc 100644 --- a/sys/dev/acpi/acpidev.h +++ b/sys/dev/acpi/acpidev.h @@ -1,4 +1,4 @@ -/* $OpenBSD: acpidev.h,v 1.4 2006/02/16 22:14:32 marco Exp $ */ +/* $OpenBSD: acpidev.h,v 1.5 2006/02/17 00:46:54 jordan Exp $ */ /* * Copyright (c) 2005 Marco Peereboom <marco@openbsd.org> * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> @@ -192,4 +192,7 @@ struct acpibat_bmd { #define HPET_TIMER2_COMPARE 0x408 #define HPET_TIMER2_INTERRUPT 0x510 +#define STA_PRESENT (1L << 0) +#define STA_BATTERY (1L << 4) + #endif /* __DEV_ACPI_ACPIDEV_H__ */ diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 18eb6909574..33baa15ce08 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.21 2006/02/16 22:42:11 jordan Exp $ */ +/* $OpenBSD: dsdt.c,v 1.22 2006/02/17 00:46:54 jordan Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -371,10 +371,8 @@ _aml_freevalue(struct aml_value *v) if (v->node || v->refcnt) return (-1); -#if 0 dnprintf(50, "freeing value : %4x %s\n", v->type, v->node ? "attached" : "freeable"); -#endif return -1; switch (v->type) { @@ -1321,11 +1319,9 @@ aml_efield(struct acpi_context *ctx, struct aml_value *e_fld, uint8_t *pb; int blen; -#if 0 - dnprintf(40, "efield %s: ", rhs ? "set" : "get"); + dnprintf(80, "efield %s: ", rhs ? "set" : "get"); aml_showvalue(e_fld); aml_showvalue(rhs); -#endif tmp.type = AML_OBJTYPE_INTEGER; switch (e_fld->v_field.type) { @@ -1721,13 +1717,11 @@ aml_esetnodevalue(struct acpi_context *ctx, struct aml_value *lhs, rhs = aml_allocint(rval); } -#if 0 dnprintf(50, "------------ SET NODE VALUE -------------\n"); dnprintf(50, "new : "); aml_showvalue(rhs); dnprintf(50, "current: "); aml_showvalue(lhs); -#endif while (lhs->type == AML_OBJTYPE_OBJREF) { lhs = aml_ederef(ctx, lhs); @@ -1750,10 +1744,8 @@ aml_esetnodevalue(struct acpi_context *ctx, struct aml_value *lhs, _aml_freevalue(lhs); *lhs = *rhs; } -#if 0 - dnprintf(50, "post : "); aml_showvalue(lhs); -#endif + dnprintf(50, "--------- post set ----------\n"); return rhs; } @@ -1850,7 +1842,7 @@ aml_doif(struct acpi_context *ctx) /* Parse IF block */ rv = aml_eparselist(ctx, end, 1); } - if (*end == AMLOP_ELSE) { + if (ctx->pos != NULL && *end == AMLOP_ELSE) { /* Parse ELSE block */ ctx->pos = ++end; end = aml_eparselen(ctx); @@ -2084,10 +2076,8 @@ aml_eparseval(struct acpi_context *ctx, int deref) start = ctx->pos; opc = aml_getopcode(ctx); -#if 0 dnprintf(40, "### %2d %.4x %s\n", ctx->depth, opc->opcode, opc->mnem); -#endif ctx->depth++; end = NULL; @@ -2408,10 +2398,8 @@ aml_eparseval(struct acpi_context *ctx, int deref) break; case AMLOP_RETURN: rv = aml_eparseval(ctx, 1); -#if 0 dnprintf(40, "RETURNING: "); aml_showvalue(rv); -#endif ctx->pos = NULL; break; case AMLOP_MID: @@ -2637,11 +2625,14 @@ aml_eval_object(struct acpi_softc *sc, struct aml_node *node, struct acpi_context *ctx; struct aml_value *rv; + ret->type = 0; ctx = acpi_alloccontext(sc, node, argc, argv); rv = aml_eparsenode(ctx, node); dnprintf(40, "###### RETURNING #####\n"); aml_showvalue(rv); - *ret = *rv; + if (rv != NULL) { + *ret = *rv; + } /* XXX: must free rv */ acpi_freecontext(ctx); |