Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
memmap.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 Intel Corporation
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#ifndef ZEPHYR_INCLUDE_ARCH_X86_MEMMAP_H_
7#define ZEPHYR_INCLUDE_ARCH_X86_MEMMAP_H_
8
9#ifndef _ASMLANGUAGE
10
11/*
12 * The "source" of the memory map refers to where we got the data to fill in
13 * the map. Order is important: if multiple sources are available, then the
14 * numerically HIGHEST source wins, a manually-provided map being the "best".
15 */
16
23
25
26/*
27 * For simplicity, we maintain a fixed-sized array of memory regions.
28 *
29 * We don't only track available RAM -- we track unavailable regions, too:
30 * sometimes we'll be given a map with overlapping regions. We have to be
31 * pessimistic about what is considered "available RAM" and it's easier to
32 * keep all the regions around than it is to correct incorrect maps. It's
33 * also handy to have the entire map intact for diagnostic purposes.
34 */
35
37 /*
38 * the UNUSED entry must have a numerical 0 value, so
39 * that partially-initialized arrays behave as expected.
40 */
41
42 X86_MEMMAP_ENTRY_UNUSED, /* this entry is unused/invalid */
43 X86_MEMMAP_ENTRY_RAM, /* available RAM */
44 X86_MEMMAP_ENTRY_ACPI, /* reserved for ACPI */
45 X86_MEMMAP_ENTRY_NVS, /* preserve during hibernation */
46 X86_MEMMAP_ENTRY_DEFECTIVE, /* bad memory modules */
47 X86_MEMMAP_ENTRY_UNKNOWN /* unknown type, do not use */
48};
49
55
56extern struct x86_memmap_entry x86_memmap[];
57
58/*
59 * We keep track of kernel memory areas (text, data, etc.) in a table for
60 * ease of reference. There's really no reason to export this table, or to
61 * label the members, except for diagnostic purposes.
62 */
63
65 char *name;
66 void *start; /* address of first byte of exclusion */
67 void *end; /* one byte past end of exclusion */
68};
69
72
73#endif /* _ASMLANGUAGE */
74
75#endif /* ZEPHYR_INCLUDE_ARCH_X86_MEMMAP_H_ */
struct x86_memmap_entry x86_memmap[]
struct x86_memmap_exclusion x86_memmap_exclusions[]
int x86_nr_memmap_exclusions
x86_memmap_source
Definition memmap.h:17
@ X86_MEMMAP_SOURCE_MANUAL
Definition memmap.h:21
@ X86_MEMMAP_SOURCE_MULTIBOOT_MMAP
Definition memmap.h:20
@ X86_MEMMAP_SOURCE_DEFAULT
Definition memmap.h:18
@ X86_MEMMAP_SOURCE_MULTIBOOT_MEM
Definition memmap.h:19
x86_memmap_entry_type
Definition memmap.h:36
@ X86_MEMMAP_ENTRY_NVS
Definition memmap.h:45
@ X86_MEMMAP_ENTRY_DEFECTIVE
Definition memmap.h:46
@ X86_MEMMAP_ENTRY_UNUSED
Definition memmap.h:42
@ X86_MEMMAP_ENTRY_ACPI
Definition memmap.h:44
@ X86_MEMMAP_ENTRY_UNKNOWN
Definition memmap.h:47
@ X86_MEMMAP_ENTRY_RAM
Definition memmap.h:43
__UINT64_TYPE__ uint64_t
Definition stdint.h:91
Definition memmap.h:50
enum x86_memmap_entry_type type
Definition memmap.h:53
uint64_t base
Definition memmap.h:51
uint64_t length
Definition memmap.h:52
Definition memmap.h:64
char * name
Definition memmap.h:65
void * end
Definition memmap.h:67
void * start
Definition memmap.h:66