From dca470cb21f75ec2c509af66b807307bf3b7c5ac Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 3 Jul 2007 23:41:35 +0100 Subject: Add (untested) UNDI loader C-level implementation. --- src/arch/i386/interface/pxe/pxe_call.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/arch/i386/interface') diff --git a/src/arch/i386/interface/pxe/pxe_call.c b/src/arch/i386/interface/pxe/pxe_call.c index 8ecacf1d1..834ca7380 100644 --- a/src/arch/i386/interface/pxe/pxe_call.c +++ b/src/arch/i386/interface/pxe/pxe_call.c @@ -298,6 +298,31 @@ void pxe_api_call ( struct i386_all_regs *ix86 ) { ix86->regs.ax = ret; } +/** + * Dispatch PXE loader call + * + * @v es:di Address of PXE parameter block + * @ret ax PXE exit code + */ +void pxe_loader_call ( struct i386_all_regs *ix86 ) { + userptr_t uparams = real_to_user ( ix86->segs.es, ix86->regs.di ); + struct s_UNDI_LOADER params; + PXENV_EXIT_t ret; + + /* Copy parameter block from caller */ + copy_from_user ( ¶ms, uparams, 0, sizeof ( params ) ); + + /* Set default status in case child routine fails to do so */ + params.Status = PXENV_STATUS_FAILURE; + + /* Call UNDI loader */ + ret = undi_loader ( ¶ms ); + + /* Copy modified parameter block back to caller and return */ + copy_to_user ( uparams, 0, ¶ms, sizeof ( params ) ); + ix86->regs.ax = ret; +} + /** * Hook INT 1A for PXE * -- cgit v1.2.3-55-g7522