iPXE
|
Memory mapping. More...
#include <stdint.h>
#include <errno.h>
#include <realmode.h>
#include <bios.h>
#include <memsizes.h>
#include <ipxe/io.h>
Go to the source code of this file.
Data Structures | |
struct | e820_entry |
An INT 15,e820 memory map entry. More... | |
Macros | |
#define | SMAP ( 0x534d4150 ) |
Magic value for INT 15,e820 calls. More... | |
#define | E820_TYPE_RAM 1 |
Normal memory. More... | |
#define | E820_TYPE_RESERVED 2 |
Reserved and unavailable. More... | |
#define | E820_TYPE_ACPI 3 |
ACPI reclaim memory. More... | |
#define | E820_TYPE_NVS 4 |
ACPI NVS memory. More... | |
#define | E820_ATTR_ENABLED 0x00000001UL |
#define | E820_ATTR_NONVOLATILE 0x00000002UL |
#define | E820_ATTR_UNKNOWN 0xfffffffcUL |
#define | E820_MIN_SIZE 20 |
#define | e820buf __use_data16 ( e820buf ) |
#define | memmap_post __use_data16 ( memmap_post ) |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
struct e820_entry | __attribute__ ((packed)) |
static struct e820_entry | __bss16 (e820buf) |
Buffer for INT 15,e820 calls. More... | |
uint8_t | __bss16 (memmap_post) |
We are running during POST; inhibit INT 15,e820 and INT 15,e801. More... | |
static unsigned int | extmemsize_e801 (void) |
Get size of extended memory via INT 15,e801. More... | |
static unsigned int | extmemsize_88 (void) |
Get size of extended memory via INT 15,88. More... | |
unsigned int | extmemsize (void) |
Get size of extended memory. More... | |
static int | meme820 (struct memory_map *memmap) |
Get e820 memory map. More... | |
void | x86_get_memmap (struct memory_map *memmap) |
Get memory map. More... | |
PROVIDE_IOAPI (x86, get_memmap, x86_get_memmap) | |
Variables | |
uint64_t | start |
Start of region. More... | |
uint64_t | len |
Length of region. More... | |
uint32_t | type |
Type of region. More... | |
uint32_t | attrs |
Extended attributes (optional) More... | |
Memory mapping.
Definition in file memmap.c.
#define SMAP ( 0x534d4150 ) |
#define e820buf __use_data16 ( e820buf ) |
#define memmap_post __use_data16 ( memmap_post ) |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
struct e820_entry __attribute__ | ( | (packed) | ) |
|
static |
Buffer for INT 15,e820 calls.
uint8_t __bss16 | ( | memmap_post | ) |
We are running during POST; inhibit INT 15,e820 and INT 15,e801.
|
static |
Get size of extended memory via INT 15,e801.
extmem | Extended memory size, in kB, or 0 |
Definition at line 79 of file memmap.c.
References __asm__(), __volatile__(), CF, DBG, flags, memmap_post, and REAL_CODE.
Referenced by extmemsize().
|
static |
Get size of extended memory via INT 15,88.
extmem | Extended memory size, in kB |
Definition at line 136 of file memmap.c.
References __asm__(), __volatile__(), DBG, and REAL_CODE.
Referenced by extmemsize().
unsigned int extmemsize | ( | void | ) |
Get size of extended memory.
extmem | Extended memory size, in kB |
Note that this is only an approximation; for an accurate picture, use the E820 memory map obtained via get_memmap();
Definition at line 156 of file memmap.c.
References extmemsize_88(), and extmemsize_e801().
Referenced by nbi_process_segments(), and x86_get_memmap().
|
static |
Get e820 memory map.
memmap | Memory map to fill in |
rc | Return status code |
Definition at line 172 of file memmap.c.
References __asm__(), __from_data16, __volatile__(), attrs, CF, memory_map::count, DBG, discard_D, E820_ATTR_ENABLED, E820_ATTR_NONVOLATILE, E820_ATTR_UNKNOWN, E820_MIN_SIZE, E820_TYPE_RAM, e820buf, EINVAL, memory_region::end, ENOTSUP, ENOTTY, flags, memmap_post, memset(), next, NULL, offsetof, REAL_CODE, memory_map::regions, size, SMAP, memory_region::start, and typeof().
Referenced by x86_get_memmap().
void x86_get_memmap | ( | struct memory_map * | memmap | ) |
Get memory map.
memmap | Memory map to fill in |
Definition at line 314 of file memmap.c.
References basememsize(), memory_map::count, DBG, memory_region::end, extmemsize(), meme820(), memset(), rc, memory_map::regions, and memory_region::start.
PROVIDE_IOAPI | ( | x86 | , |
get_memmap | , | ||
x86_get_memmap | |||
) |
uint32_t attrs |
Extended attributes (optional)
Definition at line 32 of file memmap.c.
Referenced by ansiscr_attrs(), ansiscr_erase(), ansiscr_putc(), attr_get(), attr_off(), attr_on(), attr_set(), attroff(), attron(), attrset(), efi_shim_get_variable(), efi_shim_set_variable(), efipci_dma_set_mask(), meme820(), slk_attr_off(), slk_attr_on(), slk_attr_set(), slk_attroff(), slk_attron(), slk_attrset(), wattr_get(), wattr_off(), wattr_on(), wattr_set(), wattroff(), wattron(), and wattrset().