Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for serializing package result types

  • Loading branch information...
commit 7c47a9aa4b6c3e0d1f86696620646d632933c042 1 parent b916f99
@Lekensteyn Lekensteyn authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 acpi_call.c
View
11 acpi_call.c
@@ -54,6 +54,17 @@ static int acpi_result_to_string(union acpi_object *result) {
} else {
sprintf(BUFFER, "}");
}
+ } else if (result->type == ACPI_TYPE_PACKAGE) {
+ int i;
+ sprintf(BUFFER, "[");
+ for (i=0; i<result->package.count; i++) {
+ not_written = acpi_result_to_string(&result->package.elements[i]);
+ // abort if not all data fits in it
+ if (not_written > 0)
+ break;
+ }
+ if (!not_written)
+ not_written = snprintf(BUFFER, BYTES_AVAIL, "]");
} else {
not_written = snprintf(BUFFER, BYTES_AVAIL,
"Object type 0x%x\n", result->type);
Please sign in to comment.
Something went wrong with that request. Please try again.