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
unsigned long long uint64_t
static unsigned int get_fbms(void)
Read the BIOS free base memory counter.
void hook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Hook INT vector.
int unhook_bios_interrupt(unsigned int interrupt, unsigned int handler, struct segoff *chain_vector)
Unhook INT vector.
#define hooked_bios_interrupts
static memmap_sync(void)
Synchronise in-use regions with the externally visible system memory map.
#define ABS_SYMBOL(name)
Declare an absolute symbol (e.g.
#define __unused
Declare a variable or data structure as unused.
#define DBG(...)
Print a debugging message.
uint32_t start
Starting offset.
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
#define STARTUP_EARLY
Early startup.
void hide_textdata(void)
Hide .text and .data.
void int15()
Assembly routine in e820mangler.S.
#define int15_intercept_flag
void hide_basemem(void)
Hide used base memory.
#define FAKE_E820
Set to true if you want to test a fake E820 map.
void int15_intercept(int intercept)
Set INT 15 interception flag.
static void int15_sync(void)
Synchronise in-use regions with the externally visible system memory map.
static void unhide_etherboot(int flags __unused)
Unhide Etherboot.
static void hide_region(struct hidden_region *region, physaddr_t start, physaddr_t end)
Hide region of memory from system memory map.
static void hide_etherboot(void)
Hide Etherboot.
#define ALIGN_HIDDEN
Alignment for hidden memory regions.
static void memmap_dump_all(int hide)
Dump system memory map (for debugging)
#define PROVIDE_MEMMAP(_subsys, _api_func, _func)
Provide a memory map API implementation.
#define __startup_fn(startup_order)
Declare a startup/shutdown function.
#define __data16(variable)
#define __text16(variable)
uint32_t end
Ending offset.
char * strerror(int errno)
Retrieve string representation of error number.
uint64_t start
Physical start address.
uint64_t end
Physical end address.
A startup/shutdown function.
physaddr_t uheap_end
End of external heap.
physaddr_t uheap_start
Start of external heap.