basemem.h File Reference

Base memory allocation. More...

#include <stdint.h>
#include <realmode.h>
#include <bios.h>

Go to the source code of this file.

Functions

 FILE_LICENCE (GPL2_OR_LATER)
static unsigned int get_fbms (void)
 Read the BIOS free base memory counter.
void set_fbms (unsigned int new_fbms)
 Set the BIOS free base memory counter.
void hide_basemem (void)
 Hide used base memory.


Detailed Description

Base memory allocation.

Definition in file basemem.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

static unsigned int get_fbms ( void   )  [inline, static]

Read the BIOS free base memory counter.

Return values:
fbms Free base memory counter (in kB)

Definition at line 21 of file basemem.h.

References BDA_FBMS, BDA_SEG, and get_real.

Referenced by basememsize(), com32_exec(), comboot_init_psp(), hide_basemem(), hide_etherboot(), undi_load(), and undi_unload().

00021                                              {
00022         uint16_t fbms;
00023 
00024         get_real ( fbms, BDA_SEG, BDA_FBMS );
00025         return fbms;
00026 }

void set_fbms ( unsigned int  new_fbms  ) 

Set the BIOS free base memory counter.

Parameters:
new_fbms New free base memory counter (in kB)

Definition at line 38 of file basemem.c.

References BDA_FBMS, BDA_SEG, hide_basemem(), and put_real.

Referenced by undi_load(), and undi_unload().

00038                                         {
00039         uint16_t fbms = new_fbms;
00040 
00041         /* Update the BIOS memory counter */
00042         put_real ( fbms, BDA_SEG, BDA_FBMS );
00043 
00044         /* Update our hidden memory region map */
00045         hide_basemem();
00046 }

void hide_basemem ( void   ) 

Hide used base memory.

Definition at line 102 of file hidemem.c.

References get_fbms(), and hidemem_base.

Referenced by hide_etherboot(), and set_fbms().

00102                            {
00103         /* Hide from the top of free base memory to 640kB.  Don't use
00104          * hide_region(), because we don't want this rounded to the
00105          * nearest page boundary.
00106          */
00107         hidemem_base.start = ( get_fbms() * 1024 );
00108 }


Generated on Tue Apr 6 20:01:12 2010 for gPXE by  doxygen 1.5.7.1