|
root / base / usr / src / cmd / bhyve / common / qemu_fwcfg.h
qemu_fwcfg.h C 32 lines 680 B
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*-
 * SPDX-License-Identifier: BSD-2-Clause
 *
 * Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG
 * Author: Corvin Köhne <c.koehne@beckhoff.com>
 */

#ifndef __QEMU_FWCFG_H__
#define	__QEMU_FWCFG_H__

#pragma once

#include <vmmapi.h>

#define QEMU_FWCFG_MAX_ARCHS 0x2
#define QEMU_FWCFG_MAX_ENTRIES 0x4000
#define QEMU_FWCFG_MAX_NAME 56

#define QEMU_FWCFG_FILE_TABLE_LOADER "etc/table-loader"

struct qemu_fwcfg_item {
	uint32_t size;
	uint8_t *data;
};

int qemu_fwcfg_add_file(const char *name,
    const uint32_t size, void *const data);
int qemu_fwcfg_init(struct vmctx *const ctx);
int qemu_fwcfg_parse_cmdline_arg(const char *opt);

#endif /* !__QEMU_FWCFG_H__ */