summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-03-31 17:23:46 +0000
committernjl <njl@FreeBSD.org>2004-03-31 17:23:46 +0000
commitfd0c34e87b18dc4d46cef5a65516486dd7f7090c (patch)
treec1bd07877c41ba3f799b59b9d8c57614d7f3ad73 /sys/dev
parent9f95817abba7fa2d8012e6af0d47db66ae7c840d (diff)
downloadFreeBSD-src-fd0c34e87b18dc4d46cef5a65516486dd7f7090c.zip
FreeBSD-src-fd0c34e87b18dc4d46cef5a65516486dd7f7090c.tar.gz
Add an interface to pass an argument to the resource parsing functions.
This is just groundwork for changing sysresource behavior. PR: Submitted by: Reviewed by: Approved by: Obtained from: MFC after:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpica/acpi.c2
-rw-r--r--sys/dev/acpica/acpi_resource.c10
-rw-r--r--sys/dev/acpica/acpivar.h4
3 files changed, 9 insertions, 7 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c
index bd65cd9..ff7b8f1 100644
--- a/sys/dev/acpica/acpi.c
+++ b/sys/dev/acpica/acpi.c
@@ -1211,7 +1211,7 @@ acpi_probe_child(ACPI_HANDLE handle, UINT32 level, void *context, void **status)
* device. Ignore the return value here; it's OK for the
* device not to have any resources.
*/
- acpi_parse_resources(child, handle, &acpi_res_parse_set);
+ acpi_parse_resources(child, handle, &acpi_res_parse_set, NULL);
/* If we're debugging, probe/attach now rather than later */
ACPI_DEBUG_EXEC(device_probe_and_attach(child));
diff --git a/sys/dev/acpica/acpi_resource.c b/sys/dev/acpica/acpi_resource.c
index e471f82..6c73c40 100644
--- a/sys/dev/acpica/acpi_resource.c
+++ b/sys/dev/acpica/acpi_resource.c
@@ -56,7 +56,7 @@ ACPI_MODULE_NAME("RESOURCE")
*/
ACPI_STATUS
acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
- struct acpi_parse_resource_set *set)
+ struct acpi_parse_resource_set *set, void *arg)
{
ACPI_BUFFER buf;
ACPI_RESOURCE *res;
@@ -86,7 +86,7 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
}
ACPI_DEBUG_PRINT((ACPI_DB_RESOURCES, "%s - got %ld bytes of resources\n",
acpi_name(handle), (long)buf.Length));
- set->set_init(dev, &context);
+ set->set_init(dev, arg, &context);
/* Iterate through the resources */
curr = buf.Pointer;
@@ -373,7 +373,7 @@ acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
* Resource-set vectors used to attach _CRS-derived resources
* to an ACPI device.
*/
-static void acpi_res_set_init(device_t dev, void **context);
+static void acpi_res_set_init(device_t dev, void *arg, void **context);
static void acpi_res_set_done(device_t dev, void *context);
static void acpi_res_set_ioport(device_t dev, void *context,
u_int32_t base, u_int32_t length);
@@ -411,15 +411,17 @@ struct acpi_res_context {
int ar_nmem;
int ar_nirq;
int ar_ndrq;
+ void *ar_parent;
};
static void
-acpi_res_set_init(device_t dev, void **context)
+acpi_res_set_init(device_t dev, void *arg, void **context)
{
struct acpi_res_context *cp;
if ((cp = AcpiOsAllocate(sizeof(*cp))) != NULL) {
bzero(cp, sizeof(*cp));
+ cp->ar_parent = arg;
*context = cp;
}
}
diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h
index 51d5c9d..bba700e 100644
--- a/sys/dev/acpica/acpivar.h
+++ b/sys/dev/acpica/acpivar.h
@@ -198,7 +198,7 @@ extern void acpi_UserNotify(const char *subsystem, ACPI_HANDLE h,
uint8_t notify);
struct acpi_parse_resource_set {
- void (*set_init)(device_t dev, void **context);
+ void (*set_init)(device_t dev, void *arg, void **context);
void (*set_done)(device_t dev, void *context);
void (*set_ioport)(device_t dev, void *context, u_int32_t base,
u_int32_t length);
@@ -221,7 +221,7 @@ struct acpi_parse_resource_set {
extern struct acpi_parse_resource_set acpi_res_parse_set;
extern ACPI_STATUS acpi_parse_resources(device_t dev, ACPI_HANDLE handle,
- struct acpi_parse_resource_set *set);
+ struct acpi_parse_resource_set *set, void *arg);
/* ACPI event handling */
extern UINT32 acpi_event_power_button_sleep(void *context);
OpenPOWER on IntegriCloud