mirror of https://github.com/ipxe/ipxe.git
Add free_image
parent
9817f93094
commit
742f242863
|
@ -89,6 +89,23 @@ struct image * find_image ( const char *name ) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free loaded image
|
||||||
|
*
|
||||||
|
* @v image Executable/loadable image
|
||||||
|
*
|
||||||
|
* This releases the memory being used to store the image; it does not
|
||||||
|
* release the @c struct @c image itself, nor does it unregister the
|
||||||
|
* image.
|
||||||
|
*/
|
||||||
|
void free_image ( struct image *image ) {
|
||||||
|
if ( image->free )
|
||||||
|
image->free ( image->data );
|
||||||
|
image->free = NULL;
|
||||||
|
image->data = UNULL;
|
||||||
|
image->len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load executable/loadable image into memory
|
* Load executable/loadable image into memory
|
||||||
*
|
*
|
||||||
|
|
|
@ -109,6 +109,7 @@ extern struct list_head images;
|
||||||
extern int register_image ( struct image *image );
|
extern int register_image ( struct image *image );
|
||||||
extern void unregister_image ( struct image *image );
|
extern void unregister_image ( struct image *image );
|
||||||
struct image * find_image ( const char *name );
|
struct image * find_image ( const char *name );
|
||||||
|
extern void free_image ( struct image *image );
|
||||||
extern int image_load ( struct image *image );
|
extern int image_load ( struct image *image );
|
||||||
extern int image_autoload ( struct image *image );
|
extern int image_autoload ( struct image *image );
|
||||||
extern int image_exec ( struct image *image );
|
extern int image_exec ( struct image *image );
|
||||||
|
|
Loading…
Reference in New Issue