Zephyr API Documentation
4.0.0-rc2
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
17
enum
x86_memmap_source
{
18
X86_MEMMAP_SOURCE_DEFAULT
,
19
X86_MEMMAP_SOURCE_MULTIBOOT_MEM
,
20
X86_MEMMAP_SOURCE_MULTIBOOT_MMAP
,
21
X86_MEMMAP_SOURCE_MANUAL
22
};
23
24
extern
enum
x86_memmap_source
x86_memmap_source
;
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
36
enum
x86_memmap_entry_type
{
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
50
struct
x86_memmap_entry
{
51
uint64_t
base
;
52
uint64_t
length
;
53
enum
x86_memmap_entry_type
type
;
54
};
55
56
extern
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
64
struct
x86_memmap_exclusion
{
65
char
*
name
;
66
void
*
start
;
/* address of first byte of exclusion */
67
void
*
end
;
/* one byte past end of exclusion */
68
};
69
70
extern
struct
x86_memmap_exclusion
x86_memmap_exclusions
[];
71
extern
int
x86_nr_memmap_exclusions
;
72
73
#endif
/* _ASMLANGUAGE */
74
75
#endif
/* ZEPHYR_INCLUDE_ARCH_X86_MEMMAP_H_ */
x86_memmap
struct x86_memmap_entry x86_memmap[]
x86_memmap_exclusions
struct x86_memmap_exclusion x86_memmap_exclusions[]
x86_nr_memmap_exclusions
int x86_nr_memmap_exclusions
x86_memmap_source
x86_memmap_source
Definition
memmap.h:17
X86_MEMMAP_SOURCE_MANUAL
@ X86_MEMMAP_SOURCE_MANUAL
Definition
memmap.h:21
X86_MEMMAP_SOURCE_MULTIBOOT_MMAP
@ X86_MEMMAP_SOURCE_MULTIBOOT_MMAP
Definition
memmap.h:20
X86_MEMMAP_SOURCE_DEFAULT
@ X86_MEMMAP_SOURCE_DEFAULT
Definition
memmap.h:18
X86_MEMMAP_SOURCE_MULTIBOOT_MEM
@ X86_MEMMAP_SOURCE_MULTIBOOT_MEM
Definition
memmap.h:19
x86_memmap_entry_type
x86_memmap_entry_type
Definition
memmap.h:36
X86_MEMMAP_ENTRY_NVS
@ X86_MEMMAP_ENTRY_NVS
Definition
memmap.h:45
X86_MEMMAP_ENTRY_DEFECTIVE
@ X86_MEMMAP_ENTRY_DEFECTIVE
Definition
memmap.h:46
X86_MEMMAP_ENTRY_UNUSED
@ X86_MEMMAP_ENTRY_UNUSED
Definition
memmap.h:42
X86_MEMMAP_ENTRY_ACPI
@ X86_MEMMAP_ENTRY_ACPI
Definition
memmap.h:44
X86_MEMMAP_ENTRY_UNKNOWN
@ X86_MEMMAP_ENTRY_UNKNOWN
Definition
memmap.h:47
X86_MEMMAP_ENTRY_RAM
@ X86_MEMMAP_ENTRY_RAM
Definition
memmap.h:43
uint64_t
__UINT64_TYPE__ uint64_t
Definition
stdint.h:91
x86_memmap_entry
Definition
memmap.h:50
x86_memmap_entry::type
enum x86_memmap_entry_type type
Definition
memmap.h:53
x86_memmap_entry::base
uint64_t base
Definition
memmap.h:51
x86_memmap_entry::length
uint64_t length
Definition
memmap.h:52
x86_memmap_exclusion
Definition
memmap.h:64
x86_memmap_exclusion::name
char * name
Definition
memmap.h:65
x86_memmap_exclusion::end
void * end
Definition
memmap.h:67
x86_memmap_exclusion::start
void * start
Definition
memmap.h:66
zephyr
arch
x86
memmap.h
Generated on Sat Nov 9 2024 00:03:12 for Zephyr API Documentation by
1.12.0