]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - usr.sbin/bhyve/basl.h
bhyve: add basl support for int values
[FreeBSD/FreeBSD.git] / usr.sbin / bhyve / basl.h
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2022 Beckhoff Automation GmbH & Co. KG
5  */
6
7 #pragma once
8
9 #include <contrib/dev/acpica/include/acpi.h>
10
11 #define BHYVE_ACPI_BASE 0xf2400
12
13 #define BASL_TABLE_ALIGNMENT 0x10
14 #define BASL_TABLE_ALIGNMENT_FACS 0x40
15
16 #define BASL_EXEC(x)                                                         \
17         do {                                                                 \
18                 const int error = (x);                                       \
19                 if (error) {                                                 \
20                         warnc(error,                                         \
21                             "BASL failed @ %s:%d\n    Failed to execute %s", \
22                             __func__, __LINE__, #x);                         \
23                         return (error);                                      \
24                 }                                                            \
25         } while (0)
26
27 #define QEMU_FWCFG_MAX_NAME 56
28
29 struct basl_table;
30
31 int basl_finish(void);
32 int basl_init(void);
33 int basl_table_append_bytes(struct basl_table *table, const void *bytes,
34     uint32_t len);
35 int basl_table_append_int(struct basl_table *table, uint64_t val, uint8_t size);
36 int basl_table_create(struct basl_table **table, struct vmctx *ctx,
37     const uint8_t *name, uint32_t alignment, uint32_t off);