summaryrefslogtreecommitdiff
path: root/sys/dev/acpi
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2016-03-14 06:37:32 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2016-03-14 06:37:32 +0000
commited078513889b03c43cf24d053459f31f80985844 (patch)
tree8acf16035baaed98e9f5322e02c16dd775d2a294 /sys/dev/acpi
parentf3453bbfc7ead24852eade3f4d681524931b5394 (diff)
Correct the value of SRT_ENDTAG: it was documented incorrectly in early
ACPI specs. With the correct value, it can now be used in a few places instead of hardcoding 0x79. ok kettenis@
Diffstat (limited to 'sys/dev/acpi')
-rw-r--r--sys/dev/acpi/acpicpu.c4
-rw-r--r--sys/dev/acpi/dsdt.c6
-rw-r--r--sys/dev/acpi/dsdt.h4
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/acpi/acpicpu.c b/sys/dev/acpi/acpicpu.c
index 7bf470b9659..211485622fc 100644
--- a/sys/dev/acpi/acpicpu.c
+++ b/sys/dev/acpi/acpicpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpicpu.c,v 1.72 2015/12/29 04:46:28 mmcc Exp $ */
+/* $OpenBSD: acpicpu.c,v 1.73 2016/03/14 06:37:31 guenther Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2015 Philip Guenther <guenther@openbsd.org>
@@ -386,7 +386,7 @@ acpicpu_add_cstatepkg(struct aml_value *val, void *arg)
if (val->v_package[0]->length != sizeof(*grd) + 2 ||
grd->grd_descriptor != LR_GENREGISTER ||
grd->grd_length != sizeof(grd->grd_gas) ||
- val->v_package[0]->v_buffer[sizeof(*grd)] != SR_TAG(SR_ENDTAG,1)) {
+ val->v_package[0]->v_buffer[sizeof(*grd)] != SRT_ENDTAG) {
printf("\nC%d: bogo buffer", state);
return;
}
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 248148d33c2..f04eb8f946d 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.220 2016/03/02 05:14:34 jsg Exp $ */
+/* $OpenBSD: dsdt.c,v 1.221 2016/03/14 06:37:31 guenther Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -1632,7 +1632,7 @@ aml_parse_resource(struct aml_value *res,
crs = (union acpi_resource *)(res->v_buffer+off);
rlen = AML_CRSLEN(crs);
- if (crs->hdr.typecode == 0x79 || !rlen)
+ if (crs->hdr.typecode == SRT_ENDTAG || !rlen)
break;
crs = aml_mapresource(crs);
@@ -2154,7 +2154,7 @@ aml_concatres(struct aml_value *a1, struct aml_value *a2)
{
struct aml_value *c;
int l1 = 0, l2 = 0, l3 = 2;
- uint8_t a3[] = { 0x79, 0x00 };
+ uint8_t a3[] = { SRT_ENDTAG, 0x00 };
if (a1->type != AML_OBJTYPE_BUFFER || a2->type != AML_OBJTYPE_BUFFER)
aml_die("concatres: not buffers\n");
diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h
index bcecbae824e..a72442624e9 100644
--- a/sys/dev/acpi/dsdt.h
+++ b/sys/dev/acpi/dsdt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.h,v 1.67 2016/01/13 23:11:22 kettenis Exp $ */
+/* $OpenBSD: dsdt.h,v 1.68 2016/03/14 06:37:31 guenther Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -83,7 +83,7 @@ const char *aml_nodename(struct aml_node *);
#define SRT_ENDDEP 0x38
#define SRT_IOPORT 0x47
#define SRT_FIXEDPORT 0x4B
-#define SRT_ENDTAG 0x78
+#define SRT_ENDTAG 0x79
#define SR_IRQ 0x04
#define SR_DMA 0x05