image_type Struct Reference

An executable or loadable image type. More...

#include <image.h>


Data Fields

char * name
 Name of this image type.
int(* load )(struct image *image)
 Load image into memory.
int(* exec )(struct image *image)
 Execute loaded image.


Detailed Description

An executable or loadable image type.

Definition at line 72 of file image.h.


Field Documentation

Name of this image type.

Definition at line 74 of file image.h.

Referenced by image_autoload(), image_load_type(), and imgstat().

int( * image_type::load)(struct image *image)

Load image into memory.

Parameters:
image Executable/loadable image
Return values:
rc Return status code
Load the image into memory at the correct location as determined by the file format.

If the file image is in the correct format, the method must update image->type to point to its own type (unless image->type is already set). This allows the autoloading code to disambiguate between "this is not my image format" and "there is something wrong with this image". In particular, setting image->type and then returning an error will cause image_autoload() to abort and return an error, rather than continuing to the next image type.

Referenced by image_load_type().

int( * image_type::exec)(struct image *image)

Execute loaded image.

Parameters:
image Loaded image
Return values:
rc Return status code
Note that the image may be invalidated by the act of execution, i.e. an image is allowed to choose to unregister (and so potentially free) itself.

Referenced by image_exec().


The documentation for this struct was generated from the following file:

Generated on Tue Apr 6 20:02:06 2010 for gPXE by  doxygen 1.5.7.1