xref: /illumos-gate/usr/src/cmd/bhyve/qemu_fwcfg.h (revision 32640292339b07090f10ce34d455f98711077343)
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 #ifndef __QEMU_FWCFG_H__
9 #define	__QEMU_FWCFG_H__
10 
11 #pragma once
12 
13 #include <vmmapi.h>
14 
15 #define QEMU_FWCFG_MAX_ARCHS 0x2
16 #define QEMU_FWCFG_MAX_ENTRIES 0x4000
17 #define QEMU_FWCFG_MAX_NAME 56
18 
19 #define QEMU_FWCFG_FILE_TABLE_LOADER "etc/table-loader"
20 
21 struct qemu_fwcfg_item {
22 	uint32_t size;
23 	uint8_t *data;
24 };
25 
26 int qemu_fwcfg_add_file(const char *name,
27     const uint32_t size, void *const data);
28 int qemu_fwcfg_init(struct vmctx *const ctx);
29 int qemu_fwcfg_parse_cmdline_arg(const char *opt);
30 
31 #endif /* !__QEMU_FWCFG_H__ */
32