Simon Glass | 98528d4 | 2020-07-07 13:11:42 -0600 | [diff] [blame] | 1 | /* 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 | |
| 15 | struct 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 | */ |
| 23 | u8 *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 | */ |
| 31 | void 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 | */ |
| 39 | void 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 | */ |
| 47 | void acpigen_emit_dword(struct acpi_ctx *ctx, uint data); |
| 48 | |
Simon Glass | 071c4a5 | 2020-07-07 13:11:45 -0600 | [diff] [blame^] | 49 | /** |
| 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 | */ |
| 56 | void 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 | */ |
| 66 | void acpigen_emit_string(struct acpi_ctx *ctx, const char *str); |
| 67 | |
Simon Glass | 98528d4 | 2020-07-07 13:11:42 -0600 | [diff] [blame] | 68 | #endif |