blob: 9c1faf7bf2bb4cb14841a1fee200e9b64ff8be6a [file] [log] [blame]
Simon Glass61cc9332020-07-07 13:11:42 -06001/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Core ACPI (Advanced Configuration and Power Interface) support
4 *
5 * Copyright 2019 Google LLC
6 *
7 * Modified from coreboot file acpigen.h
8 */
9
10#ifndef __ACPI_ACPIGEN_H
11#define __ACPI_ACPIGEN_H
12
13#include <linux/types.h>
14
15struct acpi_ctx;
16
17/**
18 * acpigen_get_current() - Get the current ACPI code output pointer
19 *
20 * @ctx: ACPI context pointer
21 * @return output pointer
22 */
23u8 *acpigen_get_current(struct acpi_ctx *ctx);
24
25/**
26 * acpigen_emit_byte() - Emit a byte to the ACPI code
27 *
28 * @ctx: ACPI context pointer
29 * @data: Value to output
30 */
31void acpigen_emit_byte(struct acpi_ctx *ctx, uint data);
32
33/**
34 * acpigen_emit_word() - Emit a 16-bit word to the ACPI code
35 *
36 * @ctx: ACPI context pointer
37 * @data: Value to output
38 */
39void acpigen_emit_word(struct acpi_ctx *ctx, uint data);
40
41/**
42 * acpigen_emit_dword() - Emit a 32-bit 'double word' to the ACPI code
43 *
44 * @ctx: ACPI context pointer
45 * @data: Value to output
46 */
47void acpigen_emit_dword(struct acpi_ctx *ctx, uint data);
48
Simon Glass7fb8da42020-07-07 13:11:45 -060049/**
50 * acpigen_emit_stream() - Emit a stream of bytes
51 *
52 * @ctx: ACPI context pointer
53 * @data: Data to output
54 * @size: Size of data in bytes
55 */
56void acpigen_emit_stream(struct acpi_ctx *ctx, const char *data, int size);
57
58/**
59 * acpigen_emit_string() - Emit a string
60 *
61 * Emit a string with a null terminator
62 *
63 * @ctx: ACPI context pointer
64 * @str: String to output, or NULL for an empty string
65 */
66void acpigen_emit_string(struct acpi_ctx *ctx, const char *str);
67
Simon Glass61cc9332020-07-07 13:11:42 -060068#endif