mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-14 15:21:32 +00:00
Replace image->entry with image->priv.
This commit is contained in:
parent
3bdbfe1f00
commit
797edf28b7
@ -218,6 +218,7 @@ static struct multiboot_module __data16_array ( mbmodules, [MAX_MODULES] );
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int multiboot_exec ( struct image *image ) {
|
||||
physaddr_t entry = image->priv.phys;
|
||||
|
||||
/* Populate multiboot information structure */
|
||||
memset ( &mbinfo, 0, sizeof ( mbinfo ) );
|
||||
@ -241,7 +242,7 @@ static int multiboot_exec ( struct image *image ) {
|
||||
__asm__ __volatile__ ( PHYS_CODE ( "call *%%edi\n\t" )
|
||||
: : "a" ( MULTIBOOT_BOOTLOADER_MAGIC ),
|
||||
"b" ( virt_to_phys ( &mbinfo ) ),
|
||||
"D" ( image->entry )
|
||||
"D" ( entry )
|
||||
: "ecx", "edx", "esi", "ebp", "memory" );
|
||||
|
||||
DBGC ( image, "MULTIBOOT %p returned\n", image );
|
||||
@ -328,8 +329,8 @@ static int multiboot_load_raw ( struct image *image,
|
||||
/* Copy image to segment */
|
||||
memcpy_user ( buffer, 0, image->data, offset, filesz );
|
||||
|
||||
/* Record execution entry point */
|
||||
image->entry = hdr->mb.entry_addr;
|
||||
/* Record execution entry point in image private data field */
|
||||
image->priv.phys = hdr->mb.entry_addr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -277,6 +277,10 @@ int nbi_load ( struct image *image ) {
|
||||
nbi_load_segment ) ) != 0 )
|
||||
return rc;
|
||||
|
||||
/* Record header address in image private data field */
|
||||
image->priv.user = real_to_user ( imgheader.location.segment,
|
||||
imgheader.location.offset );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -370,7 +374,7 @@ static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) {
|
||||
static int nbi_exec ( struct image *image ) {
|
||||
struct imgheader imgheader;
|
||||
|
||||
copy_from_user ( &imgheader, phys_to_user ( image->entry ), 0,
|
||||
copy_from_user ( &imgheader, image->priv.user, 0,
|
||||
sizeof ( imgheader ) );
|
||||
|
||||
if ( NBI_LINEAR_EXEC_ADDR ( imgheader.flags ) ) {
|
||||
|
@ -136,8 +136,8 @@ int elf_load ( struct image *image ) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Fill in entry point address */
|
||||
image->entry = ehdr.e_entry;
|
||||
/* Record execution entry point in image private data field */
|
||||
image->priv.phys = ehdr.e_entry;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -35,8 +35,11 @@ struct image {
|
||||
|
||||
/** Image type, if known */
|
||||
struct image_type *type;
|
||||
/** Entry point */
|
||||
physaddr_t entry;
|
||||
/** Image type private data */
|
||||
union {
|
||||
physaddr_t phys;
|
||||
userptr_t user;
|
||||
} priv;
|
||||
};
|
||||
|
||||
/** Image is loaded */
|
||||
|
Loading…
Reference in New Issue
Block a user