summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2016-10-25 06:48:59 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2016-10-25 06:48:59 +0000
commit7b6aea1978cafeca1071a28f01ee5790f10f8346 (patch)
tree9d68110825e82dc604f92b30d53f901b21a34591
parent9f52a893878b4ecee5f8b45de43395dccb39a26c (diff)
Add the resource index to aml_parse_resource() callback function.
This is needed by an upcoming acpiec commit that handles machines breaking the current ACPI specifications. Change suggested by and ok kettenis@, guenther@
-rw-r--r--sys/dev/acpi/acpi.c6
-rw-r--r--sys/dev/acpi/acpiprt.c10
-rw-r--r--sys/dev/acpi/bytgpio.c6
-rw-r--r--sys/dev/acpi/chvgpio.c6
-rw-r--r--sys/dev/acpi/dsdt.c14
-rw-r--r--sys/dev/acpi/dsdt.h5
-rw-r--r--sys/dev/acpi/dwiic.c6
-rw-r--r--sys/dev/acpi/sdhc_acpi.c6
-rw-r--r--sys/dev/acpi/tpm.c6
9 files changed, 33 insertions, 32 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index ae6a99316f8..cd1ee4b44da 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.316 2016/09/18 23:56:45 guenther Exp $ */
+/* $OpenBSD: acpi.c,v 1.317 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -513,10 +513,10 @@ TAILQ_HEAD(, acpi_pci) acpi_pcirootdevs =
TAILQ_HEAD_INITIALIZER(acpi_pcirootdevs);
int acpi_getpci(struct aml_node *node, void *arg);
-int acpi_getminbus(union acpi_resource *crs, void *arg);
+int acpi_getminbus(int crsidx, union acpi_resource *crs, void *arg);
int
-acpi_getminbus(union acpi_resource *crs, void *arg)
+acpi_getminbus(int crsidx, union acpi_resource *crs, void *arg)
{
int *bbn = arg;
int typ = AML_CRSTYPE(crs);
diff --git a/sys/dev/acpi/acpiprt.c b/sys/dev/acpi/acpiprt.c
index 00cd745a16e..51d8fe158e2 100644
--- a/sys/dev/acpi/acpiprt.c
+++ b/sys/dev/acpi/acpiprt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpiprt.c,v 1.47 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: acpiprt.c,v 1.48 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2006 Mark Kettenis <kettenis@openbsd.org>
*
@@ -60,8 +60,8 @@ SIMPLEQ_HEAD(, acpiprt_map) acpiprt_map_list =
int acpiprt_match(struct device *, void *, void *);
void acpiprt_attach(struct device *, struct device *, void *);
-int acpiprt_getirq(union acpi_resource *crs, void *arg);
-int acpiprt_chooseirq(union acpi_resource *, void *);
+int acpiprt_getirq(int, union acpi_resource *, void *);
+int acpiprt_chooseirq(int, union acpi_resource *, void *);
struct acpiprt_softc {
struct device sc_dev;
@@ -137,7 +137,7 @@ acpiprt_attach(struct device *parent, struct device *self, void *aux)
}
int
-acpiprt_getirq(union acpi_resource *crs, void *arg)
+acpiprt_getirq(int crsidx, union acpi_resource *crs, void *arg)
{
struct acpiprt_irq *irq = arg;
int typ, len;
@@ -190,7 +190,7 @@ acpiprt_pri[16] = {
};
int
-acpiprt_chooseirq(union acpi_resource *crs, void *arg)
+acpiprt_chooseirq(int crsidx, union acpi_resource *crs, void *arg)
{
struct acpiprt_irq *irq = arg;
int typ, len, i, pri = -1;
diff --git a/sys/dev/acpi/bytgpio.c b/sys/dev/acpi/bytgpio.c
index 611285f19a6..555db4deee4 100644
--- a/sys/dev/acpi/bytgpio.c
+++ b/sys/dev/acpi/bytgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bytgpio.c,v 1.11 2016/05/08 11:08:01 kettenis Exp $ */
+/* $OpenBSD: bytgpio.c,v 1.12 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -104,7 +104,7 @@ const int byt_sus_pins[] = {
56, 54, 49, 55, 48, 57, 50, 58, 52, 53, 59, 40
};
-int bytgpio_parse_resources(union acpi_resource *, void *);
+int bytgpio_parse_resources(int, union acpi_resource *, void *);
int bytgpio_read_pin(void *, int);
void bytgpio_write_pin(void *, int, int);
void bytgpio_intr_establish(void *, int, int, int (*)(), void *);
@@ -238,7 +238,7 @@ free:
}
int
-bytgpio_parse_resources(union acpi_resource *crs, void *arg)
+bytgpio_parse_resources(int crsidx, union acpi_resource *crs, void *arg)
{
struct bytgpio_softc *sc = arg;
int type = AML_CRSTYPE(crs);
diff --git a/sys/dev/acpi/chvgpio.c b/sys/dev/acpi/chvgpio.c
index a7b3c8df4d7..c3352dcbe81 100644
--- a/sys/dev/acpi/chvgpio.c
+++ b/sys/dev/acpi/chvgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chvgpio.c,v 1.5 2016/05/08 18:18:42 kettenis Exp $ */
+/* $OpenBSD: chvgpio.c,v 1.6 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -143,7 +143,7 @@ const int chv_southeast_pins[] = {
8, 12, 6, 8, 10, 11, -1
};
-int chvgpio_parse_resources(union acpi_resource *, void *);
+int chvgpio_parse_resources(int, union acpi_resource *, void *);
int chvgpio_check_pin(struct chvgpio_softc *, int);
int chvgpio_read_pin(void *, int);
void chvgpio_write_pin(void *, int, int);
@@ -264,7 +264,7 @@ unmap:
}
int
-chvgpio_parse_resources(union acpi_resource *crs, void *arg)
+chvgpio_parse_resources(int crsidx, union acpi_resource *crs, void *arg)
{
struct chvgpio_softc *sc = arg;
int type = AML_CRSTYPE(crs);
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c
index 99d5ffc34e2..c018d3f60c2 100644
--- a/sys/dev/acpi/dsdt.c
+++ b/sys/dev/acpi/dsdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.c,v 1.226 2016/10/21 21:47:03 joris Exp $ */
+/* $OpenBSD: dsdt.c,v 1.227 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
*
@@ -1623,14 +1623,14 @@ aml_mapresource(union acpi_resource *crs)
int
aml_parse_resource(struct aml_value *res,
- int (*crs_enum)(union acpi_resource *, void *), void *arg)
+ int (*crs_enum)(int, union acpi_resource *, void *), void *arg)
{
- int off, rlen;
+ int off, rlen, crsidx;
union acpi_resource *crs;
if (res->type != AML_OBJTYPE_BUFFER || res->length < 5)
return (-1);
- for (off = 0; off < res->length; off += rlen) {
+ for (off = 0, crsidx = 0; off < res->length; off += rlen, crsidx++) {
crs = (union acpi_resource *)(res->v_buffer+off);
rlen = AML_CRSLEN(crs);
@@ -1641,7 +1641,7 @@ aml_parse_resource(struct aml_value *res,
#ifdef ACPI_DEBUG
aml_print_resource(crs, NULL);
#endif
- crs_enum(crs, arg);
+ crs_enum(crsidx, crs, arg);
}
return (0);
@@ -1748,7 +1748,7 @@ int aml_compare(struct aml_value *, struct aml_value *, int);
struct aml_value *aml_concat(struct aml_value *, struct aml_value *);
struct aml_value *aml_concatres(struct aml_value *, struct aml_value *);
struct aml_value *aml_mid(struct aml_value *, int, int);
-int aml_ccrlen(union acpi_resource *, void *);
+int aml_ccrlen(int, union acpi_resource *, void *);
void aml_store(struct aml_scope *, struct aml_value *, int64_t,
struct aml_value *);
@@ -2142,7 +2142,7 @@ aml_concat(struct aml_value *a1, struct aml_value *a2)
/* Calculate length of Resource Template */
int
-aml_ccrlen(union acpi_resource *rs, void *arg)
+aml_ccrlen(int crsidx, union acpi_resource *rs, void *arg)
{
int *plen = arg;
diff --git a/sys/dev/acpi/dsdt.h b/sys/dev/acpi/dsdt.h
index 77c83c13088..a3b871a5ecd 100644
--- a/sys/dev/acpi/dsdt.h
+++ b/sys/dev/acpi/dsdt.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsdt.h,v 1.72 2016/09/02 13:59:51 pirofti Exp $ */
+/* $OpenBSD: dsdt.h,v 1.73 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
*
@@ -290,7 +290,8 @@ union acpi_resource {
int aml_print_resource(union acpi_resource *, void *);
int aml_parse_resource(struct aml_value *,
- int (*)(union acpi_resource *, void *), void *);
+ int (*)(int, union acpi_resource *, void *),
+ void *);
#define ACPI_E_NOERROR 0x00
#define ACPI_E_BADVALUE 0x01
diff --git a/sys/dev/acpi/dwiic.c b/sys/dev/acpi/dwiic.c
index 175691c6f47..60bf8d17a22 100644
--- a/sys/dev/acpi/dwiic.c
+++ b/sys/dev/acpi/dwiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwiic.c,v 1.21 2016/09/07 15:31:41 jcs Exp $ */
+/* $OpenBSD: dwiic.c,v 1.22 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Synopsys DesignWare I2C controller
*
@@ -176,7 +176,7 @@ void * dwiic_i2c_intr_establish(void *, void *, int,
int (*)(void *), void *, const char *);
const char * dwiic_i2c_intr_string(void *, void *);
-int dwiic_acpi_parse_crs(union acpi_resource *, void *);
+int dwiic_acpi_parse_crs(int, union acpi_resource *, void *);
int dwiic_acpi_found_hid(struct aml_node *, void *);
int dwiic_acpi_found_ihidev(struct dwiic_softc *,
struct aml_node *, char *, struct dwiic_crs);
@@ -385,7 +385,7 @@ dwiic_activate(struct device *self, int act)
}
int
-dwiic_acpi_parse_crs(union acpi_resource *crs, void *arg)
+dwiic_acpi_parse_crs(int crsidx, union acpi_resource *crs, void *arg)
{
struct dwiic_crs *sc_crs = arg;
struct aml_node *node;
diff --git a/sys/dev/acpi/sdhc_acpi.c b/sys/dev/acpi/sdhc_acpi.c
index f141cd628fd..d531dac13f2 100644
--- a/sys/dev/acpi/sdhc_acpi.c
+++ b/sys/dev/acpi/sdhc_acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdhc_acpi.c,v 1.8 2016/04/30 11:32:23 kettenis Exp $ */
+/* $OpenBSD: sdhc_acpi.c,v 1.9 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Copyright (c) 2016 Mark Kettenis
*
@@ -69,7 +69,7 @@ const char *sdhc_hids[] = {
NULL
};
-int sdhc_acpi_parse_resources(union acpi_resource *, void *);
+int sdhc_acpi_parse_resources(int, union acpi_resource *, void *);
int sdhc_acpi_card_detect(struct sdhc_softc *);
int sdhc_acpi_card_detect_intr(void *);
@@ -141,7 +141,7 @@ sdhc_acpi_attach(struct device *parent, struct device *self, void *aux)
}
int
-sdhc_acpi_parse_resources(union acpi_resource *crs, void *arg)
+sdhc_acpi_parse_resources(int crsidx, union acpi_resource *crs, void *arg)
{
struct sdhc_acpi_softc *sc = arg;
int type = AML_CRSTYPE(crs);
diff --git a/sys/dev/acpi/tpm.c b/sys/dev/acpi/tpm.c
index a2d058e842e..5bf9ef65f90 100644
--- a/sys/dev/acpi/tpm.c
+++ b/sys/dev/acpi/tpm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tpm.c,v 1.1 2016/08/03 17:23:38 jcs Exp $ */
+/* $OpenBSD: tpm.c,v 1.2 2016/10/25 06:48:58 pirofti Exp $ */
/*
* Minimal interface to Trusted Platform Module chips implementing the
@@ -158,7 +158,7 @@ const struct {
int tpm_match(struct device *, void *, void *);
void tpm_attach(struct device *, struct device *, void *);
int tpm_activate(struct device *, int);
-int tpm_parse_crs(union acpi_resource *, void *);
+int tpm_parse_crs(int, union acpi_resource *, void *);
int tpm_probe(bus_space_tag_t, bus_space_handle_t);
int tpm_init(struct tpm_softc *);
@@ -272,7 +272,7 @@ tpm_attach(struct device *parent, struct device *self, void *aux)
}
int
-tpm_parse_crs(union acpi_resource *crs, void *arg)
+tpm_parse_crs(int crsidx, union acpi_resource *crs, void *arg)
{
struct tpm_crs *sc_crs = arg;