mirror of https://github.com/ipxe/ipxe.git
Allow external code to update hidden memory regions.
parent
687c1e3227
commit
859da6bd32
|
@ -17,22 +17,7 @@
|
||||||
|
|
||||||
#include <realmode.h>
|
#include <realmode.h>
|
||||||
#include <biosint.h>
|
#include <biosint.h>
|
||||||
|
#include <gpxe/hidemem.h>
|
||||||
/**
|
|
||||||
* A hidden region of Etherboot
|
|
||||||
*
|
|
||||||
* This represents a region that will be edited out of the system's
|
|
||||||
* memory map.
|
|
||||||
*
|
|
||||||
* This structure is accessed by assembly code, so must not be
|
|
||||||
* changed.
|
|
||||||
*/
|
|
||||||
struct hidden_region {
|
|
||||||
/* Physical start address */
|
|
||||||
uint32_t start;
|
|
||||||
/* Physical end address */
|
|
||||||
uint32_t end;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Linker-defined symbols */
|
/* Linker-defined symbols */
|
||||||
extern char _text[];
|
extern char _text[];
|
||||||
|
@ -45,14 +30,6 @@ extern void int15();
|
||||||
extern struct segoff __text16 ( int15_vector );
|
extern struct segoff __text16 ( int15_vector );
|
||||||
#define int15_vector __use_text16 ( int15_vector )
|
#define int15_vector __use_text16 ( int15_vector )
|
||||||
|
|
||||||
/**
|
|
||||||
* Unique IDs for hidden regions
|
|
||||||
*/
|
|
||||||
enum {
|
|
||||||
TEXT = 0,
|
|
||||||
BASEMEM,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of hidden regions
|
* List of hidden regions
|
||||||
*
|
*
|
||||||
|
@ -61,9 +38,9 @@ enum {
|
||||||
struct hidden_region __data16_array ( hidden_regions, [] ) = {
|
struct hidden_region __data16_array ( hidden_regions, [] ) = {
|
||||||
[TEXT] = { 0, 0 },
|
[TEXT] = { 0, 0 },
|
||||||
[BASEMEM] = { 0, ( 640 * 1024 ) },
|
[BASEMEM] = { 0, ( 640 * 1024 ) },
|
||||||
|
[EXTMEM] = { 0, 0 },
|
||||||
{ 0, 0, } /* Terminator */
|
{ 0, 0, } /* Terminator */
|
||||||
};
|
};
|
||||||
#define hidden_regions __use_data16 ( hidden_regions )
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hide Etherboot
|
* Hide Etherboot
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
#ifndef _GPXE_HIDEMEM_H
|
||||||
|
#define _GPXE_HIDEMEM_H
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file
|
||||||
|
*
|
||||||
|
* Hidden memory regions
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A hidden region of Etherboot
|
||||||
|
*
|
||||||
|
* This represents a region that will be edited out of the system's
|
||||||
|
* memory map.
|
||||||
|
*
|
||||||
|
* This structure is accessed by assembly code, so must not be
|
||||||
|
* changed.
|
||||||
|
*/
|
||||||
|
struct hidden_region {
|
||||||
|
/* Physical start address */
|
||||||
|
physaddr_t start;
|
||||||
|
/* Physical end address */
|
||||||
|
physaddr_t end;
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unique IDs for hidden regions
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
TEXT = 0,
|
||||||
|
BASEMEM,
|
||||||
|
EXTMEM,
|
||||||
|
};
|
||||||
|
|
||||||
|
extern struct hidden_region __data16_array ( hidden_regions, [] );
|
||||||
|
#define hidden_regions __use_data16 ( hidden_regions )
|
||||||
|
|
||||||
|
static inline void hide_region ( unsigned int region,
|
||||||
|
physaddr_t start, physaddr_t end ) {
|
||||||
|
hidden_regions[region].start = start;
|
||||||
|
hidden_regions[region].end = end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif /* _GPXE_HIDEMEM_H */
|
Loading…
Reference in New Issue