summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/firmware/pcbios/hidemem.c
diff options
context:
space:
mode:
authorMichael Brown2007-01-14 00:57:31 +0100
committerMichael Brown2007-01-14 00:57:31 +0100
commit0b0e34e667bca9e2b1bf451e52a2b7d3ef62cb25 (patch)
treeec9a7fe46258dbfa8a3d2f637e420453e09d739b /src/arch/i386/firmware/pcbios/hidemem.c
parentSome operating systems get a nasty shock if a region of the E820 map seems (diff)
downloadipxe-0b0e34e667bca9e2b1bf451e52a2b7d3ef62cb25.tar.gz
ipxe-0b0e34e667bca9e2b1bf451e52a2b7d3ef62cb25.tar.xz
ipxe-0b0e34e667bca9e2b1bf451e52a2b7d3ef62cb25.zip
Provide {get,set}_fbms() in basemem.h.
set_fbms() will also update the E820 hidden region.
Diffstat (limited to 'src/arch/i386/firmware/pcbios/hidemem.c')
-rw-r--r--src/arch/i386/firmware/pcbios/hidemem.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/arch/i386/firmware/pcbios/hidemem.c b/src/arch/i386/firmware/pcbios/hidemem.c
index 3396e1e6..fa58135e 100644
--- a/src/arch/i386/firmware/pcbios/hidemem.c
+++ b/src/arch/i386/firmware/pcbios/hidemem.c
@@ -16,8 +16,8 @@
*/
#include <realmode.h>
-#include <bios.h>
#include <biosint.h>
+#include <basemem.h>
#include <gpxe/hidemem.h>
/** Alignment for hidden memory regions */
@@ -71,10 +71,12 @@ void hide_region ( unsigned int region_id, physaddr_t start, physaddr_t end ) {
/* Some operating systems get a nasty shock if a region of the
* E820 map seems to start on a non-page boundary. Make life
* safer by rounding out our edited region.
- */
+ */
region->start = ( start & ~( ALIGN_HIDDEN - 1 ) );
region->end = ( ( end + ALIGN_HIDDEN - 1 ) & ~( ALIGN_HIDDEN - 1 ) );
- DBG ( "Hiding [%lx,%lx)\n", region->start, region->end );
+
+ DBG ( "Hiding region %d [%lx,%lx)\n",
+ region_id, region->start, region->end );
}
/**
@@ -94,15 +96,12 @@ static void hide_text ( void ) {
* Hide used base memory
*
*/
-static void hide_basemem ( void ) {
- uint16_t fbms;
-
+void hide_basemem ( void ) {
/* Hide from the top of free base memory to 640kB. Don't use
* hide_region(), because we don't want this rounded to the
* nearest page boundary.
*/
- get_real ( fbms, BDA_SEG, BDA_FBMS );
- hidden_regions[BASEMEM].start = ( fbms * 1024 );
+ hidden_regions[BASEMEM].start = ( get_fbms() * 1024 );
}
/**