Permalink
Browse files

Add support for serializing package result types

  • Loading branch information...
1 parent b916f99 commit 7c47a9aa4b6c3e0d1f86696620646d632933c042 @Lekensteyn Lekensteyn committed Oct 22, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 acpi_call.c
View
@@ -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);

0 comments on commit 7c47a9a

Please sign in to comment.