Separate out pxe_start_nbp() from pxe_image.c into pxe_call.c

Implement PXENV_RESTART_TFTP.
This commit is contained in:
Michael Brown
2007-06-30 14:56:35 +01:00
parent acd598b4f9
commit 8130443f9f
5 changed files with 46 additions and 65 deletions

View File

@@ -363,3 +363,28 @@ void pxe_init_structures ( void ) {
ppxe.StructCksum -= pxe_checksum ( &ppxe, sizeof ( ppxe ) );
pxenv.Checksum -= pxe_checksum ( &pxenv, sizeof ( pxenv ) );
}
/**
* Start PXE NBP at 0000:7c00
*
* @ret rc Return status code
*/
int pxe_start_nbp ( void ) {
int discard_b, discard_c;
uint16_t rc;
/* Far call to PXE NBP */
__asm__ __volatile__ ( REAL_CODE ( "pushw %%cx\n\t"
"pushw %%ax\n\t"
"movw %%cx, %%es\n\t"
"lcall $0, $0x7c00\n\t"
"addw $4, %%sp\n\t" )
: "=a" ( rc ), "=b" ( discard_b ),
"=c" ( discard_c )
: "a" ( & __from_text16 ( ppxe ) ),
"b" ( & __from_text16 ( pxenv ) ),
"c" ( rm_cs )
: "edx", "esi", "edi", "ebp", "memory" );
return rc;
}