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