xref: /freebsd/usr.sbin/bhyve/qemu_fwcfg.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause
3  *
4  * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG
5  * Author: Corvin Köhne <c.koehne@beckhoff.com>
6  */
7 
8 #pragma once
9 
10 #include <vmmapi.h>
11 
12 #define QEMU_FWCFG_MAX_ARCHS 0x2
13 #define QEMU_FWCFG_MAX_ENTRIES 0x4000
14 #define QEMU_FWCFG_MAX_NAME 56
15 
16 #define QEMU_FWCFG_FILE_TABLE_LOADER "etc/table-loader"
17 
18 struct qemu_fwcfg_item {
19 	uint32_t size;
20 	uint8_t *data;
21 };
22 
23 int qemu_fwcfg_add_file(const char *name,
24     const uint32_t size, void *const data);
25 int qemu_fwcfg_init(struct vmctx *const ctx);
26 int qemu_fwcfg_parse_cmdline_arg(const char *opt);
27