Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/e820.h
- This file was added.
/*- | |||||
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD | |||||
* | |||||
* Copyright (c) 2021 Beckhoff Automation GmbH & Co. KG | |||||
* Author: Corvin Köhne <c.koehne@beckhoff.com> | |||||
*/ | |||||
#pragma once | |||||
#include <vmmapi.h> | |||||
#include "qemu_fwcfg.h" | |||||
#pragma pack(push, 1) | |||||
enum e820_memory_type { | |||||
E820_TYPE_MEMORY = 1, | |||||
E820_TYPE_RESERVED = 2, | |||||
E820_TYPE_ACPI = 3, | |||||
E820_TYPE_NVS = 4 | |||||
}; | |||||
enum e820_allocation_strategy { | |||||
/* allocate any address */ | |||||
E820_ALLOCATE_ANY, | |||||
/* allocate lowest address larger than address */ | |||||
E820_ALLOCATE_LOWEST, | |||||
/* allocate highest address lower than address */ | |||||
E820_ALLOCATE_HIGHEST, | |||||
/* allocate a specific address */ | |||||
E820_ALLOCATE_SPECIFIC | |||||
}; | |||||
struct e820_entry { | |||||
uint64_t base; | |||||
uint64_t length; | |||||
enum e820_memory_type type; | |||||
}; | |||||
#pragma pack(pop) | |||||
#define E820_ALIGNMENT_NONE 1 | |||||
uint64_t e820_alloc(const uint64_t address, const uint64_t length, | |||||
const uint64_t alignment, const enum e820_memory_type type, | |||||
const enum e820_allocation_strategy strategy); | |||||
void e820_dump_table(); | |||||
struct qemu_fwcfg_item *e820_get_fwcfg_item(); | |||||
int e820_init(struct vmctx *const ctx); |