acpi.h 776 B

1234567891011121314151617181920212223242526272829303132
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * Common functions for ACPI tests
  4. *
  5. * Copyright 2020 Google LLC
  6. * Written by Simon Glass <sjg@chromium.org>
  7. */
  8. #ifndef __TEST_DM_ACPI_H
  9. #define __TEST_DM_ACPI_H
  10. #define ACPI_TEST_DEV_NAME "ABCD"
  11. #define ACPI_TEST_CHILD_NAME "EFGH"
  12. /**
  13. * acpi_test_alloc_context_size() - Allocate an ACPI context of a given size
  14. *
  15. * @ctxp: Returns allocated context
  16. * @size: Size to allocate in bytes
  17. * @return 0 if OK, -ENOMEM if out of memory
  18. */
  19. int acpi_test_alloc_context_size(struct acpi_ctx **ctxp, int size);
  20. /**
  21. * acpi_test_get_length() - decode a three-byte length field
  22. *
  23. * @ptr: Length encoded as per ACPI
  24. * @return decoded length, or -EINVAL on error
  25. */
  26. int acpi_test_get_length(u8 *ptr);
  27. #endif /*__TEST_DM_ACPI_H */