summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2005-04-11 11:24:10 +0200
committerMichael Brown2005-04-11 11:24:10 +0200
commit378c1b500c201ac85681face1369c81e0cd06d04 (patch)
tree05364045811b041b6295eb8f5e153986567a7df7 /src
parentAlmost all information in this file is now obsolete. Writing a new driver (diff)
downloadipxe-378c1b500c201ac85681face1369c81e0cd06d04.tar.gz
ipxe-378c1b500c201ac85681face1369c81e0cd06d04.tar.xz
ipxe-378c1b500c201ac85681face1369c81e0cd06d04.zip
Cleaner separation of functionality between post_reloc and
initialise_via_librm.
Diffstat (limited to 'src')
-rw-r--r--src/arch/i386/transitions/librm_mgmt.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/arch/i386/transitions/librm_mgmt.c b/src/arch/i386/transitions/librm_mgmt.c
index 384fb6733..ffd55ff61 100644
--- a/src/arch/i386/transitions/librm_mgmt.c
+++ b/src/arch/i386/transitions/librm_mgmt.c
@@ -120,6 +120,14 @@ static void librm_post_reloc ( void ) {
/* Point installed_librm back at last known physical location.
*/
installed_librm = phys_to_virt ( librm_base );
+
+ /* Allocate base memory for librm and place a copy there */
+ if ( ! allocated_librm ) {
+ char *new_librm = alloc_base_memory ( librm_size );
+ uninstall_librm ();
+ install_librm ( new_librm );
+ allocated_librm = 1;
+ }
}
INIT_FN ( INIT_LIBRM, librm_init, NULL, uninstall_librm );
@@ -132,23 +140,9 @@ POST_RELOC_FN ( POST_RELOC_LIBRM, librm_post_reloc );
*
*/
void initialise_via_librm ( struct i386_all_regs *regs ) {
- char *new_librm;
-
/* Hand off to initialise() */
initialise ();
- /* Uninstall current librm (i.e. the one that's part of the
- * original, pre-relocation Etherboot image).
- */
- uninstall_librm();
-
- /* Allocate space for new librm */
- new_librm = alloc_base_memory ( librm_size );
- allocated_librm = 1;
-
- /* Install new librm */
- install_librm ( new_librm );
-
/* Point es:di to new librm's entry point. Fortunately, di is
* already set up by setup16, so all we need to do is point
* es:0000 to the start of the new librm.