if (func) {
void *start = ctx->current;
- log_debug("\n");
- log_debug("- %s %p\n", parent->name, func);
+ log_debug("- method %d, %s %p\n", method, parent->name, func);
ret = device_ofdata_to_platdata(parent);
if (ret)
return log_msg_ret("ofdata", ret);
int ret;
log_debug("Writing SSDT tables\n");
- item_count = 0;
ret = acpi_recurse_method(ctx, dm_root(), METHOD_FILL_SSDT, TYPE_SSDT);
log_debug("Writing SSDT finished, err=%d\n", ret);
ret = sort_acpi_item_type(ctx, start, TYPE_SSDT);
int ret;
log_debug("Writing DSDT tables\n");
- item_count = 0;
ret = acpi_recurse_method(ctx, dm_root(), METHOD_INJECT_DSDT,
TYPE_DSDT);
log_debug("Writing DSDT finished, err=%d\n", ret);
return ret;
}
+void acpi_reset_items(void)
+{
+ item_count = 0;
+}
+
int acpi_write_dev_tables(struct acpi_ctx *ctx)
{
int ret;
*/
int acpi_get_path(const struct udevice *dev, char *out_path, int maxlen);
+/**
+ * acpi_reset_items() - Reset the list of ACPI items to empty
+ *
+ * This list keeps track of DSDT and SSDT items that are generated
+ * programmatically. The 'acpi items' command shows the list. Use this function
+ * to empty the list, before writing new items.
+ */
+void acpi_reset_items(void);
+
#endif /* __ACPI__ */
#endif
buf = malloc(BUF_SIZE);
ut_assertnonnull(buf);
+ acpi_reset_items();
ctx.current = buf;
buf[4] = 'z'; /* sentinel */
ut_assertok(acpi_fill_ssdt(&ctx));
buf = malloc(BUF_SIZE);
ut_assertnonnull(buf);
+ acpi_reset_items();
ctx.current = buf;
buf[4] = 'z'; /* sentinel */
ut_assertok(acpi_inject_dsdt(&ctx));
buf = malloc(BUF_SIZE);
ut_assertnonnull(buf);
+ acpi_reset_items();
ctx.current = buf;
ut_assertok(acpi_fill_ssdt(&ctx));
console_record_reset();
ut_assert_nextline("dev 'acpi-test2', type 1, size 2");
ut_assert_console_end();
+ acpi_reset_items();
ctx.current = buf;
ut_assertok(acpi_inject_dsdt(&ctx));
console_record_reset();