summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include
diff options
context:
space:
mode:
authorShao Miller2010-01-24 04:12:27 +0100
committerMarty Connor2010-01-24 13:54:42 +0100
commit112a3f2de281a2afb23ced2082d555720de7c9b0 (patch)
tree50f91813ae58ed102fa4b7a47bd9f90f9d99732c /src/arch/i386/include
parent[dhcp] Keep multiple DHCP offers received, and use them intelligently (diff)
downloadipxe-112a3f2de281a2afb23ced2082d555720de7c9b0.tar.gz
ipxe-112a3f2de281a2afb23ced2082d555720de7c9b0.tar.xz
ipxe-112a3f2de281a2afb23ced2082d555720de7c9b0.zip
[pxe] Introduce PXE exit hook for NBP chaining
It might be the case that we wish to chain to an NBP without being "in the way". We now implement a hook in our exit path for gPXE *.*pxe build targets. The hook is a pointer to a SEG16:OFF16 which we try to jump to during exit. By default, this pointer results in the usual exit path. We also implement the "pxenv_file_exit_hook" PXE API routine to allow the user to specify an alternate SEG16:OFF16 to jump to during exit. Unfortunately, this additional PXE extension has a cost in code size. Fortunately, a look at the size difference for a gPXE .rom build target shows zero size difference after compression. The routine is documented in doc/pxe_extensions as follows: FILE EXIT HOOK Op-Code: PXENV_FILE_EXIT_HOOK (00e7h) Input: Far pointer to a t_PXENV_FILE_EXIT_HOOK parameter structure that has been initialized by the caller. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be returned in AX. The Status field in the parameter structure must be set to one of the values represented by the PXENV_STATUS_xxx constants. Description:Modify the exit path to jump to the specified code. Only valid for pxeprefix-based builds. typedef struct s_PXENV_FILE_EXIT_HOOK { PXENV_STATUS_t Status; SEGOFF16_t Hook; } t_PXENV_FILE_EXIT_HOOK; Set before calling API service: Hook: The SEG16:OFF16 of the code to jump to. Returned from API service: Status: See PXENV_STATUS_xxx constants. Requested-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Marty Connor <mdc@etherboot.org>
Diffstat (limited to 'src/arch/i386/include')
-rw-r--r--src/arch/i386/include/pxe.h1
-rw-r--r--src/arch/i386/include/pxe_api.h22
2 files changed, 23 insertions, 0 deletions
diff --git a/src/arch/i386/include/pxe.h b/src/arch/i386/include/pxe.h
index b0cabef0d..041ee7bab 100644
--- a/src/arch/i386/include/pxe.h
+++ b/src/arch/i386/include/pxe.h
@@ -67,6 +67,7 @@ union u_PXENV_ANY {
struct s_PXENV_GET_FILE_SIZE get_file_size;
struct s_PXENV_FILE_EXEC file_exec;
struct s_PXENV_FILE_API_CHECK file_api_check;
+ struct s_PXENV_FILE_EXIT_HOOK file_exit_hook;
};
typedef union u_PXENV_ANY PXENV_ANY_t;
diff --git a/src/arch/i386/include/pxe_api.h b/src/arch/i386/include/pxe_api.h
index ba0dbdc0a..92f046f79 100644
--- a/src/arch/i386/include/pxe_api.h
+++ b/src/arch/i386/include/pxe_api.h
@@ -1778,6 +1778,28 @@ extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_a
/** @} */ /* pxenv_file_api_check */
+/** @defgroup pxenv_file_exit_hook PXENV_FILE_EXIT_HOOK
+ *
+ * FILE EXIT HOOK
+ *
+ * @{
+ */
+
+/** PXE API function code for pxenv_file_exit_hook() */
+#define PXENV_FILE_EXIT_HOOK 0x00e7
+
+/** Parameter block for pxenv_file_exit_hook() */
+struct s_PXENV_FILE_EXIT_HOOK {
+ PXENV_STATUS_t Status; /**< PXE status code */
+ SEGOFF16_t Hook; /**< SEG16:OFF16 to jump to */
+} PACKED;
+
+typedef struct s_PXENV_FILE_EXIT_HOOK PXENV_FILE_EXIT_HOOK_t;
+
+extern PXENV_EXIT_t pxenv_file_exit_hook ( struct s_PXENV_FILE_EXIT_HOOK *file_exit_hook );
+
+/** @} */ /* pxenv_file_exit_hook */
+
/** @} */ /* pxe_file_api */
/** @defgroup pxe_loader_api PXE Loader API