2
0
mirror of https://github.com/xcat2/xNBA.git synced 2024-12-14 15:21:32 +00:00

Cleaner separation of functionality between post_reloc and

initialise_via_librm.
This commit is contained in:
Michael Brown 2005-04-11 09:24:10 +00:00
parent b9237160ad
commit 378c1b500c

View File

@ -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.