1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_E820_TYPES_H
3 #define _ASM_E820_TYPES_H
5 #include <uapi/asm/bootparam.h>
8 * These are the E820 types known to the kernel:
12 E820_TYPE_RESERVED = 2,
15 E820_TYPE_UNUSABLE = 5,
19 * This is a non-standardized way to represent ADR or
20 * NVDIMM regions that persist over a reboot.
22 * The kernel will ignore their special capabilities
23 * unless the CONFIG_X86_PMEM_LEGACY=y option is set.
25 * ( Note that older platforms also used 6 for the same
26 * type of memory, but newer versions switched to 12 as
27 * 6 was assigned differently. Some time they will learn... )
32 * Reserved RAM used by the kernel itself if
33 * CONFIG_INTEL_TXT=y is enabled, memory of this type
34 * will be included in the S3 integrity calculation
35 * and so should not include any memory that the BIOS
36 * might alter over the S3 transition:
38 E820_TYPE_RESERVED_KERN = 128,
42 * A single E820 map entry, describing a memory range of [addr...addr+size-1],
43 * of 'type' memory type:
45 * (We pack it because there can be thousands of them on large systems.)
51 } __attribute__((packed));
54 * The legacy E820 BIOS limits us to 128 (E820_MAX_ENTRIES_ZEROPAGE) nodes
55 * due to the constrained space in the zeropage.
57 * On large systems we can easily have thousands of nodes with RAM,
58 * which cannot be fit into so few entries - so we have a mechanism
59 * to extend the e820 table size at build-time, via the E820_MAX_ENTRIES
62 * ( Those extra entries are enumerated via the EFI memory map, not
63 * via the legacy zeropage mechanism. )
65 * Size our internal memory map tables to have room for these additional
66 * entries, based on a heuristic calculation: up to three entries per
67 * NUMA node, plus E820_MAX_ENTRIES_ZEROPAGE for some extra space.
69 * This allows for bootstrap/firmware quirks such as possible duplicate
70 * E820 entries that might need room in the same arrays, prior to the
71 * call to e820__update_table() to remove duplicates. The allowance
72 * of three memory map entries per node is "enough" entries for
73 * the initial hardware platform motivating this mechanism to make
74 * use of additional EFI map entries. Future platforms may want
75 * to allow more than three entries per node or otherwise refine
79 #include <linux/numa.h>
81 #define E820_MAX_ENTRIES (E820_MAX_ENTRIES_ZEROPAGE + 3*MAX_NUMNODES)
84 * The whole array of E820 entries:
88 struct e820_entry entries[E820_MAX_ENTRIES];
92 * Various well-known legacy memory ranges in physical memory:
94 #define ISA_START_ADDRESS 0x000a0000
95 #define ISA_END_ADDRESS 0x00100000
97 #define BIOS_BEGIN 0x000a0000
98 #define BIOS_END 0x00100000
100 #define HIGH_MEMORY 0x00100000
102 #define BIOS_ROM_BASE 0xffe00000
103 #define BIOS_ROM_END 0xffffffff
105 #endif /* _ASM_E820_TYPES_H */