Browse Source

Cleaner separation of functionality between post_reloc and

initialise_via_librm.
tags/v0.9.3
Michael Brown 19 years ago
parent
commit
378c1b500c
1 changed files with 8 additions and 14 deletions
  1. 8
    14
      src/arch/i386/transitions/librm_mgmt.c

+ 8
- 14
src/arch/i386/transitions/librm_mgmt.c View File

120
 	/* Point installed_librm back at last known physical location.
120
 	/* Point installed_librm back at last known physical location.
121
 	 */
121
 	 */
122
 	installed_librm = phys_to_virt ( librm_base );
122
 	installed_librm = phys_to_virt ( librm_base );
123
+
124
+	/* Allocate base memory for librm and place a copy there */
125
+	if ( ! allocated_librm ) {
126
+		char *new_librm = alloc_base_memory ( librm_size );
127
+		uninstall_librm ();
128
+		install_librm ( new_librm );
129
+		allocated_librm = 1;
130
+	}
123
 }
131
 }
124
 
132
 
125
 INIT_FN ( INIT_LIBRM, librm_init, NULL, uninstall_librm );
133
 INIT_FN ( INIT_LIBRM, librm_init, NULL, uninstall_librm );
132
  *
140
  *
133
  */
141
  */
134
 void initialise_via_librm ( struct i386_all_regs *regs ) {
142
 void initialise_via_librm ( struct i386_all_regs *regs ) {
135
-	char *new_librm;
136
-
137
 	/* Hand off to initialise() */
143
 	/* Hand off to initialise() */
138
 	initialise ();
144
 	initialise ();
139
 
145
 
140
-	/* Uninstall current librm (i.e. the one that's part of the
141
-	 * original, pre-relocation Etherboot image).
142
-	 */
143
-	uninstall_librm();
144
-
145
-	/* Allocate space for new librm */
146
-	new_librm = alloc_base_memory ( librm_size );
147
-	allocated_librm = 1;
148
-	
149
-	/* Install new librm */
150
-	install_librm ( new_librm );
151
-
152
 	/* Point es:di to new librm's entry point.  Fortunately, di is
146
 	/* Point es:di to new librm's entry point.  Fortunately, di is
153
 	 * already set up by setup16, so all we need to do is point
147
 	 * already set up by setup16, so all we need to do is point
154
 	 * es:0000 to the start of the new librm.
148
 	 * es:0000 to the start of the new librm.

Loading…
Cancel
Save