facs.c 825 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * Write an ACPI Firmware ACPI Control Structure (FACS) table
  4. *
  5. * Copyright 2021 Google LLC
  6. */
  7. #define LOG_CATEGORY LOGC_ACPI
  8. #include <common.h>
  9. #include <acpi/acpi_table.h>
  10. #include <dm/acpi.h>
  11. int acpi_write_facs(struct acpi_ctx *ctx, const struct acpi_writer *entry)
  12. {
  13. struct acpi_facs *facs = ctx->current;
  14. memset((void *)facs, '\0', sizeof(struct acpi_facs));
  15. memcpy(facs->signature, "FACS", 4);
  16. facs->length = sizeof(struct acpi_facs);
  17. facs->hardware_signature = 0;
  18. facs->firmware_waking_vector = 0;
  19. facs->global_lock = 0;
  20. facs->flags = 0;
  21. facs->x_firmware_waking_vector_l = 0;
  22. facs->x_firmware_waking_vector_h = 0;
  23. facs->version = 1;
  24. ctx->facs = facs;
  25. acpi_inc(ctx, sizeof(struct acpi_facs));
  26. return 0;
  27. }
  28. ACPI_WRITER(1facs, "FACS", acpi_write_facs, 0);