From 4fc9333159f3ad62bdc7e27103eac3139ba41e68 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Thu, 11 Jan 2007 16:04:36 +0000 Subject: Move include/image.h to include/gpxe/image.h --- src/include/gpxe/image.h | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/include/gpxe/image.h (limited to 'src/include/gpxe') diff --git a/src/include/gpxe/image.h b/src/include/gpxe/image.h new file mode 100644 index 000000000..cf6b7a88f --- /dev/null +++ b/src/include/gpxe/image.h @@ -0,0 +1,60 @@ +#ifndef _GPXE_IMAGE_H +#define _GPXE_IMAGE_H + +/** + * @file + * + * Executable/loadable image formats + * + */ + +#include + +/** An executable or loadable image */ +struct image { + /** Raw file image */ + userptr_t image; + /** Length of raw file image */ + size_t len; + + /** Execute method + * + * Filled in by the image loader. If NULL, then the image + * cannot be executed. + */ + int ( * execute ) ( struct image *image ); + /** Entry point */ + physaddr_t entry; +}; + +/** An executable or loadable image type */ +struct image_type { + /** Name of this image type */ + char *name; + /** Load image into memory + * + * @v image Executable/loadable image + * @ret rc Return status code + * + * Load the image into memory. The file image may be + * discarded after this call; the method must preserve any + * information it may require later (e.g. the execution + * address) within the @c image structure. + */ + int ( * load ) ( struct image *image ); +}; + +/** An executable or loadable image type */ +#define __image_type __table ( struct image_type, image_types, 01 ) + +/** + * An unverifiable executable or loadable image type + * + * This should be used to mark image types for which there are no + * signature or other checks that can be used to verify the validity + * of the image (such as PXE images). These will then be tried last + * in the list of image types. + */ +#define __default_image_type __table ( struct image_type, image_types, 02 ) + +#endif /* _GPXE_IMAGE_H */ -- cgit v1.2.3-55-g7522