40 #define ALIGN_HIDDEN 4096 60 #define hidemem_base __use_data16 ( hidemem_base ) 64 #define hidemem_umalloc __use_data16 ( hidemem_umalloc ) 68 #define hidemem_textdata __use_data16 ( hidemem_textdata ) 75 #define int15_vector __use_text16 ( int15_vector ) 79 #define int15_intercept_flag __use_text16 ( int15_intercept_flag ) 85 #define _text16_memsz ABS_VALUE ( _text16_memsz ) 87 #define _data16_memsz ABS_VALUE ( _data16_memsz ) 106 DBG (
"Hiding region [%llx,%llx)\n", region->
start, region->
end );
168 unsigned int rm_ds_top;
169 unsigned int rm_cs_top;
173 DBG (
"Hiding iPXE from system memory map\n" );
178 DBG (
"Hooking in fake E820 map\n" );
201 if ( ( rm_cs_top < fbms ) && ( rm_ds_top < fbms ) ) {
202 DBG (
"Detected potentially unsafe UNDI load at CS=%04x " 204 DBG (
"Disabling INT 15 memory hiding\n" );
212 DBG (
"Hidden iPXE from system memory map\n" );
232 DBG (
"Cannot unhide: %d interrupt vectors still hooked\n",
252 DBG (
"Unhidden iPXE from system memory map\n" );
struct arbelprm_rc_send_wqe rc
static void hide_etherboot(void)
Hide Etherboot.
static unsigned int get_fbms(void)
Read the BIOS free base memory counter.
void int15()
Assembly routine in e820mangler.S.
#define STARTUP_EARLY
Early startup.
physaddr_t uheap_start
Start of external heap.
unsigned long long uint64_t
struct hidden_region __data16(hidemem_base)
Hidden base memory.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
uint32_t start
Starting offset.
A startup/shutdown function.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
#define int15_intercept_flag
static void unhide_etherboot(int flags __unused)
Unhide Etherboot.
#define __unused
Declare a variable or data structure as unused.
uint64_t start
Physical start address.
static void hide_region(struct hidden_region *region, physaddr_t start, physaddr_t end)
Hide region of memory from system memory map.
struct segoff __text16(int15_vector)
Vector for storing original INT 15 handler.
#define hooked_bios_interrupts
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
char * strerror(int errno)
Retrieve string representation of error number.
void int15_intercept(int intercept)
Set INT 15 interception flag.
#define FAKE_E820
Set to true if you want to test a fake E820 map.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
static memmap_sync(void)
Synchronise in-use regions with the externally visible system memory map.
#define ALIGN_HIDDEN
Alignment for hidden memory regions.
size_t ABS_SYMBOL(_text16_memsz)
uint32_t end
Ending offset.
uint64_t end
Physical end address.
void hide_basemem(void)
Hide used base memory.
void hide_textdata(void)
Hide .text and .data.
struct startup_fn hide_etherboot_startup_fn __startup_fn(STARTUP_EARLY)
Hide Etherboot startup function.
static void int15_sync(void)
Synchronise in-use regions with the externally visible system memory map.
PROVIDE_MEMMAP(int15, memmap_sync, int15_sync)
#define DBG(...)
Print a debugging message.
physaddr_t uheap_end
End of external heap.