blob: c6636b882403b4d033b00c195871f8c90c7590ae [file] [log] [blame]
Simon Glass0e5a0a02020-07-07 13:11:56 -06001/* 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
9#ifndef __TEST_DM_ACPI_H
10#define __TEST_DM_ACPI_H
11
Simon Glass82659cc2020-07-07 21:32:10 -060012#define ACPI_TEST_DEV_NAME "ABCD"
13#define ACPI_TEST_CHILD_NAME "EFGH"
14
Simon Glass0e5a0a02020-07-07 13:11:56 -060015/**
16 * acpi_test_alloc_context_size() - Allocate an ACPI context of a given size
17 *
18 * @ctxp: Returns allocated context
19 * @size: Size to allocate in bytes
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010020 * Return: 0 if OK, -ENOMEM if out of memory
Simon Glass0e5a0a02020-07-07 13:11:56 -060021 */
22int acpi_test_alloc_context_size(struct acpi_ctx **ctxp, int size);
23
24/**
25 * acpi_test_get_length() - decode a three-byte length field
26 *
27 * @ptr: Length encoded as per ACPI
Heinrich Schuchardt185f8122022-01-19 18:05:50 +010028 * Return: decoded length, or -EINVAL on error
Simon Glass0e5a0a02020-07-07 13:11:56 -060029 */
30int acpi_test_get_length(u8 *ptr);
31
32#endif /*__TEST_DM_ACPI_H */