blob: 8703a55115cdbe3aa6a3577270e604b3b90248ff (
plain) (
blame)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
/*-
* SPDX-License-Identifier: BSD-2-Clause
*
* 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"
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;
uint32_t type;
} __packed;
#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(void);
struct qemu_fwcfg_item *e820_get_fwcfg_item(void);
int e820_init(struct vmctx *const ctx);
|