[ipxe-devel] Is the definition of undi_loader as both procedure and object intended?

Michael Tautschnig mt at debian.org
Sun May 29 15:00:39 UTC 2016


Dear iPXE developers,

I have noticed that undi_loader is defined both as a struct as well as a
procedure:

src/arch/i386/drivers/net/undiload.c has
static struct s_UNDI_LOADER __bss16 ( undi_loader );

while src/arch/i386/include/pxe.h (also include from the above file) has:
extern PXENV_EXIT_t undi_loader ( struct s_UNDI_LOADER *undi_loader );

Presumably the compiler's name mangling (renaming the latter to, e.g.,
_undi_loader) will ensure this works in practice. But is that the intended set
up? I would assume the following patch would avoid relying on such compiler
internals:

--- a/src/arch/i386/drivers/net/undiload.c
+++ b/src/arch/i386/drivers/net/undiload.c
@@ -45,8 +45,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
 #define EUNDILOAD( status ) EPLATFORM ( EINFO_EUNDILOAD, status )

 /** Parameter block for calling UNDI loader */
-static struct s_UNDI_LOADER __bss16 ( undi_loader );
-#define undi_loader __use_data16 ( undi_loader )
+static struct s_UNDI_LOADER __bss16 ( undi_loader_p );
+#define undi_loader __use_data16 ( undi_loader_p )

 /** UNDI loader entry point */
 static SEGOFF16_t __bss16 ( undi_loader_entry );

Thanks a lot,
Michael




More information about the ipxe-devel mailing list